Path: news.mathworks.com!not-for-mail
From: "David Doria" <daviddoria@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Origin in the center of an image, +y at the top!
Date: Fri, 5 Oct 2007 23:42:33 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 56
Message-ID: <fe6i59$l43$1@fred.mathworks.com>
References: <fducih$nku$1@fred.mathworks.com> <fe0akp$3nn$1@fred.mathworks.com> <fe0gjh$dk9$1@fred.mathworks.com>
Reply-To: "David Doria" <daviddoria@gmail.com>
NNTP-Posting-Host: webapp-06-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1191627753 21635 172.30.248.36 (5 Oct 2007 23:42:33 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 5 Oct 2007 23:42:33 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1105197
Xref: news.mathworks.com comp.soft-sys.matlab:431569



Surely someone else has had to center an image at (0,0)? !!

I'm actually quite surprised matlab makes it so annoying to
do this, maybe i am just not getting it :)

"David Doria" <daviddoria@gmail.com> wrote in message
<fe0gjh$dk9$1@fred.mathworks.com>...
> I see, thanks!  However, With:
> 
> imshow(InputImage, 'XData', [-size(InputImage,2)/2
> size(InputImage,2)/2], 'YData', [size(InputImage,1)/2
> -size(InputImage,1)/2])
> axis xy
> axis on
> 
> I still cannot click on points, it still snaps the cursor to
> the top or bottom edge!! Any thoughts?
> 
> Thanks
> 
> David
> 
> "Dietrich Lueerssen" <dietrich.lueerssen@nospam.ogt.co.uk>
> wrote in message <fe0akp$3nn$1@fred.mathworks.com>...
> > Dear David,
> > 
> > I think the simplest solution to your issue is the use of
> > the command "axis xy".
> > 
> > You use the command imshow to display the image, and this
> > sets the coordinate system in the conventional way for image
> > applications ("axis ij"). The origin is then in the upper
> > left corner. 
> > 
> > If you add "axis on" to your code, you can see that the
> > coordinate system is the way you would like it to be (I
> assume).
> > 
> > Best regards,
> > Dietrich
> > 
> > "David Doria" <daviddoria@gmail.com> wrote in message
> > <fducih$nku$1@fred.mathworks.com>...
> > > I figured out how to move the origin, using this command:
> > > 
> > > imshow(InputImage, 'XData', [-size(InputImage,2)/2
> > > size(InputImage,2)/2], 'YData', [size(InputImage,1)/2
> > > -size(InputImage,1)/2])
> > > 
> > > however, that FLIPS my image!!  Is there a convenient
way to
> > > have (0,0) at the center of my image and have +y going up
> > > and +x going to the right?
> > 
>