SMIL  1.0.3
Morphological Filters

Detailed Description

Morphological Filters

Morphological filters are morphological image transformations which are both increasing and idempotent, i.e.,

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

Functions

template<class T >
RES_T close (const Image< T > &imIn, Image< T > &imOut, const StrElt &se=DEFAULT_SE)
 close() - Morphological grayscale closing More...
 
template<class T >
RES_T close (const Image< T > &imIn, Image< T > &imOut, UINT seSize)
 close() - Morphological grayscale closing using the default structuring element but being able to set its size More...
 
template<class T >
RES_T open (const Image< T > &imIn, Image< T > &imOut, const StrElt &se=DEFAULT_SE)
 open() - Morphological grayscale opening More...
 
template<class T >
RES_T open (const Image< T > &imIn, Image< T > &imOut, UINT seSize)
 open() - Morphological grayscale opening using the default structuring element but being able to set its size More...
 
template<class T >
RES_T asfClose (const Image< T > &imIn, Image< T > &imOut, const StrElt &se=DEFAULT_SE)
 Alternate Sequential Filter beginning by a closing. More...
 
template<class T >
RES_T asfOpen (const Image< T > &imIn, Image< T > &imOut, const StrElt &se=DEFAULT_SE)
 Alternate Sequential Filter beginning by an opening. More...
 
template<class T >
RES_T mean (const Image< T > &imIn, Image< T > &imOut, const StrElt &se=DEFAULT_SE)
 Mean filter. More...
 
template<class T >
RES_T median (const Image< T > &imIn, Image< T > &imOut, const StrElt &se=DEFAULT_SE)
 Median filter. More...
 
template<class T >
RES_T rank (const Image< T > &imIn, Image< T > &imOut, double percentile, const StrElt &se=DEFAULT_SE)
 Rank filter. More...
 

Function Documentation

◆ close() [1/2]

RES_T smil::close ( const Image< T > &  imIn,
Image< T > &  imOut,
const StrElt se = DEFAULT_SE 
)

close() - Morphological grayscale closing

A closing filter is defined as a dilation followed by an erosion.

Parameters
[in]imIn: input image
[out]imOut: output image
[in]se: structuring element

◆ close() [2/2]

RES_T smil::close ( const Image< T > &  imIn,
Image< T > &  imOut,
UINT  seSize 
)

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

A closing filter is defined as a dilation followed by an erosion.

Parameters
[in]imIn: input image
[out]imOut: output image
[in]seSize: size of structuring element
Note
If you want to use a structuring element different of the default you should set it before

◆ open() [1/2]

RES_T smil::open ( const Image< T > &  imIn,
Image< T > &  imOut,
const StrElt se = DEFAULT_SE 
)

open() - Morphological grayscale opening

A opening filter is defined as an erosion followed by a dilation.

Parameters
[in]imIn: input image
[out]imOut: output image
[in]se: structuring element

◆ open() [2/2]

RES_T smil::open ( const Image< T > &  imIn,
Image< T > &  imOut,
UINT  seSize 
)

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

A opening filter is defined as an erosion followed by a dilation.

Parameters
[in]imIn: input image
[out]imOut: output image
[in]seSize: size of structuring element
Note
If you want to use a structuring element different of the default you should set it before

◆ asfClose()

RES_T smil::asfClose ( const Image< T > &  imIn,
Image< T > &  imOut,
const StrElt se = DEFAULT_SE 
)

Alternate Sequential Filter beginning by a closing.

Sequence of closings and openings with increasing size 1, 2, ..., max_size. The max_size is given by the size of the structuring element (for example 3 for SE(3)).

Parameters
[in]imIn: input image
[out]imOut: output image
[in]se: structuring element with the maximum size of the filter

Example

import smilpython as sp
imin = sp.Image("https://smil.cmm.minesparis.psl.eu/images/lena.png")
imout = sp.Image(imin)
sp.asfClose(imin, imout, sp.SquSE(5))

◆ asfOpen()

RES_T smil::asfOpen ( const Image< T > &  imIn,
Image< T > &  imOut,
const StrElt se = DEFAULT_SE 
)

Alternate Sequential Filter beginning by an opening.

Sequence of openings and closings with increasing size 1, 2, ..., max_size. The max_size is given by the size of the structuring element (for example 3 for SE(3)).

Parameters
[in]imIn: input image
[out]imOut: output image
[in]se: structuring element with the maximum size of the filter

◆ mean()

RES_T smil::mean ( const Image< T > &  imIn,
Image< T > &  imOut,
const StrElt se = DEFAULT_SE 
)

Mean filter.

Parameters
[in]imIn: input image
[out]imOut: output image
[in]se: structuring element

◆ median()

RES_T smil::median ( const Image< T > &  imIn,
Image< T > &  imOut,
const StrElt se = DEFAULT_SE 
)

Median filter.

Parameters
[in]imIn: input image
[out]imOut: output image
[in]se: structuring element

◆ rank()

RES_T smil::rank ( const Image< T > &  imIn,
Image< T > &  imOut,
double  percentile,
const StrElt se = DEFAULT_SE 
)

Rank filter.

Parameters
[in]imIn: input image
[out]imOut: output image
[in]percentile:
[in]se: structuring element