mmcfilters
Public API documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
mmcfilters::TreeOfShapesBuilder Class Reference

Builds trees of shapes (ToS) using a union-find construction. More...

#include <TreeOfShapesBuilder.hpp>

Public Member Functions

 TreeOfShapesBuilder (TopographicConvention convention={})
 Creates a tree-of-shapes builder.
 
const TopographicConvention & convention () const noexcept
 Returns the immutable topographic convention selected for this producer.
 
 ~TreeOfShapesBuilder ()=default
 Destroys TreeOfShapesBuilder.
 
template<class Altitude = std::uint8_t>
NativeHierarchyOwned< Altitude > build (const ImageUInt8Ptr &imgPtr) &&
 Builds the native hierarchy in the declared altitude scale, consuming the producer.
 

Detailed Description

Builds trees of shapes (ToS) using a union-find construction.

The builder uses interval interpolation, ordered flooding, union-find, canonicalization, and projection to the original domain [GCCN13]. SelfDualSpan uses the span construction of [BGN15]. Complementary 4/8 conventions use the optimized immersion and max-tree of the order map described in [CCG18]. The corresponding methods cite sections and algorithms.

Domain cropping, a configurable infinity pixel, altitude encoding, and native-array materialization are project options or adaptations. Cropping the exterior ring or choosing an interior seed differs from the exterior initialization described in [GCCN13], Section 4.1, and [BGN15], Section 4.2.

Scientific references
  • [GCCN13] Thierry Géraud, Edwin Carlinet, Sébastien Crozet, and Laurent Najman, "A Quasi-linear Algorithm to Compute the Tree of Shapes of nD Images," Mathematical Morphology and Its Applications to Signal and Image Processing (ISMM 2013), LNCS 7883, pp. 98-110, Springer, 2013. DOI: 10.1007/978-3-642-38294-9_9.
  • [BGN15] Nicolas Boutry, Thierry Géraud, and Laurent Najman, "How to Make nD Functions Digitally Well-Composed in a Self-dual Way," Mathematical Morphology and Its Applications to Signal and Image Processing (ISMM 2015), LNCS 9082, pp. 561-572, Springer, 2015. DOI: 10.1007/978-3-319-18720-4_47.
  • [CCG18] Edwin Carlinet, Sébastien Crozet, and Thierry Géraud, "The Tree of Shapes Turned into a Max-Tree: A Simple and Efficient Linear Algorithm," 2018 IEEE International Conference on Image Processing (ICIP), pp. 1488-1492, 2018. DOI: 10.1109/ICIP.2018.8451180.

Definition at line 522 of file TreeOfShapesBuilder.hpp.

Constructor & Destructor Documentation

◆ TreeOfShapesBuilder()

mmcfilters::TreeOfShapesBuilder::TreeOfShapesBuilder ( TopographicConvention  convention = {})
inlineexplicit

Creates a tree-of-shapes builder.

Parameters
conventionComplete topographic convention.

Definition at line 837 of file TreeOfShapesBuilder.hpp.

Member Function Documentation

◆ build()

template<class Altitude = std::uint8_t>
NativeHierarchyOwned< Altitude > mmcfilters::TreeOfShapesBuilder::build ( const ImageUInt8Ptr &  imgPtr) &&
inline

Builds the native hierarchy in the declared altitude scale, consuming the producer.

Under TopographicAltitudeEncoding::UInt8 the published altitudes are unchanged source gray levels. This encoding is exact for a complementary-grid immersion and for a self-dual span immersion without an exterior ring. Under TopographicAltitudeEncoding::ExactDoubled, even values represent source gray levels and odd values represent half levels introduced by self-dual interpolation. Neither encoding loses a parent-child altitude distinction to quantization.

The result owns the native arrays and the resolved topographic convention. Named producers must be passed through std::move to transfer ownership.

Template Parameters
AltitudePublished node-altitude type, which must match the altitude encoding declared by the convention.
Parameters
imgPtrImage.
Returns
Owning hierarchy independent of the producer and source image.

Definition at line 1596 of file TreeOfShapesBuilder.hpp.

◆ convention()

const TopographicConvention & mmcfilters::TreeOfShapesBuilder::convention ( ) const
inlinenoexcept

Returns the immutable topographic convention selected for this producer.

Returns
The immutable topographic convention selected for this producer.

Definition at line 845 of file TreeOfShapesBuilder.hpp.


The documentation for this class was generated from the following file: