IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

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

IPSDKIPLADVANCEDMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::advmorpho::watershedGreySeparation2dImg (const image::ImageConstPtr &pInIntImg, const ipsdk::imaproc::attr::eShapeGreyscaleType &inShapeGreyscaleType, const ipReal32 inDilateFactor, const attr::eWatershedSeparationMode &inWatershedSeparationMode)
 wrapper function for algorithm, based on watershed, allowing to separate grey 2d shapes More...
 
IPSDKIPLADVANCEDMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::advmorpho::watershedGreySeparation2dImg (const image::ImageConstPtr &pInIntImg, const ipsdk::imaproc::attr::eShapeGreyscaleType &inShapeGreyscaleType, 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 grey 2d shapes More...
 
IPSDKIPLADVANCEDMORPHOLOGY_API void ipsdk::imaproc::advmorpho::watershedGreySeparation2dImg (const image::ImageConstPtr &pInIntImg, const ipsdk::imaproc::attr::eShapeGreyscaleType &inShapeGreyscaleType, 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 grey 2d shapes More...
 

Detailed Description

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

This algorithm, based on watershed algorithm, allows to separate shapes of an input grey image. It is an equivalent of Watershed Binary Separation 2d applied on grey scale images case.

Input grey image InIntImg is classicaly a gradient image since it will be used in place of distance map used in binary case.

Note
In the following, images are given for illustration purpose, used input image is classicaly a gradient image.

Given an input grey image InIntImg, algorithm process following steps :

Parameter InShapeGreyscaleType allows to select for searched shapes type :

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::InIntImg [Input] image for processing operation (data contained in image buffer are integers) X
ipsdk::imaproc::attr::InShapeGreyscaleType [Input] shape greyscale type considered during processing 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::OutWk1Img [Output] Temporary working image for algorithm customOutput (_pOutWk1Img, outputWk1Watershed(_pInIntImg,_pInWatershedSeparationMode))
ipsdk::imaproc::attr::OutWk2Img [Output] Temporary working image for algorithm customOutput (_pOutWk2Img, outputWk2Watershed(_pInIntImg,_pInWatershedSeparationMode))
ipsdk::imaproc::attr::OutOptWk1Img [Output Optional] Temporary working image for algorithm X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation customOutput (_pOutImg, outputWatershed(_pInIntImg,_pInWatershedSeparationMode))

Global Rule description

Global rule description for algorithm :
(ipsdk::imaproc::matchSize (_pInIntImg,_pOutImg) && 
 ipsdk::imaproc::customImageProperty (_pOutImg,
  allowedBufferType (_pInWatershedSeparationMode,_pInIntImg)) && 
 ipsdk::imaproc::matchSize (_pInIntImg,_pOutWk1Img) && 
 ipsdk::imaproc::customImageProperty (_pOutWk1Img,
  allowedWk1BufferType (_pInWatershedSeparationMode)) && 
 ipsdk::imaproc::matchSize (_pInIntImg,_pOutWk2Img) && 
 ipsdk::imaproc::customImageProperty (_pOutWk2Img,
  allowedWk2BufferType (_pInWatershedSeparationMode,_pInIntImg)) && 
 ipsdk::processor::ifIsSet (_pOutOptWk1Img,
  ipsdk::imaproc::matchSize (_pInIntImg,_pOutOptWk1Img)))

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho

Code Example

# opening of input images
inGreyImg = PyIPSDK.loadTiffImageFile(inputGreyImgPath)
# process watershed binary separation (split mode)
outImg = advmorpho.watershedGreySeparation2dImg(inGreyImg, PyIPSDK.eShapeGreyscaleType.eSGT_Light, 50,
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(utImagesCommonPath / "blobs3d_483x348x31_UInt8.tif");
// process grey separation (split mode)
See also
WatershedGreySeparation2dImgLvl1

Function Documentation

◆ watershedGreySeparation2dImg() [1/3]

IPSDKIPLADVANCEDMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::advmorpho::watershedGreySeparation2dImg ( const image::ImageConstPtr pInIntImg,
const ipsdk::imaproc::attr::eShapeGreyscaleType inShapeGreyscaleType,
const ipReal32  inDilateFactor,
const attr::eWatershedSeparationMode inWatershedSeparationMode 
)

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

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ watershedGreySeparation2dImg() [2/3]

IPSDKIPLADVANCEDMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::advmorpho::watershedGreySeparation2dImg ( const image::ImageConstPtr pInIntImg,
const ipsdk::imaproc::attr::eShapeGreyscaleType inShapeGreyscaleType,
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 grey 2d shapes

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ watershedGreySeparation2dImg() [3/3]

IPSDKIPLADVANCEDMORPHOLOGY_API void ipsdk::imaproc::advmorpho::watershedGreySeparation2dImg ( const image::ImageConstPtr pInIntImg,
const ipsdk::imaproc::attr::eShapeGreyscaleType inShapeGreyscaleType,
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 grey 2d shapes

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure