MomentsOfInertia2d
Computes the elements of the covariance matrix of a two-dimensional grayscale image.
Access to parameter description
For an introduction:
For this measurement the image calibration is ignored. The coordinates used to calculate the moments are expressed in pixels.
See also
Access to parameter description
For an introduction:
- section Image Analysis
- section Moment And Orientation
For this measurement the image calibration is ignored. The coordinates used to calculate the moments are expressed in pixels.
See also
Function Syntax
This function returns outputMeasurement.
// Function prototype
MomentsOfInertia2dMsr::Ptr momentsOfInertia2d( std::shared_ptr< iolink::ImageView > inputImage, MomentsOfInertia2dMsr::Ptr outputMeasurement = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
![]() |
inputImage |
The input image. | Image | Binary, Label or Grayscale | nullptr |
![]() |
outputMeasurement |
The output measurement result. | MomentsOfInertia2dMsr | nullptr |
Object Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); MomentsOfInertia2d momentsOfInertia2dAlgo; momentsOfInertia2dAlgo.setInputImage( polystyrene ); momentsOfInertia2dAlgo.execute(); std::cout << "barycenterX: " << momentsOfInertia2dAlgo.outputMeasurement()->barycenterX( 0 ) ;
Function Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = momentsOfInertia2d( polystyrene ); std::cout << "barycenterX: " << result->barycenterX( 0 ) ;