vpgl_essential_matrix.h
Go to the documentation of this file.
1 // This is core/vpgl/vpgl_essential_matrix.h
2 #ifndef vpgl_essential_matrix_h_
3 #define vpgl_essential_matrix_h_
4 //:
5 // \file
6 // \brief A class for the essential matrix between two projective cameras.
7 // \author Joseph Mundy
8 // \date February 28, 2007
9 //
10 // The essential matrix is related to the fundamental matrix by
11 // $E = [K_{left}]^t [F] [K_{right}]$
12 // The notation "left" and "right" refers to camera producing points used
13 // on the left side of the F or E matrix and vice versa.
14 // Note: the extract left camera function requires points be transformed to
15 // the camera focal plane. That is, e.g.,
16 // left_coor(in camera focal plane coordinates) =
17 // $[K_{left}]^{-1} p_{left}$ (in image coordinates).
18 #include <iosfwd>
19 #include <vnl/vnl_fwd.h>
20 #include <vnl/vnl_matrix_fixed.h>
21 #include <vgl/vgl_fwd.h>
22 #ifdef _MSC_VER
23 # include <vcl_msvc_warnings.h>
24 #endif
25 
29 
30 
31 template <class T>
33 {
34  public:
35  // Constructors:----------------------
36 
37  //: Default constructor creates dummy rank 2 matrix.
39 
40  //: construct from a fundamental matrix and left and right calibration matrices
42  const vpgl_calibration_matrix<T>& K_left,
43  const vpgl_calibration_matrix<T>& K_right);
44 
45 
46  //: Main constructor takes two perspective cameras.
47  // The RHS of the essential matrix will correspond to cr and the LHS to cl.
49  const vpgl_perspective_camera<T>& cl );
50 
51  //: Construct from an essential matrix in vnl form.
53 
54  //: Copy Constructor
56 
57  //: Assignment
59 
60  //: Destructor
61  ~vpgl_essential_matrix() override;
62 };
63 
64 //Public functions
65 //: Left camera extractor. Normalized correspondence pair is needed to determine which of four solutions should be used, i.e. focal plane coordinates
66 // The translation part of the camera is normalized to the indicated magnitude.
67 template <class T>
69  const vgl_point_2d<T>& left_corr,//focal plane coordinates
70  const vgl_point_2d<T>& right_corr,//focal plane coordinates
72  const T translation_mag = (T)1);
73 
74 //:vpgl_essential_matrix stream I/O
75 
76 template <class T>
77 std::ostream& operator<<(std::ostream& s, vpgl_essential_matrix<T> const& p);
78 
79 //: Read vpgl_perspective_camera from stream
80 template <class T>
81 std::istream& operator>>(std::istream& s, vpgl_essential_matrix<T>& p);
82 
83 #endif // vpgl_essential_matrix_h_
A class for the perspective camera model.
A class for the fundamental matrix between two projective cameras.
std::istream & operator>>(std::istream &is, vpgl_local_rational_camera< T > &p)
Read from stream.
vpgl_essential_matrix(const vnl_matrix_fixed< T, 3, 3 > &E)
Construct from an essential matrix in vnl form.
A class representing the "K" matrix of a perspective camera matrix as described in.
const vpgl_essential_matrix< T > & operator=(const vpgl_essential_matrix< T > &em)
Assignment.
bool extract_left_camera(const vpgl_essential_matrix< T > &E, const vgl_point_2d< T > &left_corr, const vgl_point_2d< T > &right_corr, vpgl_perspective_camera< T > &p_left, const T translation_mag=(T) 1)
Left camera extractor. Normalized correspondence pair is needed to determine which of four solutions ...
std::ostream & operator<<(std::ostream &s, const vpgl_local_rational_camera< T > &p)
Write to stream.
This class implements the perspective camera class as described in Hartley & Zisserman as a finite ca...
vpgl_essential_matrix()
Default constructor creates dummy rank 2 matrix.
~vpgl_essential_matrix() override
Destructor.
A class for the calibration matrix component of a perspective camera matrix.