IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

algorithm, based on watershed, allowing to separate binary 2d shapes More...

IPSDKIPLADVANCEDMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::advmorpho::watershedBinarySeparation2dImg (const image::ImageConstPtr &pInBinImg, const ipReal32 inDilateFactor, const ipsdk::imaproc::attr::eWatershedSeparationMode &inWatershedSeparationMode)
 wrapper function for algorithm, based on watershed, allowing to separate binary 2d shapes More...
 
IPSDKIPLADVANCEDMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::advmorpho::watershedBinarySeparation2dImg (const image::ImageConstPtr &pInBinImg, const ipReal32 inDilateFactor, const ipsdk::imaproc::attr::eWatershedSeparationMode &inWatershedSeparationMode, const ipsdk::imaproc::attr::eWatershedProcessingMode &inOptWatershedProcMode)
 wrapper function for algorithm, based on watershed, allowing to separate binary 2d shapes More...
 
IPSDKIPLADVANCEDMORPHOLOGY_API void ipsdk::imaproc::advmorpho::watershedBinarySeparation2dImg (const image::ImageConstPtr &pInBinImg, const ipReal32 inDilateFactor, const ipsdk::imaproc::attr::eWatershedSeparationMode &inWatershedSeparationMode, const ipsdk::imaproc::attr::eWatershedProcessingMode &inOptWatershedProcMode, const image::ImagePtr &pOutBinLabImg)
 wrapper function for algorithm, based on watershed, allowing to separate binary 2d shapes More...
 

Detailed Description

algorithm, based on watershed, allowing to separate binary 2d shapes

This algorithm, based on distance map and watershed algorithms, allows to separate shapes of an input binary image.

Given an input binary image InBinImg, algorithm process following steps :

Global output of a algorithm can be customized using parameter InWatershedSeparationMode which can take following values :

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InBinImg [Input] binary image for processing operation X
ipsdk::imaproc::attr::InDilateFactor [Input] factor used for dilation X
ipsdk::imaproc::attr::InWatershedSeparationMode [Input] parameter allowing to define watershed separation mode X
ipsdk::imaproc::attr::InOptWatershedProcMode [Input Optional] Watershed processing mode X
ipsdk::imaproc::attr::InOptNbMinDataByThread [Input Optional] minimum number of data by thread X
ipsdk::imaproc::attr::OutWk1DistImg [Output] Temporary working image for algorithm ipsdk::imaproc::duplicateInOut (_pOutWk1DistImg, _pInBinImg, ipsdk::image::eImageBufferType::eIBT_UInt16)
ipsdk::imaproc::attr::OutWk1Img [Output] Temporary working image for algorithm customOutput (_pOutWk1Img, outputWk1Watershed(_pInBinImg,_pInWatershedSeparationMode))
ipsdk::imaproc::attr::OutOptWk1Img [Output Optional] Temporary working image for algorithm X
ipsdk::imaproc::attr::OutOptWk1BinImg [Output Optional] Temporary working image for algorithm X
ipsdk::imaproc::attr::OutBinLabImg [Output] binary or label image for processing operation customOutput (_pOutBinLabImg, outputWatershed(_pInBinImg,_pInWatershedSeparationMode))

Global Rule description

Global rule description for algorithm :
(ipsdk::imaproc::matchSize (_pInBinImg,_pOutBinLabImg) && 
 ipsdk::imaproc::customImageProperty (_pOutBinLabImg,
  allowedBufferType (_pInWatershedSeparationMode)) && 
 ipsdk::imaproc::matchSize (_pInBinImg,_pOutWk1DistImg) && 
 ipsdk::imaproc::matchSize (_pInBinImg,_pOutWk1Img) && 
 ipsdk::imaproc::customImageProperty (_pOutWk1Img,
  allowedWk1BufferType (_pInWatershedSeparationMode)) && 
 ipsdk::processor::ifIsSet (_pOutOptWk1Img,
  ipsdk::imaproc::matchSize (_pInBinImg,_pOutOptWk1Img)))

Example of Python code :

Example imports

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

Code Example

# opening of input images
inGreyImg = PyIPSDK.loadTiffImageFile(inputGreyImgPath)
# threshold of input image
inBinImg = bin.thresholdImg(inGreyImg, 75, 255)
# process watershed binary separation (split mode)
outImg = advmorpho.watershedBinarySeparation2dImg(inBinImg, 5,
PyIPSDK.eWatershedSeparationMode.eWSM_Split)

Example of C++ code :

Example informations

Associated library

IPSDKIPLAdvancedMorphology

Header file

Code Example

// opening of input grey image
ImagePtr pInGreyImg = loadTiffImageFile(inputGreyImgPath);
// threshold of input image
ImagePtr pBinImg = thresholdImg(pInGreyImg, 75, 255);
// process binary separation (split mode)
See also
WatershedBinarySeparation2dImgLvl1

Function Documentation

◆ watershedBinarySeparation2dImg() [1/3]

IPSDKIPLADVANCEDMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::advmorpho::watershedBinarySeparation2dImg ( const image::ImageConstPtr pInBinImg,
const ipReal32  inDilateFactor,
const ipsdk::imaproc::attr::eWatershedSeparationMode inWatershedSeparationMode 
)

wrapper function for algorithm, based on watershed, allowing to separate binary 2d shapes

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ watershedBinarySeparation2dImg() [2/3]

IPSDKIPLADVANCEDMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::advmorpho::watershedBinarySeparation2dImg ( const image::ImageConstPtr pInBinImg,
const ipReal32  inDilateFactor,
const ipsdk::imaproc::attr::eWatershedSeparationMode inWatershedSeparationMode,
const ipsdk::imaproc::attr::eWatershedProcessingMode inOptWatershedProcMode 
)

wrapper function for algorithm, based on watershed, allowing to separate binary 2d shapes

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ watershedBinarySeparation2dImg() [3/3]

IPSDKIPLADVANCEDMORPHOLOGY_API void ipsdk::imaproc::advmorpho::watershedBinarySeparation2dImg ( const image::ImageConstPtr pInBinImg,
const ipReal32  inDilateFactor,
const ipsdk::imaproc::attr::eWatershedSeparationMode inWatershedSeparationMode,
const ipsdk::imaproc::attr::eWatershedProcessingMode inOptWatershedProcMode,
const image::ImagePtr pOutBinLabImg 
)

wrapper function for algorithm, based on watershed, allowing to separate binary 2d shapes

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure