java.lang.Object
imagingbook.common.mser.components.ComponentTree<T>
- Type Parameters:
T
- the data type of components (e.g.,MserData
)
- Direct Known Subclasses:
ComponentTreeGlobalImmersion
,ComponentTreeLinearTime
This class represents a tree of extremal image components.
- Version:
- 2022/11/19
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration specifying the method (algorithm) for building the component tree. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ComponentTree<T>
from
(ByteProcessor ip) Creates a new component tree for the specified image using the default method (ComponentTree.Method.LinearTime
).static <T> ComponentTree<T>
from
(ByteProcessor ip, ComponentTree.Method method) Creates a new component tree for the specified image.static <T> ComponentTree<T>
from
(PixelMap pm, ComponentTree.Method method) Creates a new component tree for the specifiedPixelMap
.abstract Collection<Component<T>>
Returns an unordered collection of all tree components.Finds and returns a collection of all leaf components of this tree.getRoot()
Returns the root component of this component tree.iterator()
toString()
boolean
validate()
Performs integrity checks on this component tree.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
from
Creates a new component tree for the specified image using the default method (ComponentTree.Method.LinearTime
).- Type Parameters:
T
- the generic node type- Parameters:
ip
- the input image- Returns:
- the component tree for the specified image
-
from
Creates a new component tree for the specified image.- Type Parameters:
T
- the data type of components (e.g.,MserData
)- Parameters:
ip
- the input (gray-level) imagemethod
- the method for building the component tree- Returns:
- the component tree
-
from
Creates a new component tree for the specifiedPixelMap
. -
getRoot
Returns the root component of this component tree. To be implemented by concrete subclasses.- Returns:
- the root component
-
getComponents
Returns an unordered collection of all tree components. To be implemented by concrete subclasses.- Returns:
- all tree components
-
iterator
-
getLeaves
Finds and returns a collection of all leaf components of this tree. A leaf is a component which has no children.- Returns:
- all leaf components
-
validate
Performs integrity checks on this component tree.- Returns:
- true iff all checks are passed
-
toString
-