image = | localMaxima2dImg (inImg) |
image = | localMinima2dImg (inImg) |
algorithm allowing to extract local extrema 2d from an image
This algorithm allows, given an input image InImg and a searched extrema type defined by InLocalExtremumType parameter, to compute a binary ouput image OutBinImg where all set pixels are local extrema.
This means that if a pixel is set in output image, all neighbor value respect one of following condition :
- neighbor value is lower in case of maxima search (or greater in case of minima search)
- neighbor value is equal and neighbor is also a extrema (plateau case with neighbor pixel set in output image)
This is illustrated in case of a 1d signal :
Here is an example of a local maxima extraction applied to an unsigned char input image :
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
outImg = advmorpho.localMaxima2dImg(inImg)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLAdvancedMorphology/Processor/LocalExtrema2dImg/LocalExtrema2dImg.h>
Code Example
ImagePtr pOutMaxImg = localMaxima2dImg(pInImg);
ImagePtr pOutMinImg = localMinima2dImg(pInImg);