Reduces skeleton branches. If enough iterations are processed, the branches are completely removed.
More...
| IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr | ipsdk::imaproc::morpho::pruning2dImg (const image::ImageConstPtr &pInBinImg) |
| | wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed More...
|
| |
| IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr | ipsdk::imaproc::morpho::pruning2dImg (const image::ImageConstPtr &pInBinImg, const ipsdk::ipUInt32 nbMaxIter) |
| | wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed More...
|
| |
| IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr | ipsdk::imaproc::morpho::pruning2dImg_keepAll (const image::ImageConstPtr &pInBinImg) |
| | wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed More...
|
| |
| IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr | ipsdk::imaproc::morpho::pruning2dImg_keepAll (const image::ImageConstPtr &pInBinImg, const ipsdk::ipUInt32 nbMaxIter) |
| | wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed More...
|
| |
| IPSDKIPLBASICMORPHOLOGY_API void | ipsdk::imaproc::morpho::pruning2dImg (const image::ImageConstPtr &pInBinImg, const image::ImagePtr &pOutBinImg) |
| | wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed More...
|
| |
| IPSDKIPLBASICMORPHOLOGY_API void | ipsdk::imaproc::morpho::pruning2dImg (const image::ImageConstPtr &pInBinImg, const ipsdk::ipUInt32 nbMaxIter, const image::ImagePtr &pOutBinImg) |
| | wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed More...
|
| |
| IPSDKIPLBASICMORPHOLOGY_API void | ipsdk::imaproc::morpho::pruning2dImg_keepAll (const image::ImageConstPtr &pInBinImg, const image::ImagePtr &pOutBinImg) |
| | wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed More...
|
| |
| IPSDKIPLBASICMORPHOLOGY_API void | ipsdk::imaproc::morpho::pruning2dImg_keepAll (const image::ImageConstPtr &pInBinImg, const ipsdk::ipUInt32 nbMaxIter, const image::ImagePtr &pOutBinImg) |
| | wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed More...
|
| |
Reduces skeleton branches. If enough iterations are processed, the branches are completely removed.
This algorithm iteratively reduces the branches of skeletons in the input binary image. For a single pass, pixels with a single neighbour are detected and are deleted. The algorithm repeats the process untill the output image does not change anymore.
However, it is possible to limit the number of iterations to keep parts of some branches by specifying the parameter nbMaxIter.
When the image contains skeletons without loop (i.e. the object that generated the skeleton does not have holes), the pruning operation completely remove the object. In order to keep a record of the presence of such objects, it is possible to call the function pruning2dImg_keepAll instead of the standard wrapper. This way, the result for a skeleton without loop is an isolated single pixel.
Here is the result of the pruning operation. The image on the left illustrates an example of pruning processing untill convergence, the middle image shows the result when applying 10 iterations and the image on the right displays the result when the skeleton wihtout loop is not deleted:
Attributes description
Attribute description for algorithm :
Global Rule description
Global rule description for algorithm :
ipsdk::imaproc::matchSizeAndType (_pInBinImg,_pOutBinImg)
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLBasicMorphology as morpho
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
outImg = morpho.pruning2dImg(inImg)
Example of C++ code :
Example informations
Associated library
IPSDKIPLBasicMorphology
Header file
Code Example
- See also
- Pruning2dImgLvl1
-
Pruning2dImgLvl2
-
Pruning2dImgLvl3
◆ pruning2dImg() [1/4]
wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed
- Exceptions
-
◆ pruning2dImg() [2/4]
wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed
- Exceptions
-
◆ pruning2dImg_keepAll() [1/4]
wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed
- Exceptions
-
◆ pruning2dImg_keepAll() [2/4]
wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed
- Exceptions
-
◆ pruning2dImg() [3/4]
wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed
- Exceptions
-
◆ pruning2dImg() [4/4]
wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed
- Exceptions
-
◆ pruning2dImg_keepAll() [3/4]
wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed
- Exceptions
-
◆ pruning2dImg_keepAll() [4/4]
wrapper function for Reduces skeleton branches. If enough iterations are processed, the branches are completely removed
- Exceptions
-