vpgl_affine_fundamental_matrix.hxx
Go to the documentation of this file.
1 // This is core/vpgl/vpgl_affine_fundamental_matrix.hxx
2 #ifndef vpgl_affine_fundamental_matrix_hxx_
3 #define vpgl_affine_fundamental_matrix_hxx_
4 //:
5 // \file
6 
8 //
9 #include <vnl/vnl_matrix_fixed.h>
10 
11 //---------------------------------
12 template <class T>
15 {
16  vnl_matrix_fixed<T,3,3> default_matrix( (T)0 );
17  default_matrix(0,1) = default_matrix(0,2) = (T)1;
18  default_matrix(1,0) = default_matrix(2,0) = -(T)1;
20 }
21 
22 
23 //---------------------------------
24 template <class T>
26  const vpgl_fundamental_matrix<T>& fm )
27 {
28  set_from_params( fm.get_matrix()(2,0), fm.get_matrix()(2,1), fm.get_matrix()(2,2),
29  fm.get_matrix()(1,2), fm.get_matrix()(0,2) );
30 }
31 
32 
33 //---------------------------------
34 template <class T>
36 {
37  vnl_matrix_fixed<T,3,3> fm( (T)0 );
38  fm.put( 2, 0, a );
39  fm.put( 2, 1, b );
40  fm.put( 2, 2, c );
41  fm.put( 1, 2, d );
42  fm.put( 0, 2, e );
44 };
45 
46 
47 // Code for easy instantiation.
48 #undef vpgl_AFFINE_FUNDAMENTAL_MATRIX_INSTANTIATE
49 #define vpgl_AFFINE_FUNDAMENTAL_MATRIX_INSTANTIATE(T) \
50 template class vpgl_affine_fundamental_matrix<T >
51 
52 #endif // vpgl_affine_fundamental_matrix_hxx_
vpgl_affine_fundamental_matrix()
Default constructor creates dummy matrix.
void put(unsigned r, unsigned c, T const &v)
void set_from_params(T a, T b, T c, T d, T e)
Form the matrix from its free parameters.
A class for the fundamental matrix between two affine cameras.
const vnl_matrix_fixed< T, 3, 3 > & get_matrix() const
Get a copy of the FM in vnl form.
void set_matrix(const vpgl_proj_camera< T > &cr, const vpgl_proj_camera< T > &cl)