Processing an image with numarray.nd image

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Raphaël MARC

    #1

    Processing an image with numarray.nd image

    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("Pyt hon.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
  • Matt Feinstein

    #2
    Re: Processing an image with numarray.nd image

    On Tue, 04 Oct 2005 11:56:51 +0200, Raphaël MARC
    <raphael.marc@f ree.fr> wrote:
    [color=blue]
    >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("Pyt hon.jpg")
    >data = list(im.getdata ())
    >import numarray.nd image as ti
    >ti.median filter(data,... )[/color]

    I've been doing something like that...

    from numarray import *
    import numarray.nd_ima ge as Filter
    import PIL.Image as Image

    im = Image.open(file _name)
    array_dat = reshape(array(l ist(im.getdata( ))), im.size)
    filt_array_dat = Filter.correlat e(array_dat, my_filter)

    et cetera...

    Matt Feinstein

    --
    There is no virtue in believing something that can be proved to be true.

    Comment

    Working...