- メインページ
- モジュール
- ネームスペース
- データ構造
- ファイル

- ファイル一覧
- グローバル

データ構造 | 関数
epipolar.h

epipolar geometry [詳細]

`#include <mist/mist.h>`
`#include <mist/matrix.h>`
`#include <mist/numeric.h>`
`#include <mist/random.h>`
`#include <queue>`
`#include <cmath>`

ソースコードを見る。

## データ構造
class | trifocal_tensor< T >
| trifocal tensor [詳細]

## 関数
template<typename T >
bool | __epipolar__::enforce_rank2 (matrix< T > &in, matrix< T > &out)
| enforce rank 2 on a fundamental matrix of rank 3.
bool | __epipolar__::line_triangle_intersection (matrix< double > &origin, matrix< double > &direction, matrix< double > &vert0, matrix< double > &vert1, matrix< double > &vert2, matrix< double > &intersection)
| test whether the line and the triangle are intersected
template<typename T1 , typename T2 >
bool | compute_fundamental_matrix (matrix< T1 > &points1, matrix< T1 > &points2, matrix< T2 > &fundamental_matrix)
| compute a fundamental matrix from 8 or more correspondence of the points.
template<typename T1 , typename T2 >
bool | compute_correspond_epilines (matrix< T1 > &points, int which_image, matrix< T2 > &fundamental_matrix, matrix< T1 > &correspondent_lines)
| compute epipolar lines on the image.
template<typename T1 , typename T2 >
bool | compute_epipole (matrix< T1 > &fundamental_matrix, matrix< T2 > &epipole)
| compute epipole from a fundamental matrix
template<typename T1 , typename T2 >
bool | factorize_essential_matrix (matrix< T1 > &essential_matrix, matrix< T2 > &t, matrix< T2 > &r1, matrix< T2 > &r2)
| factorize essential matrix
template<typename T1 , typename T2 >
bool | triangulation_dlt (matrix< T1 > &xc1, matrix< T1 > &xc2, matrix< T2 > &camera_matrix1, matrix< T2 > &camera_matrix2, matrix< T1 > &xw)
| Estimate a coordinate of a point in world coordinate. The triangulation is performed by DLT method.
template<typename T1 >
matrix< T1 > | trilinear_three_points (matrix< T1 > &p1, matrix< T1 > &p2, matrix< T1 > &p3)
| Generate trilinear relations from 3-view point-point-pont correspondences.
template<typename T1 >
matrix< T1 > | trilinear_three_lines (matrix< T1 > &l1, matrix< T1 > &l2, matrix< T1 > &l3)
| Generate trilinear relations from 3-view line-line-line correspondence.
template<typename T1 , typename T2 >
bool | compute_trifocal_tensor (mist::matrix< T1 > &relations, trifocal_tensor< T2 > &tensor)
| Compute trifocal tensor from trilinear relations.
template<typename T1 , typename T2 >
bool | trifocal_tensor_to_epipoles (trifocal_tensor< T1 > &tensor, mist::matrix< T2 > &epi21, mist::matrix< T2 > &epi31)
| Compute epipoles from trifocal tensor.
template<typename T1 , typename T2 >
bool | compute_fundamental_matrices (trifocal_tensor< T1 > &tensor, mist::matrix< T2 > &fundamental21, mist::matrix< T2 > &fundamental31)
| Compute fundamental matrices from trifocal tensor.
template<typename T1 , typename T2 >
bool | trifocal_tensor_to_camera_matrices (trifocal_tensor< T1 > &tensor, mist::matrix< T2 > &mat2, mist::matrix< T2 > &mat3)
| Compute camera matrices from trifocal tensor.

## 説明

epipolar geometry

## 関数

template<typename T1 , typename T2 >

bool compute_correspond_epilines | ( | matrix< T1 > & | points,
|  | int | which_image,
|  | matrix< T2 > & | fundamental_matrix,
|  | matrix< T1 > & | correspondent_lines
| ) |  |
| inline

compute epipolar lines on the image.

Epipolar line is calculated by "l = F * p" if which_image is 0 or "l = F^T * p" if which_image is 1. The line is represented as "a*x + b*y + c = 0", where "l = [a, b, c]^T".

引数

  [in] | points | is a array of points. The size is 2xN or 3xN.
  [in] | which_image | is an index of the image including the points (0 or 1).
  [in] | fundamental | matrix is a input fundamental matrix.
  [out] | correspondent_lines | are epipolar lines which corresponds to the points. The size is 3xN.

戻り値
  return true if success

template<typename T1 , typename T2 >

bool compute_epipole | ( | matrix< T1 > & | fundamental_matrix,
|  | matrix< T2 > & | epipole
| ) |  |
| inline

compute epipole from a fundamental matrix

引数

  [in] | fundamental | matrix is a input fundamental matrix.
  [out] | epipole | is a (3, 1) matrix

戻り値
  return true if success

参照先 mist::svd().

template<typename T1 , typename T2 >

bool compute_fundamental_matrices | ( | trifocal_tensor< T1 > & | tensor,
|  | mist::matrix< T2 > & | fundamental21,
|  | mist::matrix< T2 > & | fundamental31
| ) |  |

Compute fundamental matrices from trifocal tensor.

引数

  [in] | tensor | is the input trifocal tensor
  [out] | fundamental21 | is the fundamental matrix with the second image (3x3)
  [out] | fundamental31 | is the fundamental matrix with the third image (3x3)

戻り値
  Return true if success

参照先 mist::matrix< T, Allocator >::resize(), と trifocal_tensor_to_epipoles().

template<typename T1 , typename T2 >

