IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Adaptive Watershed Binary Separation 3dSee full documentation
imageadaptiveBinaryWatershed3dImg (inBinImg3d,inArithmeticVal,mode)
imageadaptiveBinaryWatershed3dImg (inBinImg3d,inArithmeticVal,mode,inOptWatershedProcMode)

Detailed Description

Adaptive binary watershed 3d algorithm.

The 3D adaptive watershed binary sepation is a brand new algorithm developped by Reactiv'IP [1].

While standard watershed algorithm is well suited to separate objects with similar sizes and with rather circular shapes, it may have difficulties to separate more complex objects with various sizes.

Munch et al. [2] proposed an efficient adaptative algorithm to separate such objects, but its iterative nature leads to prohibitive processing times.

The adaptive watershed algorithm implemented in IPSDK is still based on the Seeded Watershed 3d algorithm, but the seeds are generated without locally considering each configuration.

In addition, the algorithm is very easy to set up since the only parameter inArithmeticVal to consider is the ratio between the size of the seed and the size of the object. The figure below illustrates in 2D the seeds for inArithmeticVal = 0.55 on a part of an image kindly provided by the 3S-R lab and used by Hassar et al. in the paper [3].

adaptiveWatershed2d_seedSizeRatio.png

Just like the Watershed Binary Separation 3d algorithm, it is possible to compute the separation lines, the basins or the splitted objects as a binary or label image.

Please, see Adaptive Watershed Binary Separation 2d for an example of result in 2D case.

[1] Bernard, L., Baptista, J., Aim, W., & Abbal, R. (2022). "A fast and adaptive solution for object separation". ICTMS 2022 https://www.linkedin.com/pulse/fast-adaptive-solution-object-separation-laurent-bernard/

[2] Munch, B., Gasser, P., Holzer, L., & Flatt, R. (2006). "FIB-Nanotomography of Particulate Systems-Part II: Particle Recognition and Effect of Boundary Truncation". Journal of the American Ceramic Society, 89(8), 2586-2595.

[3] Haffar, I., Flin, F., Geindreau, C., Petillon, N., Gervais, P.C., Edery, V. "X-ray tomography for 3D analysis of ice particles in jet A-1 fuel", Powder Technology (2021), 384, 200-210

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho
import PyIPSDK.IPSDKIPLBinarization as bin

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
inBinImg = bin.lightThresholdImg(inImg, 97)
# process watershed binary separation (split mode)
outImg = advmorpho.adaptiveBinaryWatershed3dImg(inBinImg, 0.1, PyIPSDK.eWatershedSeparationMode.eWSM_SplitLabel, PyIPSDK.eWPM_Repeatable)

Example of C++ code :

Example informations

Header file

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

Code Example

// opening of input grey image
ImagePtr pInImg = loadTiffImageFile(inputBinImgPath);
ImagePtr pInBinImg = lightThresholdImg(pInImg, 97);
// process adaptive binary separation
ImagePtr pOutImg = adaptiveBinaryWatershed3dImg(pInBinImg, 0.1, eWatershedSeparationMode::eWSM_SplitLabel);