mmcfilters
Public API documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
mmcfilters::MSERComputer< T, Real > Class Template Reference

Detects MSER-like nodes from a monotone increasing attribute defined on the hierarchy. More...

#include <MSERComputer.hpp>

Public Types

using variation_value_type = Real
 Floating-point type used to store variation scores.
 

Public Member Functions

 MSERComputer (const ValuedMorphologicalTree< T > &valuedTree, std::vector< Real > attr_increasing)
 Creates an MSER detector backed by an owned attribute buffer.
 
 MSERComputer (const ValuedMorphologicalTree< T > &valuedTree, const Real *attr_increasing)
 Creates an MSER detector backed by a non-owning attribute view.
 
 MSERComputer (const ValuedMorphologicalTree< T > &valuedTree)
 Creates an MSER detector that lazily falls back to AREA.
 
 MSERComputer (const MSERComputer &)=default
 Copies the evaluator while preserving owned-buffer safety.
 
 MSERComputer (MSERComputer &&) noexcept=default
 Moves the evaluator while preserving its referenced tree.
 
MSERComputeroperator= (const MSERComputer &)=delete
 Assignment is unavailable because the evaluator stores tree references.
 
MSERComputeroperator= (MSERComputer &&)=delete
 Move assignment is unavailable because the evaluator stores tree references.
 
 ~MSERComputer ()=default
 Destroys the MSER evaluator.
 
std::vector< uint8_tcomputeMSER (AltitudeDifference< T > altitudeWindowRadius)
 Computes the MSER indicator vector for an altitude-window radius.
 
Real getVariation (NodeId node)
 Returns the variation score currently associated with a node.
 
Real getAttrMSER (NodeId node)
 Returns the attribute used by the MSER stability measure, lazily computing AREA when no external buffer has been provided.
 
NodeId nodeWithMinimumVariationInWindow (NodeId node)
 Returns the node with minimum variation among the current node and its altitude-window neighbours.
 
NodeId ancestorInStabilityWindow (NodeId node) const
 Returns the ancestor used in the current stability window.
 
NodeId descendantInStabilityWindow (NodeId node) const
 Returns the descendant used in the current stability window.
 
std::vector< Real > & getVariations ()
 Returns the current variation array, indexed by node slot.
 
int numNodes ()
 Returns the number of nodes selected as MSER-like in the last run.
 
void setMaxVariation (Real maxVariation)
 Sets the maximum accepted variation value.
 
void setMinAttribute (Real minAttr)
 Sets the lower bound of the accepted attribute interval.
 
void setMaxAttribute (Real maxAttr)
 Sets the upper bound of the accepted attribute interval.
 

Detailed Description

template<AltitudeValue T, std::floating_point Real = float>
class mmcfilters::MSERComputer< T, Real >

Detects MSER-like nodes from a monotone increasing attribute defined on the hierarchy.

The class implements the classical MSER stability measure in tree form. It is intentionally tied to ValuedMorphologicalTree<T>: the altitude neighbourhood is computed from the altitude buffer owned by the valuedTree tree, not from an arbitrary external altitude array. Given an altitude-window radius, each node is paired with an ancestor and a descendant located at the requested distance in altitude space. The node variation is then defined from a monotone increasing attribute as:

variation(node) = (attr(ancestor(node)) - attr(descendant(node))) / attr(node)

A node is marked as MSER-like when:

If no external attribute buffer is supplied, the class lazily computes AREA and uses it as the increasing attribute. The object may therefore act either as a lightweight view over an externally owned buffer or as a small owner of the fallback AREA buffer.

Note
MSER requires a globally monotone altitude capability on the topology. Standard max-tree and min-tree producers provide that capability. Standard tree-of-shapes and self-dual residual-tree producers publish NodeAltitudeOrder::Unconstrained and are therefore rejected. The descriptive tree kind itself is not used as the acceptance gate.

Definition at line 59 of file MSERComputer.hpp.

Member Typedef Documentation

◆ variation_value_type

template<AltitudeValue T, std::floating_point Real = float>
using mmcfilters::MSERComputer< T, Real >::variation_value_type = Real

Floating-point type used to store variation scores.

Definition at line 62 of file MSERComputer.hpp.

Constructor & Destructor Documentation

◆ MSERComputer() [1/3]

template<AltitudeValue T, std::floating_point Real = float>
mmcfilters::MSERComputer< T, Real >::MSERComputer ( const ValuedMorphologicalTree< T > &  valuedTree,
std::vector< Real >  attr_increasing 
)
inline

Creates an MSER detector backed by an owned attribute buffer.

Parameters
valuedTreeValued tree.
attr_increasingAttribute information.

Definition at line 141 of file MSERComputer.hpp.

◆ MSERComputer() [2/3]

template<AltitudeValue T, std::floating_point Real = float>
mmcfilters::MSERComputer< T, Real >::MSERComputer ( const ValuedMorphologicalTree< T > &  valuedTree,
const Real *  attr_increasing 
)
inline

