ImageDev

RegionalMinima

Computes the regional minima in a grayscale image and marks them in a binary image.

Access to parameter description

For an introduction: This algorithm computes the regional or relative minima in a grayscale image $I$ and creates a binary image $O$ containing these minima.

A regional minimum $C$ is a set of connected pixels such that:

<b> Figure 1.</b> One-dimensional example of a regional minima detection
Figure 1. One-dimensional example of a regional minima detection

This algorithm is based on [1] and uses a recursive method combined with a geodesic propagation.
To avoid getting too many regions in the output image, input should be smoothed first with a low-pass filter or with the numerical reconstruction algorithm.

Reference:
[1] B. Laÿ. "Recursive Algorithms in Mathematical Morphology", In Acta Stereologica, vol.6/III, pp.691-696, 7th International Congress For Stereology, Caen, France, Sept. 1987.

See also

Function Syntax

This function returns outputBinaryImage.
// Function prototype
std::shared_ptr< iolink::ImageView > regionalMinima( std::shared_ptr< iolink::ImageView > inputImage, RegionalMinima::Neighborhood neighborhood, std::shared_ptr< iolink::ImageView > outputBinaryImage = NULL );
This function returns outputBinaryImage.
// Function prototype.
regional_minima( input_image, neighborhood = RegionalMinima.Neighborhood.CONNECTIVITY_26, output_binary_image = None )
This function returns outputBinaryImage.
// Function prototype.
public static IOLink.ImageView
RegionalMinima( IOLink.ImageView inputImage,
                RegionalMinima.Neighborhood neighborhood = ImageDev.RegionalMinima.Neighborhood.CONNECTIVITY_26,
                IOLink.ImageView outputBinaryImage = null );

Class Syntax

Parameters

Class Name RegionalMinima

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
neighborhood
The 3D neighborhood configuration. This parameter is ignored with a 2D input image.
CONNECTIVITY_6 The structuring element is composed of voxels with a common face with the voxel of interest.
CONNECTIVITY_18 The structuring element is composed of voxels with at least one common edge.
CONNECTIVITY_26 The structuring element is a full cube.
Enumeration CONNECTIVITY_26
output
outputBinaryImage
The binary output image. Its dimensions and type are forced to the same values as the input. Image nullptr

Object Examples

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

RegionalMinima regionalMinimaAlgo;
regionalMinimaAlgo.setInputImage( foam );
regionalMinimaAlgo.setNeighborhood( RegionalMinima::Neighborhood::CONNECTIVITY_26 );
regionalMinimaAlgo.execute();

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

regional_minima_algo = imagedev.RegionalMinima()
regional_minima_algo.input_image = foam
regional_minima_algo.neighborhood = imagedev.RegionalMinima.CONNECTIVITY_26
regional_minima_algo.execute()

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

RegionalMinima regionalMinimaAlgo = new RegionalMinima
{
    inputImage = foam,
    neighborhood = RegionalMinima.Neighborhood.CONNECTIVITY_26
};
regionalMinimaAlgo.Execute();

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

Function Examples

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

auto result = regionalMinima( foam, RegionalMinima::Neighborhood::CONNECTIVITY_26 );

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

result = imagedev.regional_minima( foam, imagedev.RegionalMinima.CONNECTIVITY_26 )

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

IOLink.ImageView result = Processing.RegionalMinima( foam, RegionalMinima.Neighborhood.CONNECTIVITY_26 );

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