Skip to content

vector_to_fundamental_matrixVectorToFundamentalMatrixVectorToFundamentalMatrixvector_to_fundamental_matrixT_vector_to_fundamental_matrixπŸ”—

Short descriptionπŸ”—

vector_to_fundamental_matrixVectorToFundamentalMatrixVectorToFundamentalMatrixvector_to_fundamental_matrixT_vector_to_fundamental_matrix β€” Compute the fundamental matrix given a set of image point correspondences and reconstruct 3D points.

SignatureπŸ”—

vector_to_fundamental_matrix( number Rows1, number Cols1, number Rows2, number Cols2, number CovRR1, number CovRC1, number CovCC1, number CovRR2, number CovRC2, number CovCC2, string Method, out hom_mat2d FMatrix, out real CovFMat, out real Error, out real X, out real Y, out real Z, out real W, out real CovXYZW )void VectorToFundamentalMatrix( const HTuple& Rows1, const HTuple& Cols1, const HTuple& Rows2, const HTuple& Cols2, const HTuple& CovRR1, const HTuple& CovRC1, const HTuple& CovCC1, const HTuple& CovRR2, const HTuple& CovRC2, const HTuple& CovCC2, const HTuple& Method, HTuple* FMatrix, HTuple* CovFMat, HTuple* Error, HTuple* X, HTuple* Y, HTuple* Z, HTuple* W, HTuple* CovXYZW )static void HOperatorSet.VectorToFundamentalMatrix( HTuple rows1, HTuple cols1, HTuple rows2, HTuple cols2, HTuple covRR1, HTuple covRC1, HTuple covCC1, HTuple covRR2, HTuple covRC2, HTuple covCC2, HTuple method, out HTuple FMatrix, out HTuple covFMat, out HTuple error, out HTuple x, out HTuple y, out HTuple z, out HTuple w, out HTuple covXYZW )def vector_to_fundamental_matrix( rows_1: Sequence[Union[float, int]], cols_1: Sequence[Union[float, int]], rows_2: Sequence[Union[float, int]], cols_2: Sequence[Union[float, int]], cov_rr1: Sequence[Union[float, int]], cov_rc1: Sequence[Union[float, int]], cov_cc1: Sequence[Union[float, int]], cov_rr2: Sequence[Union[float, int]], cov_rc2: Sequence[Union[float, int]], cov_cc2: Sequence[Union[float, int]], method: str ) -> Tuple[Sequence[float], Sequence[float], float, Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float]]

Herror T_vector_to_fundamental_matrix( const Htuple Rows1, const Htuple Cols1, const Htuple Rows2, const Htuple Cols2, const Htuple CovRR1, const Htuple CovRC1, const Htuple CovCC1, const Htuple CovRR2, const Htuple CovRC2, const Htuple CovCC2, const Htuple Method, Htuple* FMatrix, Htuple* CovFMat, Htuple* Error, Htuple* X, Htuple* Y, Htuple* Z, Htuple* W, Htuple* CovXYZW )

HTuple HHomMat2D::VectorToFundamentalMatrix( const HTuple& Rows1, const HTuple& Cols1, const HTuple& Rows2, const HTuple& Cols2, const HTuple& CovRR1, const HTuple& CovRC1, const HTuple& CovCC1, const HTuple& CovRR2, const HTuple& CovRC2, const HTuple& CovCC2, const HString& Method, double* Error, HTuple* X, HTuple* Y, HTuple* Z, HTuple* W, HTuple* CovXYZW )

HTuple HHomMat2D::VectorToFundamentalMatrix( const HTuple& Rows1, const HTuple& Cols1, const HTuple& Rows2, const HTuple& Cols2, const HTuple& CovRR1, const HTuple& CovRC1, const HTuple& CovCC1, const HTuple& CovRR2, const HTuple& CovRC2, const HTuple& CovCC2, const char* Method, double* Error, HTuple* X, HTuple* Y, HTuple* Z, HTuple* W, HTuple* CovXYZW )

