Public Member Functions | Static Public Member Functions | Protected Attributes | Friends
FMatrixAffine Class Reference

#include <FMatrixAffine.h>

Inheritance diagram for FMatrixAffine:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FMatrixAffine ()
 Constructor.
 ~FMatrixAffine ()
 Destructor.
bool set (const double *f_matrix)
 Set the fundamental matrix using the two-dimensional (C-storage) array f_matrix.
bool set (vnl_matrix< double > const &f_matrix)
 Set the fundamental matrix using the vnl_matrix f_matrix.
HomgLine2D image1_epipolar_line (const HomgPoint2D &x2) const
 Return the epipolar line $l_1$ in image 1: $l_1 = F^ x_2$.
vgl_homg_line_2d< double > image1_epipolar_line (vgl_homg_point_2d< double > const &x2) const
 Return the epipolar line $l_1$ in image 1: $l_1 = F^ x_2$.
HomgLine2D image2_epipolar_line (const HomgPoint2D &x1) const
 Return the epipolar line $l_2$ in image 2: $l_2 = F x_1$.
vgl_homg_line_2d< double > image2_epipolar_line (vgl_homg_point_2d< double > const &x1) const
 Return the epipolar line $l_2$ in image 2: $l_2 = F x_1$.
double image1_epipolar_distance_squared (HomgPoint2D *point1_ptr, HomgPoint2D *point2_ptr) const
double image1_epipolar_distance_squared (vgl_homg_point_2d< double > const &p1, vgl_homg_point_2d< double > const &p2) const
double image2_epipolar_distance_squared (HomgPoint2D *point1_ptr, HomgPoint2D *point2_ptr) const
double image2_epipolar_distance_squared (vgl_homg_point_2d< double > const &p1, vgl_homg_point_2d< double > const &p2) const
void set_rank2_using_svd ()
 Ensure the current Fundamental matrix is rank 2.
FMatrix get_rank2_truncated ()
FMatrix transpose () const
 Return an FMatrix which corresponds to the reverse of this one.
bool get_epipoles (HomgPoint2D *e1_out, HomgPoint2D *e2_out) const
 Compute the epipoles (left and right nullspaces of F) using vnl_svd<double>.
bool get_epipoles (vgl_homg_point_2d< double > &e1_out, vgl_homg_point_2d< double > &e2_out) const
 Compute the epipoles (left and right nullspaces of F) using vnl_svd<double>.
void decompose_to_skew_rank3 (vnl_matrix< double > *skew, vnl_matrix< double > *rank3) const
 Decompose F to the product of a skew-symmetric matrix and a rank 3 matrix.
void find_nearest_perfect_match (const HomgPoint2D &in1, const HomgPoint2D &in2, HomgPoint2D *out1, HomgPoint2D *out2) const
 Find nearest match which agrees with F.
void find_nearest_perfect_match (vgl_homg_point_2d< double > const &in1, vgl_homg_point_2d< double > const &in2, vgl_homg_point_2d< double > &out1, vgl_homg_point_2d< double > &out2) const
 Find nearest match which agrees with F.
void find_nearest_perfect_match (const HomgPoint2D &in1, const HomgPoint2D &in2, const HomgPoint2D &e1, const HomgPoint2D &e2, HomgPoint2D *out1, HomgPoint2D *out2) const
 Faster Hartley-Sturm using precomputed epipoles.
void find_nearest_perfect_match (vgl_homg_point_2d< double > const &in1, vgl_homg_point_2d< double > const &in2, vgl_homg_point_2d< double > const &e1, vgl_homg_point_2d< double > const &e2, vgl_homg_point_2d< double > &out1, vgl_homg_point_2d< double > &out2) const
 Faster Hartley-Sturm using precomputed epipoles.
void compute_P_matrix (vnl_matrix< double > &P2) const
void compute_P_matrix (PMatrix &P2) const
void compute_P_matrix (vgl_p_matrix< double > &P2) const
double get (unsigned int row_index, unsigned int col_index) const
 Return the element of the matrix at the specified indices (zero-based).
