Public Member Functions | Protected Member Functions | Protected Attributes
vpgl_em_compute_5_point< T > Class Template Reference

#include <vpgl_em_compute_5_point.h>

List of all members.

Public Member Functions

 vpgl_em_compute_5_point ()
 vpgl_em_compute_5_point (bool v)
 vpgl_em_compute_5_point (bool v, double t)
bool compute (const vcl_vector< vgl_point_2d< T > > &normed_right_points, const vcl_vector< vgl_point_2d< T > > &normed_left_points, vcl_vector< vpgl_essential_matrix< T > > &ems) const
 Compute from two sets of corresponding points.
bool compute (const vcl_vector< vgl_point_2d< T > > &right_points, const vpgl_calibration_matrix< T > &k_right, const vcl_vector< vgl_point_2d< T > > &left_points, const vpgl_calibration_matrix< T > &k_left, vcl_vector< vpgl_essential_matrix< T > > &ems) const

Protected Member Functions

void normalize (const vcl_vector< vgl_point_2d< T > > &points, const vpgl_calibration_matrix< T > &k, vcl_vector< vgl_point_2d< T > > &normed_points) const
 Normalization is the process of left-multiplying by the inverse of the calibration matrix.
void compute_nullspace_basis (const vcl_vector< vgl_point_2d< T > > &right_points, const vcl_vector< vgl_point_2d< T > > &left_points, vcl_vector< vnl_vector_fixed< T, 9 > > &basis) const
 Constructs the 5x9 epipolar constraint matrix based off the constraint that q1' * E * q2 = 0, and fills the vectors x, y, z and w with the nullspace basis for this matrix.
void compute_constraint_polynomials (const vcl_vector< vnl_vector_fixed< T, 9 > > &basis, vcl_vector< vnl_real_npolynomial > &constraints) const
 Finds 10 constraint polynomials, based on the following criteria: if X, Y, Z and W are the basis vectors, then E = xX + yY + zZ + wW for some scalars x, y, z, w.
void compute_groebner_basis (const vcl_vector< vnl_real_npolynomial > &constraints, vnl_matrix< double > &groebner_basis) const
void compute_action_matrix (const vnl_matrix< double > &groebner_basis, vnl_matrix< double > &action_matrix) const
void compute_e_matrices (const vcl_vector< vnl_vector_fixed< T, 9 > > &basis, const vnl_matrix< double > &action_matrix, vcl_vector< vpgl_essential_matrix< T > > &ems) const
double get_coeff (const vnl_real_npolynomial &p, unsigned int x_p, unsigned int y_p, unsigned int z_p) const
 Returns the coefficient of a term of a vnl_real_npolynomial in three variables with an x power of x_p, a y power of y_p and a z power of z_p.

Protected Attributes

const bool verbose
const double tolerance

Detailed Description

template<class T>
class vpgl_em_compute_5_point< T >

Definition at line 28 of file vpgl_em_compute_5_point.h.


Constructor & Destructor Documentation

template<class T>
vpgl_em_compute_5_point< T >::vpgl_em_compute_5_point ( ) [inline]

Definition at line 32 of file vpgl_em_compute_5_point.h.

template<class T>
vpgl_em_compute_5_point< T >::vpgl_em_compute_5_point ( bool  v) [inline]

Definition at line 33 of file vpgl_em_compute_5_point.h.

template<class T>
vpgl_em_compute_5_point< T >::vpgl_em_compute_5_point ( bool  v,
double  t 
) [inline]

Definition at line 34 of file vpgl_em_compute_5_point.h.


Member Function Documentation

template<class T >
bool vpgl_em_compute_5_point< T >::compute ( const vcl_vector< vgl_point_2d< T > > &  normed_right_points,
const vcl_vector< vgl_point_2d< T > > &  normed_left_points,
vcl_vector< vpgl_essential_matrix< T > > &  ems 
) const

Compute from two sets of corresponding points.

Puts the resulting matrix into em, returns true if successful. Each of right_points and left_points must contain exactly 5 points! This function returns a set of potential solutions, generally 10. Each of these solutions is appropriate to use as RANSAC hypthosis.

