IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Algorithm for image 2d dilation. More...

IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::dilate2dImg (const image::ImageConstPtr &pInImg, const StructuringElementXYInfoConstPtr &pInSEXY)
 wrapper function for Algorithm for image 2d dilation More...
 
IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::dilate2dImg (const image::ImageConstPtr &pInImg, const StructuringElementXYInfoConstPtr &pInSEXY, const image::ImagePtr &pOutImg)
 wrapper function for Algorithm for image 2d dilation More...
 

Detailed Description

Algorithm for image 2d dilation.

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 dilation 2d case with an input image $ InImg $ and an input flat structuring element $ InSEXY $, Minkowski sum is given by :

\[ OutImg = InImg \oplus InSEXY = \left \{ (x, y) / InSEXY_{(x, y)} \cap InImg \neq \varnothing \right \} \]

with

\[ InSEXY_{(x, y)} = \left \{ (o_x + x, o_y + y) / (o_x, o_y) \in InSEXY \right \} \]

In binary cases, this equation can be reexpressed as :

\[ OutImg[x, y] = (InImg \oplus InSEXY)[x, y] = \bigcup_{(o_x, o_y) \in InSEXY} InImg[(x+o_x, y+o_y)] \]

In grayscale cases, this equation can be reexpressed as :

\[ OutImg[x, y] = (InImg \oplus InSEXY)[x, y] = \sup_{(o_x, o_y) \in InSEXY} InImg[(x+o_x, y+o_y)] \]

Note
Behavior of this algorithm is specialized using specific morphological structuring elements (see 2d 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 dilation 2d extraction operation applied to a binary input image with a circular structuring element with radius 3 :

genericDilate2dImg.png
See also
http://en.wikipedia.org/wiki/Dilation_%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::InImg [Input] image for processing operation X
ipsdk::imaproc::attr::InSEXY [Input] structuring element xy 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, _pInImg)

Global Rule description

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

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.circularSEXYInfo(8)
# dilatation 2d image computation
outImg = morpho.dilate2dImg(inImg, inSE)

Example of C++ code :

Example informations

Associated library

IPSDKIPLBasicMorphology

Header file

Code Example

// create a 5x7 rectangular structuring element
// opening input image
ImagePtr pInImg = loadTiffImageFile(inputImgPath);
// compute dilation on input image
ImagePtr pOutImg = dilate2dImg(pInImg, pInSEXY);
See also
Dilate2dImgLvl1

Function Documentation

◆ dilate2dImg() [1/2]

IPSDKIPLBASICMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::morpho::dilate2dImg ( const image::ImageConstPtr pInImg,
const StructuringElementXYInfoConstPtr pInSEXY 
)

wrapper function for Algorithm for image 2d dilation

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ dilate2dImg() [2/2]

IPSDKIPLBASICMORPHOLOGY_API void ipsdk::imaproc::morpho::dilate2dImg ( const image::ImageConstPtr pInImg,
const StructuringElementXYInfoConstPtr pInSEXY,
const image::ImagePtr pOutImg 
)

wrapper function for Algorithm for image 2d dilation

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure