src/qvmath/qvprojective.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 
00021 #ifndef PROJECTIVE_H
00022 #define PROJECTIVE_H
00023 
00024 #include <qvmath/qvmatrix.h>
00025 #include <qvmath/qvmath.h>
00026 #include <qvdta/qvdta.h>
00027 #include <QPair>
00028 
00029 
00033 
00036 
00048 QVMatrix ComputeHomography(const QList<QPointF> &sourcePoints, const QList<QPointF> &destPoints);
00049 
00059 QVMatrix ComputeProjectiveHomography(const QList< QPair<QPointF, QPointF> > &matchings);
00060 
00065 QVMatrix ComputeEuclideanHomography(const QPair<QPointF, QPointF> &firstMatching, const QPair<QPointF, QPointF> &secondMatching);
00066 
00071 QVMatrix ComputeEuclideanHomography(const QList< QPair<QPointF, QPointF> > &matchings);
00072 
00077 QPointF ApplyHomography(const QVMatrix &homography, const QPointF &point);
00078 
00083 QList<QPointF> ApplyHomography(const QVMatrix &homography, const QList<QPointF> &sourcePoints);
00084 
00106 double HomographyTestError(const QVMatrix &homography);
00107 
00108 
00111 
00112 /*
00113 @brief Obtains intrinsic and extrinsic camera matrix decomposition from a planar <a href="http://en.wikipedia.org/wiki/Homography">homography</a>.
00114 @ingroup qvproyective
00115 
00116 @todo explain how focal value is needed for intrinsic matrix, and how it is searched.
00117 This is a direct version of the function @ref GetIntrinsicCameraMatrixFromHomography, which doesn't 
00118 
00119 @param H homography matrix
00120 @param K matrix to store resulting intrinsic camera matrix.
00121 @param M matrix to store resulting extrinsic camera matrix.
00122 */
00123 //bool DecomposeCameraMatricesFromPlanarHomography(const QVMatrix &H, QVMatrix &K, QVMatrix &M);
00124 
00129 void GetExtrinsicCameraMatrixFromHomography(const QVMatrix &K, const QVMatrix &H, QVMatrix &M4x4);
00130 
00135 void GetDirectIntrinsicCameraMatrixFromHomography(const QVMatrix &H, QVMatrix &K);
00136 
00141 void GetIntrinsicCameraMatrixFromHomography(const QVMatrix &H, QVMatrix &K,
00142         double focal = 3, const double maxFocal = 50, const int maxIterations = 100, const double maxError = 0.00001);
00143 
00144 #endif

Generated on Thu Jul 17 17:23:28 2008 for QVision by  doxygen 1.5.3