<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/157061</link>
    <title>MATLAB Central Newsreader - Origin in the center of an image, +y at the top!</title>
    <description>Feed for thread: Origin in the center of an image, +y at the top!</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 02 Oct 2007 21:18:09 -0400</pubDate>
      <title>Origin in the center of an image, +y at the top!</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/157061#394861</link>
      <author>David Doria</author>
      <description>I figured out how to move the origin, using this command:&lt;br&gt;
&lt;br&gt;
imshow(InputImage, 'XData', [-size(InputImage,2)/2&lt;br&gt;
size(InputImage,2)/2], 'YData', [size(InputImage,1)/2&lt;br&gt;
-size(InputImage,1)/2])&lt;br&gt;
&lt;br&gt;
however, that FLIPS my image!!  Is there a convenient way to&lt;br&gt;
have (0,0) at the center of my image and have +y going up&lt;br&gt;
and +x going to the right?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
David</description>
    </item>
    <item>
      <pubDate>Wed, 03 Oct 2007 02:41:12 -0400</pubDate>
      <title>Re: Origin in the center of an image, +y at the top!</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/157061#394878</link>
      <author>Steven Lord</author>
      <description>&lt;br&gt;
&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message &lt;br&gt;
news:fducih$nku$1@fred.mathworks.com...&lt;br&gt;
&amp;gt;I figured out how to move the origin, using this command:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; imshow(InputImage, 'XData', [-size(InputImage,2)/2&lt;br&gt;
&amp;gt; size(InputImage,2)/2], 'YData', [size(InputImage,1)/2&lt;br&gt;
&amp;gt; -size(InputImage,1)/2])&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; however, that FLIPS my image!!  Is there a convenient way to&lt;br&gt;
&amp;gt; have (0,0) at the center of my image and have +y going up&lt;br&gt;
&amp;gt; and +x going to the right?&lt;br&gt;
&lt;br&gt;
Set the YDir property of your axes.&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/support/solutions/data/1-16MFFQ.html?solution=1-16MFFQ&quot;&gt;http://www.mathworks.com/support/solutions/data/1-16MFFQ.html?solution=1-16MFFQ&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com </description>
    </item>
    <item>
      <pubDate>Wed, 03 Oct 2007 12:58:42 -0400</pubDate>
      <title>Re: Origin in the center of an image, +y at the top!</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/157061#394934</link>
      <author>David Doria</author>
      <description>Hmm kind of...&lt;br&gt;
&lt;br&gt;
If I do this:&lt;br&gt;
&lt;br&gt;
image(InputImage, 'XData', [-size(InputImage,2)/2&lt;br&gt;
size(InputImage,2)/2], 'YData', [size(InputImage,1)/2&lt;br&gt;
-size(InputImage,1)/2])&lt;br&gt;
&lt;br&gt;
set(gca, 'Ydir', 'normal');&lt;br&gt;
&lt;br&gt;
It appears correctly (with axes labeled how i want them),&lt;br&gt;
but I cant click on the image to get the coordinates, it&lt;br&gt;
snaps the cursor to the top/bottom edge of the image.&lt;br&gt;
&lt;br&gt;
If i do this (note the sign change):&lt;br&gt;
&lt;br&gt;
image(InputImage, 'XData', [-size(InputImage,2)/2&lt;br&gt;
size(InputImage,2)/2],'YData', [-size(InputImage,1)/2&lt;br&gt;
size(InputImage,1)/2])&lt;br&gt;
&lt;br&gt;
set(gca, 'Ydir', 'reverse');&lt;br&gt;
&lt;br&gt;
the picture is the right orientation, but the y labels are&lt;br&gt;
upside down from what i want, but i CAN click on the image.&lt;br&gt;
&lt;br&gt;
Surely I am being silly... but i think i've tried all&lt;br&gt;
combinations of these signs and directions and it wont seem&lt;br&gt;
to workout.&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
&lt;br&gt;
David&lt;br&gt;
&lt;br&gt;
&quot;Steven Lord&quot; &amp;lt;slord@mathworks.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fduvg8$mmt$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; news:fducih$nku$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; &amp;gt;I figured out how to move the origin, using this command:&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; imshow(InputImage, 'XData', [-size(InputImage,2)/2&lt;br&gt;
&amp;gt; &amp;gt; size(InputImage,2)/2], 'YData', [size(InputImage,1)/2&lt;br&gt;
&amp;gt; &amp;gt; -size(InputImage,1)/2])&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; however, that FLIPS my image!!  Is there a convenient way to&lt;br&gt;
&amp;gt; &amp;gt; have (0,0) at the center of my image and have +y going up&lt;br&gt;
&amp;gt; &amp;gt; and +x going to the right?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Set the YDir property of your axes.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/support/solutions/data/1-16MFFQ.html?solution=1-16MFFQ&quot;&gt;http://www.mathworks.com/support/solutions/data/1-16MFFQ.html?solution=1-16MFFQ&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt; Steve Lord&lt;br&gt;
&amp;gt; slord@mathworks.com &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; </description>
    </item>
    <item>
      <pubDate>Wed, 03 Oct 2007 14:57:29 -0400</pubDate>
      <title>Re: Origin in the center of an image, +y at the top!</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/157061#394969</link>
      <author>Dietrich Lueerssen</author>
      <description>Dear David,&lt;br&gt;
&lt;br&gt;
I think the simplest solution to your issue is the use of&lt;br&gt;
the command &quot;axis xy&quot;.&lt;br&gt;
&lt;br&gt;
You use the command imshow to display the image, and this&lt;br&gt;
sets the coordinate system in the conventional way for image&lt;br&gt;
applications (&quot;axis ij&quot;). The origin is then in the upper&lt;br&gt;
left corner. &lt;br&gt;
&lt;br&gt;
If you add &quot;axis on&quot; to your code, you can see that the&lt;br&gt;
coordinate system is the way you would like it to be (I assume).&lt;br&gt;
&lt;br&gt;
Best regards,&lt;br&gt;
Dietrich&lt;br&gt;
&lt;br&gt;
&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fducih$nku$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I figured out how to move the origin, using this command:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; imshow(InputImage, 'XData', [-size(InputImage,2)/2&lt;br&gt;
&amp;gt; size(InputImage,2)/2], 'YData', [size(InputImage,1)/2&lt;br&gt;
&amp;gt; -size(InputImage,1)/2])&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; however, that FLIPS my image!!  Is there a convenient way to&lt;br&gt;
&amp;gt; have (0,0) at the center of my image and have +y going up&lt;br&gt;
&amp;gt; and +x going to the right?</description>
    </item>
    <item>
      <pubDate>Wed, 03 Oct 2007 16:39:13 -0400</pubDate>
      <title>Re: Origin in the center of an image, +y at the top!</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/157061#394996</link>
      <author>David Doria</author>
      <description>I see, thanks!  However, With:&lt;br&gt;
