ImageDev

DistanceMean2d

Gives the mean distance, edge to edge, between direct neighbor objects of a two-dimensional binary image.

Access to parameter description

For an introduction: section Image Analysis.
This algorithm calculates the distance map of the negative input image and then extracts the ridges separating the image objects.
The measured mean distance is computed as the average of twice the distance map values along this path.

See also

Function Syntax

This function returns outputMeasurement.
// Function prototype
DistanceMeanMsr::Ptr distanceMean2d( std::shared_ptr< iolink::ImageView > inputBinaryImage, DistanceMeanMsr::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. DistanceMeanMsr nullptr

Object Examples

auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" );

DistanceMean2d distanceMean2dAlgo;
distanceMean2dAlgo.setInputBinaryImage( polystyrene_sep );
distanceMean2dAlgo.execute();

std::cout << "distance: " << distanceMean2dAlgo.outputMeasurement()->distance( 0 ) ;

Function Examples

auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" );

auto result = distanceMean2d( polystyrene_sep );

std::cout << "distance: " << result->distance( 0 ) ;