Internal: Why do output histograms in classic ENVI sometimes have alternating low and high values?
Anonym
In Interactive Stretching, sometimes the output histogram looks like it is a double histogram, with alternating low and high peaks at each bin. Sometimes this effect is described as looking like two superimposed histograms, one with 'darker/lower' values and one with'lighter/higher' values. This tech tip explains why that is so, and how to adjust the Interactive Stretching dialog so that the histogram looks like a single, smooth, histogram.
In Interactive Stretching, sometimes the output histogram looks like it is a double histogram, with alternating low and high peaks at each bin. Sometimes this effect is described as looking like two superimposed histograms, one with 'darker/lower' values and one with'lighter/higher' values.
ENVI tries to show the output histogram distribution after the input histogram is passed through the given stretch function. The thing to remember here is that input bins can never be split. Either all of the contents of an input bin go to an output bin, or none of them do. By default, input histograms contain only 256 unique bins. Often many of them get assigned to the output histogram bin for 0, and many of them get assigned to the output histogram bin for 255. The leaves considerably fewer than 254 input bins to map to the output bins from 1 to 254. Consequently, there end up being some empty output bins.
If you increase the number of maximum input bins to, say, 512, then you won't see this effect in the Interactive Stretching dialog. You can do that by going to the main ENVI menu and choosing File > Preferences, then choosing the Miscellaneous tab. You will find an option for Max Histogram Bins that can be set higher than 256.