&lt;br&gt;
imshow(InputImage, 'XData', [-size(InputImage,2)/2&lt;br&gt;
size(InputImage,2)/2], 'YData', [size(InputImage,1)/2&lt;br&gt;
-size(InputImage,1)/2])&lt;br&gt;
axis xy&lt;br&gt;
axis on&lt;br&gt;
&lt;br&gt;
I still cannot click on points, it still snaps the cursor to&lt;br&gt;
the top or bottom edge!! Any thoughts?&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
&lt;br&gt;
David&lt;br&gt;
&lt;br&gt;
&quot;Dietrich Lueerssen&quot; &amp;lt;dietrich.lueerssen@nospam.ogt.co.uk&amp;gt;&lt;br&gt;
wrote in message &amp;lt;fe0akp$3nn$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Dear David,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I think the simplest solution to your issue is the use of&lt;br&gt;
&amp;gt; the command &quot;axis xy&quot;.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You use the command imshow to display the image, and this&lt;br&gt;
&amp;gt; sets the coordinate system in the conventional way for image&lt;br&gt;
&amp;gt; applications (&quot;axis ij&quot;). The origin is then in the upper&lt;br&gt;
&amp;gt; left corner. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If you add &quot;axis on&quot; to your code, you can see that the&lt;br&gt;
&amp;gt; coordinate system is the way you would like it to be (I&lt;br&gt;
assume).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Best regards,&lt;br&gt;
&amp;gt; Dietrich&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;fducih$nku$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I figured out how to move the origin, using this command:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; imshow(InputImage, 'XData', [-size(InputImage,2)/2&lt;br&gt;
&amp;gt; &amp;gt; size(InputImage,2)/2], 'YData', [size(InputImage,1)/2&lt;br&gt;
&amp;gt; &amp;gt; -size(InputImage,1)/2])&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; however, that FLIPS my image!!  Is there a convenient way to&lt;br&gt;
&amp;gt; &amp;gt; have (0,0) at the center of my image and have +y going up&lt;br&gt;
&amp;gt; &amp;gt; and +x going to the right?&lt;br&gt;
&amp;gt; </description>
    </item>
    <item>
      <pubDate>Fri, 05 Oct 2007 23:42:33 -0400</pubDate>
      <title>Re: Origin in the center of an image, +y at the top!</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/157061#395346</link>
      <author>David Doria</author>
      <description>Surely someone else has had to center an image at (0,0)? !!&lt;br&gt;
&lt;br&gt;
I'm actually quite surprised matlab makes it so annoying to&lt;br&gt;
do this, maybe i am just not getting it :)&lt;br&gt;
&lt;br&gt;
&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fe0gjh$dk9$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I see, thanks!  However, With:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; imshow(InputImage, 'XData', [-size(InputImage,2)/2&lt;br&gt;
&amp;gt; size(InputImage,2)/2], 'YData', [size(InputImage,1)/2&lt;br&gt;
&amp;gt; -size(InputImage,1)/2])&lt;br&gt;
&amp;gt; axis xy&lt;br&gt;
&amp;gt; axis on&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I still cannot click on points, it still snaps the cursor to&lt;br&gt;
&amp;gt; the top or bottom edge!! Any thoughts?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; David&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Dietrich Lueerssen&quot; &amp;lt;dietrich.lueerssen@nospam.ogt.co.uk&amp;gt;&lt;br&gt;
&amp;gt; wrote in message &amp;lt;fe0akp$3nn$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Dear David,&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I think the simplest solution to your issue is the use of&lt;br&gt;
&amp;gt; &amp;gt; the command &quot;axis xy&quot;.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; You use the command imshow to display the image, and this&lt;br&gt;
&amp;gt; &amp;gt; sets the coordinate system in the conventional way for image&lt;br&gt;
&amp;gt; &amp;gt; applications (&quot;axis ij&quot;). The origin is then in the upper&lt;br&gt;
&amp;gt; &amp;gt; left corner. &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; If you add &quot;axis on&quot; to your code, you can see that the&lt;br&gt;
&amp;gt; &amp;gt; coordinate system is the way you would like it to be (I&lt;br&gt;
&amp;gt; assume).&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Best regards,&lt;br&gt;
&amp;gt; &amp;gt; Dietrich&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fducih$nku$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I figured out how to move the origin, using this command:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; imshow(InputImage, 'XData', [-size(InputImage,2)/2&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; size(InputImage,2)/2], 'YData', [size(InputImage,1)/2&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; -size(InputImage,1)/2])&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; however, that FLIPS my image!!  Is there a convenient&lt;br&gt;
way to&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; have (0,0) at the center of my image and have +y going up&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; and +x going to the right?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; </description>
    </item>
  </channel>
</rss>

