[gdal-dev] Histograms without null pixels

Caleb Hanger cdhanger at gmail.com
Mon Mar 4 21:26:35 PST 2013


All,

I am writing a script which is calling gdalinfo to get a histogram of pixel values in an image file.  Apparently the mechanism for obtaining a "default" histogram enables the "bIncludeOutOfRange" flag to dump not-in-range pixels (including null pixels, in formats that support it) into whichever bin of the histogram is closest.  I see that in the GetHistogram() function, the functionality is already coded to respond appropriately to either a true *or* false value in this flag.  However, I can't seem to find any way to turn that flag off through any of the user-level programs (in particular, gdalinfo), rendering the parameter to the function useless, unless I'm just not looking hard enough.  Hence, my questions:

1) Is there any standard user-level operation (preferably in gdalinfo) which disables, or at least *allows* for disabling of, the bIncludeOutOfRange flag?  If so, I can't find it.
2) If not, how come?  Has there been no apparent need for histograms that omit null values or other "out of range" situations?

Thanks in advance for any insight,
Caleb Hanger


More information about the gdal-dev mailing list