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 = nullptr );
This function returns outputImage.
// Function prototype.
image_local_maxima_2d(input_image_x: idt.ImageType,
                      input_image_y: idt.ImageType,
                      input_amplitude_image: idt.ImageType,
                      output_image: idt.ImageType = None) -> idt.ImageType
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

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
Parameter Name Description Type Supported Values Default Value
input
input_image_x
The X-gradient input image. image Grayscale or Multispectral None
input
input_image_y
The Y-gradient input image. image Grayscale or Multispectral None
input
input_amplitude_image
The gradient amplitude input image. image Binary, Label, Grayscale or Multispectral None
output
output_image
The output image. image None
Parameter Name Description Type Supported Values Default Value
input
inputImageX
The X-gradient input image. Image Grayscale or Multispectral null
input
inputImageY
The Y-gradient input image. Image Grayscale or Multispectral null
input
inputAmplitudeImage
The gradient amplitude input image. Image Binary, Label, Grayscale or Multispectral null
output
outputImage
The output image. Image null

Object Examples

auto 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

auto 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() );