bool compute_fundamental_matrix | ( | matrix< T1 > & | points1,
|  | matrix< T1 > & | points2,
|  | matrix< T2 > & | fundamental_matrix
| ) |  |
| inline

compute a fundamental matrix from 8 or more correspondence of the points.

The fundamental matrix is computed using 8 point algorithm.

引数

  [in] | points1 | is an array of points on image1. The size is 2xN or 3xN.
  [in] | points2 | is an array of points on image2. The size is 2xN or 3xN.
  [out] | fundamental_matrix | is a fundamental matrix. The size is 3x3.

戻り値
  return true if success

参照先 _DESCENDING_ORDER_EIGEN_VALUE_, と mist::eigen().

template<typename T1 , typename T2 >

bool compute_trifocal_tensor | ( | mist::matrix< T1 > & | relations,
|  | trifocal_tensor< T2 > & | tensor
| ) |  |

Compute trifocal tensor from trilinear relations.

Solve At=0 using SVD, where t is the vector of the trifocal tensor components and A are the coefficients of the trilinear relations.

引数

  [in] | relations | is the trilinear relations (Nx27)
  [out] | tensor | is the output trifocal tensor

戻り値
  Return true if success

参照先 mist::matrix< T, Allocator >::cols(), mist::matrix< T, Allocator >::rows(), と mist::svd().

template<typename T1 , typename T2 >

bool factorize_essential_matrix | ( | matrix< T1 > & | essential_matrix,
|  | matrix< T2 > & | t,
|  | matrix< T2 > & | r1,
|  | matrix< T2 > & | r2
| ) |  |
| inline

factorize essential matrix

factorize E to SR, where S = U Z U^t R1 = U W V^t or R2 = U W^t V^t E = U diag(1, 1, 0) V^t W = { (0,1,0)^t, (-1,0,0)^t, (0,0,1)^t } Z = { (0,-1,0)^t, (1,0,0)^t, (0,0,0)^t }

引数

  [in] | essential_matrix | is a input
  [out] | t | is the traslation vector
  [out] | r1 | is one of the solution of the rotation R
  [out] | r2 | is the other solution of the rotaion R

戻り値
  return true if success

参照先 mist::matrix< T, Allocator >::_33(), mist::svd(), と mist::matrix< T, Allocator >::t().

template<typename T1 , typename T2 >

bool triangulation_dlt | ( | matrix< T1 > & | xc1,
|  | matrix< T1 > & | xc2,
|  | matrix< T2 > & | camera_matrix1,
|  | matrix< T2 > & | camera_matrix2,
|  | matrix< T1 > & | xw
| ) |  |
| inline

Estimate a coordinate of a point in world coordinate. The triangulation is performed by DLT method.

引数

  [in] | xc1 | is the point on the first camera
  [in] | xc2 | is the point on the second camera
  [in] | camera_matrix1 | is that for the first camera
  [in] | camera_matrix2 | is that for the second camera
  [out] | xw | is the point on the world coordinate

戻り値
  return true if success

参照先 mist::svd().

template<typename T1 , typename T2 >

bool trifocal_tensor_to_camera_matrices | ( | trifocal_tensor< T1 > & | tensor,
|  | mist::matrix< T2 > & | mat2,
|  | mist::matrix< T2 > & | mat3
| ) |  |

Compute camera matrices from trifocal tensor.

The first camera matrix is fixed as P = [I | 0]. The camera matrices are obtained up to projection ambiguity.

引数

  [in] | tensor | is the input trifocal tensor
  [out] | mat2 | is the camera matrix for the second image (3x4)
  [out] | mat1 | is the camera matrix for the third image (3x4)

戻り値
  Return true if success

参照先 mist::matrix< T, Allocator >::resize(), mist::matrix< T, Allocator >::t(), と trifocal_tensor_to_epipoles().

template<typename T1 , typename T2 >

bool trifocal_tensor_to_epipoles | ( | trifocal_tensor< T1 > & | tensor,
|  | mist::matrix< T2 > & | epi21,
|  | mist::matrix< T2 > & | epi31
| ) |  |

Compute epipoles from trifocal tensor.

引数

  [in] | tensor | is the input trifocal tensor
  [out] | epi21 | is the epipole in the second image (3x1)
  [out] | epi31 | is the epipole in the third image (3x1)

戻り値
  Return true if success

参照先 mist::matrix< T, Allocator >::resize(), と mist::svd().

参照元 compute_fundamental_matrices(), と trifocal_tensor_to_camera_matrices().

template<typename T1 >

matrix< T1 > trilinear_three_lines | ( | matrix< T1 > & | l1,
|  | matrix< T1 > & | l2,
|  | matrix< T1 > & | l3
| ) |  |

Generate trilinear relations from 3-view line-line-line correspondence.

Return A, where At=0 and t is the vector of the trifocal tensor components.

引数

  [in] | l1 | is a line on the first camera (3x1)
  [in] | l2 | is a line on the second camera (3x1)
  [in] | l3 | is a line on the third camera (3x1)

戻り値
  trilinear relations (3x27)

template<typename T1 >

matrix< T1 > trilinear_three_points | ( | matrix< T1 > & | p1,
|  | matrix< T1 > & | p2,
|  | matrix< T1 > & | p3
| ) |  |

Generate trilinear relations from 3-view point-point-pont correspondences.

Return A, where At=0 and t is the vector of the trifocal tensor components.

引数

  [in] | p1 | is a point on the first camera (3x1)
  [in] | p2 | is a point on the second camera (3x1)
  [in] | p3 | is a point on the third camera (3x1)

戻り値
  Return trilinear relations (9x27)