Aghh, yes, thanks, just dopiness on my part. More coffee needed.
Bill
> Bill Janssen wrote:
>
> >
> > I keep getting different values for "s.median" than I get for "h.index(v)".
> >
> > Shouldn't they be the same value? Am I missing something?
>
> Isn't it *mode* that you are calculating, n
Bill Janssen wrote:
>
> I keep getting different values for "s.median" than I get for "h.index(v)".
>
> Shouldn't they be the same value? Am I missing something?
Isn't it *mode* that you are calculating, not median? The median would
be calculated by adding up the histogram values until you ha
> I keep getting different values for "s.median" than I get for "h.index(v)".
>
> Shouldn't they be the same value? Am I missing something?
I guess they theoretically could be different, but in the photo I'm
looking at, there are no repeated values in the histogram, so that
possibility doesn't o
I'm running the following program over a photo:
#!/usr/bin/env python
import sys, os, Image, ImageStat
im = Image.open(sys.argv[1])
im = im.convert("L")
h = im.histogram()
for i in range(len(h)):
print i, h[i]
s = ImageStat.Stat(h)
print s.mean, s.stddev, s.extrema, s.median
v = max(h)
l = l