2 #ifndef vpgl_essential_matrix_hxx_ 3 #define vpgl_essential_matrix_hxx_ 18 # include <vcl_msvc_warnings.h> 53 this->set_matrix(crc, clc);
90 const T translation_mag )
96 W[0][0]=0; W[0][1]=-1;W[0][2]=0;
97 W[1][0]=1; W[1][1]=0; W[1][2]=0;
98 W[2][0]=0; W[2][1]=0; W[2][2]=1;
106 for (
int c = 0; c < 4; c++ )
124 if ( vnl_det<T>( R ) < 0 ) R = -R ;
135 vgl_point_3d<T> p3d = triangulate_3d_point<T>(ppl, left_corr, ppr, right_corr );
140 std::cerr <<
"ERROR: extract_left_camera in vpgl_essential_matrix failed.\n";
166 #undef vpgl_ESSENTIAL_MATRIX_INSTANTIATE 167 #define vpgl_ESSENTIAL_MATRIX_INSTANTIATE(T) \ 168 template class vpgl_essential_matrix<T >; \ 169 template bool extract_left_camera(const vpgl_essential_matrix<T >& E, \ 170 const vgl_point_2d<T >& left_corr, \ 171 const vgl_point_2d<T >& right_corr, \ 172 vpgl_perspective_camera<T >& p_left, \ 173 const T translation_mag); \ 174 template std::ostream& operator<<(std::ostream&, const vpgl_essential_matrix<T >&); \ 175 template std::istream& operator>>(std::istream&, vpgl_essential_matrix<T >&) 178 #endif // vpgl_essential_matrix_hxx_ A class for the essential matrix between two projective cameras.
vnl_matrix_ref< T > as_ref()
void set_rotation(const vgl_rotation_3d< T > &R)
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)
Left camera extractor. Normalized correspondence pair is needed to determine which of four solutions ...
std::istream & operator>>(std::istream &is, vpgl_local_rational_camera< T > &p)
Read from stream.
A class representing the "K" matrix of a perspective camera matrix as described in.
void set_camera_center(const vgl_point_3d< T > &camera_center)
const vpgl_essential_matrix< T > & operator=(const vpgl_essential_matrix< T > &em)
Assignment.
void set_calibration(const vpgl_calibration_matrix< T > &K)
Setters and getters.
vnl_matrix_fixed< T, num_cols, num_rows > transpose() const
vnl_matrix_fixed< T, 3, 3 > F_
Internal representation of the fundamental matrix.
vnl_matrix_fixed< T, 3, 3 > get_matrix() const
Get the calibration matrix.
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...
A camera model using the standard 3x4 matrix representation.
bool is_behind_camera(const vgl_homg_point_3d< T > &world_point) const
Determine whether the given point lies in front of the principal plane.
vpgl_essential_matrix()
Default constructor creates dummy rank 2 matrix.
~vpgl_essential_matrix() override
Destructor.
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)