void get (double *f_matrix) const
 Copy the fundamental matrix into a 2D array of doubles for `C' compatibility.
void get (vnl_matrix< double > *f_matrix) const
 Copy the fundamental matrix into a vnl_matrix<double>.
virtual bool set (const vnl_double_3x3 &f_matrix)
 Set the fundamental matrix using the vnl_matrix_fixed<double,3,3> f_matrix.
void set (const PMatrix &P1, const PMatrix &P2)
 Set from two P matrices.
void set (const PMatrix &P2)
 Set from one P matrix, the second. The first is assumed to be [I O].
void set (const FMatrix &)
 Set from another FMatrix: this is just the assignment operator.
const vnl_double_3x3get_matrix () const
 Return a const reference to the internal 3x3 matrix.
const vnl_double_3x3get_transpose_matrix () const
 Return a const reference to the transpose of the internal 3x3 matrix.
bool get_rank2_flag (void) const
 Return the rank2_flag_.
void set_rank2_flag (bool rank2_flag)
 Set the rank2_flag_.
bool read_ascii (vcl_istream &f)
 Read from ASCII vcl_istream.

Static Public Member Functions

static FMatrix read (char const *filename)
static FMatrix read (vcl_istream &s)
 Read from ASCII vcl_istream.

Protected Attributes

vnl_double_3x3 f_matrix_
vnl_double_3x3 ft_matrix_
bool rank2_flag_

Friends

vcl_ostream & operator<< (vcl_ostream &s, const FMatrix &F)
 Print to vcl_ostream.
vcl_istream & operator>> (vcl_istream &s, FMatrix &F)
 Read from ASCII vcl_istream.

Detailed Description

Definition at line 20 of file FMatrixAffine.h.


Constructor & Destructor Documentation

FMatrixAffine::FMatrixAffine ( )

Constructor.

Definition at line 14 of file FMatrixAffine.cxx.

FMatrixAffine::~FMatrixAffine ( )

Destructor.

Definition at line 21 of file FMatrixAffine.cxx.


Member Function Documentation

void FMatrix::compute_P_matrix ( vnl_matrix< double > &  P2) const [inherited]

Definition at line 561 of file FMatrix.cxx.

void FMatrix::compute_P_matrix ( PMatrix P2) const [inline, inherited]

Definition at line 99 of file FMatrix.h.

void FMatrix::compute_P_matrix ( vgl_p_matrix< double > &  P2) const [inline, inherited]

Definition at line 104 of file FMatrix.h.

void FMatrix::decompose_to_skew_rank3 ( vnl_matrix< double > *  skew,
vnl_matrix< double > *  rank3 
) const [inherited]

Decompose F to the product of a skew-symmetric matrix and a rank 3 matrix.

Reimplemented in FMatrixSkew.

Definition at line 597 of file FMatrix.cxx.

void FMatrix::find_nearest_perfect_match ( const HomgPoint2D point1,
const HomgPoint2D point2,
HomgPoint2D perfect_point1_ptr,
HomgPoint2D perfect_point2_ptr 
) const [inherited]

Find nearest match which agrees with F.

For a specified pair of matching points, find the nearest (minimum sum of squared image distances) match which is in perfect agreement with the epipolar geometry of the F matrix. (see R.I. Hartley and P. Sturm, ``Triangulation''. In {Proceedings, Computer Analysis of Images and Patterns}, Prague, 1995).

Reimplemented in FMatrixSkew, and FMatrixPlanar.

Definition at line 313 of file FMatrix.cxx.

void FMatrix::find_nearest_perfect_match ( vgl_homg_point_2d< double > const &  point1,
vgl_homg_point_2d< double > const &  point2,
vgl_homg_point_2d< double > &  perfect_point1,
vgl_homg_point_2d< double > &  perfect_point2 
) const [inherited]

Find nearest match which agrees with F.

For a specified pair of matching points, find the nearest (minimum sum of squared image distances) match which is in perfect agreement with the epipolar geometry of the F matrix. (see R.I. Hartley and P. Sturm, ``Triangulation''. In {Proceedings, Computer Analysis of Images and Patterns}, Prague, 1995).

Reimplemented in FMatrixSkew, and FMatrixPlanar.

Definition at line 291 of file FMatrix.cxx.

void FMatrix::find_nearest_perfect_match ( const HomgPoint2D in1,
const HomgPoint2D in2,
const HomgPoint2D e1,
const HomgPoint2D e2,
HomgPoint2D out1,
HomgPoint2D out2 
) const [inherited]

Faster Hartley-Sturm using precomputed epipoles.

Definition at line 441 of file FMatrix.cxx.

void FMatrix::find_nearest_perfect_match ( vgl_homg_point_2d< double > const &  in1,
vgl_homg_point_2d< double > const &  in2,
vgl_homg_point_2d< double > const &  e1,
vgl_homg_point_2d< double > const &  e2,
vgl_homg_point_2d< double > &  out1,
vgl_homg_point_2d< double > &  out2 
) const [inherited]

Faster Hartley-Sturm using precomputed epipoles.

Definition at line 326 of file FMatrix.cxx.

double FMatrix::get ( unsigned int  row_index,
unsigned int  col_index 
) const [inherited]

Return the element of the matrix at the specified indices (zero-based).

Definition at line 607 of file FMatrix.cxx.

void FMatrix::get ( double *  f_matrix) const [inherited]

Copy the fundamental matrix into a 2D array of doubles for `C' compatibility.

Definition at line 616 of file FMatrix.cxx.

void FMatrix::get ( vnl_matrix< double > *  f_matrix) const [inherited]

Copy the fundamental matrix into a vnl_matrix<double>.

Definition at line 626 of file FMatrix.cxx.

bool FMatrix::get_epipoles ( HomgPoint2D epipole1_ptr,
HomgPoint2D epipole2_ptr 
) const [inherited]

Compute the epipoles (left and right nullspaces of F) using vnl_svd<double>.

Return false if the rank of F is not 2, and set approximate epipoles, (the left and right singular vectors corresponding to the smallest singular value of F).

Reimplemented in FMatrixSkew.

Definition at line 270 of file FMatrix.cxx.

bool FMatrix::get_epipoles ( vgl_homg_point_2d< double > &  epipole1,
vgl_homg_point_2d< double > &  epipole2 
) const [inherited]

Compute the epipoles (left and right nullspaces of F) using vnl_svd<double>.

Return false if the rank of F is not 2, and set approximate epipoles, (the left and right singular vectors corresponding to the smallest singular value of F).

Reimplemented in FMatrixSkew.

Definition at line 252 of file FMatrix.cxx.

const vnl_double_3x3& FMatrix::get_matrix ( ) const [inline, inherited]

Return a const reference to the internal 3x3 matrix.

Definition at line 124 of file FMatrix.h.

bool FMatrix::get_rank2_flag ( void  ) const [inherited]

Return the rank2_flag_.

Reimplemented in FMatrixSkew, and FMatrixPlanar.

Definition at line 635 of file FMatrix.cxx.

FMatrix FMatrix::get_rank2_truncated ( ) [inherited]

Reimplemented in FMatrixPlanar, and FMatrixSkew.

const vnl_double_3x3& FMatrix::get_transpose_matrix ( ) const [inline, inherited]

Return a const reference to the transpose of the internal 3x3 matrix.

Definition at line 127 of file FMatrix.h.

double FMatrix::image1_epipolar_distance_squared ( HomgPoint2D point1_ptr,
HomgPoint2D point2_ptr 
) const [inherited]

Definition at line 191 of file FMatrix.cxx.

double FMatrix::image1_epipolar_distance_squared ( vgl_homg_point_2d< double > const &  p1,
vgl_homg_point_2d< double > const &  p2 
) const [inherited]

Definition at line 178 of file FMatrix.cxx.

HomgLine2D FMatrix::image1_epipolar_line ( const HomgPoint2D x2) const [inherited]

Return the epipolar line $l_1$ in image 1: $l_1 = F^ x_2$.

Definition at line 148 of file FMatrix.cxx.

vgl_homg_line_2d< double > FMatrix::image1_epipolar_line ( vgl_homg_point_2d< double > const &  x2) const [inherited]

Return the epipolar line $l_1$ in image 1: $l_1 = F^ x_2$.

Definition at line 139 of file FMatrix.cxx.

double FMatrix::image2_epipolar_distance_squared ( HomgPoint2D point1_ptr,
HomgPoint2D point2_ptr 
) const [inherited]

Definition at line 217 of file FMatrix.cxx.

double FMatrix::image2_epipolar_distance_squared ( vgl_homg_point_2d< double > const &  p1,
vgl_homg_point_2d< double > const &  p2 
) const [inherited]

Definition at line 204 of file FMatrix.cxx.

HomgLine2D FMatrix::image2_epipolar_line ( const HomgPoint2D x1) const [inherited]

Return the epipolar line $l_2$ in image 2: $l_2 = F x_1$.

Definition at line 167 of file FMatrix.cxx.

vgl_homg_line_2d< double > FMatrix::image2_epipolar_line ( vgl_homg_point_2d< double > const &  x1) const [inherited]

Return the epipolar line $l_2$ in image 2: $l_2 = F x_1$.

Definition at line 157 of file FMatrix.cxx.

FMatrix FMatrix::read ( char const *  filename) [static, inherited]

Definition at line 110 of file FMatrix.cxx.

FMatrix FMatrix::read ( vcl_istream &  s) [static, inherited]

Read from ASCII vcl_istream.

Definition at line 129 of file FMatrix.cxx.

bool FMatrix::read_ascii ( vcl_istream &  f) [inherited]

Read from ASCII vcl_istream.

Definition at line 97 of file FMatrix.cxx.

bool FMatrixAffine::set ( const double *  f_matrix) [virtual]

Set the fundamental matrix using the two-dimensional (C-storage) array f_matrix.

Only returns true if f_matrix contained a Fundamental matrix in the affine form, and not an approximation to one. Otherwise returns false and the matrix is not set. f_matrix must be 3x3, i.e., must contain 9 elements.

Reimplemented from FMatrix.

Definition at line 53 of file FMatrixAffine.cxx.

bool FMatrixAffine::set ( vnl_matrix< double > const &  f_matrix)

Set the fundamental matrix using the vnl_matrix f_matrix.

Only returns true if f_matrix contained a Fundamental matrix in the affine form, and not an approximation to one. Otherwise returns false and the matrix is not set. f_matrix must be 3x3.

Definition at line 33 of file FMatrixAffine.cxx.

bool FMatrix::set ( const vnl_double_3x3 f_matrix) [virtual, inherited]

Set the fundamental matrix using the vnl_matrix_fixed<double,3,3> f_matrix.

Always returns true for the base class - showing the set was a success. When overridden by derived classes it may return false, to indicate that the matrix violates the constraints imposed by the derived classes.

Reimplemented in FMatrixPlanar.

Definition at line 675 of file FMatrix.cxx.

void FMatrix::set ( const PMatrix P1,
const PMatrix P2 
) [inherited]

Set from two P matrices.

Definition at line 684 of file FMatrix.cxx.

void FMatrix::set ( const PMatrix P2) [inherited]

Set from one P matrix, the second. The first is assumed to be [I O].

Definition at line 694 of file FMatrix.cxx.

void FMatrix::set ( const FMatrix F) [inherited]

Set from another FMatrix: this is just the assignment operator.

Definition at line 706 of file FMatrix.cxx.

void FMatrix::set_rank2_flag ( bool  rank2_flag) [inherited]

Set the rank2_flag_.

Reimplemented in FMatrixSkew.

Definition at line 643 of file FMatrix.cxx.

void FMatrix::set_rank2_using_svd ( void  ) [inherited]

Ensure the current Fundamental matrix is rank 2.

Does this by taking its vnl_svd<double>, setting the smallest singular value to zero, and recomposing. Sets the rank2_flag_ to true.

Reimplemented in FMatrixPlanar, and FMatrixSkew.

Definition at line 582 of file FMatrix.cxx.

FMatrix FMatrix::transpose ( ) const [inherited]

Return an FMatrix which corresponds to the reverse of this one.

Definition at line 241 of file FMatrix.cxx.


Friends And Related Function Documentation

vcl_ostream& operator<< ( vcl_ostream &  s,
const FMatrix F 
) [friend, inherited]

Print to vcl_ostream.

Definition at line 226 of file FMatrix.cxx.

vcl_istream& operator>> ( vcl_istream &  s,
FMatrix F 
) [friend, inherited]

Read from ASCII vcl_istream.

Definition at line 121 of file FMatrix.cxx.


Member Data Documentation

vnl_double_3x3 FMatrix::f_matrix_ [protected, inherited]

Definition at line 144 of file FMatrix.h.

vnl_double_3x3 FMatrix::ft_matrix_ [protected, inherited]

Definition at line 147 of file FMatrix.h.

bool FMatrix::rank2_flag_ [protected, inherited]

Definition at line 151 of file FMatrix.h.


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