ImageDev

ConvexHull2d

Fills the concavities of particles in a two-dimensional binary image.

Access to parameter description

For an introduction: This algorithm fills the concavities of particles in an image without connecting the particles. It is found by rotating the configurations below to perform successive thickening until convergence. $$\begin{array}{ccc} 1 & 1 & \times\\ 1 & 0 & \times\\ 1 & \times & 0\end{array} ~~~~~ \mbox{ followed by } ~~~~~ \begin{array}{ccc} \times & 1 & \times\\ 1 & 0 & 0\\ \times & 1 & \times\end{array}$$ See also

Function Syntax

This function returns outputBinaryImage.
// Function prototype
std::shared_ptr< iolink::ImageView > convexHull2d( std::shared_ptr< iolink::ImageView > inputBinaryImage, std::shared_ptr< iolink::ImageView > outputBinaryImage = NULL );
This function returns outputBinaryImage.
// Function prototype.
convex_hull_2d( input_binary_image, output_binary_image = None )
This function returns outputBinaryImage.
// Function prototype.
public static IOLink.ImageView
ConvexHull2d( IOLink.ImageView inputBinaryImage, IOLink.ImageView outputBinaryImage = null );

Class Syntax

Parameters

Class Name ConvexHull2d

Parameter Name Description Type Supported Values Default Value
input
inputBinaryImage
The input binary image. Image Binary nullptr
output
outputBinaryImage
The output binary image. Its dimensions 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" );

ConvexHull2d convexHull2dAlgo;
convexHull2dAlgo.setInputBinaryImage( polystyrene_sep );
convexHull2dAlgo.execute();

std::cout << "outputBinaryImage:" << convexHull2dAlgo.outputBinaryImage()->toString();
polystyrene_sep = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_sep.vip"))

convex_hull_2d_algo = imagedev.ConvexHull2d()
convex_hull_2d_algo.input_binary_image = polystyrene_sep
convex_hull_2d_algo.execute()

print( "output_binary_image:", str( convex_hull_2d_algo.output_binary_image ) )
ImageView polystyrene_sep = Data.ReadVipImage( @"Data/images/polystyrene_sep.vip" );

ConvexHull2d convexHull2dAlgo = new ConvexHull2d
{
    inputBinaryImage = polystyrene_sep
};
convexHull2dAlgo.Execute();

Console.WriteLine( "outputBinaryImage:" + convexHull2dAlgo.outputBinaryImage.ToString() );

Function Examples

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

auto result = convexHull2d( polystyrene_sep );

std::cout << "outputBinaryImage:" << result->toString();
polystyrene_sep = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_sep.vip"))

result = imagedev.convex_hull_2d( polystyrene_sep )

print( "output_binary_image:", str( result ) )
ImageView polystyrene_sep = Data.ReadVipImage( @"Data/images/polystyrene_sep.vip" );

IOLink.ImageView result = Processing.ConvexHull2d( polystyrene_sep );

Console.WriteLine( "outputBinaryImage:" + result.ToString() );