Processing an image with numarray.nd image

  • Thread starter =?ISO-8859-1?Q?Rapha=EBl_MARC?=
  • Start date
?

=?ISO-8859-1?Q?Rapha=EBl_MARC?=

Hello,

Can anyone tell me how to open an image
and transform it into a list so that
the functions of the multi dimensionnal module of
numarray (numarray.nd image) can process it ?

Do I have to use PIL ?

So I would code something like :
import Image
im = Image.open("Python.jpg")
data = list(im.getdata())
import numarray.nd image as ti
ti.median filter(data,...)

Is that the correct way to do ?


Thanks for any help.


Raphaël
 
M

Matt Feinstein

Hello,

Can anyone tell me how to open an image
and transform it into a list so that
the functions of the multi dimensionnal module of
numarray (numarray.nd image) can process it ?

Do I have to use PIL ?

So I would code something like :
import Image
im = Image.open("Python.jpg")
data = list(im.getdata())
import numarray.nd image as ti
ti.median filter(data,...)

I've been doing something like that...

from numarray import *
import numarray.nd_image as Filter
import PIL.Image as Image

im = Image.open(file_name)
array_dat = reshape(array(list(im.getdata())), im.size)
filt_array_dat = Filter.correlate(array_dat, my_filter)

et cetera...

Matt Feinstein
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top