ImageDev

LocalMaxima3d

Extracts the local maxima of an image using a three-dimensional neighborhood analysis.

Access to parameter description

This algorithm considers $I(i,j,k)$ as a local maximum of $I$ if the two conditions below are verified
<b> Figure 1.</b> Graphic visualization of the 3D neighborhood analysis
Figure 1. Graphic visualization of the 3D neighborhood analysis


See also

Function Syntax

This function returns the outputMeasurement output parameter.
// Function prototype.
LocalMaximaMsr::Ptr
localMaxima3d( std::shared_ptr< iolink::ImageView > inputGrayImage,
               iolink::Vector3i32 localWindow,
               double thresholdRange,
               LocalMaxima3d::Precision precision,
               int32_t numberOfPatterns,
               LocalMaximaMsr::Ptr outputMeasurement = NULL );
This function returns the outputMeasurement output parameter.
// Function prototype.
local_maxima_3d( input_gray_image,
                 local_window = [3, 3, 3],
                 threshold_range = 0,
                 precision = LocalMaxima3d.Precision.PIXEL,
                 number_of_patterns = 1,
                 output_measurement = None )
This function returns the outputMeasurement output parameter.
// Function prototype.
public static LocalMaximaMsr
LocalMaxima3d( IOLink.ImageView inputGrayImage,
               int[] localWindow = null,
               double thresholdRange = 0,
               LocalMaxima3d.Precision precision = ImageDev.LocalMaxima3d.Precision.PIXEL,
               Int32 numberOfPatterns = 1,
               LocalMaximaMsr outputMeasurement = null );

Class Syntax

Parameters

Class Name LocalMaxima3d

Parameter Name Description Type Supported Values Default Value
input
inputGrayImage
The input grayscale image Image Binary, Label, Grayscale or Multispectral nullptr
input
localWindow
The neighborhood size in pixels, along the X, Y, and Z directions. Vector3i32 >=0 {3, 3, 3}
input
thresholdRange
The threshold value higher than which maxima are retained. Float64 >=0 0
input
precision
The precision of the maxima localization.
PIXEL No sub-pixel approximation.
SUB_PIXEL Sub-pixel approximation determined by parabola fitting.
Enumeration PIXEL
input
numberOfPatterns
The maximum number of patterns to be detected. Int32 >=1 1
output
outputMeasurement
The result object containing the maxima positions. LocalMaximaMsr nullptr

Object Examples

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

LocalMaxima3d localMaxima3dAlgo;
localMaxima3dAlgo.setInputGrayImage( foam );
localMaxima3dAlgo.setLocalWindow( {3, 3, 3} );
localMaxima3dAlgo.setThresholdRange( 0 );
localMaxima3dAlgo.setPrecision( LocalMaxima3d::Precision::PIXEL );
localMaxima3dAlgo.setNumberOfPatterns( 1 );
localMaxima3dAlgo.execute();

std::cout << "value: " << localMaxima3dAlgo.outputMeasurement()->value( ) ;
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

local_maxima_3d_algo = imagedev.LocalMaxima3d()
local_maxima_3d_algo.input_gray_image = foam
local_maxima_3d_algo.local_window = [3, 3, 3]
local_maxima_3d_algo.threshold_range = 0
local_maxima_3d_algo.precision = imagedev.LocalMaxima3d.PIXEL
local_maxima_3d_algo.number_of_patterns = 1
local_maxima_3d_algo.execute()

print( "value: ", str( local_maxima_3d_algo.output_measurement.value( ) ) )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

LocalMaxima3d localMaxima3dAlgo = new LocalMaxima3d
{
    inputGrayImage = foam,
    localWindow = new int[]{3, 3, 3},
    thresholdRange = 0,
    precision = LocalMaxima3d.Precision.PIXEL,
    numberOfPatterns = 1
};
localMaxima3dAlgo.Execute();

Console.WriteLine( "value: " + localMaxima3dAlgo.outputMeasurement.value( ) );

Function Examples

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

auto result = localMaxima3d( foam, {3, 3, 3}, 0, LocalMaxima3d::Precision::PIXEL, 1 );

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

result = imagedev.local_maxima_3d( foam, [3, 3, 3], 0, imagedev.LocalMaxima3d.PIXEL, 1 )

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

LocalMaximaMsr result = Processing.LocalMaxima3d( foam, new int[]{3, 3, 3}, 0, LocalMaxima3d.Precision.PIXEL, 1 );

Console.WriteLine(  "value: " + result.value( )  );