Creates an MSER detector backed by a non-owning attribute view.

The raw pointer must reference one value per internal node slot.

Parameters
valuedTreeValued tree.
attr_increasingAttribute information.

Definition at line 155 of file MSERComputer.hpp.

◆ MSERComputer() [3/3]

template<AltitudeValue T, std::floating_point Real = float>
mmcfilters::MSERComputer< T, Real >::MSERComputer ( const ValuedMorphologicalTree< T > &  valuedTree)
inline

Creates an MSER detector that lazily falls back to AREA.

Parameters
valuedTreeValued tree.

Definition at line 166 of file MSERComputer.hpp.

Member Function Documentation

◆ ancestorInStabilityWindow()

template<AltitudeValue T, std::floating_point Real = float>
NodeId mmcfilters::MSERComputer< T, Real >::ancestorInStabilityWindow ( NodeId  node) const
inline

Returns the ancestor used in the current stability window.

Parameters
nodeNode identifier.
Returns
The ancestor used in the current stability window.

Definition at line 255 of file MSERComputer.hpp.

◆ computeMSER()

template<AltitudeValue T, std::floating_point Real = float>
std::vector< uint8_t > mmcfilters::MSERComputer< T, Real >::computeMSER ( AltitudeDifference< T >  altitudeWindowRadius)
inline

Computes the MSER indicator vector for an altitude-window radius.

Parameters
altitudeWindowRadiusPositive altitude-window radius.
Returns
A dense boolean-like vector indexed by the tree's internal node slots, with true at the nodes selected as MSER-like regions.

Definition at line 190 of file MSERComputer.hpp.

◆ descendantInStabilityWindow()

template<AltitudeValue T, std::floating_point Real = float>
NodeId mmcfilters::MSERComputer< T, Real >::descendantInStabilityWindow ( NodeId  node) const
inline

Returns the descendant used in the current stability window.

Parameters
nodeNode identifier.
Returns
The descendant used in the current stability window.

Definition at line 266 of file MSERComputer.hpp.

◆ getAttrMSER()

template<AltitudeValue T, std::floating_point Real = float>
Real mmcfilters::MSERComputer< T, Real >::getAttrMSER ( NodeId  node)
inline

Returns the attribute used by the MSER stability measure, lazily computing AREA when no external buffer has been provided.

Parameters
nodeNode identifier.
Returns
Increasing-attribute value of the requested node.

Definition at line 224 of file MSERComputer.hpp.

◆ getVariation()

template<AltitudeValue T, std::floating_point Real = float>
Real mmcfilters::MSERComputer< T, Real >::getVariation ( NodeId  node)
inline

Returns the variation score currently associated with a node.

Parameters
nodeNode identifier.
Returns
The variation score currently associated with a node.

Definition at line 210 of file MSERComputer.hpp.

◆ getVariations()

template<AltitudeValue T, std::floating_point Real = float>
std::vector< Real > & mmcfilters::MSERComputer< T, Real >::getVariations ( )
inline

Returns the current variation array, indexed by node slot.

Returns
The current variation array, indexed by node slot.

Definition at line 276 of file MSERComputer.hpp.

◆ nodeWithMinimumVariationInWindow()

template<AltitudeValue T, std::floating_point Real = float>
NodeId mmcfilters::MSERComputer< T, Real >::nodeWithMinimumVariationInWindow ( NodeId  node)
inline

Returns the node with minimum variation among the current node and its altitude-window neighbours.

Parameters
nodeNode identifier.
Returns
The node with minimum variation among the current node and its altitude-window neighbours.

Definition at line 243 of file MSERComputer.hpp.

◆ numNodes()

template<AltitudeValue T, std::floating_point Real = float>
int mmcfilters::MSERComputer< T, Real >::numNodes ( )
inline

Returns the number of nodes selected as MSER-like in the last run.

Returns
The number of nodes selected as MSER-like in the last run.

Definition at line 286 of file MSERComputer.hpp.

◆ setMaxAttribute()

template<AltitudeValue T, std::floating_point Real = float>
void mmcfilters::MSERComputer< T, Real >::setMaxAttribute ( Real  maxAttr)
inline

Sets the upper bound of the accepted attribute interval.

Parameters
maxAttrMaximum accepted attribute value.

Definition at line 308 of file MSERComputer.hpp.

◆ setMaxVariation()

template<AltitudeValue T, std::floating_point Real = float>
void mmcfilters::MSERComputer< T, Real >::setMaxVariation ( Real  maxVariation)
inline

Sets the maximum accepted variation value.

Parameters
maxVariationMaximum accepted stability variation.

Definition at line 296 of file MSERComputer.hpp.

◆ setMinAttribute()

template<AltitudeValue T, std::floating_point Real = float>
void mmcfilters::MSERComputer< T, Real >::setMinAttribute ( Real  minAttr)
inline

Sets the lower bound of the accepted attribute interval.

Parameters
minAttrMinimum accepted attribute value.

Definition at line 302 of file MSERComputer.hpp.


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