00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef PROJECTIVE_H
00022 #define PROJECTIVE_H
00023
00024
00025 #include <qvmath.h>
00026 #include <QVMatrix>
00027 #include <QV3DPointF>
00028
00032
00035
00036 void homogenizePoints(const QList< QPointFMatching > &matchings,
00037 QVMatrix &premult, QVMatrix &postmult,
00038 QList< QPair<QPointF, QPointF> > &homogeneizedPairs);
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00120 QVMatrix ComputeProjectiveHomography(const QList< QPointFMatching > &matchings);
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00140 QVMatrix cvFindFundamentalMat(const QList< QPointFMatching > &matchings);
00141
00149 QVMatrix ComputeEuclideanHomography(const QList< QPointFMatching > &matchings);
00150
00165 QPointF ApplyHomography(const QVMatrix &homography, const QPointF &point);
00166
00179 QList<QPointF> ApplyHomography(const QVMatrix &homography, const QList<QPointF> &sourcePoints);
00180
00202 double HomographyTestError(const QVMatrix &homography);
00203
00209 void GetExtrinsicCameraMatrixFromHomography(const QVMatrix &K, const QVMatrix &H, QVMatrix &M4x4);
00210
00225 void GetDirectIntrinsicCameraMatrixFromHomography(const QVMatrix &H, QVMatrix &K);
00226
00239
00240
00241
00246 void CalibrateCameraFromPlanarHomography(const QVMatrix &H, QVMatrix &K, QVMatrix &Rt);
00247
00292 void GetPinholeCameraIntrinsicsFromPlanarHomography( const QVMatrix &H, QVMatrix &K, const int iterations = 100,
00293 const double maxGradientNorm = 1e-3, const double step = 0.01, const double tol = 1e-4);
00294
00296
00306 QList<QVMatrix> getCanonicalCameraMatricesFromEssentialMatrix(const QVMatrix &E);
00307
00318 QVMatrix getEssentialMatrixFromCanonicalCameraMatrix(const QVMatrix &P);
00319
00334 QVMatrix getCameraMatrixFrom2D3DPointCorrespondences(const QList<QPointF> &points2d, const QList<QV3DPointF> &points3d);
00335
00354 QV3DPointF triangulate3DPointFrom2DProjectionsAndCanonicalCameraMatrices(const QList<QPointF> &points, const QList<QVMatrix> &Plist);
00355 #endif