Eccentricity2d
Computes a shape factor of a binary two-dimensional image.
Access to parameter description
For an introduction:
The eccentricity is necessarily between 0 and 1; it is zero if and only if a=b, in which case the ellipse is a circle.
As the eccentricity tends to 1, the ellipse gets a more elongated shape and tends either towards a line segment (see below) or a parabola, and the ratio a/b tends to infinity: e=√1−b2a2
See also
Access to parameter description
For an introduction:
- section Image Analysis
- section Moment And Orientation
The eccentricity is necessarily between 0 and 1; it is zero if and only if a=b, in which case the ellipse is a circle.
As the eccentricity tends to 1, the ellipse gets a more elongated shape and tends either towards a line segment (see below) or a parabola, and the ratio a/b tends to infinity: e=√1−b2a2
See also
Function Syntax
This function returns outputMeasurement.
// Function prototype
Eccentricity2dMsr::Ptr eccentricity2d( std::shared_ptr< iolink::ImageView > inputBinaryImage, Eccentricity2dMsr::Ptr outputMeasurement = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
![]() |
inputBinaryImage |
The input binary image. | Image | Binary | nullptr |
![]() |
outputMeasurement |
The output measurement result. | Eccentricity2dMsr | nullptr |
Object Examples
auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); Eccentricity2d eccentricity2dAlgo; eccentricity2dAlgo.setInputBinaryImage( polystyrene_sep ); eccentricity2dAlgo.execute(); std::cout << "eccentricity: " << eccentricity2dAlgo.outputMeasurement()->eccentricity( ) ;
Function Examples
auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); auto result = eccentricity2d( polystyrene_sep ); std::cout << "eccentricity: " << result->eccentricity( ) ;