eightPointAlgorithm.cpp
Go to the documentation of this file.00001
00016 #include <dlrComputerVision/eightPointAlgorithm.h>
00017
00018 namespace num = dlr::numeric;
00019 namespace linAlg = dlr::linearAlgebra;
00020
00021 namespace dlr {
00022
00023 namespace computerVision {
00024
00025
00026
00027
00028
00029 void
00030 normalizePointSequence(dlr::numeric::Array2D<double> const& inputPoints,
00031 dlr::numeric::Array2D<double>& outputPoints,
00032 dlr::numeric::Array2D<double>& transform)
00033 {
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 dlr::numeric::Array2D<double> EE =
00057 num::matrixMultiply(inputPoints.transpose(), inputPoints);
00058 double sqrtN = std::sqrt(inputPoints.rows());
00059
00060 num::Array2D<double> KK;
00061 linAlg::choleskyFactorization(EE, KK, false);
00062 KK /= sqrtN;
00063 num::Array2D<double> KKInv = linAlg::inverse(KK);
00064
00065
00066
00067 outputPoints = num::matrixMultiply(inputPoints, KKInv.transpose());
00068 transform = KKInv;
00069 }
00070
00071 }
00072
00073 }