image = | minPropagation2dImg (inImg) |
propagation of minima in a 2d image
Minima propagation algorithm allows to propagate minimum grayscale values inside particules separated by zero grayscale pixel values with respect to a given neighborhood 2d policy (see 2d neighborhood models).
Two versions of this algorithm are implemented which can be selected using attribute InOptOptimizationPolicy which associated to enumerate ipsdk::imaproc::attr::eProcessingOptimizationPolicy :
- a 'fast' version using a binary and a label intermediate image (which can optionally be provided via OutOptWk1BinImg and OutOptWk1LabelImg attributes)
- a low memory consumption iterative algorithm which propagate minima until convergence.
The following figure illustrate algorithm effect on synthetic data :
Here is an example of minima propagation applied to a grayscale input image (with 8 connexity neighborhood type) :
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
outImg = advmorpho.minPropagation2dImg(inImg)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLAdvancedMorphology/Processor/MinPropagation2dImg/MinPropagation2dImg.h>
Code Example
ImagePtr pOutImg = minPropagation2dImg(pInImg);