IntensityStatistics
Computes basic statistics of an image.
Access to parameter description
For an introduction:
See also
See related example
Access to parameter description
For an introduction:
- section Image Analysis
- section Image Statistics
- $ range = Max ~-~ Min ~+~ 1 $
- $ \mbox{k-}th~ central~ moment = \mu_k = \sum{(I(i,j)-mean)}^{k} $
- $ stddev = \sigma=\sqrt{\mu_2} $
- $ skewness = \frac{\mu_3}{\sigma^3} $
- $ kurtosis = (\frac{\mu_4}{\sigma^4})-3 $
- If the distribution has a tail length smaller than the maximum, the function has negative skewness.
- Otherwise, it has positive skewness.
See also
See related example
Function Syntax
This function returns outputMeasurement.
// Function prototype
StatisticsMsr::Ptr intensityStatistics( std::shared_ptr< iolink::ImageView > inputImage, IntensityStatistics::RangeMode rangeMode, iolink::Vector2i32 intensityInputRange, StatisticsMsr::Ptr outputMeasurement = NULL );
This function returns outputMeasurement.
// Function prototype. intensity_statistics( input_image, range_mode = IntensityStatistics.RangeMode.MIN_MAX, intensity_input_range = [0, 255], output_measurement = None )
This function returns outputMeasurement.
// Function prototype. public static StatisticsMsr IntensityStatistics( IOLink.ImageView inputImage, IntensityStatistics.RangeMode rangeMode = ImageDev.IntensityStatistics.RangeMode.MIN_MAX, int[] intensityInputRange = null, StatisticsMsr outputMeasurement = null );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
inputImage |
The input image. It can be grayscale, color, multi-channel, or time series. | Image | Binary, Label, Grayscale or Multispectral | nullptr | |||||
rangeMode |
The way to determine the input intensity range within which statistics are computed.
|
Enumeration | MIN_MAX | ||||||
intensityInputRange |
The input intensity range [a,b] within which the statistics are computed. This parameter is ignored if the range mode is set to MIN_MAX. | Vector2i32 | Any value | {0, 255} | |||||
outputMeasurement |
The output measurement results. | StatisticsMsr | nullptr |
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
input_image |
The input image. It can be grayscale, color, multi-channel, or time series. | image | Binary, Label, Grayscale or Multispectral | None | |||||
range_mode |
The way to determine the input intensity range within which statistics are computed.
|
enumeration | MIN_MAX | ||||||
intensity_input_range |
The input intensity range [a,b] within which the statistics are computed. This parameter is ignored if the range mode is set to MIN_MAX. | vector2i32 | Any value | [0, 255] | |||||
output_measurement |
The output measurement results. | StatisticsMsr | None |
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
inputImage |
The input image. It can be grayscale, color, multi-channel, or time series. | Image | Binary, Label, Grayscale or Multispectral | null | |||||
rangeMode |
The way to determine the input intensity range within which statistics are computed.
|
Enumeration | MIN_MAX | ||||||
intensityInputRange |
The input intensity range [a,b] within which the statistics are computed. This parameter is ignored if the range mode is set to MIN_MAX. | Vector2i32 | Any value | {0, 255} | |||||
outputMeasurement |
The output measurement results. | StatisticsMsr | null |
Object Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); IntensityStatistics intensityStatisticsAlgo; intensityStatisticsAlgo.setInputImage( polystyrene ); intensityStatisticsAlgo.setRangeMode( IntensityStatistics::RangeMode::MIN_MAX ); intensityStatisticsAlgo.setIntensityInputRange( {0, 255} ); intensityStatisticsAlgo.execute(); std::cout << "pixelCount: " << intensityStatisticsAlgo.outputMeasurement()->pixelCount( 0 , 0 ) ;
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif")) intensity_statistics_algo = imagedev.IntensityStatistics() intensity_statistics_algo.input_image = polystyrene intensity_statistics_algo.range_mode = imagedev.IntensityStatistics.MIN_MAX intensity_statistics_algo.intensity_input_range = [0, 255] intensity_statistics_algo.execute() print( "pixelCount: ", str( intensity_statistics_algo.output_measurement.pixel_count( 0 , 0 ) ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" ); IntensityStatistics intensityStatisticsAlgo = new IntensityStatistics { inputImage = polystyrene, rangeMode = IntensityStatistics.RangeMode.MIN_MAX, intensityInputRange = new int[]{0, 255} }; intensityStatisticsAlgo.Execute(); Console.WriteLine( "pixelCount: " + intensityStatisticsAlgo.outputMeasurement.pixelCount( 0 , 0 ) );
Function Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = intensityStatistics( polystyrene, IntensityStatistics::RangeMode::MIN_MAX, {0, 255} ); std::cout << "pixelCount: " << result->pixelCount( 0 , 0 ) ;
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif")) result = imagedev.intensity_statistics( polystyrene, imagedev.IntensityStatistics.MIN_MAX, [0, 255] ) print( "pixelCount: ", str( result.pixel_count( 0 , 0 ) ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" ); StatisticsMsr result = Processing.IntensityStatistics( polystyrene, IntensityStatistics.RangeMode.MIN_MAX, new int[]{0, 255} ); Console.WriteLine( "pixelCount: " + result.pixelCount( 0 , 0 ) );