Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vpgl_em_compute_5_point< T > Class Template Reference

#include <vpgl_em_compute_5_point.h>

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 std::vector< vgl_point_2d< T > > &normed_right_points, const std::vector< vgl_point_2d< T > > &normed_left_points, std::vector< vpgl_essential_matrix< T > > &ems) const
 Compute from two sets of corresponding points. More...
 
bool compute (const std::vector< vgl_point_2d< T > > &right_points, const vpgl_calibration_matrix< T > &k_right, const std::vector< vgl_point_2d< T > > &left_points, const vpgl_calibration_matrix< T > &k_left, std::vector< vpgl_essential_matrix< T > > &ems) const
 

Protected Member Functions

void normalize (const std::vector< vgl_point_2d< T > > &points, const vpgl_calibration_matrix< T > &k, std::vector< vgl_point_2d< T > > &normed_points) const
 Normalization is the process of left-multiplying by the inverse of the calibration matrix. More...
 
void compute_nullspace_basis (const std::vector< vgl_point_2d< T > > &right_points, const std::vector< vgl_point_2d< T > > &left_points, std::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. More...
 
void compute_constraint_polynomials (const std::vector< vnl_vector_fixed< T, 9 > > &basis, std::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. More...
 
void compute_groebner_basis (const std::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 std::vector< vnl_vector_fixed< T, 9 > > &basis, const vnl_matrix< double > &action_matrix, std::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. More...
 

Protected Attributes

const bool verbose
 
const double tolerance
 

Detailed Description

template<class T>
class vpgl_em_compute_5_point< T >

Definition at line 31 of file vpgl_em_compute_5_point.h.

Constructor & Destructor Documentation

◆ vpgl_em_compute_5_point() [1/3]

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

Definition at line 35 of file vpgl_em_compute_5_point.h.

◆ vpgl_em_compute_5_point() [2/3]

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

Definition at line 36 of file vpgl_em_compute_5_point.h.

◆ vpgl_em_compute_5_point() [3/3]

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

Definition at line 37 of file vpgl_em_compute_5_point.h.

Member Function Documentation

◆ compute() [1/2]

template<class T >
bool vpgl_em_compute_5_point< T >::compute ( const std::vector< vgl_point_2d< T > > &  normed_right_points,
const std::vector< vgl_point_2d< T > > &  normed_left_points,
std::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 39 of file vpgl_em_compute_5_point.hxx.

◆ compute() [2/2]

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

Definition at line 22 of file vpgl_em_compute_5_point.hxx.

◆ compute_action_matrix()

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 358 of file vpgl_em_compute_5_point.hxx.

◆ compute_constraint_polynomials()

template<class T >
void vpgl_em_compute_5_point< T >::compute_constraint_polynomials ( const std::vector< vnl_vector_fixed< T, 9 > > &  basis,
std::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 152 of file vpgl_em_compute_5_point.hxx.

◆ compute_e_matrices()

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

Definition at line 381 of file vpgl_em_compute_5_point.hxx.

◆ compute_groebner_basis()

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

Definition at line 283 of file vpgl_em_compute_5_point.hxx.

◆ compute_nullspace_basis()

template<class T >
void vpgl_em_compute_5_point< T >::compute_nullspace_basis ( const std::vector< vgl_point_2d< T > > &  right_points,
const std::vector< vgl_point_2d< T > > &  left_points,
std::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 102 of file vpgl_em_compute_5_point.hxx.

◆ get_coeff()

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 266 of file vpgl_em_compute_5_point.hxx.

◆ normalize()

template<class T >
void vpgl_em_compute_5_point< T >::normalize ( const std::vector< vgl_point_2d< T > > &  points,
const vpgl_calibration_matrix< T > &  k,
std::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 84 of file vpgl_em_compute_5_point.hxx.

Member Data Documentation

◆ tolerance

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

Definition at line 61 of file vpgl_em_compute_5_point.h.

◆ verbose

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

Definition at line 60 of file vpgl_em_compute_5_point.h.


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