contrib/mul/m23d/m23d_pure_ortho_projection.cxx
Go to the documentation of this file.
00001 #include "m23d_pure_ortho_projection.h"
00002 //:
00003 // \file
00004 // \author Tim Cootes
00005 // \brief Extracts pure rotation/projection component of 2x3 projection matrix P
00006 
00007 #include <vnl/algo/vnl_svd.h>
00008 
00009 //: Extracts pure rotation/projection component of 2x3 projection matrix P
00010 // Resulting 2x3 applies only rotation/projection, no scaling.
00011 // However, it may include a reflection.
00012 vnl_matrix<double> m23d_pure_ortho_projection(const vnl_matrix<double>& P)
00013 {
00014   vnl_svd<double> svd(P.transpose());
00015   return svd.V()*svd.U().transpose();  // Remove effect of singular values
00016 }