#include <qvdta/qvcomponenttree.h>
Public Member Functions | |
QVComponentTree (const QVImage< uChar, 1 > &image, bool inverseTree=false) | |
Constructs a component tree set, from a gray-scale image. | |
~QVComponentTree () | |
bool | isInverseTree () const |
uInt | rootNode () const |
uInt | seedX (uInt node) const |
uInt | seedY (uInt node) const |
uChar | firstThreshold (uInt node) const |
uChar | lastThreshold (uInt node) const |
uInt | numChilds (uInt node) const |
uInt | firstChild (uInt node) const |
uInt | nextSibling (uInt node) const |
uInt * | area (uInt node) const |
bool | validNode (uInt node) const |
uInt & | rootNode () |
uInt & | seedX (uInt node) |
uInt & | seedY (uInt node) |
uChar & | firstThreshold (uInt node) |
uChar & | lastThreshold (uInt node) |
uInt & | numChilds (uInt node) |
uInt & | firstChild (uInt node) |
uInt & | nextSibling (uInt node) |
uInt * | area (uInt node) |
bool & | validNode (uInt node) |
uInt | getNumNodes () const |
uInt | getTotalPoints () const |
uInt | getLeafNodes () const |
A level set in a gray-scale image is a connected set of points (pixels) with a gray-scale level above a given threshold. Component trees are built upon the inclusion relation of the level sets in an image.
They are a representation useful to obtain non-flat connected component filters, that may preserve connected components in the image, satisfying a given criterion. These trees are used in computer vision for task like image segmentation, filtering, scale and rotation invariant image feature extraction (like MSER, see [Matas]), amongst other.
For a wider explanation about component trees, you can read paper [Jones]. The former implementation of component trees is very efficient, so that it can be used with regular sized images (320x240 to 640x480, depending on the computer speed) in real-time programs. It is based in the algorithm described in the paper [Najman], which is supossed to obtain the component tree in quasi-linear time.
There's a main difference between this implementation and that described in the paper. While the latter constructs a node for each gray-level in a level set, this implementation compacts every gray-level included in a same level set, in one node only. It will only be stored for every gray-level in the same node it's histogram area; thus, every non-leaf node in QVision's component tree will have more than one descendant, making smaller trees.
The function rootNode returns the index of the parent root of the tree. You can check if that node (or any node) is a leaf node, with the function numChilds, which returns the number of descendant nodes that has a given node from the tree. For any non-leaf node, you can transverse the list of it's descendant nodes using first the function firstChild to get the index of the first of it's child nodes, and then using the function nextSibling to get the next child in the list, for that child to the last of the list.
For every node index, you can get a seed point of the level set it represents (that is, generally a given point of the set) using functions seedX and seedY, to get horizontal and vertical coordinates of the point. Functions firstThreshold, lastThreshold, and area can be used to obtain histogram information about gray-scale values for the level set of the node.
REFERENCES:
Definition at line 71 of file qvcomponenttree.h.
qvdta::QVComponentTree::QVComponentTree | ( | const QVImage< uChar, 1 > & | image, | |
bool | inverseTree = false | |||
) |
Constructs a component tree set, from a gray-scale image.
Root node will embrace the whole image, and will descend to the lower gray-scale level valued areas.
image | image to create from the component tree. |
Definition at line 106 of file qvcomponenttree.cpp.
References QVImage< Type, Planes >::getCols(), QVImage< Type, Planes >::getRows(), QVIMAGE_INIT_READ, QVIMAGE_INIT_WRITE, and QVIMAGE_PIXEL.