Image stats - going from Matlab to Python
tjv_at_hotmail.com
Date: 01/31/05
- Next message: Baoqiu Cui: "a Python bug in processing __del__ method ??"
- Previous message: Steven Bethard: "Re: Problem with loading textfiles into dictionaries."
- Next in thread: Robert Kern: "Re: Image stats - going from Matlab to Python"
- Reply: Robert Kern: "Re: Image stats - going from Matlab to Python"
- Reply: Fernando Perez: "Re: Image stats - going from Matlab to Python"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Baoqiu Cui: "a Python bug in processing __del__ method ??"
- Previous message: Steven Bethard: "Re: Problem with loading textfiles into dictionaries."
- Next in thread: Robert Kern: "Re: Image stats - going from Matlab to Python"
- Reply: Robert Kern: "Re: Image stats - going from Matlab to Python"
- Reply: Fernando Perez: "Re: Image stats - going from Matlab to Python"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|