[Tutor] [tutor] Finding image statistics
kent37 at tds.net
Sun Mar 2 18:02:26 CET 2008
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]
More information about the Tutor