[PYTHON IMAGE-SIG] PIL example scripts?
Thu, 6 Mar 1997 13:35:32 +0100
> I want to compare two images by computing something like an RMS
> value for the difference of the images. Is this easily doable with
> PIL (and possibly NumPy mixed in)?
h1 = Image.open("image1").histogram()
h2 = Image.open("image2").histogram()
rms = math.sqrt(reduce(operator.add,
map(lambda a,b: (a-b)**2, h1, h2))/len(h1))
Or something (completely untested).
> In general, are there some interesting PIL example scripts laying
> about? I didn't see much in the PIL distribution and nothing in the
> contrib section of the Python site.
Except for the Scripts subdirectory (which IMO contains some pretty
interesting stuff), its not much. Will probably put some material
that doesn't fit into the book at my homepage, but its not much there
Cheers /F (http://hem1.passagen.se/eff)
IMAGE-SIG - SIG on Image Processing with Python
send messages to: email@example.com
administrivia to: firstname.lastname@example.org