ImageDev

Histogram

This attribute manages measurements belonging to the Histogram category of native measurements.

All measurements available in the Histogram category are customizable with the following methods.

Syntax

Method Description
void setAutoAdjusted( bool autoAdjusted ) Enables or disables the automatic setting of the histogram parameters. If it equals false, the bin size and gray level ranges must be user defined.
bool isAutoAdjusted() Returns true if automatic mode for setting histogram parameters is enabled, false otherwise.
void setInterpolated( bool interpolated ) Enables or disables quantile interpolation.
bool isInterpolated() Returns true if quantile interpolation is enabled, false otherwise.
void setBinSize( float size ) Sets the histogram bin size. It must be strictly positive. It is ignored when the automatic mode is disabled.
float binSize() Returns the bin size of the histogram. This parameter is ignored is the automatic mode is disabled.
void setMinIntensity( float value ) Sets the minimum gray level value used to compute the histogram. This parameter is ignored if the automatic mode is disabled.
float minIntensity() Returns the minimum gray level value used to compute the histogram. This parameter is ignored if the automatic mode is disabled.
void setMaxIntensity( float value ) Sets the maximum gray level value used to compute the histogram. This parameter is ignored if the automatic mode is disabled.
float maxIntensity() Returns the maximum gray level value used to compute the histogram. This parameter is ignored if the automatic mode is disabled.

Histogram::Ptr histo = MeasurementAttributes::histogram();
histo->setAutoAdjusted( false );
bool valueAutoAdjusted = histo->isAutoAdjusted();
histo->setInterpolated( false );
bool valueInterpolated = histo->isInterpolated();
histo->setBinSize( 2 );
float valueBinSize = histo->binSize();
histo->setMinIntensity( 5 );
float valueMinValue = histo->minIntensity();
histo->setMaxIntensity( 200 );
float valueMaxValue = histo->maxIntensity();