|
MorphologicalAttributeFilters
Public API documentation
|
Connected alternating sequential filter on paired component trees. More...
#include <CasfComponentTrees.hpp>
Public Member Functions | |
| CasfComponentTrees (image_ptr_t image, CasfComponentTreesAttribute attribute=CasfComponentTreesAttribute::AREA, double radius=1.5) | |
| Initializes the CASF state from the input image and the chosen attribute. | |
| image_ptr_t | filter (const std::vector< double > &thresholds) |
| Runs the CASF on the threshold sequence and returns the filtered image. | |
| const tree_t & | minTree () const noexcept |
| Returns the current min-tree state. | |
| const tree_t & | maxTree () const noexcept |
| Returns the current max-tree state. | |
| CasfComponentTreesAttribute | attribute () const noexcept |
| Returns the increasing attribute configured for this CASF instance. | |
| std::pair< std::vector< NodeId >, std::vector< T > > | exportMinTree () const |
| Exports the current min-tree as a compact static parent/altitude pair. | |
| std::pair< std::vector< NodeId >, std::vector< T > > | exportMaxTree () const |
| Exports the current max-tree as a compact static parent/altitude pair. | |
Connected alternating sequential filter on paired component trees.
This class implements a connected alternating sequential filter (CASF) on a fixed image-domain adjacency. Instead of rebuilding both component trees after every threshold, it owns a mutable min-tree / max-tree pair and updates one tree incrementally whenever rooted subtrees are pruned from the dual one.
Supported workflow:
AREA, BOUNDING_BOX_WIDTH, BOUNDING_BOX_HEIGHT, or BOUNDING_BOX_DIAGONAL);filter(thresholds) on one or more threshold sequences applied successively to the current state;minTree, maxTree, exportMinTree, and exportMaxTree.For each threshold, the standard two CASF half-steps are performed:
Internal state owned by this class:
Update semantics:
filter(...) with a non-empty threshold sequence mutates the internal trees;filter(...) calls continue from the current filtered state;Attribute buffers are initialized once and then kept synchronized through DualMinMaxTreeIncrementalFilter; they are not globally recomputed at every threshold.
Ownership note:
CASF intentionally remains a mutable WeightedMorphologicalTree<T> owner. WeightedTreeView<T> is suited to read-only kernels; here each threshold step changes tree topology, proper-part ownership, altitude state, and dynamic attribute buffers together.
Definition at line 84 of file CasfComponentTrees.hpp.
|
inline |
Initializes the CASF state from the input image and the chosen attribute.
| image | Input gray-level image. |
| attribute | Increasing attribute used to select pruning candidates. |
| radius | Radius used to build the image-domain adjacency relation. |
Definition at line 188 of file CasfComponentTrees.hpp.
|
inlinenoexcept |
Returns the increasing attribute configured for this CASF instance.
Definition at line 241 of file CasfComponentTrees.hpp.
|
inline |
Exports the current max-tree as a compact static parent/altitude pair.
The pair follows the local WeightedMorphologicalTree<T> export convention and can be compared with Higra-style static hierarchy outputs in tests and benchmarks.
Definition at line 261 of file CasfComponentTrees.hpp.
|
inline |
Exports the current min-tree as a compact static parent/altitude pair.
The pair follows the local WeightedMorphologicalTree<T> export convention and can be compared with Higra-style static hierarchy outputs in tests and benchmarks.
Definition at line 251 of file CasfComponentTrees.hpp.
|
inline |
Runs the CASF on the threshold sequence and returns the filtered image.
Thresholds are applied to the current internal state. The object is therefore stateful: successive non-empty calls continue filtering the result of the previous ones.
Definition at line 217 of file CasfComponentTrees.hpp.
|
inlinenoexcept |
Returns the current max-tree state.
Definition at line 234 of file CasfComponentTrees.hpp.
|
inlinenoexcept |
Returns the current min-tree state.
Definition at line 227 of file CasfComponentTrees.hpp.