OpenCV  3.4.3
Open Source Computer Vision
Functions

Functions

void cv::sfm::computeOrientation (InputArrayOfArrays x1, InputArrayOfArrays x2, OutputArray R, OutputArray t, double s)
 Computes Absolute or Exterior Orientation (Pose Estimation) between 2 sets of 3D point. More...
 
void cv::sfm::essentialFromFundamental (InputArray F, InputArray K1, InputArray K2, OutputArray E)
 Get Essential matrix from Fundamental and Camera matrices. More...
 
void cv::sfm::essentialFromRt (InputArray R1, InputArray t1, InputArray R2, InputArray t2, OutputArray E)
 Get Essential matrix from Motion (R's and t's ). More...
 
void cv::sfm::fundamentalFromEssential (InputArray E, InputArray K1, InputArray K2, OutputArray F)
 Get Essential matrix from Fundamental and Camera matrices. More...
 
void cv::sfm::fundamentalFromProjections (InputArray P1, InputArray P2, OutputArray F)
 Get Fundamental matrix from Projection matrices. More...
 
void cv::sfm::motionFromEssential (InputArray E, OutputArrayOfArrays Rs, OutputArrayOfArrays ts)
 
int cv::sfm::motionFromEssentialChooseSolution (InputArrayOfArrays Rs, InputArrayOfArrays ts, InputArray K1, InputArray x1, InputArray K2, InputArray x2)
 
void cv::sfm::normalizedEightPointSolver (InputArray x1, InputArray x2, OutputArray F)
 Estimate the fundamental matrix between two dataset of 2D point (image coords space). More...
 
void cv::sfm::normalizeFundamental (InputArray F, OutputArray F_normalized)
 Normalizes the Fundamental matrix. More...
 
void cv::sfm::projectionsFromFundamental (InputArray F, OutputArray P1, OutputArray P2)
 Get projection matrices from Fundamental matrix. More...
 
void cv::sfm::relativeCameraMotion (InputArray R1, InputArray t1, InputArray R2, InputArray t2, OutputArray R, OutputArray t)
 Computes the relative camera motion between two cameras. More...
 

Detailed Description

Function Documentation

§ computeOrientation()

void cv::sfm::computeOrientation ( InputArrayOfArrays  x1,
InputArrayOfArrays  x2,
OutputArray  R,
OutputArray  t,
double  s 
)

Computes Absolute or Exterior Orientation (Pose Estimation) between 2 sets of 3D point.

Parameters
x1Input first 3xN or 2xN array of points.
x2Input second 3xN or 2xN array of points.
ROutput 3x3 computed rotation matrix.
tOutput 3x1 computed translation vector.
sOutput computed scale factor.

Find the best transformation such that xp=projection*(s*R*x+t) (same as Pose Estimation, ePNP). The routines below are only for the orthographic case for now.

§ essentialFromFundamental()

void cv::sfm::essentialFromFundamental ( InputArray  F,
InputArray  K1,
InputArray  K2,
OutputArray  E 
)

Get Essential matrix from Fundamental and Camera matrices.

Parameters
FInput 3x3 fundamental matrix.
K1Input 3x3 first camera matrix \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\).
K2Input 3x3 second camera matrix. The parameters are similar to K1.
EOutput 3x3 essential matrix.

Reference: [77] 9.6 pag 257 (formula 9.12)

§ essentialFromRt()

void cv::sfm::essentialFromRt ( InputArray  R1,
InputArray  t1,
InputArray  R2,
InputArray  t2,
OutputArray  E 
)

Get Essential matrix from Motion (R's and t's ).

Parameters
R1Input 3x3 first camera rotation matrix.
t1Input 3x1 first camera translation vector.
R2Input 3x3 second camera rotation matrix.
t2Input 3x1 second camera translation vector.
EOutput 3x3 essential matrix.

Reference: [77] 9.6 pag 257 (formula 9.12)

§ fundamentalFromEssential()

