Morphological structuring element

`SE = strel('arbitrary',NHOOD,HEIGHT)`

`SE = strel('ball',R,H,N)`

`SE = strel('pair',OFFSET)`

`SE = strel('periodicline',P,V)`

The following syntaxes still work, but are not recommended for use. |

A `strel`

object represents a flat morphological *structuring
element*, which is an essential part of morphological dilation
and erosion operations. (To create a nonflat structuring element,
use `offsetstrel`

.)

A flat structuring element is a binary valued neighborhood,
either 2-D or multidimensional, in which the true pixels are included
in the morphological computation, and the false pixels are not. The
center pixel of the structuring element, called the *origin*,
identifies the pixel in the image being processed. Use the `strel`

function to create a flat
structuring element. You can use flat structuring elements with both
binary and grayscale images. The following figure illustrates a flat
structuring element.

`SE = strel('diamond',`

creates
a diamond-shaped structuring element, where `R`

)`R`

specifies
the distance from the structuring element origin to the points of
the diamond.

`SE = strel('disk',`

creates
a disk-shaped structuring element, where `R`

,`N`

)`R`

specifies
the radius. `N`

specifies the number of line structuring
elements used to approximate the disk shape. Morphological operations
using disk approximations run much faster when the structuring element
uses approximations.

`SE = strel('line',`

creates
a linear structuring element that is symmetric with respect to the
neighborhood center. `len`

,`deg`

)`deg`

specifies the angle
(in degrees) of the line as measured in a counterclockwise direction
from the horizontal axis. `len`

is approximately
the distance between the centers of the structuring element members
at opposite ends of the line.

`SE = strel('octagon',`

creates
a octagonal structuring element, where `R`

)`R`

specifies
the distance from the structuring element origin to the sides of the
octagon, as measured along the horizontal and vertical axes. `R`

must
be a nonnegative multiple of 3.

`SE = strel('rectangle',`

creates
a rectangular structuring element, where `MN`

)`MN`

specifies
the size.

`SE = strel('cube',`

creates
a cubic structuring element whose width is `W`

)`W`

pixels. `W`

must
be a nonnegative integer scalar.

`SE = strel('cuboid',`

creates
a cuboidal structuring element of size `XYZ`

)`XYZ`

.

`SE = strel('arbitrary',`

creates
a structuring element, where `nhood`

)`NHOOD`

is a matrix
of 1s and 0s that specifies the neighborhood. You can omit `'arbitrary'`

and
specify `strel(nhood)`

.

Code Generation support: Yes.

MATLAB Function Block support: Yes.

Structuring elements that do not use approximations

`(N = 0)`

are not suitable for computing granulometries.

This function supports the generation of C code using MATLAB^{®} Coder™.
For more information, see Code Generation for Image Processing.

When generating code, note the following:

All input arguments must be compile-time constants.

The methods associated with

`strel`

objects are not supported in code generation.Arrays of

`strel`

objects are not supported.

You can use this function in the MATLAB Function Block in Simulink.

For all shapes except `'arbitrary'`

, structuring
elements are constructed using a family of techniques known collectively
as *structuring element decomposition*. The principle
is that dilation by some large structuring elements can be computed
faster by dilation with a sequence of smaller structuring elements.
For example, dilation by an 11-by-11 square structuring element can
be accomplished by dilating first with a 1-by-11 structuring element
and then with an 11-by-1 structuring element. This results in a theoretical
performance improvement of a factor of 5.5, although in practice the
actual performance improvement is somewhat less. Structuring element
decompositions used for the `'disk'`

shape is an
approximations—all other decompositions are exact.

decompose | Return sequence of decomposed structuring elements |

reflect | Reflect structuring element |

translate | Translate structuring element |

[1] van den Boomgard, R, and R. van Balen,
"Methods for Fast Morphological Image Transforms Using Bitmapped
Images," *Computer Vision, Graphics, and Image Processing:
Graphical Models and Image Processing*, Vol. 54, Number
3, pp. 252–254, May 1992.

[2] Adams, R., "Radial Decomposition of Discs
and Spheres," *Computer Vision, Graphics, and Image Processing:
Graphical Models and Image Processing*, Vol. 55, Number
5, pp. 325–332, September 1993.

[3] Jones, R., and P. Soille, "Periodic lines:
Definition, cascades, and application to granulometrie," *Pattern
Recognition Letters*, Vol. 17, pp. 1057–1063, 1996.

Was this topic helpful?