IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Adaptive Watershed Binary Separation 2dSee full documentation
imageadaptiveBinaryWatershed2dImg (inBinImg,inArithmeticVal,mode)
imageadaptiveBinaryWatershed2dImg (inBinImg,inArithmeticVal,mode,inOptWatershedProcMode)

Detailed Description

Adaptive binary watershed 2d algorithm.

The 2D 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 2d algorithm, but the seeds are generated without locally considering each configuration.

Moreover, 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 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 [2].

adaptiveWatershed2d_seedSizeRatio.png

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

The following figure illustrates a comparison between the standard watershed with a dilation factor of 2 (left), the standard watershed with a dilation factor of 3 (center) and the adaptive watershed separations with a seed size ratio InArithmeticVal = 0.55 on a part of image used in [3]:

adaptiveWatershed2d_results.png

[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

Code Example

# opening of input images
inBinImg = PyIPSDK.loadTiffImageFile(inputBinImgPath)
# process watershed binary separation (split mode)
outImg = advmorpho.adaptiveBinaryWatershed2dImg(inBinImg, 0.1, PyIPSDK.eWatershedSeparationMode.eWSM_SplitLabel, PyIPSDK.eWPM_Repeatable)

Example of C++ code :

Example informations

Header file

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

Code Example

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