ImageDev

ImageLocalMaxima2d

Removes the non-local maxima from the gradient amplitude of a two-dimensional image.

Access to parameter description

For an introduction: For each pixel of a gradient image, gray level values within the neighborhood in the direction of the gradient are computed (given by X and Y gradients). If this value is greater than all of its neighbors it is kept, otherwise it is set to 0.

This algorithm eliminates some noise effects. It is very useful after having applied the GradientOperator2d algorithm.

The output edges are one pixel thickness edges. It is then possible to perform a HysteresisThresholding algorithm.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > imageLocalMaxima2d( std::shared_ptr< iolink::ImageView > inputImageX, std::shared_ptr< iolink::ImageView > inputImageY, std::shared_ptr< iolink::ImageView > inputAmplitudeImage, std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns outputImage.
// Function prototype.
image_local_maxima_2d( input_image_x,
                       input_image_y,
                       input_amplitude_image,
                       output_image = None )
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
ImageLocalMaxima2d( IOLink.ImageView inputImageX,
                    IOLink.ImageView inputImageY,
                    IOLink.ImageView inputAmplitudeImage,
                    IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Class Name ImageLocalMaxima2d

Parameter Name Description Type Supported Values Default Value
input
inputImageX
The X-gradient input image. Image Grayscale or Multispectral nullptr
input
inputImageY
The Y-gradient input image. Image Grayscale or Multispectral nullptr
input
inputAmplitudeImage
The gradient amplitude input image. Image Binary, Label, Grayscale or Multispectral nullptr
output
outputImage
The output image. Image nullptr

Object Examples

std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

ImageLocalMaxima2d imageLocalMaxima2dAlgo;
imageLocalMaxima2dAlgo.setInputImageX( polystyrene );
imageLocalMaxima2dAlgo.setInputImageY( polystyrene );
imageLocalMaxima2dAlgo.setInputAmplitudeImage( polystyrene );
imageLocalMaxima2dAlgo.execute();

std::cout << "outputImage:" << imageLocalMaxima2dAlgo.outputImage()->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

image_local_maxima_2d_algo = imagedev.ImageLocalMaxima2d()
image_local_maxima_2d_algo.input_image_x = polystyrene
image_local_maxima_2d_algo.input_image_y = polystyrene
image_local_maxima_2d_algo.input_amplitude_image = polystyrene
image_local_maxima_2d_algo.execute()

print( "output_image:", str( image_local_maxima_2d_algo.output_image ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

ImageLocalMaxima2d imageLocalMaxima2dAlgo = new ImageLocalMaxima2d
{
    inputImageX = polystyrene,
    inputImageY = polystyrene,
    inputAmplitudeImage = polystyrene
};
imageLocalMaxima2dAlgo.Execute();

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

Function Examples

std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

auto result = imageLocalMaxima2d( polystyrene, polystyrene, polystyrene );

std::cout << "outputImage:" << result->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

result = imagedev.image_local_maxima_2d( polystyrene, polystyrene, polystyrene )

print( "output_image:", str( result ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

IOLink.ImageView result = Processing.ImageLocalMaxima2d( polystyrene, polystyrene, polystyrene );

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