Loading [MathJax]/jax/output/CommonHTML/jax.js
ImageDev

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: This algorithm computes a measurement of an object's resistance to changes in its rotational motion.
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(xp(x))2 where: The rotation axis is defined by a point (rotationCenterX and rotationCenterY) and an orientation (rotationAngle), which are user-defined parameters.

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
input
inputBinaryImage
The input binary image. Image Binary nullptr
input
rotationCenterX
The X pixel coordinate of the rotation axis. Int32 >=1 1024
input
rotationCenterY
The Y pixel coordinate of the rotation axis. Int32 >=1 1024
input
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
output
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 ) ;