Re: [Image-SIG] ImageStat median calculation off?

2007-04-26 Thread Bill Janssen
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

Re: [Image-SIG] ImageStat median calculation off?

2007-04-26 Thread Douglas Bagnall
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

Re: [Image-SIG] ImageStat median calculation off?

2007-04-26 Thread Bill Janssen
> 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

[Image-SIG] ImageStat median calculation off?

2007-04-26 Thread Bill Janssen
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