HTuple HHomMat2D::VectorToFundamentalMatrix( const HTuple& Rows1, const HTuple& Cols1, const HTuple& Rows2, const HTuple& Cols2, const HTuple& CovRR1, const HTuple& CovRC1, const HTuple& CovCC1, const HTuple& CovRR2, const HTuple& CovRC2, const HTuple& CovCC2, const wchar_t* Method, double* Error, HTuple* X, HTuple* Y, HTuple* Z, HTuple* W, HTuple* CovXYZW ) (Windows only)

HTuple HHomMat2D.VectorToFundamentalMatrix( HTuple rows1, HTuple cols1, HTuple rows2, HTuple cols2, HTuple covRR1, HTuple covRC1, HTuple covCC1, HTuple covRR2, HTuple covRC2, HTuple covCC2, string method, out double error, out HTuple x, out HTuple y, out HTuple z, out HTuple w, out HTuple covXYZW )

DescriptionπŸ”—

For a stereo configuration with unknown camera parameters the geometric relation between the two images is defined by the fundamental matrix. The operator vector_to_fundamental_matrixVectorToFundamentalMatrix determines the fundamental matrix FMatrixFMatrixfmatrix from given point correspondences (Rows1rows1rows_1,Cols1cols1cols_1), (Rows2rows2rows_2,Cols2cols2cols_2), that fulfill the epipolar constraint:

\[\begin{eqnarray*} \left(\begin{array}{c} \textrm{Cols2} \\ \textrm{Rows2} \\ 1 \end{array} \right)^T \cdot \textrm{FMatrix} \cdot \left(\begin{array}{c} \textrm{Cols1} \\ \textrm{Rows1} \\ 1 \end{array} \right) = 0 \enspace . \end{eqnarray*}\]

Note the column/row ordering in the point coordinates: since the fundamental matrix encodes the projective relation between two stereo images embedded in 3D space, the x/y notation must be compliant with the camera coordinate system. Therefore, (x,y) coordinates correspond to (column,row) pairs.

For a general relative orientation of the two cameras the minimum number of required point correspondences is eight. Then, Methodmethodmethod is chosen to be 'normalized_dlt'"normalized_dlt" or 'gold_standard'"gold_standard". If left and right camera are identical and the relative orientation between them is a pure translation then choose Methodmethodmethod equal to 'trans_normalized_dlt'"trans_normalized_dlt" or 'trans_gold_standard'"trans_gold_standard". In this special case the minimum number of correspondences is only two. The typical application of the motion being a pure translation is that of a single fixed camera looking onto a moving conveyor belt.

The fundamental matrix is determined by minimizing a cost function. To minimize the respective error different algorithms are available, and the user can choose between the direct-linear-transformation (β€˜normalized_dlt’) and the gold-standard-algorithm (β€˜gold_standard’). Like the motion case, the algorithm can be selected with the parameter Methodmethodmethod. For Methodmethodmethod = 'normalized_dlt'"normalized_dlt" or 'trans_normalized_dlt'"trans_normalized_dlt", a linear algorithm minimizes an algebraic error based on the above epipolar constraint. This algorithm offers a good compromise between speed and accuracy. For Methodmethodmethod = 'gold_standard'"gold_standard" or 'trans_gold_standard'"trans_gold_standard", a mathematically optimal, but slower optimization is used, which minimizes the geometric backprojection error of reconstructed projective 3D points. In this case, in addition to the fundamental matrix its covariance matrix CovFMatcovFMatcov_fmat is output, along with the projective coordinates (Xxx,Yyy,Zzz,Www) of the reconstructed points and their covariances CovXYZWcovXYZWcov_xyzw. Let n be the number of points. Then the concatenated covariances are stored in a 16xn tuple.

If an optimal gold-standard-algorithm is chosen the covariances of the image points (CovRR1covRR1cov_rr1, CovRC1covRC1cov_rc1, CovCC1covCC1cov_cc1, CovRR2covRR2cov_rr2, CovRC2covRC2cov_rc2, CovCC2covCC2cov_cc2) can be incorporated in the computation. They can be provided for example by the operator points_foerstnerPointsFoerstner. If the point covariances are unknown, which is the default, empty tuples are input. In this case the optimization algorithm internally assumes uniform and equal covariances for all points.

The value Errorerrorerror indicates the overall quality of the optimization procedure and is the mean Euclidean distance in pixels between the points and their corresponding epipolar lines.

If the correspondence between the points are not known, match_fundamental_matrix_ransacMatchFundamentalMatrixRansac should be used instead.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersπŸ”—

Rows1rows1rows_1 (input_control) number-array β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Input points in image 1 (row coordinate).

Restriction: length(Rows1) >= 8 || length(Rows1) >= 2

Cols1cols1cols_1 (input_control) number-array β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Input points in image 1 (column coordinate).

Restriction: length(Cols1) == length(Rows1)

Rows2rows2rows_2 (input_control) number-array β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Input points in image 2 (row coordinate).

Restriction: length(Rows2) == length(Rows1)

Cols2cols2cols_2 (input_control) number-array β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Input points in image 2 (column coordinate).

Restriction: length(Cols2) == length(Rows1)

CovRR1covRR1cov_rr1 (input_control) number-array β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Row coordinate variance of the points in image 1.

Default: [][]

CovRC1covRC1cov_rc1 (input_control) number-array β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Covariance of the points in image 1.

Default: [][]

CovCC1covCC1cov_cc1 (input_control) number-array β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Column coordinate variance of the points in image 1.

Default: [][]

CovRR2covRR2cov_rr2 (input_control) number-array β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Row coordinate variance of the points in image 2.

Default: [][]

CovRC2covRC2cov_rc2 (input_control) number-array β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Covariance of the points in image 2.

Default: [][]

CovCC2covCC2cov_cc2 (input_control) number-array β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Column coordinate variance of the points in image 2.

Default: [][]

Methodmethodmethod (input_control) string β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Estimation algorithm.

Default: 'normalized_dlt'"normalized_dlt"
List of values: 'gold_standard', 'normalized_dlt', 'trans_gold_standard', 'trans_normalized_dlt'"gold_standard", "normalized_dlt", "trans_gold_standard", "trans_normalized_dlt"

FMatrixFMatrixfmatrix (output_control) hom_mat2d β†’ (real)HTuple (double)HHomMat2D, HTuple (double)Sequence[float]Htuple (double)

Computed fundamental matrix.

CovFMatcovFMatcov_fmat (output_control) real-array β†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

9x9 covariance matrix of the fundamental matrix.

Errorerrorerror (output_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Root-Mean-Square of the epipolar distance error.

Xxx (output_control) real-array β†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

X coordinates of the reconstructed points in projective 3D space.

Yyy (output_control) real-array β†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Y coordinates of the reconstructed points in projective 3D space.

Zzz (output_control) real-array β†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Z coordinates of the reconstructed points in projective 3D space.

Www (output_control) real-array β†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

W coordinates of the reconstructed points in projective 3D space.

CovXYZWcovXYZWcov_xyzw (output_control) real-array β†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Covariance matrices of the reconstructed 3D points.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

match_fundamental_matrix_ransacMatchFundamentalMatrixRansac

Possible successors

gen_binocular_proj_rectificationGenBinocularProjRectification

Alternatives

vector_to_essential_matrixVectorToEssentialMatrix, vector_to_rel_poseVectorToRelPose

ReferencesπŸ”—

Richard Hartley, Andrew Zisserman: ``Multiple View Geometry in Computer Visionβ€™β€˜; Cambridge University Press, Cambridge; 2000.

Olivier Faugeras, Quang-Tuan Luong: ``The Geometry of Multiple Images: The Laws That Govern the Formation of Multiple Images of a Scene and Some of Their Applicationsβ€™β€˜; MIT Press, Cambridge, MA; 2001.

ModuleπŸ”—

3D Metrology