Processing math: 100%
ImageDev

EndPoints2d

Point detector selecting end points of a two-dimensional binary image.

Access to parameter description

For an introduction:
This algorithm is a point detector that selects end points of a skeleton (that is, all object pixels having only one neighbor).
The skeleton is first detected, and then this algorithm performs a hit-or-miss transform (HMT) with the following configuration and its 7 associated rotations: 00×010000 Where × means "don't care".

<b> Figure 1.</b> Skeleton and its end points
Figure 1. Skeleton and its end points

See also

Function Syntax

This function returns the outputBinaryImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
endPoints2d( std::shared_ptr< iolink::ImageView > inputBinaryImage,
             EndPoints2d::BorderCondition borderCondition,
             EndPoints2d::Neighborhood neighborhood,
             std::shared_ptr< iolink::ImageView > outputBinaryImage = NULL );

Class Syntax

Parameters

Class Name EndPoints2d

Parameter Name Description Type Supported Values Default Value
input
inputBinaryImage
The binary input image. Image Binary nullptr
input
borderCondition
The way to consider pixels out of image borders.
ZERO Pixels outside of the image are considered as having the value 0.
MIRROR Pixels outside of the image are considered as an extrapolation of the image pixels with a mirror border condition.
Enumeration ZERO
input
neighborhood
The 2D neighborhood configuration for performing dilations or erosions.
CONNECTIVITY_4 The structuring element is a cross.
CONNECTIVITY_8 The structuring element is a square.
Enumeration CONNECTIVITY_8
output
outputBinaryImage
The binary output image. Its size and type are forced to the same values as the input. Image nullptr

Object Examples

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

EndPoints2d endPoints2dAlgo;
endPoints2dAlgo.setInputBinaryImage( polystyrene_sep );
endPoints2dAlgo.setBorderCondition( EndPoints2d::BorderCondition::ZERO );
endPoints2dAlgo.setNeighborhood( EndPoints2d::Neighborhood::CONNECTIVITY_8 );
endPoints2dAlgo.execute();

std::cout << "outputBinaryImage:" << endPoints2dAlgo.outputBinaryImage()->toString();

Function Examples

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

auto result = endPoints2d( polystyrene_sep, EndPoints2d::BorderCondition::ZERO, EndPoints2d::Neighborhood::CONNECTIVITY_8 );

std::cout << "outputBinaryImage:" << result->toString();