Go to the documentation of this file.00001
00002 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00003 #pragma implementation
00004 #endif
00005
00006
00007
00008 #include "FDesignMatrix.h"
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 FDesignMatrix::FDesignMatrix(vcl_vector<HomgPoint2D> const& points1,
00030 vcl_vector<HomgPoint2D> const& points2):
00031 base(points1.size(), 9)
00032 {
00033 unsigned int n = points1.size();
00034 for (unsigned int row = 0; row < n; ++row) {
00035 const HomgPoint2D& p1 = points1[row];
00036 const HomgPoint2D& p2 = points2[row];
00037
00038 vnl_matrix<double>& D = *this;
00039 D(row,0) = p1.x() * p2.x();
00040 D(row,1) = p1.y() * p2.x();
00041 D(row,2) = p1.w() * p2.x();
00042 D(row,3) = p1.x() * p2.y();
00043 D(row,4) = p1.y() * p2.y();
00044 D(row,5) = p1.w() * p2.y();
00045 D(row,6) = p1.x() * p2.w();
00046 D(row,7) = p1.y() * p2.w();
00047 D(row,8) = p1.w() * p2.w();
00048 }
00049 }
00050
00051 FDesignMatrix::FDesignMatrix(vcl_vector<vgl_homg_point_2d<double> > const& points1,
00052 vcl_vector<vgl_homg_point_2d<double> > const& points2):
00053 base(points1.size(), 9)
00054 {
00055 unsigned int n = points1.size();
00056 for (unsigned int row = 0; row < n; ++row) {
00057 const vgl_homg_point_2d<double>& p1 = points1[row];
00058 const vgl_homg_point_2d<double>& p2 = points2[row];
00059
00060 vnl_matrix<double>& D = *this;
00061 D(row,0) = p1.x() * p2.x();
00062 D(row,1) = p1.y() * p2.x();
00063 D(row,2) = p1.w() * p2.x();
00064 D(row,3) = p1.x() * p2.y();
00065 D(row,4) = p1.y() * p2.y();
00066 D(row,5) = p1.w() * p2.y();
00067 D(row,6) = p1.x() * p2.w();
00068 D(row,7) = p1.y() * p2.w();
00069 D(row,8) = p1.w() * p2.w();
00070 }
00071 }