Re: quick pixelwise euclidean difference

Christopher Barker <[email protected]>
Newsgroups gmane.comp.python.image
Message-ID <[email protected]>
Lauri Love (nsh) wrote:
> Let me know if there is any faster solution short of coding in some 
> distance functions to the C modules

You might do better with numpy and/or scipy.ndimage.

You can convert a PIL RGB image to a numpy array very easily. I think 
it's as simple as:

import numpy as np

arr = np.asarray(pil_image)


Then you have a WxHx3 array of uint8 values you can do all sorts of math on.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]
_______________________________________________
Image-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/image-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.