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: $$ \begin{array}{ccc} 0 & 0 & \times\\ 0 & 1 & 0\\ 0 & 0 & 0 \end{array} $$ Where $\times$ means "don't care".
Figure 1. Skeleton and its end points
See also
Access to parameter description
For an introduction:
- section Mathematical Morphology
- section Point Detectors
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: $$ \begin{array}{ccc} 0 & 0 & \times\\ 0 & 1 & 0\\ 0 & 0 & 0 \end{array} $$ Where $\times$ means "don't care".
Figure 1. Skeleton and its end points
See also
Function Syntax
This function returns outputBinaryImage.
// 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 = nullptr );
This function returns outputBinaryImage.
// Function prototype. end_points_2d(input_binary_image: idt.ImageType, border_condition: EndPoints2d.BorderCondition = EndPoints2d.BorderCondition.ZERO, neighborhood: EndPoints2d.Neighborhood = EndPoints2d.Neighborhood.CONNECTIVITY_8, output_binary_image: idt.ImageType = None) -> idt.ImageType
This function returns outputBinaryImage.
// Function prototype. public static IOLink.ImageView EndPoints2d( IOLink.ImageView inputBinaryImage, EndPoints2d.BorderCondition borderCondition = ImageDev.EndPoints2d.BorderCondition.ZERO, EndPoints2d.Neighborhood neighborhood = ImageDev.EndPoints2d.Neighborhood.CONNECTIVITY_8, IOLink.ImageView outputBinaryImage = null );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
inputBinaryImage |
The binary input image. | Image | Binary | nullptr | |||||
borderCondition |
The way to consider pixels out of image borders.
|
Enumeration | ZERO | ||||||
neighborhood |
The 2D neighborhood configuration for performing dilations or erosions.
|
Enumeration | CONNECTIVITY_8 | ||||||
outputBinaryImage |
The binary output image. Its size and type are forced to the same values as the input. | Image | nullptr |
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
input_binary_image |
The binary input image. | image | Binary | None | |||||
border_condition |
The way to consider pixels out of image borders.
|
enumeration | ZERO | ||||||
neighborhood |
The 2D neighborhood configuration for performing dilations or erosions.
|
enumeration | CONNECTIVITY_8 | ||||||
output_binary_image |
The binary output image. Its size and type are forced to the same values as the input. | image | None |
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
inputBinaryImage |
The binary input image. | Image | Binary | null | |||||
borderCondition |
The way to consider pixels out of image borders.
|
Enumeration | ZERO | ||||||
neighborhood |
The 2D neighborhood configuration for performing dilations or erosions.
|
Enumeration | CONNECTIVITY_8 | ||||||
outputBinaryImage |
The binary output image. Its size and type are forced to the same values as the input. | Image | null |
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();
polystyrene_sep = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_sep.vip")) end_points_2d_algo = imagedev.EndPoints2d() end_points_2d_algo.input_binary_image = polystyrene_sep end_points_2d_algo.border_condition = imagedev.EndPoints2d.ZERO end_points_2d_algo.neighborhood = imagedev.EndPoints2d.CONNECTIVITY_8 end_points_2d_algo.execute() print("output_binary_image:", str(end_points_2d_algo.output_binary_image))
ImageView polystyrene_sep = Data.ReadVipImage( @"Data/images/polystyrene_sep.vip" ); EndPoints2d endPoints2dAlgo = new EndPoints2d { inputBinaryImage = polystyrene_sep, borderCondition = EndPoints2d.BorderCondition.ZERO, neighborhood = EndPoints2d.Neighborhood.CONNECTIVITY_8 }; endPoints2dAlgo.Execute(); Console.WriteLine( "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();
polystyrene_sep = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_sep.vip")) result = imagedev.end_points_2d(polystyrene_sep, imagedev.EndPoints2d.ZERO, imagedev.EndPoints2d.CONNECTIVITY_8) print("output_binary_image:", str(result))
ImageView polystyrene_sep = Data.ReadVipImage( @"Data/images/polystyrene_sep.vip" ); IOLink.ImageView result = Processing.EndPoints2d( polystyrene_sep, EndPoints2d.BorderCondition.ZERO, EndPoints2d.Neighborhood.CONNECTIVITY_8 ); Console.WriteLine( "outputBinaryImage:" + result.ToString() );