ImageDev

ClosingLineMinimum

Performs a minimal linear closing.

Access to parameter description

For an introduction: This algorithm computes the intersection of the closings in several directions (binary case) or the minimum of these closings (grayscale case).
It is very useful for filtering circular shapes, because it fills holes in all directions (the circular ones first).
Like a classical closing transform, combining this algorithm with a subtraction to the original image and an appropriate threshold performs a Top Hat well adapted to circular dark object detection.
In the 2D case, directions are regularly sampled around the unit circle (starting with an horizontal right oriented direction). In the 3D case, a unit sphere is regularly sampled (starting with a vertical upper oriented direction).

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > closingLineMinimum( std::shared_ptr< iolink::ImageView > inputImage, int32_t kernelRadius, int32_t directionNumber, std::shared_ptr< iolink::ImageView > outputImage = nullptr );
This function returns outputImage.
// Function prototype.
closing_line_minimum(input_image: idt.ImageType,
                     kernel_radius: int = 3,
                     direction_number: int = 4,
                     output_image: idt.ImageType = None) -> idt.ImageType
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
ClosingLineMinimum( IOLink.ImageView inputImage,
                    Int32 kernelRadius = 3,
                    Int32 directionNumber = 4,
                    IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
kernelRadius
The length of the linear structuring element in pixels. Int32 >=1 3
input
directionNumber
The number of directions for linear linear closing. Int32 >=1 4
output
outputImage
The output image. Its dimensions and type are forced to the same values as the input image. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
input_image
The input image. image Binary, Label, Grayscale or Multispectral None
input
kernel_radius
The length of the linear structuring element in pixels. int32 >=1 3
input
direction_number
The number of directions for linear linear closing. int32 >=1 4
output
output_image
The output image. Its dimensions and type are forced to the same values as the input image. image None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral null
input
kernelRadius
The length of the linear structuring element in pixels. Int32 >=1 3
input
directionNumber
The number of directions for linear linear closing. Int32 >=1 4
output
outputImage
The output image. Its dimensions and type are forced to the same values as the input image. Image null

Object Examples

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

ClosingLineMinimum closingLineMinimumAlgo;
closingLineMinimumAlgo.setInputImage( foam );
closingLineMinimumAlgo.setKernelRadius( 3 );
closingLineMinimumAlgo.setDirectionNumber( 4 );
closingLineMinimumAlgo.execute();

std::cout << "outputImage:" << closingLineMinimumAlgo.outputImage()->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

closing_line_minimum_algo = imagedev.ClosingLineMinimum()
closing_line_minimum_algo.input_image = foam
closing_line_minimum_algo.kernel_radius = 3
closing_line_minimum_algo.direction_number = 4
closing_line_minimum_algo.execute()

print("output_image:", str(closing_line_minimum_algo.output_image))
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

ClosingLineMinimum closingLineMinimumAlgo = new ClosingLineMinimum
{
    inputImage = foam,
    kernelRadius = 3,
    directionNumber = 4
};
closingLineMinimumAlgo.Execute();

Console.WriteLine( "outputImage:" + closingLineMinimumAlgo.outputImage.ToString() );

Function Examples

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

auto result = closingLineMinimum( foam, 3, 4 );

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

result = imagedev.closing_line_minimum(foam, 3, 4)

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

IOLink.ImageView result = Processing.ClosingLineMinimum( foam, 3, 4 );

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