src/qvdta/qvcomponenttree.h

Go to the documentation of this file.
00001 /*
00002  *      Copyright (C) 2007. PARP Research Group.
00003  *      <http://perception.inf.um.es>
00004  *      University of Murcia, Spain.
00005  *
00006  *      This file is part of the QVision library.
00007  *
00008  *      QVision is free software: you can redistribute it and/or modify
00009  *      it under the terms of the GNU Lesser General Public License as
00010  *      published by the Free Software Foundation, version 3 of the License.
00011  *
00012  *      QVision is distributed in the hope that it will be useful,
00013  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *      GNU Lesser General Public License for more details.
00016  *
00017  *      You should have received a copy of the GNU Lesser General Public
00018  *      License along with QVision. If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00024 
00025 #include <qvdta/qvdta.h>
00026 
00027 #define  NULL_NODE      256*256*256
00028 
00030 namespace qvdta
00031 {
00032 class QVComponentTreeNode
00033         {
00034         public:
00035                 uInt seedX, seedY;
00036                 uInt child, brother, numChilds;
00037                 uChar firstThreshold, lastThreshold;
00038                 uInt area[256];
00039                 bool inited;
00040         };
00041 
00042 class QVComponentTree
00043         {
00044         public:
00045                 QVComponentTree(uInt cols, uInt rows, const QVImage<uChar,1> image);
00046                 ~QVComponentTree();
00047 
00048                 void pruneLowRegions(QVImage<uChar> &image, uInt area);
00049                 void pruneHighRegions(QVImage<uChar> &image, uInt area);
00050 
00051         public:
00052                 uInt numNodes, freePoints, totalPoints, leafNodes, rootNode, maxNodes;
00053                 QVComponentTreeNode *nodes;
00054 
00055                 uInt *nodeID;
00056                 bool *valid;
00057 
00058                 void getComponentTree(const QVImage<uChar> &image);
00059                 void pruneLowComponentTreeAux(QVImage<uChar> &image, uInt minArea, uInt node, uInt validThreshold);
00060                 void pruneHighComponentTreeAux(QVImage<uChar> &image, uInt minArea, uInt node, uInt validThreshold);
00061         };
00062 
00063 uInt debug_print_componentTree(QVComponentTree &componentTree);
00064 }

Generated on Fri Dec 7 12:20:59 2007 for QVision by  doxygen 1.5.3