From: Sami Oueslati on 28 Apr 2010 19:25 Hi all, I want to select two points in an image...how to rotate the image by rotating the line formed by the two points in a vertical direction (90°) maintaining fixed the 1st point and just move the 2nd one??? Is it possible to do it inside a GUI??? Thank you in advance...
From: ImageAnalyst on 28 Apr 2010 21:08 On Apr 28, 7:25 pm, "Sami Oueslati" <Samy...(a)yahoo.fr> wrote: > Hi all, > I want to select two points in an image...how to rotate the image by rotating the line formed by the two points in a vertical direction (90°) maintaining fixed the 1st point and just move the 2nd one??? Is it possible to do it inside a GUI??? > > Thank you in advance... ------------------------------------------------------------- Yes. Use maketform(). Pick your two line endpoints in your original array, and then pick the two in the desired output image (where your second point will be above your first point), and then use maketform() to get the transform, then use tformfwd() or imtransform() to apply the transform to the input array and give you the desired rotated/ translated image.
From: Sami Oueslati on 28 Apr 2010 21:25 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <bdb67531-ca7f-4a21-a654-33445ea51f38(a)y12g2000vbg.googlegroups.com>... > Yes. Use maketform(). Pick your two line endpoints in your original > array, and then pick the two in the desired output image (where your > second point will be above your first point), and then use maketform() > to get the transform, then use tformfwd() or imtransform() to apply > the transform to the input array and give you the desired rotated/ > translated image. ------------------------------------------------------------------------------------------ I can do that interactively??? I mean clicking the desired points in the image shown in my GUI...
From: ImageAnalyst on 28 Apr 2010 22:01 No, not interactively. For that you'd use cpselect(). See the help on "Image registration" for instructions on how to do that.
From: Sami Oueslati on 29 Apr 2010 14:53 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <54951836-a5a1-4a0a-ba5e-79bc3a97fe6f(a)s2g2000yqa.googlegroups.com>... > No, not interactively. For that you'd use cpselect(). See the help > on "Image registration" for instructions on how to do that. ----------------------------------------------------------------------------- Thanks ImageAnalyst, cpselect() seems complicated for me, I found [x,y]=ginput(2) which gives me the coordinates of two points selected by mouse...But after that, tell me please how I rotate the image around the 1st point to convert the line formed by the two points in a vertical way... I know you told me to use maketform() but don't know which transform type I must use...etc.
|
Pages: 1 Prev: PCI_QUAD04 random spikes in reading Next: Figure Invisiblity when publishing |