![]() |
IPSDK
4_1_0_2
IPSDK : Image Processing Software Development Kit
|
Morphological structuring elements management. More...
Classes | |
| class | ipsdk::BaseStructuringElement |
| Base class for binary structuring element objects. More... | |
| class | ipsdk::BaseStructuringElementInfo |
| Base class for objects encapsulating informations about binary structuring element objects. More... | |
| class | ipsdk::StructuringElementXY |
| Class encapsulating a 2d structuring element spanning along x and y axis. More... | |
| class | ipsdk::StructuringElementXYInfo |
| Concrete class for objects encapsulating informations about 2d binary structuring element objects. More... | |
| class | ipsdk::StructuringElementXYZ |
| Class encapsulating a 3d structuring element spanning along x, y and z axis. More... | |
| class | ipsdk::StructuringElementXYZInfo |
| Concrete class for objects encapsulating informations about 3d binary structuring element objects. More... | |
Typedefs | |
| typedef std::set< OffsetXY > | ipsdk::XYOffsetColl |
| collection of xy 2d offsets | |
| typedef std::set< OffsetXYZ > | ipsdk::XYZOffsetColl |
| collection of xyz 3d offsets | |
Enumerations | |
| enum | ipsdk::eSEXYSubType { ipsdk::eSEXY_Generic, ipsdk::eSEXY_Circular, ipsdk::eSEXY_Square, ipsdk::eSEXY_Rectangular, ipsdk::eSEXY_HalfLinear, ipsdk::eSEXY_Linear } |
| Enumerate describing binary structuring element 2d sub type. More... | |
| enum | ipsdk::eSEXYZSubType { ipsdk::eSEXYZ_Generic, ipsdk::eSEXYZ_Spherical, ipsdk::eSEXYZ_Cubic, ipsdk::eSEXYZ_Rectangular, ipsdk::eSEXYZ_HalfLinear, ipsdk::eSEXYZ_Linear } |
| Enumerate describing binary structuring element 3d sub type. More... | |
| enum | ipsdk::eStructuringElementType { ipsdk::eSET_XY, ipsdk::eSET_XYZ } |
| Enumerate describing binary structuring element type. More... | |
Morphological structuring elements management.
A morphological structuring element (SE) is a binary shape used by morphological operators (such as erosion, dilation, ...) to specialize operator behavior.
In 2d case, a morphological structuring element (associated to class ipsdk::StructuringElementXYInfo) is represented by a collection of offsets (associated to class ipsdk::OffsetXY) defining its shape.
Rectangular structuring elements are defined by their half size along X and Y axis (
and
) and aggregate all offsets such as :
Full size of structuring element is then defined by :
The following C++ example illustrates the definition of a rectangular morphological structuring element :
The following C++ example illustrates the definition of a square morphological structuring element :
Circular structuring elements are defined by their radius and aggregate all offsets enclosed in associated circle :
The following C++ example illustrates the definition of a circular morphological structuring element :
Half linear structuring elements are defined by an orientation and a radius and aggregate offsets at the intersection of associated direction and circle :
The following C++ example illustrates the definition of a half linear morphological structuring element :
Linear structuring elements are defined by an orientation and a radius and aggregate offsets at the intersection of associated direction and circle :
The following C++ example illustrates the definition of a linear morphological structuring element :
In 3d case, a morphological structuring element (associated to class ipsdk::StructuringElementXYZInfo) is represented by a collection of offsets (associated to class ipsdk::OffsetXYZ) defining its shape.
Rectangular structuring elements are defined by their half size along X, Y and Z axis (
,
and
) and aggregate all offsets such as :
Full size of structuring element is then defined by :
The following C++ example illustrates the definition of a rectangular morphological structuring element :
The following C++ example illustrates the definition of a cubic morphological structuring element :
Spherical structuring elements are defined by their radius and aggregate all offsets enclosed in associated sphere :
The following C++ example illustrates the definition of a spherical morphological structuring element :
Half linear structuring elements are defined by an orientation and a radius and aggregate offsets at the intersection of associated direction and sphere :
The following C++ example illustrates the definition of a half linear morphological structuring element :
Linear structuring elements are defined by an orientation and a radius and aggregate offsets at the intersection of associated direction and sphere :
The following C++ example illustrates the definition of a linear morphological structuring element :
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). Formula associated to each of these operations are given by :
Structuring elements specific typology (shape) are detailed into :
These different typologies include rectangle, circle, sphere, lines, ...
Each of this shape can be used to respond to a specific need. We will try to illustrate this concept in the following section.
The following examples illustrates usage of different structuring element types for dilation 2d algorithm. A dilation 2d operation has been chosen for this use case but all these considerations could be extended to 3d case as well as other morphological operators.
and
:
and
:
and
:
Circular 2d and spherical 3d structuring elements morphological operations can be optimised using a multi-level decomposition algorithm described in :
Multi-level decomposition of Euclidean spheres, Michael S. Vaz, Atilla P. Kiraly and Russell M. Mersereau, Proceedings of the 8 th International Symposium on Mathematical Morphology, Rio de Janeiro, Brazil, Oct. 10–13, 2007, MCT/INPE, v. 1, p. 461–472
This method allows to decompose convex and symmetric (with respect to x, y and z axis) structuring elements into a combination of elementary structuring elements.
The following graph shows processing time comportment of a standard implementation of a morphological operation using a circular 2d structuring element versus its multi-level decomposition form :
The following graph shows processing time comportment of a standard implementation of a morphological operation using a spherical 3d structuring element versus its multi-level decomposition form :
Morphological 2d and 3d operations are optimized to swap between a standard and a multi-level decomposition implementation in function of these graphs.
| enum ipsdk::eSEXYSubType |
Enumerate describing binary structuring element 2d sub type.
| enum ipsdk::eSEXYZSubType |
Enumerate describing binary structuring element 3d sub type.
| IPSDKBASEDATA_API StructuringElementXYInfoPtr ipsdk::squareSEXYInfo | ( | const ipUInt32 | halfSESize | ) |
function allowing to generate a square XY structuring element (SE)
| IPSDKBASEDATA_API StructuringElementXYInfoPtr ipsdk::rectangularSEXYInfo | ( | const ipUInt32 | halfSESizeX, |
| const ipUInt32 | halfSESizeY | ||
| ) |
function allowing to generate a rectangular XY structuring element (SE)
| IPSDKBASEDATA_API StructuringElementXYInfoPtr ipsdk::circularSEXYInfo | ( | const ipReal64 | radius | ) |
function allowing to generate a filled circular XY structuring element (SE)
| ipsdk::IPSDKBaseDataException | if radius < 0 |
| ipsdk::IPSDKBaseDataException | if radius < 0 |
| IPSDKBASEDATA_API StructuringElementXYInfoPtr ipsdk::halfLinearSEXYInfo | ( | const ipReal64 | theta, |
| const ipReal64 | radius | ||
| ) |
function allowing to generate a half linear structuring element (SE)
| ipsdk::IPSDKBaseDataException | if radius < 0 |
| IPSDKBASEDATA_API StructuringElementXYInfoPtr ipsdk::linearSEXYInfo | ( | const ipReal64 | theta, |
| const ipReal64 | radius | ||
| ) |
function allowing to generate a linear structuring element (SE)
| ipsdk::IPSDKBaseDataException | if radius < 0 |
| IPSDKBASEDATA_API StructuringElementXYZInfoPtr ipsdk::cubicSEXYZInfo | ( | const ipUInt32 | halfSESize | ) |
function allowing to generate a cubic XYZ structuring element (SE)
| IPSDKBASEDATA_API StructuringElementXYZInfoPtr ipsdk::rectangularSEXYZInfo | ( | const ipUInt32 | halfSESizeX, |
| const ipUInt32 | halfSESizeY, | ||
| const ipUInt32 | halfSESizeZ | ||
| ) |
function allowing to generate a rectangular parallelepiped XYZ structuring element (SE)
| IPSDKBASEDATA_API StructuringElementXYZInfoPtr ipsdk::sphericalSEXYZInfo | ( | const ipReal64 | radius | ) |
function allowing to generate a filled spherical XYZ structuring element (SE)
| ipsdk::IPSDKBaseDataException | if radius < 0 |
| ipsdk::IPSDKBaseDataException | if radius < 0 |
| IPSDKBASEDATA_API StructuringElementXYZInfoPtr ipsdk::halfLinearSEXYZInfo | ( | const ipReal64 | theta, |
| const ipReal64 | phi, | ||
| const ipReal64 | radius | ||
| ) |
function allowing to generate a half linear structuring element (SE)
| ipsdk::IPSDKBaseDataException | if radius < 0 |
| IPSDKBASEDATA_API StructuringElementXYZInfoPtr ipsdk::linearSEXYZInfo | ( | const ipReal64 | theta, |
| const ipReal64 | phi, | ||
| const ipReal64 | radius | ||
| ) |
function allowing to generate a linear structuring element (SE)
| ipsdk::IPSDKBaseDataException | if radius < 0 |
1.8.14