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

#include <FMatrixSkew.h>

Inheritance diagram for FMatrixSkew:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FMatrixSkew ()
 Default constructor.
 FMatrixSkew (const double *f_matrix)
 Constructor.
 FMatrixSkew (const vnl_matrix< double > &f_matrix)
 Constructor.
 ~FMatrixSkew ()
 Destructor.
void set_rank2_using_svd ()
 Null function as already Rank 2.
FMatrixSkew get_rank2_truncated ()
 Returns current matrix which is already Rank 2.
bool get_epipoles (HomgPoint2D *e1_out, HomgPoint2D *e2_out) const
 Compute the epipole which is the same in each image.
bool get_epipoles (vgl_homg_point_2d< double > &e1_out, vgl_homg_point_2d< double > &e2_out) const
 Compute the epipole which is the same in each image.
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 is in agreement 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 is in agreement with F.
bool set (const double *f_matrix)
 Set the fundamental matrix using the two-dimensional array f_matrix.
bool set (const vnl_matrix< double > &f_matrix)
 Set the fundamental matrix using the vnl_matrix<double> f_matrix.
bool get_rank2_flag (void) const
 Returns the rank2_flag_ which is always true for FMatrixSkew.
void set_rank2_flag (bool rank2_flag)
 Set the rank2_flag_. Null function as always set true.
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.
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 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 27 of file FMatrixSkew.h.


Constructor & Destructor Documentation

FMatrixSkew::FMatrixSkew ( )

Default constructor.

Definition at line 21 of file FMatrixSkew.cxx.

FMatrixSkew::FMatrixSkew ( const double *  f_matrix)

Constructor.

Definition at line 30 of file FMatrixSkew.cxx.

FMatrixSkew::FMatrixSkew ( const vnl_matrix< double > &  f_matrix)

Constructor.

Definition at line 40 of file FMatrixSkew.cxx.

FMatrixSkew::~FMatrixSkew ( )

Destructor.

Definition at line 51 of file FMatrixSkew.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 FMatrixSkew::decompose_to_skew_rank3 ( vnl_matrix< double > *  skew_matrix_ptr,
vnl_matrix< double > *  rank3_matrix_ptr 
) const

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

Actually returns current matrix and identity matrix.

Reimplemented from FMatrix.

Definition at line 101 of file FMatrixSkew.cxx.

void FMatrixSkew::find_nearest_perfect_match ( const HomgPoint2D point1,
const HomgPoint2D point2,
HomgPoint2D perfect_point1_ptr,
HomgPoint2D perfect_point2_ptr 
) const

Find nearest match which is in agreement 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. For skew symmetric matrix a reduced form with only a quadratic equation can be used (see Armstrong Zisserman Beardsley, BMVC 94 ).

Reimplemented from FMatrix.

Definition at line 210 of file FMatrixSkew.cxx.

void FMatrixSkew::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 is in agreement 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. For skew symmetric matrix a reduced form with only a quadratic equation can be used (see Armstrong Zisserman Beardsley, BMVC 94 ).

Reimplemented from FMatrix.

Definition at line 139 of file FMatrixSkew.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 FMatrixSkew::get_epipoles ( HomgPoint2D epipole1_ptr,
HomgPoint2D epipole2_ptr 
) const

Compute the epipole which is the same in each image.

Returns true as FMatrixSkew is always Rank 2.

Reimplemented from FMatrix.

Definition at line 82 of file FMatrixSkew.cxx.

bool FMatrixSkew::get_epipoles ( vgl_homg_point_2d< double > &  epipole1,
vgl_homg_point_2d< double > &  epipole2 
) const

Compute the epipole which is the same in each image.

Returns true as FMatrixSkew is always Rank 2.

Reimplemented from FMatrix.

Definition at line 62 of file FMatrixSkew.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 FMatrixSkew::get_rank2_flag ( void  ) const [inline]

Returns the rank2_flag_ which is always true for FMatrixSkew.

Reimplemented from FMatrix.

Definition at line 336 of file FMatrixSkew.cxx.

FMatrixSkew FMatrixSkew::get_rank2_truncated ( ) [inline]

Returns current matrix which is already Rank 2.

Reimplemented from FMatrix.

Definition at line 123 of file FMatrixSkew.cxx.

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 FMatrixSkew::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 skew matrix, not an approximation to one. The test is against a 0.0 tolerance. Otherwise returns false and the matrix is not set.

Reimplemented from FMatrix.

Definition at line 280 of file FMatrixSkew.cxx.

bool FMatrixSkew::set ( const vnl_matrix< double > &  f_matrix) [inline]

Set the fundamental matrix using the vnl_matrix<double> f_matrix.

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

Definition at line 325 of file FMatrixSkew.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 FMatrixSkew::set_rank2_flag ( bool  rank2_flag) [inline]

Set the rank2_flag_. Null function as always set true.

Reimplemented from FMatrix.

Definition at line 346 of file FMatrixSkew.cxx.

void FMatrixSkew::set_rank2_using_svd ( void  ) [inline]

Null function as already Rank 2.

Reimplemented from FMatrix.

Definition at line 114 of file FMatrixSkew.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: