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
00029 #ifdef QVIPP
00030 #include <QVImage>
00031 #include <qvipp.h>
00032 #endif
00033
00037
00040
00041 void homogenizePoints(const QList< QPointFMatching > &matchings,
00042 QVMatrix &premult, QVMatrix &postmult,
00043 QList< QPair<QPointF, QPointF> > &homogeneizedPairs);
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00126 QVMatrix ComputeProjectiveHomography(const QList< QPointFMatching > &matchings);
00127
00160 QVMatrix ComputeAffineHomography(const QList< QPointFMatching > &matchings);
00161
00169 QVMatrix ComputeEuclideanHomography(const QList< QPointFMatching > &matchings);
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00191 #ifdef QVOPENCV
00192 QVMatrix cvFindFundamentalMat(const QList< QPointFMatching > &matchings);
00193 #endif
00194
00212 #ifdef QVIPP
00213 QPointF ApplyHomography(const QVMatrix &homography, const QPointF &point);
00214 #endif
00215
00230 #ifdef QVIPP
00231 QList<QPointF> ApplyHomography(const QVMatrix &homography, const QList<QPointF> &sourcePoints);
00232 #endif
00233
00258 #ifdef QVIPP
00259 QVImage<uChar, 1> ApplyHomography(const QVMatrix &homography, const QVImage<uChar, 1> &image, const int interpolation = IPPI_INTER_CUBIC);
00260 #endif
00261
00285 #ifdef QVIPP
00286 QVImage<uChar, 3> ApplyHomography(const QVMatrix &homography, const QVImage<uChar, 3> &image, const int interpolation = IPPI_INTER_CUBIC);
00287 #endif
00288
00310 double HomographyTestError(const QVMatrix &homography);
00311
00317 void GetExtrinsicCameraMatrixFromHomography(const QVMatrix &K, const QVMatrix &H, QVMatrix &M4x4);
00318
00333 void GetDirectIntrinsicCameraMatrixFromHomography(const QVMatrix &H, QVMatrix &K);
00334
00347
00348
00349
00354 void CalibrateCameraFromPlanarHomography(const QVMatrix &H, QVMatrix &K, QVMatrix &Rt);
00355
00400 void GetPinholeCameraIntrinsicsFromPlanarHomography( const QVMatrix &H, QVMatrix &K, const int iterations = 100,
00401 const double maxGradientNorm = 1e-3, const double step = 0.01, const double tol = 1e-4);
00402
00412 QList<QVMatrix> getCanonicalCameraMatricesFromEssentialMatrix(const QVMatrix &E);
00413
00424 QVMatrix getEssentialMatrixFromCanonicalCameraMatrix(const QVMatrix &P);
00425
00440 QVMatrix getCameraMatrixFrom2D3DPointCorrespondences(const QList<QPointF> &points2d, const QList<QV3DPointF> &points3d);
00441
00455 QVMatrix refineExtrinsicCameraMatrixWithQRDecomposition(const QVMatrix &P);
00456
00483 QVMatrix refineExtrinsicCameraMatrixWithPolarDecomposition(const QVMatrix &P);
00484
00503 QV3DPointF triangulate3DPointFromNViews(const QList<QPointF> &points, const QList<QVMatrix> &Plist);
00504
00525 QV3DPointF triangulate3DPointFrom2Views(const QPointF &point1, const QVMatrix &P1, const QPointF &point2, const QVMatrix &P2);
00526
00527 #endif