SMIL 1.1.2
Loading...
Searching...
No Matches
Base Morphological Operators

Basic Mathematical Morphology Operators. More...

Detailed Description

Basic Mathematical Morphology Operators.

The most basic mathematical morphology operators are dilate() and erode(). The very most of Mathematical Morphology are based on these operations combined with a Structuring Element.

See also
  • [13] Jean Serra, Image Analysis and Mathematical Morphology - Vol. 1, 1982
  • [14] Jean Serra, Image Analysis and Mathematical Morphology - Vol. 2, 1988
  • [16] P. Soille, Morphological Image Analysis, 2003
+ Collaboration diagram for Base Morphological Operators:

Function Documentation

◆ dilate() [1/2]

template<class T >
RES_T dilate ( const Image< T > &  imIn,
Image< T > &  imOut,
const StrElt se = DEFAULT_SE,
const T  borderVal = ImDtTypes<T>::min() 
)

dilate() - Morphological grayscale dilation

Morphological grayscale dilation

\htmlonly    <script src="dynsections.js" type="text/javascript"></script>    <div id="dilation" class="dynheader closed"      style="cursor:pointer;"      onclick="return toggleVisibility(this)">      <img id="dilation-trigger" alt="+" src="closed.png">      "Theoretical Details:"    </div>    <div id="dilation-summary" class="dynsummary" style="display: none;"> </div>    <div id="dilation-content" class="dyncontent" style="display: none;">    \endhtmlonly

Denoting an image by $ f(x) $ and the structuringfunction" by $ B(x) $, the grayscale dilation of $ f $ by $ B $ is given by [13] :

\[ (f\oplus B)(x)=\sup_{y \in \Re^3 }[f(y)+B(x-y)] \]

Parameters
[in]imInInput image
[out]imOutOutput image
[in]se(optional) The structuring element to use
[in]borderVal(optional) The border value

◆ dilate() [2/2]

template<class T >
RES_T dilate ( const Image< T > &  imIn,
Image< T > &  imOut,
UINT  seSize,
const T  borderVal = ImDtTypes<T>::min() 
)

dilate() - Morphological grayscale dilation using the default structuring element but being able to set its size

Parameters
[in]imInInput image
[out]imOutOutput image
[in]seSizeThe size of the default structuring element
[in]borderVal(optional) The border value
Note
If you want to use a structuring element different of the default you should set it before Example
import smilPython as sp
im = sp.Image("lena.png")
# set new default StrElt and save old one
saveSE = sp.Morpho.getDefaultSE()
sp.Morpho.setDefaultSE(sp.SquSE))
# do something
imd = sp.Image(im)
sp.dilate(im, imd, 3)
# restore old default StrElt
sp.Morpho.setDefaultSE(saveSE)

◆ erode() [1/2]

template<class T >
RES_T erode ( const Image< T > &  imIn,
Image< T > &  imOut,
const StrElt se = DEFAULT_SE,
const T  borderVal = ImDtTypes<T>::max() 
)

erode() - Morphological grayscale erosion

\htmlonly    <script src="dynsections.js" type="text/javascript"></script>    <div id="erosion" class="dynheader closed"      style="cursor:pointer;"      onclick="return toggleVisibility(this)">      <img id="erosion-trigger" alt="+" src="closed.png">      "Theoretical Details:"    </div>    <div id="erosion-summary" class="dynsummary" style="display: none;"> </div>    <div id="erosion-content" class="dyncontent" style="display: none;">    \endhtmlonly

Denoting an image by $ f(x) $ and the Structuring Elements (or structuring function) by $ B(x) $, the grayscale erosion of $ f $ by $ B $ is given by [13] :

\[ (f\ominus B)(x)=\inf_{y \in \Re^3 }[f(y)-B(x-y)] \]

Parameters
[in]imIn: Input image
[out]imOut: Output image
[in]se: Structuring element
[in]borderVal: (optional) The border value

◆ erode() [2/2]

template<class T >
RES_T erode ( const Image< T > &  imIn,
Image< T > &  imOut,
UINT  seSize,
const T  borderVal = ImDtTypes<T>::max() 
)

erode() - Morphological grayscale erosion using the default structuring element but being able to set its size

Parameters
[in]imIn: Input image
[out]imOut: Output image
[in]seSize: The size of the default structuring element
[in]borderVal: (optional) The border value
Note
If you want to use a structuring element different of the default you should set it before