Fundamental#
Detailed Description#
Function Documentation#
computeOrientation()#
void cv::sfm::computeOrientation(
InputArrayOfArrays x1,
InputArrayOfArrays x2,
OutputArray R,
OutputArray t,
double s )
#include <opencv2/sfm/fundamental.hpp>
Computes Absolute or Exterior Orientation (Pose Estimation) between 2 sets of 3D point.
Find the best transformation such that xp=projection*(sRx+t) (same as Pose Estimation, ePNP). The routines below are only for the orthographic case for now.
Parameters
x1— Input first 3xN or 2xN array of points.x2— Input second 3xN or 2xN array of points.R— Output 3x3 computed rotation matrix.t— Output 3x1 computed translation vector.s— Output computed scale factor.
essentialFromFundamental()#
void cv::sfm::essentialFromFundamental(
InputArray F,
InputArray K1,
InputArray K2,
OutputArray E )
#include <opencv2/sfm/fundamental.hpp>
Get Essential matrix from Fundamental and Camera matrices.
Reference: [133] 9.6 pag 257 (formula 9.12)
Parameters
F— Input 3x3 fundamental matrix.K1— Input 3x3 first camera matrix \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\).K2— Input 3x3 second camera matrix. The parameters are similar to K1.E— Output 3x3 essential matrix.
essentialFromRt()#
void cv::sfm::essentialFromRt(
InputArray R1,
InputArray t1,
InputArray R2,
InputArray t2,
OutputArray E )
#include <opencv2/sfm/fundamental.hpp>
Get Essential matrix from Motion (R’s and t’s ).
Reference: [133] 9.6 pag 257 (formula 9.12)
Parameters
R1— Input 3x3 first camera rotation matrix.t1— Input 3x1 first camera translation vector.R2— Input 3x3 second camera rotation matrix.t2— Input 3x1 second camera translation vector.E— Output 3x3 essential matrix.
fundamentalFromEssential()#
void cv::sfm::fundamentalFromEssential(
InputArray E,
InputArray K1,
InputArray K2,
OutputArray F )
#include <opencv2/sfm/fundamental.hpp>
Get Essential matrix from Fundamental and Camera matrices.
Reference: [133] 9.6 pag 257 (formula 9.12) or http://ai.stanford.edu/~birch/projective/node20.html
Parameters
E— Input 3x3 essential matrix.K1— Input 3x3 first camera matrix \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\).K2— Input 3x3 second camera matrix. The parameters are similar to K1.F— Output 3x3 fundamental matrix.
fundamentalFromProjections()#
void cv::sfm::fundamentalFromProjections(
InputArray P1,
InputArray P2,
OutputArray F )
#include <opencv2/sfm/fundamental.hpp>
Get Fundamental matrix from Projection matrices.
Parameters
P1— Input 3x4 first projection matrix.P2— Input 3x4 second projection matrix.F— Output 3x3 fundamental matrix.
motionFromEssential()#
void cv::sfm::motionFromEssential(
InputArray E,
OutputArrayOfArrays Rs,
OutputArrayOfArrays ts )
#include <opencv2/sfm/fundamental.hpp>
Get Motion (R’s and t’s ) from Essential matrix. Reference: [133] 9.6 pag 259 (Result 9.19)
Parameters
E— Input 3x3 essential matrix.Rs— Output vector of 3x3 rotation matrices.ts— Output vector of 3x1 translation vectors.
motionFromEssentialChooseSolution()#
int cv::sfm::motionFromEssentialChooseSolution(
InputArrayOfArrays Rs,
InputArrayOfArrays ts,
InputArray K1,
InputArray x1,
InputArray K2,
InputArray x2 )
#include <opencv2/sfm/fundamental.hpp>
Choose one of the four possible motion solutions from an essential matrix. Decides the right solution by checking that the triangulation of a match x1x2 lies in front of the cameras. Return index of the right solution or -1 if no solution.
Reference: See [133] 9.6 pag 259 (9.6.3 Geometrical interpretation of the 4 solutions).
Parameters
Rs— Input vector of 3x3 rotation matrices.ts— Input vector of 3x1 translation vectors.K1— Input 3x3 first camera matrix \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\).x1— Input 2x1 vector with first 2d point.K2— Input 3x3 second camera matrix. The parameters are similar to K1.x2— Input 2x1 vector with second 2d point.
normalizedEightPointSolver()#
void cv::sfm::normalizedEightPointSolver(
InputArray x1,
InputArray x2,
OutputArray F )
#include <opencv2/sfm/fundamental.hpp>
Estimate the fundamental matrix between two dataset of 2D point (image coords space).
Uses the normalized 8-point fundamental matrix solver. Reference: [133] 11.2 pag.281 (x1 = x, x2 = x’)
Parameters
x1— Input 2xN Array of 2D points in view 1.x2— Input 2xN Array of 2D points in view 2.F— Output 3x3 fundamental matrix.
normalizeFundamental()#
void cv::sfm::normalizeFundamental(
InputArray F,
OutputArray F_normalized )
#include <opencv2/sfm/fundamental.hpp>
Normalizes the Fundamental matrix.
By default divides the fundamental matrix by its L2 norm.
Parameters
F— Input 3x3 fundamental matrix.F_normalized— Output 3x3 normalized fundamental matrix.
projectionsFromFundamental()#
void cv::sfm::projectionsFromFundamental(
InputArray F,
OutputArray P1,
OutputArray P2 )
#include <opencv2/sfm/fundamental.hpp>
Get projection matrices from Fundamental matrix.
Parameters
F— Input 3x3 fundamental matrix.P1— Output 3x4 one possible projection matrix.P2— Output 3x4 another possible projection matrix.
relativeCameraMotion()#
void cv::sfm::relativeCameraMotion(
InputArray R1,
InputArray t1,
InputArray R2,
InputArray t2,
OutputArray R,
OutputArray t )
#include <opencv2/sfm/fundamental.hpp>
Computes the relative camera motion between two cameras.
Given the motion parameters of two cameras, computes the motion parameters of the second one assuming the first one to be at the origin. If T1 and T2 are the camera motions, the computed relative motion is \(T = T_2 T_1^{-1}\)
Parameters
R1— Input 3x3 first camera rotation matrix.t1— Input 3x1 first camera translation vector.R2— Input 3x3 second camera rotation matrix.t2— Input 3x1 second camera translation vector.R— Output 3x3 relative rotation matrix.t— Output 3x1 relative translation vector.