ClosestBoundaryPoints2d
Computes the Chamfer distance map of the background of a two-dimensional image and the coordinates of the associated boundary points.
Access to parameter description
This algorithm is like the DistanceMap2d algorithm, applied on the background of the input image, and indicates the distance to the closest object boundary point.
It also stores the X and Y coordinates of the corresponding point in two additional output images.
Note: This algorithm does not take into account the input image calibration. The output values are systematically indicating distance in pixel units.
See also
Access to parameter description
This algorithm is like the DistanceMap2d algorithm, applied on the background of the input image, and indicates the distance to the closest object boundary point.
It also stores the X and Y coordinates of the corresponding point in two additional output images.
Note: This algorithm does not take into account the input image calibration. The output values are systematically indicating distance in pixel units.
See also
Function Syntax
This function returns a ClosestBoundaryPoints2dOutput structure containing outputMapImage, outputImageX and outputImageY.
// Output structure of the closestBoundaryPoints2d function. struct ClosestBoundaryPoints2dOutput { /// The output background distance map image. Its dimensions are forced to the same values as the input. Its type is signed 16-bit integer. std::shared_ptr< iolink::ImageView > outputMapImage; /// The X coordinate image of the closest boundary point, in pixel units. Its dimensions are forced to the same values as the input. Its type is signed 16-bit integer. std::shared_ptr< iolink::ImageView > outputImageX; /// The Y coordinate image of the closest boundary point, in pixel units. Its dimensions are forced to the same values as the input. Its type is signed 16-bit integer. std::shared_ptr< iolink::ImageView > outputImageY; }; // Function prototype
ClosestBoundaryPoints2dOutput closestBoundaryPoints2d( std::shared_ptr< iolink::ImageView > inputBinaryImage, std::shared_ptr< iolink::ImageView > outputMapImage = NULL, std::shared_ptr< iolink::ImageView > outputImageX = NULL, std::shared_ptr< iolink::ImageView > outputImageY = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
![]() |
inputBinaryImage |
The binary input image. | Image | Binary | nullptr |
![]() |
outputMapImage |
The output background distance map image. Its dimensions are forced to the same values as the input. Its type is signed 16-bit integer. | Image | nullptr | |
![]() |
outputImageX |
The X coordinate image of the closest boundary point, in pixel units. Its dimensions are forced to the same values as the input. Its type is signed 16-bit integer. | Image | nullptr | |
![]() |
outputImageY |
The Y coordinate image of the closest boundary point, in pixel units. Its dimensions are forced to the same values as the input. Its type is signed 16-bit integer. | Image | nullptr |
Object Examples
auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); ClosestBoundaryPoints2d closestBoundaryPoints2dAlgo; closestBoundaryPoints2dAlgo.setInputBinaryImage( polystyrene_sep ); closestBoundaryPoints2dAlgo.execute(); std::cout << "outputMapImage:" << closestBoundaryPoints2dAlgo.outputMapImage()->toString(); std::cout << "outputImageX:" << closestBoundaryPoints2dAlgo.outputImageX()->toString(); std::cout << "outputImageY:" << closestBoundaryPoints2dAlgo.outputImageY()->toString();
Function Examples
auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); auto result = closestBoundaryPoints2d( polystyrene_sep ); std::cout << "outputMapImage:" << result.outputMapImage->toString(); std::cout << "outputImageX:" << result.outputImageX->toString(); std::cout << "outputImageY:" << result.outputImageY->toString();