Processing math: 100%
ImageDev

Eccentricity2d

Computes a shape factor of a binary two-dimensional image.

Access to parameter description

For an introduction: The eccentricty is a classical elliptic parameter used for characterizing the shape of binarized objects. The eccentricity of an ellipse, usually denoted by e, is the ratio of the distance between its two foci to the length of its major axis.

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=1b2a2
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
input
inputBinaryImage
The input binary image. Image Binary nullptr
output
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( ) ;