vpgl_ortho_procrustes.h
Go to the documentation of this file.
1 // This is core/vpgl/algo/vpgl_ortho_procrustes.h
2 #ifndef vpgl_ortho_procrustes_h_
3 #define vpgl_ortho_procrustes_h_
4 //:
5 // \file
6 // \brief 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 is a translation vector.
7 // \author J. L. Mundy
8 // \date June 29, 2007
9 //
10 
11 #include <vnl/vnl_fwd.h>
13 
14 //: Solve orthogonal Procrustes problem
15 // Solve the orthogonal Procrustes problem by finding a rotation matrix, R,
16 // scale factor, s, and translation vector, t, that minimizes the distance
17 // between two pointsets, X and Y, where Y is transformed to produce X.
19 {
20  public:
21  //: only one constructor X and Y must both have dimensions 3 x N
23  vnl_matrix<double> const& Y);
24 
25  //: the resulting rotation matrix
27 
28  //: the resulting translation vector
30 
31  //: The scale factor, s
32  double s();
33 
34  //: the residual error
35  double residual_mean_sq_error();
36 
37  //: successful computation
38  bool compute_ok() const { return !cannot_compute_; }
39 
40  protected:
41  //: No default constructor
43  void compute();
44 
45  //: members
47  bool computed_;
52  double s_;
53  double residual_;
54 };
55 
56 #endif // vpgl_ortho_procrustes_h_
vnl_matrix< double > Y_
vnl_vector_fixed< double, 3 > t()
the resulting translation vector.
vpgl_ortho_procrustes()
No default constructor.
vnl_matrix< double > X_
vgl_rotation_3d< double > R_
bool compute_ok() const
successful computation.
double residual_mean_sq_error()
the residual error.
vnl_vector_fixed< double, 3 > t_
Solve orthogonal Procrustes problem.
vgl_rotation_3d< double > R()
the resulting rotation matrix.
double s()
The scale factor, s.