void cv::sfm::fundamentalFromEssential ( InputArray  E,
InputArray  K1,
InputArray  K2,
OutputArray  F 
)

Get Essential matrix from Fundamental and Camera matrices.

Parameters
EInput 3x3 essential matrix.
K1Input 3x3 first camera matrix \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\).
K2Input 3x3 second camera matrix. The parameters are similar to K1.
FOutput 3x3 fundamental matrix.

Reference: [77] 9.6 pag 257 (formula 9.12) or http://ai.stanford.edu/~birch/projective/node20.html

§ fundamentalFromProjections()

void cv::sfm::fundamentalFromProjections ( InputArray  P1,
InputArray  P2,
OutputArray  F 
)

Get Fundamental matrix from Projection matrices.

Parameters
P1Input 3x4 first projection matrix.
P2Input 3x4 second projection matrix.
FOutput 3x3 fundamental matrix.

§ motionFromEssential()

void cv::sfm::motionFromEssential ( InputArray  E,
OutputArrayOfArrays  Rs,
OutputArrayOfArrays  ts 
)

Get Motion (R's and t's ) from Essential matrix.

Parameters
EInput 3x3 essential matrix.
RsOutput vector of 3x3 rotation matrices.
tsOutput vector of 3x1 translation vectors.

Reference: [77] 9.6 pag 259 (Result 9.19)

§ motionFromEssentialChooseSolution()

int cv::sfm::motionFromEssentialChooseSolution ( InputArrayOfArrays  Rs,
InputArrayOfArrays  ts,
InputArray  K1,
InputArray  x1,
InputArray  K2,
InputArray  x2 
)

Choose one of the four possible motion solutions from an essential matrix.

Parameters
RsInput vector of 3x3 rotation matrices.
tsInput vector of 3x1 translation vectors.
K1Input 3x3 first camera matrix \(K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\).
x1Input 2x1 vector with first 2d point.
K2Input 3x3 second camera matrix. The parameters are similar to K1.
x2Input 2x1 vector with second 2d point.

Decides the right solution by checking that the triangulation of a match x1–x2 lies in front of the cameras. Return index of the right solution or -1 if no solution.

Reference: See [77] 9.6 pag 259 (9.6.3 Geometrical interpretation of the 4 solutions).

§ normalizedEightPointSolver()

void cv::sfm::normalizedEightPointSolver ( InputArray  x1,
InputArray  x2,
OutputArray  F 
)

Estimate the fundamental matrix between two dataset of 2D point (image coords space).

Parameters
x1Input 2xN Array of 2D points in view 1.
x2Input 2xN Array of 2D points in view 2.
FOutput 3x3 fundamental matrix.

Uses the normalized 8-point fundamental matrix solver. Reference: [77] 11.2 pag.281 (x1 = x, x2 = x')

§ normalizeFundamental()

void cv::sfm::normalizeFundamental ( InputArray  F,
OutputArray  F_normalized 
)

Normalizes the Fundamental matrix.

Parameters
FInput 3x3 fundamental matrix.
F_normalizedOutput 3x3 normalized fundamental matrix.

By default divides the fundamental matrix by its L2 norm.

§ projectionsFromFundamental()

void cv::sfm::projectionsFromFundamental ( InputArray  F,
OutputArray  P1,
OutputArray  P2 
)

Get projection matrices from Fundamental matrix.

Parameters
FInput 3x3 fundamental matrix.
P1Output 3x4 one possible projection matrix.
P2Output 3x4 another possible projection matrix.

§ relativeCameraMotion()

void cv::sfm::relativeCameraMotion ( InputArray  R1,
InputArray  t1,
InputArray  R2,
InputArray  t2,
OutputArray  R,
OutputArray  t 
)

Computes the relative camera motion between two cameras.

Parameters
R1Input 3x3 first camera rotation matrix.
t1Input 3x1 first camera translation vector.
R2Input 3x3 second camera rotation matrix.
t2Input 3x1 second camera translation vector.
ROutput 3x3 relative rotation matrix.
tOutput 3x1 relative translation vector.

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}\)