[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Histogram Hot-shots Required
- Subject: Re: Histogram Hot-shots Required
- From: Liam Gumley <Liam.Gumley(at)ssec.wisc.edu>
- Date: Fri, 16 Jul 1999 08:30:12 -0500
- Newsgroups: comp.lang.idl-pvwave
- Organization: Space Science and Engineering Center, University of Wisconsin-Madison
- References: <MPG.11f876f9f15942a98982b@news.frii.com>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:15695
David Fanning wrote:
> What I can't figure out tonight is how to find out
> what bin that pixel is in, given that I know the pixel
> value. (Even as I write this sentence I have the sense
> that this is a trivial exercise, but I'm afraid it is
> not yielding the shear number of hours I have spent
> on it. At least not for me.)
Assuming I know the minimum and maximum values (the range) used in
creating the histogram, the histogram binsize, and the number of bins,
the zero-based bin index is given by
bin_index = long(float(pixel_value - histogram_min_value) /
float(binsize))
and then to protect against pixel values LT histogram minimum value, or
GE histogram maximum value
bin_index = (bin_index > 0L) < (number_of_bins - 1L)
At least, that's how it looks to me on paper....
Cheers,
Liam.
--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley