ImageDev

IntensityBinHistogram

Computes the histogram of a gray level image with a user-defined bin size.

Access to parameter description

For an introduction: This algorithm computes the histogram of a gray level image. The input range is divided into equal intervals of a given size. The histogram is then the number of pixels having values in each interval of a class.

Note: This algorithm is useful for computing a histogram on floating point images or when the input range is very large.
Binarization
@SEE_ALSO Processing_ImageAnalysis_ImageStatistics_IntensityHistogram IntensityHistogram@END_SEE_ALSO

Function Syntax

This function returns outputMeasurement.
// Function prototype
IntensityBinHistogramMsr::Ptr intensityBinHistogram( std::shared_ptr< iolink::ImageView > inputImage, iolink::Vector2d intensityInputRange, double binSize, IntensityBinHistogramMsr::Ptr outputMeasurement = NULL );
This function returns outputMeasurement.
// Function prototype.
intensity_bin_histogram( input_image,
                         intensity_input_range = [0, 255],
                         bin_size = 25,
                         output_measurement = None )
This function returns outputMeasurement.
// Function prototype.
public static IntensityBinHistogramMsr
IntensityBinHistogram( IOLink.ImageView inputImage,
                       double[] intensityInputRange = null,
                       double binSize = 25,
                       IntensityBinHistogramMsr outputMeasurement = null );

Class Syntax

Parameters

Class Name IntensityBinHistogram

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input gray scale image. Image Binary, Label, Grayscale or Multispectral nullptr
input
intensityInputRange
The minimal and maximal value of the histogram. Vector2d Any value {0.f, 255.f}
input
binSize
The size of a class of the histogram. Note that the histogram is divided into equal intervals. Float64 >0 25
output
outputMeasurement
The output histogram. IntensityBinHistogramMsr nullptr

Object Examples

std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

IntensityBinHistogram intensityBinHistogramAlgo;
intensityBinHistogramAlgo.setInputImage( polystyrene );
intensityBinHistogramAlgo.setIntensityInputRange( {0, 255} );
intensityBinHistogramAlgo.setBinSize( 25 );
intensityBinHistogramAlgo.execute();

std::cout << "minValueBin: " << intensityBinHistogramAlgo.outputMeasurement()->minValueBin( 0 ) ;
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

intensity_bin_histogram_algo = imagedev.IntensityBinHistogram()
intensity_bin_histogram_algo.input_image = polystyrene
intensity_bin_histogram_algo.intensity_input_range = [0, 255]
intensity_bin_histogram_algo.bin_size = 25
intensity_bin_histogram_algo.execute()

print( "minValueBin: ", str( intensity_bin_histogram_algo.output_measurement.min_value_bin( 0 ) ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

IntensityBinHistogram intensityBinHistogramAlgo = new IntensityBinHistogram
{
    inputImage = polystyrene,
    intensityInputRange = new double[]{0, 255},
    binSize = 25
};
intensityBinHistogramAlgo.Execute();

Console.WriteLine( "minValueBin: " + intensityBinHistogramAlgo.outputMeasurement.minValueBin( 0 ) );

Function Examples

std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

auto result = intensityBinHistogram( polystyrene, {0, 255}, 25 );

std::cout << "minValueBin: " << result->minValueBin( 0 ) ;
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

result = imagedev.intensity_bin_histogram( polystyrene, [0, 255], 25 )

print( "minValueBin: ", str( result.min_value_bin( 0 ) )  )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

IntensityBinHistogramMsr result = Processing.IntensityBinHistogram( polystyrene, new double[]{0, 255}, 25 );

Console.WriteLine(  "minValueBin: " + result.minValueBin( 0 )  );