image = | erode3dImg (inImg3d,inSEXYZ) |
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
and an input flat structuring element
, Minkowski subtraction is given by :
with
In binary cases, this equation can be reexpressed as :
In grayscale cases, this equation can be reexpressed as :
- 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 :
- 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.
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLBasicMorphology as morpho
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
inSE = PyIPSDK.sphericalSEXYZInfo(2)
outImg = morpho.erode3dImg(inImg, inSE)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLBasicMorphology/Processor/Erode3dImg/Erode3dImg.h>
Code Example
ImagePtr pOutImg = erode3dImg(pInImg, pInSEXYZ);