image = | dilateLocalMaxima2dImg (inImg,inDilateFactor) |
image = | dilateLocalMinima2dImg (inImg,inDilateFactor) |
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) :
where pixel with index
is :
- connected to pixel with index
in output image
- greater than or equal to all other values (local maxima) in the connected component associated to the pixel with index
.
This is illustrated in case of a 1d signal :
Here is an example of a dilated local maxima extraction applied to an unsigned char input image with dilation factor equal to 0 :
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) :
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
outImg = advmorpho.dilateLocalMaxima2dImg(inImg, 5)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLAdvancedMorphology/Processor/DilateLocalExtrema2dImg/DilateLocalExtrema2dImg.h>
Code Example
ImagePtr pOutMaxImg = dilateLocalMaxima2dImg(pInImg, 5);
ImagePtr pOutMinImg = dilateLocalMinima2dImg(pInImg, 5);