IPSDK 4.2
IPSDK : Image Processing Software Development Kit
Dilate Local Extrema 2d
image = dilateLocalMaxima2dImg (inImg,inDilateFactor)
image = dilateLocalMinima2dImg (inImg,inDilateFactor)

Detailed Description

algorithm allowing to extract dilated local extrema 2d from an image

This algorithm allows, given an input image InImg, a dilation factor InDilateFactor and a searched extrema type defined by InLocalExtremumType parameter, to compute a binary ouput image OutBinImg where all set pixels are part of a dilated local extrema.

Note
This algorithm is an extension of Local Extrema 2d algorithm allowing to dilate (and in some case merge) local extrema. Using this algorithm with a value of InDilateFactor set to 0 is equivalent of using Local Extrema 2d algorithm.
Dilation factor InDilateFactor is a grey scale factor (not a geometric factor) since local extrema are dilated with a distance based on grey scale difference.

Output image is computed has follow (local maxima case) :

\[ OutBinImg[i] = \left\{ \begin{matrix} 1 & if & InImg[i] >= InImg[E_i] - InDilateFactor \\ 0 & otherwise \end{matrix} \right. \]

where pixel with index $E_i$ is :

This is illustrated in case of a 1d signal :

dilateLocalExtremaGraph.png

Here is an example of a dilated local maxima extraction applied to an unsigned char input image with dilation factor equal to 0 :

dilateLocalExtrema2dImg0.png

Here is an example of a dilated local maxima extraction applied to an unsigned char input image with dilation factor equal to 5 (note merged maxima) :

dilateLocalExtrema2dImg5.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# dilate local maxima 2d computation
outImg = advmorpho.dilateLocalMaxima2dImg(inImg, 5)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLAdvancedMorphology/Processor/DilateLocalExtrema2dImg/DilateLocalExtrema2dImg.h>

Code Example

// opening of input image
ImagePtr pInImg = loadTiffImageFile(inputImgPath);
// mark local maxima in input image
ImagePtr pOutMaxImg = dilateLocalMaxima2dImg(pInImg, 5);
// mark local minima in input image
ImagePtr pOutMinImg = dilateLocalMinima2dImg(pInImg, 5);