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 
00030 #include <QList>
00031 #include <QMap>
00032 #include <QVector>
00033 #include <QPoint>
00034 
00035 #include <QVImage>
00036 
00044 
00045 
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054 QVector< QVector< QPoint > > CountingSort(const QVImage<uChar, 1> &img);
00055 
00056 #ifndef DOXYGEN_IGNORE_THIS
00059 template <typename T1, typename T2> QList< QPair<T1,T2> > joinPairList(const QList<T1> &list1, const QList<T2> &list2)
00060         {
00061         QList< QPair<T1,T2> > result;
00062         for (int i = 0; i < MIN(list1.size(),list2.size()); i++)
00063                 result.append(QPair<T1,T2>(list1.at(i), list2.at(i)));
00064         return result;
00065         }
00066 
00069 template <typename T1, typename T2> QList<T1> getFirstPairList(const QList< QPair<T1,T2> > &list)
00070         {
00071         QList<T1> result;
00072         QPair<T1,T2> pair;
00073         foreach(pair, list)
00074                 result.append(pair.first);
00075         return result;
00076         }
00077 
00080 template <typename T1, typename T2> QList<T2> getSecondPairList(const QList< QPair<T1,T2> > &list)
00081         {
00082         QList<T2> result;
00083         QPair<T1,T2> pair;
00084         foreach(pair, list)
00085                 result.append(pair.second);
00086         return result;
00087         }
00088 
00091 template <typename T1, typename T2> QList<T1> convertList(QList<T2> &list)
00092         {
00093         QList<T1> result;
00094         foreach(T2 element, list)
00095                 result.append(element);
00096         return result;
00097         }
00098 
00099 #endif
00100 
00103 QList<QPointF> GetMaximalResponsePoints1(const QVImage<sFloat> &cornerResponseImage, const double threshold = 1.0);
00104 
00107 QList<QPointF> GetMaximalResponsePoints3(const QVImage<sFloat> &cornerResponseImage, const double threshold = 1.0);
00108 
00111 QList< QPair<sFloat, QPointF> > GetMaximalResponsePoints1bis(const QVImage<sFloat> &cornerResponseImage, const double threshold = 1.0);
00112 
00115 QList< QPair<sFloat, QPointF> > GetMaximalResponsePoints3bis(const QVImage<sFloat> &cornerResponseImage, const double threshold = 1.0);
00116 
00117 #endif