contrib/mul/m23d/m23d_select_basis_views.h
Go to the documentation of this file.
00001 //:
00002 // \file
00003 // \author Tim Cootes
00004 // \brief Select a subset most suitable for use as a basis set
00005 
00006 #ifndef m23d_select_basis_views_h_
00007 #define m23d_select_basis_views_h_
00008 
00009 #include <vnl/vnl_matrix.h>
00010 #include <vcl_vector.h>
00011 
00012 //: Select a subset most suitable for use as a basis set
00013 //  Data matrix is 2ns x np (ns= number of samples, np = number of points)
00014 //  Each two rows gives the points in a single view.
00015 //  This returns a list of point indices for views which have most
00016 //  independent points, and are thus suitable for defining the basis.
00017 //  Randomly generates n_tries possible bases and selects the best.
00018 //  Note: First view (1st two rows) always included, as this often defines
00019 //  the default viewing angle.
00020 vcl_vector<unsigned> m23d_select_basis_views(const vnl_matrix<double>& P2D,
00021                                              unsigned n_modes,
00022                                              unsigned n_tries=1000);
00023 
00024 //: Evaluate quality of a basis set
00025 //  Data matrix is 2ns x np (ns= number of samples, np = number of points)
00026 //  Each two rows gives the points in a single view.
00027 //  Form a basis from the pairs of rows defined by selected, and compute
00028 //  a measure of how independent the rows are - the smallest SV/largest SV
00029 double m23d_evaluate_basis(const vnl_matrix<double>& P2D,
00030                            const vcl_vector<unsigned>& selected);
00031 
00032 #endif // m23d_select_basis_views_h_
00033