5 # include <vcl_msvc_warnings.h> 7 #include <vnl/algo/vnl_svd.h> 20 unsigned N=P.size(); assert(N==Q.size());
21 vnl_matrix<double> D(N,4);
22 for (
unsigned i=0;i<N;i++) {
23 D(i,0)=P[i].x()*Q[i].w();
24 D(i,1)=P[i].w()*Q[i].w();
25 D(i,2)=-P[i].x()*Q[i].x();
26 D(i,3)=-P[i].w()*Q[i].x();
28 vnl_svd<double> svd(D);
29 M.
set(svd.nullvector().data_block());
A class to hold a line-to-line projective transformation matrix and to perform common operations usin...
bool compute_cool_homg(const std::vector< vgl_homg_point_1d< double > > &points1, const std::vector< vgl_homg_point_1d< double > > &points2, vgl_h_matrix_1d< double > &H) override
vgl_h_matrix_1d & set(T const *M)
Set to 2x2 row-stored matrix.
find line-to-line projectivity from a set of matched points using SVD
Represents a homogeneous 1-D point, i.e., a homogeneous pair (x,w).