IntensityHistogram
Computes the histogram of a gray level image.
Access to parameter description
For an introduction:
This number of points per level is given in an histogram array. The histogram size depends on the intensity range. As an example, for an 8-bit integer image, the histogram H is an array with 256 entries. H(i) is the number of pixels at level i, for i∈[0,255].
Notice: This algorithm can be used only on integer input images. The IntensityBinHistogram algorithm must be used to compute a histogram on floating point images.
See also
Access to parameter description
For an introduction:
- section Image Analysis
- section Image Statistics
This number of points per level is given in an histogram array. The histogram size depends on the intensity range. As an example, for an 8-bit integer image, the histogram H is an array with 256 entries. H(i) is the number of pixels at level i, for i∈[0,255].
Notice: This algorithm can be used only on integer input images. The IntensityBinHistogram algorithm must be used to compute a histogram on floating point images.
See also
Function Syntax
This function returns the outputMeasurement output parameter.
// Function prototype. IntensityHistogramMsr::Ptr intensityHistogram( std::shared_ptr< iolink::ImageView > inputImage, IntensityHistogram::RangeMode rangeMode, iolink::Vector2i32 intensityInputRange, IntensityHistogramMsr::Ptr outputMeasurement = NULL );
Class Syntax
Parameters
Class Name | IntensityHistogram |
---|
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
![]() |
inputImage |
The input gray scale image. Float images are not supported | Image | Binary, Label, Grayscale or Multispectral | nullptr | ||||
![]() |
rangeMode |
The way to determine the input intensity range within which the histogram is computed.
|
Enumeration | MIN_MAX | |||||
![]() |
intensityInputRange |
The input intensity range [a,b] within which the histogram is computed. This parameter is ignored if the range mode is set to MIN_MAX. | Vector2i32 | Any value | {0, 255} | ||||
![]() |
outputMeasurement |
The output histogram. | IntensityHistogramMsr | nullptr |
Object Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); IntensityHistogram intensityHistogramAlgo; intensityHistogramAlgo.setInputImage( polystyrene ); intensityHistogramAlgo.setRangeMode( IntensityHistogram::RangeMode::MIN_MAX ); intensityHistogramAlgo.setIntensityInputRange( {0, 255} ); intensityHistogramAlgo.execute(); std::cout << "intensityValue: " << intensityHistogramAlgo.outputMeasurement()->intensityValue( 0 ) ;
Function Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = intensityHistogram( polystyrene, IntensityHistogram::RangeMode::MIN_MAX, {0, 255} ); std::cout << "intensityValue: " << result->intensityValue( 0 ) ;