InertiaMoment2d
Measures the resistance of an object, defined by a two-dimensional binary image, to changes in its motion around a given axis of rotation.
Access to parameter description
For an introduction:
The moment of inertia of an object on a given axis describes how difficult it is to change its angular motion around this axis.
For a point mass m, the moment of inertia I is simply m times the square perpendicular distance r from the axis of rotation: I=mr2 On a digital image, a pixel intensity can be considered as a mass.
Then, for an object of a binary image, m is a constant equal to 1. Thus, the moment of inertia is the sum of the square perpendicular distances from the axis: I=∑rr2=∑x(x−p(x))2 where:
See also
Access to parameter description
For an introduction:
- section Image Analysis
- section Moment And Orientation
The moment of inertia of an object on a given axis describes how difficult it is to change its angular motion around this axis.
For a point mass m, the moment of inertia I is simply m times the square perpendicular distance r from the axis of rotation: I=mr2 On a digital image, a pixel intensity can be considered as a mass.
Then, for an object of a binary image, m is a constant equal to 1. Thus, the moment of inertia is the sum of the square perpendicular distances from the axis: I=∑rr2=∑x(x−p(x))2 where:
- x is an object pixel
- p(x) is the orthogonal projection of x onto the axis of rotation.
See also
Function Syntax
This function returns the outputMeasurement output parameter.
// Function prototype. MeanInertiaMomentMsr::Ptr inertiaMoment2d( std::shared_ptr< iolink::ImageView > inputBinaryImage, int32_t rotationCenterX, int32_t rotationCenterY, double rotationAngle, MeanInertiaMomentMsr::Ptr outputMeasurement = NULL );
Class Syntax
Parameters
Class Name | InertiaMoment2d |
---|
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
![]() |
inputBinaryImage |
The input binary image. | Image | Binary | nullptr |
![]() |
rotationCenterX |
The X pixel coordinate of the rotation axis. | Int32 | >=1 | 1024 |
![]() |
rotationCenterY |
The Y pixel coordinate of the rotation axis. | Int32 | >=1 | 1024 |
![]() |
rotationAngle |
The orientation of the rotation axis in degrees. A positive value means that the angle is taken from the positive X axis to the positive Y axis. | Float64 | Any value | 10 |
![]() |
outputMeasurement |
The output measurement result. | MeanInertiaMomentMsr | nullptr |
Object Examples
auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); InertiaMoment2d inertiaMoment2dAlgo; inertiaMoment2dAlgo.setInputBinaryImage( polystyrene_sep ); inertiaMoment2dAlgo.setRotationCenterX( 1024 ); inertiaMoment2dAlgo.setRotationCenterY( 1024 ); inertiaMoment2dAlgo.setRotationAngle( 10 ); inertiaMoment2dAlgo.execute(); std::cout << "meanMoment: " << inertiaMoment2dAlgo.outputMeasurement()->meanMoment( 0 ) ;
Function Examples
auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); auto result = inertiaMoment2d( polystyrene_sep, 1024, 1024, 10 ); std::cout << "meanMoment: " << result->meanMoment( 0 ) ;