MorphologicalAttributeFilters
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 WeightedMorphologicalTree< T > &weighted, std::vector< Real > attr_increasing)
 Creates an MSER detector backed by an owned attribute buffer.
 
 MSERComputer (const WeightedMorphologicalTree< T > &weighted, const Real *attr_increasing)
 Creates an MSER detector backed by a non-owning attribute view.
 
 MSERComputer (const WeightedMorphologicalTree< T > &weighted)
 Creates an MSER detector that lazily falls back to AREA.
 
std::vector< uint8_tcomputeMSER (AltitudeDiff< T > delta)
 Computes the MSER indicator vector for the given delta.
 
Real getVariation (NodeId node)
 Returns the variation score currently associated with a node.
 
Real getAttrMSER (NodeId node)
 Returns the attribute used by the MSER criterion, 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 delta-linked neighbours.
 
NodeId ascendantInStabilityWindow (NodeId node) const
 Returns the ascendant 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 getNumNodes ()
 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 criterion in tree form. It is intentionally tied to WeightedMorphologicalTree<T>: the delta neighbourhood is computed from the altitude buffer owned by the weighted tree, not from an arbitrary external altitude array. Given a delta value, each node is paired with an ascendant and a descendant located approximately delta units away in altitude space. The node variation is then defined from a monotone increasing attribute as:

variation(node) = (attr(asc(node)) - attr(desc(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 only makes semantic sense for max-trees and min-trees whose altitude matches the weighted tree topology. Public constructors therefore accept WeightedMorphologicalTree<T> only and reject self-dual tree kinds.

Definition at line 56 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 59 of file MSERComputer.hpp.

Constructor & Destructor Documentation

◆ MSERComputer() [1/3]

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

Creates an MSER detector backed by an owned attribute buffer.

Definition at line 99 of file MSERComputer.hpp.

◆ MSERComputer() [2/3]

template<AltitudeValue T, std::floating_point Real = float>
mmcfilters::MSERComputer< T, Real >::MSERComputer ( const WeightedMorphologicalTree< T > &  weighted,
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.

Definition at line 110 of file MSERComputer.hpp.

◆ MSERComputer() [3/3]

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

Creates an MSER detector that lazily falls back to AREA.

Definition at line 120 of file MSERComputer.hpp.

Member Function Documentation

◆ ascendantInStabilityWindow()

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

Returns the ascendant used in the current stability window.

Definition at line 223 of file MSERComputer.hpp.

◆ computeMSER()

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

Computes the MSER indicator vector for the given delta.

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 131 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.

Definition at line 227 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 criterion, lazily computing AREA when no external buffer has been provided.

Definition at line 188 of file MSERComputer.hpp.

◆ getNumNodes()

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

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

Definition at line 235 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.

Definition at line 165 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.

Definition at line 231 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 delta-linked neighbours.

Definition at line 204 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.

Definition at line 247 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.

Definition at line 239 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.

Definition at line 243 of file MSERComputer.hpp.


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