[Tutor] [tutor] Finding image statistics
varsha.purohit at gmail.com
Mon Mar 3 01:09:15 CET 2008
I am getting this list as an output
[268541.0, 264014.0, 324155.0]
Actually in my code i am finding difference between two images and i need to
count the number of pixels which appear as a difference of these two images.
These values i m getting as output are little large.
i m pasting my code again....
diff = ImageChops.subtract(file1,file2,0.3)
stat1 = ImageStat.Stat(diff)
AS you can see i am finding difference of two images which are nearly
identical. But they have some pixels that are different and i can see that
in the output image diff.jpg. So i am trying to put this difference image in
the imagestat and trying to see if i can get to count the number of pixels
On Sun, Mar 2, 2008 at 9:48 AM, Varsha Purohit <varsha.purohit at gmail.com>
> Yes i am getting this but i was confused why i am getting 3 values for
> count, extrema.. and dats y i couldn't figure out how to find area of those
> On Sun, Mar 2, 2008 at 9:02 AM, Kent Johnson <kent37 at tds.net> wrote:
> > Varsha Purohit wrote:
> > > of this module in this application.
> > >
> > > I want to find other image statistics such as finding number of pixels
> > > which exist after taking difference between two images, getting sum of
> > > all pixels and area of pixels that are in that image etc.
> > I don't think you can get all of that out of ImageStat, it is pretty
> > basic.
> > In : import Image, ImageStat
> > In : i=Image.open('kent.jpg')
> > In : s=ImageStat.Stat(i)
> > In : s.extrema
> > Out: [(0, 255), (0, 255), (0, 251)]
> > In : s.count
> > Out: [43200, 43200, 43200]
> > In : s.mean
> > Out: [116.61453703703704, 103.23967592592592, 97.624606481481479]
> > etc.
> > Kent
> Varsha Purohit,
> Graduate Student
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor