|
MorphologicalAttributeFilters
Public API documentation
|
Family of attribute-based image filtering operators on morphological trees. More...
#include <AttributeFilters.hpp>
Public Member Functions | |
| AttributeFilters (AltitudeView view) | |
| Creates filtering operators over a non-owning weighted tree view. | |
| AttributeFilters (const WeightedMorphologicalTree< T > &weighted) | |
| Creates filtering operators over an owned weighted tree. | |
| std::vector< bool > | getAdaptiveCriterion (std::vector< bool > &criterion, AltitudeDiff< T > delta) |
| Builds an MSER-assisted pruning criterion from an existing keep/reject mask. | |
| std::vector< bool > | getAdaptiveCriterionByDepth (std::vector< bool > &criterion, int depthDelta) |
| Builds a depth-stability pruning criterion from an existing mask. | |
| template<std::floating_point Real> | |
| ImagePtr< T > | filteringByPruningMin (const std::shared_ptr< Real[]> &attr, Real threshold) |
| Applies pruning-min filtering from an attribute buffer. | |
| template<std::floating_point Real> | |
| ImagePtr< T > | filteringByPruningMin (const Real *attr, Real threshold) |
| Applies pruning-min filtering from a raw internal-node attribute buffer. | |
| template<std::floating_point Real> | |
| ImagePtr< T > | filteringByPruningMax (const std::shared_ptr< Real[]> &attr, Real threshold) |
| Applies pruning-max filtering from an attribute buffer. | |
| template<std::floating_point Real> | |
| ImagePtr< T > | filteringByPruningMax (const Real *attr, Real threshold) |
| Applies pruning-max filtering from a raw internal-node attribute buffer. | |
| template<std::floating_point Real> | |
| ImagePtr< T > | filteringByViterbiRule (const Real *attr, Real threshold) |
| Applies Salembier-style Viterbi filtering from a raw attribute buffer. | |
| ImagePtr< T > | filteringByPruningMin (std::vector< bool > &criterion) |
| Applies pruning-min filtering from a dense internal-node criterion. | |
| ImagePtr< T > | filteringByPruningMax (std::vector< bool > &criterion) |
| Applies pruning-max filtering from a dense internal-node criterion. | |
| ImagePtr< T > | filteringByDirectRule (std::vector< bool > &criterion) |
| Applies the direct filtering rule from a dense internal-node criterion. | |
| ImagePtr< T > | filteringBySubtractiveRule (std::vector< bool > &criterion) |
| Applies the subtractive filtering rule from a dense internal-node criterion. | |
| ImageFloatPtr | filteringBySubtractiveScoreRule (std::vector< float > &prob) |
| Applies the subtractive score rule from dense per-node scores. | |
Static Public Member Functions | |
| static void | filteringBySubtractiveScoreRule (const WeightedTreeView< T > &weighted, std::vector< float > &prob, ImageFloatPtr imgOutputPtr) |
| Writes subtractive-score filtering into a caller-owned output image. | |
| static void | filteringBySubtractiveScoreRule (const WeightedMorphologicalTree< T > &weighted, std::vector< float > &prob, ImageFloatPtr imgOutputPtr) |
| Writes subtractive-score filtering from a weighted owner into an output image. | |
| static void | filteringBySubtractiveRule (const WeightedTreeView< T > &weighted, std::vector< bool > &criterion, ImagePtr< T > imgOutputPtr) |
| Writes subtractive-rule filtering into a caller-owned output image. | |
| static void | filteringBySubtractiveRule (const WeightedMorphologicalTree< T > &weighted, std::vector< bool > &criterion, ImagePtr< T > imgOutputPtr) |
| Writes subtractive-rule filtering from a weighted owner into an output image. | |
| static void | filteringByDirectRule (const WeightedTreeView< T > &weighted, std::vector< bool > &criterion, ImagePtr< T > imgOutputPtr) |
| Writes direct-rule filtering into a caller-owned output image. | |
| static void | filteringByDirectRule (const WeightedMorphologicalTree< T > &weighted, std::vector< bool > &criterion, ImagePtr< T > imgOutputPtr) |
| Writes direct-rule filtering from a weighted owner into an output image. | |
| static void | filteringByPruningMin (const WeightedTreeView< T > &weighted, std::vector< bool > &criterion, ImagePtr< T > imgOutputPtr) |
| Writes pruning-min filtering from a criterion into an output image. | |
| static void | filteringByPruningMin (const WeightedMorphologicalTree< T > &weighted, std::vector< bool > &criterion, ImagePtr< T > imgOutputPtr) |
| Writes pruning-min filtering from a weighted owner into an output image. | |
| static void | filteringByPruningMax (const WeightedTreeView< T > &weighted, std::vector< bool > &criterion, ImagePtr< T > imgOutputPtr) |
| Writes pruning-max filtering from a criterion into an output image. | |
| static void | filteringByPruningMax (const WeightedMorphologicalTree< T > &weighted, std::vector< bool > &criterion, ImagePtr< T > imgOutputPtr) |
| Writes pruning-max filtering from a weighted owner into an output image. | |
| template<std::floating_point Real> | |
| static void | filteringByPruningMin (const WeightedTreeView< T > &weighted, const std::shared_ptr< Real[]> &attribute, Real threshold, ImagePtr< T > imgOutputPtr) |
| Writes pruning-min filtering from an owned attribute buffer into an output image. | |
| template<std::floating_point Real> | |
| static void | filteringByPruningMin (const WeightedMorphologicalTree< T > &weighted, const std::shared_ptr< Real[]> &attribute, Real threshold, ImagePtr< T > imgOutputPtr) |
| Writes pruning-min filtering from a weighted owner and owned attribute buffer. | |
| template<std::floating_point Real> | |
| static void | filteringByPruningMin (const WeightedTreeView< T > &weighted, const Real *attribute, Real threshold, ImagePtr< T > imgOutputPtr) |
| Writes pruning-min filtering from a raw attribute buffer into an output image. | |
| template<std::floating_point Real> | |
| static void | filteringByPruningMin (const WeightedMorphologicalTree< T > &weighted, const Real *attribute, Real threshold, ImagePtr< T > imgOutputPtr) |
| Writes pruning-min filtering from a weighted owner and raw attribute buffer. | |
| template<std::floating_point Real> | |
| static void | filteringByPruningMax (const WeightedTreeView< T > &weighted, const std::shared_ptr< Real[]> &attribute, Real threshold, ImagePtr< T > imgOutputPtr) |
| Writes pruning-max filtering from an owned attribute buffer into an output image. | |
| template<std::floating_point Real> | |
| static void | filteringByPruningMax (const WeightedMorphologicalTree< T > &weighted, const std::shared_ptr< Real[]> &attribute, Real threshold, ImagePtr< T > imgOutputPtr) |
| Writes pruning-max filtering from a weighted owner and owned attribute buffer. | |
| template<std::floating_point Real> | |
| static void | filteringByPruningMax (const WeightedTreeView< T > &weighted, const Real *attribute, Real threshold, ImagePtr< T > imgOutputPtr) |
| Writes pruning-max filtering from a raw attribute buffer into an output image. | |
| template<std::floating_point Real> | |
| static void | filteringByPruningMax (const WeightedMorphologicalTree< T > &weighted, const Real *attribute, Real threshold, ImagePtr< T > imgOutputPtr) |
| Writes pruning-max filtering from a weighted owner and raw attribute buffer. | |
| template<std::floating_point Real> | |
| static std::vector< bool > | getAdaptiveCriterion (const WeightedMorphologicalTree< T > &weighted, const std::shared_ptr< Real[]> &attribute, Real threshold, AltitudeDiff< T > delta) |
| Builds an MSER-assisted pruning criterion from an attribute threshold. | |
| template<std::floating_point Real> | |
| static std::vector< bool > | getAdaptiveCriterion (const WeightedMorphologicalTree< T > &weighted, const Real *attribute, Real threshold, AltitudeDiff< T > delta) |
| Builds an MSER-assisted pruning criterion from a raw attribute buffer. | |
| static std::vector< bool > | getAdaptiveCriterion (const WeightedMorphologicalTree< T > &weighted, std::vector< bool > &criterion, AltitudeDiff< T > delta) |
| Builds an MSER-assisted pruning criterion from an existing criterion mask. | |
| template<std::floating_point Real> | |
| static std::vector< bool > | getAdaptiveCriterionByDepth (const WeightedMorphologicalTree< T > &weighted, const std::shared_ptr< Real[]> &attribute, Real threshold, int depthDelta) |
| Builds a depth-stability pruning criterion from an attribute threshold. | |
| template<std::floating_point Real> | |
| static std::vector< bool > | getAdaptiveCriterionByDepth (const WeightedMorphologicalTree< T > &weighted, const Real *attribute, Real threshold, int depthDelta) |
| Builds a depth-stability pruning criterion from a raw attribute buffer. | |
| static std::vector< bool > | getAdaptiveCriterionByDepth (const WeightedMorphologicalTree< T > &weighted, std::vector< bool > &criterion, int depthDelta) |
| Builds a depth-stability pruning criterion from an existing criterion mask. | |
Family of attribute-based image filtering operators on morphological trees.
AttributeFilters groups the classical reconstruction rules used in this project: direct filtering, subtractive filtering, pruning-based filtering, and a few residual/score-based variants. The operators consume criteria or attribute buffers defined on dense node ids and reconstruct proper-part images as their output.
Contract and node-domain assumptions:
NodeId slot domain, not by exported Higra ids;getProperParts(node) contains only the pixels owned directly by that node;NodeId slot order is not a topological order after Higra import or structural edits;Reconstruction rule summary:
Definition at line 66 of file AttributeFilters.hpp.
|
inlineexplicit |
Creates filtering operators over a non-owning weighted tree view.
The view must remain valid for the lifetime of the filter object. Public methods reject use after the underlying topology mutates.
Definition at line 524 of file AttributeFilters.hpp.
|
inlineexplicit |
Creates filtering operators over an owned weighted tree.
This overload keeps a pointer to the owner so methods that require tree-owned altitude state, such as MSER-assisted adaptive criteria, can be used.
Definition at line 538 of file AttributeFilters.hpp.
|
inlinestatic |
Writes direct-rule filtering from a weighted owner into an output image.
Definition at line 738 of file AttributeFilters.hpp.
|
inlinestatic |
Writes direct-rule filtering into a caller-owned output image.
Definition at line 731 of file AttributeFilters.hpp.
|
inline |
Applies the direct filtering rule from a dense internal-node criterion.
Accepted nodes use their own altitude; rejected nodes inherit the filtered level propagated from their parent.
Definition at line 667 of file AttributeFilters.hpp.
|
inline |
Applies pruning-max filtering from a raw internal-node attribute buffer.
Definition at line 612 of file AttributeFilters.hpp.
|
inline |
Applies pruning-max filtering from an attribute buffer.
Nodes with attribute values above threshold are kept, and fully rejected subtrees are reconstructed at their own subtree levels.
Definition at line 604 of file AttributeFilters.hpp.
|
inlinestatic |
Writes pruning-max filtering from a weighted owner and raw attribute buffer.
Definition at line 830 of file AttributeFilters.hpp.
|
inlinestatic |
Writes pruning-max filtering from a weighted owner and owned attribute buffer.
Definition at line 814 of file AttributeFilters.hpp.
|
inlinestatic |
Writes pruning-max filtering from a weighted owner into an output image.
Definition at line 766 of file AttributeFilters.hpp.
|
inlinestatic |
Writes pruning-max filtering from a raw attribute buffer into an output image.
Definition at line 822 of file AttributeFilters.hpp.
|
inlinestatic |
Writes pruning-max filtering from an owned attribute buffer into an output image.
Definition at line 806 of file AttributeFilters.hpp.
|
inlinestatic |
Writes pruning-max filtering from a criterion into an output image.
Definition at line 759 of file AttributeFilters.hpp.
|
inline |
Applies pruning-max filtering from a dense internal-node criterion.
Definition at line 654 of file AttributeFilters.hpp.
|
inline |
Applies pruning-min filtering from a raw internal-node attribute buffer.
Definition at line 589 of file AttributeFilters.hpp.
|
inline |
Applies pruning-min filtering from an attribute buffer.
Nodes with attribute values above threshold remain traversable; rejected subtrees are reconstructed at the ancestor level selected by the pruning-min rule.
Definition at line 581 of file AttributeFilters.hpp.
|
inlinestatic |
Writes pruning-min filtering from a weighted owner and raw attribute buffer.
Definition at line 798 of file AttributeFilters.hpp.
|
inlinestatic |
Writes pruning-min filtering from a weighted owner and owned attribute buffer.
Definition at line 782 of file AttributeFilters.hpp.
|
inlinestatic |
Writes pruning-min filtering from a weighted owner into an output image.
Definition at line 752 of file AttributeFilters.hpp.
|
inlinestatic |
Writes pruning-min filtering from a raw attribute buffer into an output image.
Definition at line 790 of file AttributeFilters.hpp.
|
inlinestatic |
Writes pruning-min filtering from an owned attribute buffer into an output image.
Definition at line 774 of file AttributeFilters.hpp.
|
inlinestatic |
Writes pruning-min filtering from a criterion into an output image.
Definition at line 745 of file AttributeFilters.hpp.
|
inline |
Applies pruning-min filtering from a dense internal-node criterion.
Definition at line 644 of file AttributeFilters.hpp.
|
inlinestatic |
Writes subtractive-rule filtering from a weighted owner into an output image.
Definition at line 724 of file AttributeFilters.hpp.
|
inlinestatic |
Writes subtractive-rule filtering into a caller-owned output image.
Definition at line 717 of file AttributeFilters.hpp.
|
inline |
Applies the subtractive filtering rule from a dense internal-node criterion.
Accepted nodes add their residue to the propagated reconstruction level; rejected nodes inherit the parent level.
Definition at line 680 of file AttributeFilters.hpp.
|
inlinestatic |
Writes subtractive-score filtering from a weighted owner into an output image.
Definition at line 710 of file AttributeFilters.hpp.
|
inlinestatic |
Writes subtractive-score filtering into a caller-owned output image.
Definition at line 703 of file AttributeFilters.hpp.
|
inline |
Applies the subtractive score rule from dense per-node scores.
Each node residue is weighted by prob[nodeId] before accumulation, and the result is reconstructed as a floating-point image.
Definition at line 693 of file AttributeFilters.hpp.
|
inline |
Applies Salembier-style Viterbi filtering from a raw attribute buffer.
The internal detail implementation turns attr and threshold into preserve/remove costs and solves the optimal connected keep mask on the tree. The root is always preserved. Once the Viterbi path removes a node, every descendant is removed as well; preserved descendants can only appear below preserved ancestors. The final image is reconstructed by the direct rule using that connected keep criterion.
Definition at line 631 of file AttributeFilters.hpp.
|
inlinestatic |
Builds an MSER-assisted pruning criterion from a raw attribute buffer.
Definition at line 846 of file AttributeFilters.hpp.
|
inlinestatic |
Builds an MSER-assisted pruning criterion from an attribute threshold.
Definition at line 838 of file AttributeFilters.hpp.
|
inlinestatic |
Builds an MSER-assisted pruning criterion from an existing criterion mask.
Definition at line 853 of file AttributeFilters.hpp.
|
inline |
Builds an MSER-assisted pruning criterion from an existing keep/reject mask.
| criterion | Dense internal-node mask. Nodes with false are candidates for adaptive pruning. |
| delta | Altitude distance used by the MSER stability computation. |
Definition at line 553 of file AttributeFilters.hpp.
|
inlinestatic |
Builds a depth-stability pruning criterion from a raw attribute buffer.
Definition at line 869 of file AttributeFilters.hpp.
|
inlinestatic |
Builds a depth-stability pruning criterion from an attribute threshold.
Definition at line 861 of file AttributeFilters.hpp.
|
inlinestatic |
Builds a depth-stability pruning criterion from an existing criterion mask.
Definition at line 876 of file AttributeFilters.hpp.
|
inline |
Builds a depth-stability pruning criterion from an existing mask.
depthDelta is a number of tree edges. The stability computation does not read altitude, so it is suitable for tree-of-shapes and self-dual residual trees where max/min altitude polarity is not defined.
Definition at line 568 of file AttributeFilters.hpp.