PARP Research Group University of Murcia, Spain


src/qvdta/qvdta.h

00001 /*
00002  *      Copyright (C) 2007, 2008. 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 #ifndef QVDTA_H
00026 #define QVDTA_H
00027 
00028 #include <iostream>
00029 #include <qvdefines.h>
00030 
00031 #include <QMap>
00032 #include <QVImage>
00033 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 
00051 QVector< QVector< QPoint > > CountingSort(const QVImage<uChar, 1> &img);
00052 
00053 #ifndef DOXYGEN_IGNORE_THIS
00056 template <typename T1, typename T2> QList< QPair<T1,T2> > joinPairList(const QList<T1> &list1, const QList<T2> &list2)
00057         {
00058         QList< QPair<T1,T2> > result;
00059         for (int i = 0; i < MIN(list1.size(),list2.size()); i++)
00060                 result.append(QPair<T1,T2>(list1.at(i), list2.at(i)));
00061         return result;
00062         }
00063 
00066 template <typename T1, typename T2> QList<T1> getFirstPairList(const QList< QPair<T1,T2> > &list)
00067         {
00068         QList<T1> result;
00069         QPair<T1,T2> pair;
00070         foreach(pair, list)
00071                 result.append(pair.first);
00072         return result;
00073         }
00074 
00077 template <typename T1, typename T2> QList<T2> getSecondPairList(const QList< QPair<T1,T2> > &list)
00078         {
00079         QList<T2> result;
00080         QPair<T1,T2> pair;
00081         foreach(pair, list)
00082                 result.append(pair.second);
00083         return result;
00084         }
00085 
00088 template <typename T1, typename T2> QList<T1> convertList(QList<T2> &list)
00089         {
00090         QList<T1> result;
00091         foreach(T2 element, list)
00092                 result.append(element);
00093         return result;
00094         }
00095 
00096 #endif
00097 
00098 #endif



QVision framework. PARP research group, copyright 2007, 2008.