The points must be normalized!! Use the function below to avoid normalizing the points yourself.

Definition at line 36 of file vpgl_em_compute_5_point.txx.

template<class T >
bool vpgl_em_compute_5_point< T >::compute ( const vcl_vector< vgl_point_2d< T > > &  right_points,
const vpgl_calibration_matrix< T > &  k_right,
const vcl_vector< vgl_point_2d< T > > &  left_points,
const vpgl_calibration_matrix< T > &  k_left,
vcl_vector< vpgl_essential_matrix< T > > &  ems 
) const

Definition at line 19 of file vpgl_em_compute_5_point.txx.

template<class T >
void vpgl_em_compute_5_point< T >::compute_action_matrix ( const vnl_matrix< double > &  groebner_basis,
vnl_matrix< double > &  action_matrix 
) const [protected]

Definition at line 355 of file vpgl_em_compute_5_point.txx.

template<class T >
void vpgl_em_compute_5_point< T >::compute_constraint_polynomials ( const vcl_vector< vnl_vector_fixed< T, 9 > > &  basis,
vcl_vector< vnl_real_npolynomial > &  constraints 
) const [protected]

Finds 10 constraint polynomials, based on the following criteria: if X, Y, Z and W are the basis vectors, then E = xX + yY + zZ + wW for some scalars x, y, z, w.

Since these are unique up to a scale, we say w = 1;

Furthermore, det(E) = 0, and E*E'*E - .5 * trace(E*E') * E = 0. Substituting the original equation into all 10 of the equations generated by these two constraints gives us the constraint polynomials.

Definition at line 149 of file vpgl_em_compute_5_point.txx.

template<class T >
void vpgl_em_compute_5_point< T >::compute_e_matrices ( const vcl_vector< vnl_vector_fixed< T, 9 > > &  basis,
const vnl_matrix< double > &  action_matrix,
vcl_vector< vpgl_essential_matrix< T > > &  ems 
) const [protected]

Definition at line 378 of file vpgl_em_compute_5_point.txx.

template<class T >
void vpgl_em_compute_5_point< T >::compute_groebner_basis ( const vcl_vector< vnl_real_npolynomial > &  constraints,
vnl_matrix< double > &  groebner_basis 
) const [protected]

Definition at line 280 of file vpgl_em_compute_5_point.txx.

template<class T >
void vpgl_em_compute_5_point< T >::compute_nullspace_basis ( const vcl_vector< vgl_point_2d< T > > &  right_points,
const vcl_vector< vgl_point_2d< T > > &  left_points,
vcl_vector< vnl_vector_fixed< T, 9 > > &  basis 
) const [protected]

Constructs the 5x9 epipolar constraint matrix based off the constraint that q1' * E * q2 = 0, and fills the vectors x, y, z and w with the nullspace basis for this matrix.

Definition at line 99 of file vpgl_em_compute_5_point.txx.

template<class T >
double vpgl_em_compute_5_point< T >::get_coeff ( const vnl_real_npolynomial p,
unsigned int  x_p,
unsigned int  y_p,
unsigned int  z_p 
) const [protected]

Returns the coefficient of a term of a vnl_real_npolynomial in three variables with an x power of x_p, a y power of y_p and a z power of z_p.

Definition at line 263 of file vpgl_em_compute_5_point.txx.

template<class T >
void vpgl_em_compute_5_point< T >::normalize ( const vcl_vector< vgl_point_2d< T > > &  points,
const vpgl_calibration_matrix< T > &  k,
vcl_vector< vgl_point_2d< T > > &  normed_points 
) const [protected]

Normalization is the process of left-multiplying by the inverse of the calibration matrix.

Definition at line 81 of file vpgl_em_compute_5_point.txx.


Member Data Documentation

template<class T>
const double vpgl_em_compute_5_point< T >::tolerance [protected]

Definition at line 58 of file vpgl_em_compute_5_point.h.

template<class T>
const bool vpgl_em_compute_5_point< T >::verbose [protected]

Definition at line 57 of file vpgl_em_compute_5_point.h.


The documentation for this class was generated from the following files: