Question about imshow

Hi,
I want to read images and do some processing with them. While learning how to do this, i.e. opening images, displaying them, transforming them tu numpy arrays, etc., I came across a strange behaviour. If I open an image and use imshow() to display it, it comes upside down. See this thread in the numpy mailing list for more details: http://thread.gmane.org/gmane.comp.python.numeric.general/30148 . Someone on that list suggested to check here if this behavior was correct. Is it normal that the image appears upside down? If yes, can someone explain what's going on?

jorge

Hi,
I want to read images and do some processing with them. While learning how to do this, i.e. opening images, displaying them, transforming them tu numpy arrays, etc., I came across a strange behaviour. If I open an image and use imshow() to display it, it comes upside down. See this thread in the numpy mailing list for more details: http://thread.gmane.org/gmane.comp.python.numeric.general/30148 . Someone on that list suggested to check here if this behavior was correct. Is it normal that the image appears upside down? If yes, can someone explain what's going on?

Note that the image may be upside down for you but may be correct for
others. The array itself does not know about the orientation of the
image and you have to explicitly specify this.

For imshow (and other similar commands), use the origin keyword. e.g.,

>>> imshow(a, origin="lower")

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.imshow

-JJ

ยทยทยท

On Sat, May 16, 2009 at 6:58 PM, <jorgesmbox-ml@...1664...> wrote:

jorge

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options