Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 02-12-2009, 05:10 AM   #1
Registered: Nov 2006
Location: Kerala, India
Distribution: Arch Linux
Posts: 134

Rep: Reputation: 25
Exclamation unable to read images using 'pymorph' in python

I am trying to do some image processing work on python. I load the image using python imaging library. I want to do some morphological operations on the image. So, I used pymorph.
I couldn't apply the morphological operations using pymorph, on the images read using pil. I dont know why. Please help on this.

Next, I tried to read the image directly using pymorph.readgray() function. I am trying to read an RGB image. But, I got these error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/pymorph-0.90b-py2.5.egg/pymorph/", line 3571, in readgray
if numpy.alltrue(numpy.alltrue(y[0,:,:] == y[1,:,:] and
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Please help me on this too.

I would also like to know, what libraries are useful for doing image processing applications.

Thanks and regards
Old 02-14-2009, 12:05 AM   #2
Senior Member
Registered: Aug 2003
Location: Sydney
Distribution: debian
Posts: 1,495

Rep: Reputation: 48
I am not familiar with polymorph. Is it designed to work with PIL? If not there is no reason to expect them to deal with images in a compatible way.

As for pymorph.readgray() maybe it is just not smart enough to convert the RGB image as it loads. Can you convert to grayscale before you try to load it? For example using the conversion tools in the netpbm package (or even with PIL for that matter)?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
python update - Unable to load GTK2 Python bindings: No module named gtk itpedersen Linux - Software 2 10-03-2008 04:44 AM
Reading embedded images with python xpromisex Programming 0 06-01-2007 06:33 PM
editing iso images (mounting read-write?) aesahaettr Linux - Software 5 11-16-2006 08:51 PM
Python: Bit masking images? sienarot Programming 1 03-06-2004 03:46 PM
kernel panic unable to mount root (yes ive read/read other posts) dmx9595 Linux - General 4 01-17-2004 06:07 AM

All times are GMT -5. The time now is 07:28 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration