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

#include <FMatrixPlanar.h>

Inheritance diagram for FMatrixPlanar:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FMatrixPlanar ()
 Default constructor.
 FMatrixPlanar (const double *f_matrix)
 Constructor.
 FMatrixPlanar (const vnl_double_3x3 &f_matrix)
 Constructor.
 ~FMatrixPlanar ()
 Destructor.
void init (const FMatrix &F)
 Initialises the FMatrixPlanar using a general fundamental matrix F.
void set_rank2_using_svd ()
 Null function since planar FMatrix has already rank 2.
FMatrixPlanar get_rank2_truncated ()
 Returns current matrix which is already Rank 2.
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.
bool set (const double *f_matrix)
 Set the fundamental matrix using the two-dimensional array f_matrix.
bool set (const vnl_double_3x3 &f_matrix)
 Set the fundamental matrix using the vnl_double_3x3 f_matrix.
bool get_rank2_flag (void) const
 Returns the rank2 flag which is always true for FMatrixPlanar.
void set_rank2_flag (bool) const
 Null function since planar FMatrix has already rank 2.
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
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, 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>.
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.
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 30 of file FMatrixPlanar.h.


Constructor & Destructor Documentation

FMatrixPlanar::FMatrixPlanar ( )

Default constructor.

Definition at line 25 of file FMatrixPlanar.cxx.

FMatrixPlanar::FMatrixPlanar ( const double *  f_matrix)

Constructor.

Definition at line 34 of file FMatrixPlanar.cxx.

FMatrixPlanar::FMatrixPlanar ( const vnl_double_3x3 f_matrix)

Constructor.

Definition at line 44 of file FMatrixPlanar.cxx.

FMatrixPlanar::~FMatrixPlanar ( )

Destructor.

Definition at line 55 of file FMatrixPlanar.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 FMatrixPlanar::find_nearest_perfect_match ( const HomgPoint2D point1,
const HomgPoint2D point2,
HomgPoint2D perfect_point1_ptr,
HomgPoint2D perfect_point2_ptr 
) const

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 from FMatrix.

void FMatrixPlanar::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

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 from FMatrix.

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 FMatrixPlanar::get_rank2_flag ( void  ) const [inline]

Returns the rank2 flag which is always true for FMatrixPlanar.

Reimplemented from FMatrix.

Definition at line 57 of file FMatrixPlanar.h.

FMatrixPlanar FMatrixPlanar::get_rank2_truncated ( ) [inline]

Returns current matrix which is already Rank 2.

Reimplemented from FMatrix.

Definition at line 44 of file FMatrixPlanar.h.

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.

void FMatrixPlanar::init ( const FMatrix F)

Initialises the FMatrixPlanar using a general fundamental matrix F.

Does so by finding the nearest planar fundamental matrix to F. This should be used prior to FMPlanarComputeNonLinear to give an initial value for the non-linear minimisation. This function is required as trying to set FMatrixPlanar using a general fundamental matrix will fail as it does not satisfy the extra constraint of $\det ({\tt F} + {\tt F}^\top) = 0$.

Definition at line 144 of file FMatrixPlanar.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 FMatrixPlanar::set ( const double *  f_matrix) [virtual]

Set the fundamental matrix using the two-dimensional array f_matrix.

Only returns true if f_matrix contained a planar matrix, not an approximation to one. Otherwise returns false and the matrix is not set. Patch on FMatrixSkew::set (const vnl_double_3x3& f_matrix ).

Reimplemented from FMatrix.

Definition at line 66 of file FMatrixPlanar.cxx.

bool FMatrixPlanar::set ( const vnl_double_3x3 f_matrix) [virtual]

Set the fundamental matrix using the vnl_double_3x3 f_matrix.

Only returns true if f_matrix contained a planar matrix, not an approximation to one. The test is against a Rank 2 constraint for both ${\tt F}$ and the symmetric part ({ F}+{ F}^). Otherwise returns false and the matrix is not set.

Reimplemented from FMatrix.

Definition at line 82 of file FMatrixPlanar.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 FMatrixPlanar::set_rank2_flag ( bool  ) const [inline]

Null function since planar FMatrix has already rank 2.

Definition at line 59 of file FMatrixPlanar.h.

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 FMatrixPlanar::set_rank2_using_svd ( void  ) [inline]

Null function since planar FMatrix has already rank 2.

Reimplemented from FMatrix.

Definition at line 42 of file FMatrixPlanar.h.

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: