15 : cannot_compute_(false), computed_(false), s_(1.0), residual_(0)
19 std::cout <<
"Fatal error in vpgl_ortho_procrustes - unmatched pointsets\n";
32 for (
unsigned c = 0; c<N; ++c)
35 for (
unsigned r = 0; r<3; ++r)
46 for (
unsigned c = 0; c<N; ++c)
49 for (
unsigned r = 0; r<3; ++r)
51 Xm[r][c] =
X_[r][c]-Cx[r];
52 Ym[r][c] =
Y_[r][c]-Cy[r];
60 auto neu = vnl_trace<double, 3, 3>(Xm*(Xm.transpose()));
61 auto den = vnl_trace<double, 3, 3>(Ym*(Ym.
transpose()));
63 s_ = std::sqrt(neu/den);
66 double sigma_x = std::sqrt(smx/N), sigma_y = std::sqrt(smy/N);
81 T[2][2]=vnl_det<double>(temp);
89 t_ = (1.0/
s_)*Cx - rr*Cy;
92 for (
unsigned c = 0; c<N; ++c)
95 for (
unsigned r = 0; r<3; ++r)
100 diff =
s_*(rr*y +
t_) - x;
vnl_matrix_ref< T > as_ref()
vnl_vector_fixed< double, 3 > t()
the resulting translation vector.
vnl_matrix< double > transpose() const
vpgl_ortho_procrustes()
No default constructor.
bool cannot_compute_
members.
vnl_vector_fixed & fill(T const &v)
vgl_rotation_3d< double > R_
abs_t squared_magnitude() const
VNL_EXPORT T vnl_det(T const *row0, T const *row1)
vnl_matrix_fixed & fill(T)
double residual_mean_sq_error()
the residual error.
unsigned int rows() const
vnl_vector_fixed< double, 3 > t_
vgl_rotation_3d< double > R()
the resulting rotation matrix.
unsigned int columns() const
Solve min(R,s) ||X-s(RY+t)||, where R is a rotation matrix, X,Y are 3-d points, s is a scalar and t i...
double s()
The scale factor, s.