Image stats - going from Matlab to Python

tjv_at_hotmail.com
Date: 01/31/05


Date: 30 Jan 2005 22:41:00 -0800

Hi all,
I am working with images in python using PIL. I come from a MATLAB
background so I am finding it to be sometimes frustrating to do things
correctly and quickly. All I need to do is load an image and store a
list of pixel coordinates at which the alpha channel is set to 1.
In Matlab this would be easy...Lets say we have a 2x2x4 array that
represents the image. I would just type something like:

indices = find(im(:,:,3)==1);

then work with indices to get xy coords. Is there a similar way to
accomplish the same thing in python and PIL without having a nested for
loop and checking every pixel?
I would appreciate advice. Thanks very much for your attention!
-Tim



Relevant Pages

  • Re: Image stats - going from Matlab to Python
    ... > I am working with images in python using PIL. ... I come from a MATLAB ... by the Numeric/Numarray libraries. ...
    (comp.lang.python)
  • Re: Python and Image Processing
    ... is it useful for Image Manipulation? ... I took a quick look at this and PIL seems to have some serious ... operations, equivalents to matlab bwlabel and bwboundaries, etc. ... These might be provided by a python wrapper to OpenCVhttp://tinyurl.com/6qe9vl ...
    (sci.image.processing)
  • Re: Image stats - going from Matlab to Python
    ... > I am working with images in python using PIL. ... I come from a MATLAB ...
    (comp.lang.python)
  • Re: help
    ... I would use MATLAB. ... However, if you have to do generic programming in addition to this, I ... would use Python with the libraries ImageMagick or Python Image Library ... (PIL). ...
    (comp.lang.python)
  • Of money and mouths
    ... He emailed me a Python ... Matlab is a package produced by Mathworks. ... I'm not sure how to interface Lisp with a process ... Now the Scheme ...
    (comp.lang.python)