IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Algorithm for image 3d erosion. More...

IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::erode3dImg (const image::ImageConstPtr &pInImg3d, const StructuringElementXYZInfoConstPtr &pInSEXYZ)
 wrapper function for Algorithm for image 3d erosion More...
 
IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::erode3dImg (const image::ImageConstPtr &pInImg3d, const StructuringElementXYZInfoConstPtr &pInSEXYZ, const image::ImagePtr &pOutImg)
 wrapper function for Algorithm for image 3d erosion More...
 

Detailed Description

Algorithm for image 3d erosion.

Erosion and dilation are the two fundamental morphological operations.

These operations use a flat (with values in [0, 1]) structuring element combined to a Minkowski sum (in case of dilation) or subtraction (in case of erosion).

In erosion 3d case with an input image $ InImg3d $ and an input flat structuring element $ InSEXYZ $, Minkowski subtraction is given by :

\[ OutImg = InImg3d \ominus InSEXYZ = \left \{ (x, y, z) / InSEXYZ_{(x, y, z)} \subseteq InImg3d \right \} \]

with

\[ InSEXYZ_{(x, y, z)} = \left \{ (o_x + x, o_y + y, o_z + z) / (o_x, o_y, o_z) \in InSEXYZ \right \} \]

In binary cases, this equation can be reexpressed as :

\[ OutImg[x, y, z] = (InImg3d \ominus InSEXYZ)[x, y, z] = \bigcap_{(o_x, o_y, o_z) \in InSEXYZ} InImg3d[(x+o_x, y+o_y, z+o_z)] \]

In grayscale cases, this equation can be reexpressed as :

\[ OutImg[x, y, z] = (InImg3d \ominus InSEXYZ)[x, y, z] = \inf_{(o_x, o_y, o_z) \in InSEXYZ} InImg3d[(x+o_x, y+o_y, z+o_z)] \]

Note
Behavior of this algorithm is specialized using specific morphological structuring elements (see 3d structuring elements for more informations about these shapes).
Please refer to Usage for examples of usage of different types of specific structuring elements during morphological operations.

Here is an example of a erosion 3d extraction operation applied to a binary input image with a spherical structuring element with radius 3 :

genericErode3dImg.png
See also
http://en.wikipedia.org/wiki/Erosion_%28morphology%29
Note
This algorithm is associated with a temporary working image ipsdk::imaproc::attr::OutOptWk1Img. This parameter is only used in special processing cases defined via ipsdk::imaproc::morpho::eSEProcessingCase enumerate. Such situation can be tested using ipsdk::imaproc::morpho::getSEProcessingCase function and associated image buffer type can be retrieved using ipsdk::imaproc::morpho::getSEWkImageBufferType. This working temporary image can be provided by user or will be automatically allocated when requested.

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d image for operation X
ipsdk::imaproc::attr::InSEXYZ [Input] structuring element xyz for processing operation X
ipsdk::imaproc::attr::OutOptWk1Img [Output Optional] Temporary working image for algorithm X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation ipsdk::imaproc::duplicateInOut (_pOutImg, _pInImg3d)

Global Rule description

Global rule description for algorithm :
((ipsdk::imaproc::matchSizeAndType (_pInImg3d,_pOutImg)) && 
 (ipsdk::processor::ifIsSet (_pOutOptWk1Img,
   ipsdk::imaproc::customImageProperty (_pOutOptWk1Img,
    matchSEMorphology (_pInImg3d,_pInSEXYZ)))))

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLBasicMorphology as morpho

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# definition of used structuring element
inSE = PyIPSDK.sphericalSEXYZInfo(2)
# erosion 3d image computation
outImg = morpho.erode3dImg(inImg, inSE)

Example of C++ code :

Example informations

Associated library

IPSDKIPLBasicMorphology

Header file

Code Example

// create a 2x3x4 rectangular structuring element
// opening input image
ImagePtr pInImg = loadTiffImageFile(inputImgPath);
// compute erosion on input image
ImagePtr pOutImg = erode3dImg(pInImg, pInSEXYZ);
See also
Erode3dImgLvl1

Function Documentation

◆ erode3dImg() [1/2]

IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::erode3dImg ( const image::ImageConstPtr pInImg3d,
const StructuringElementXYZInfoConstPtr pInSEXYZ 
)

wrapper function for Algorithm for image 3d erosion

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ erode3dImg() [2/2]

IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::erode3dImg ( const image::ImageConstPtr pInImg3d,
const StructuringElementXYZInfoConstPtr pInSEXYZ,
const image::ImagePtr pOutImg 
)

wrapper function for Algorithm for image 3d erosion

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure