Blender  V3.3
Typedefs | Enumerations | Functions
libmv::euclidean_resection Namespace Reference

Typedefs

typedef unsigned int uint
 

Enumerations

enum  ResectionMethod { RESECTION_ANSAR_DANIILIDIS , RESECTION_EPNP , RESECTION_PPNP }
 

Functions

bool EuclideanResection (const Mat2X &x_camera, const Mat3X &X_world, Mat3 *R, Vec3 *t, ResectionMethod method)
 
bool EuclideanResection (const Mat &x_image, const Mat3X &X_world, const Mat3 &K, Mat3 *R, Vec3 *t, ResectionMethod method)
 
void AbsoluteOrientation (const Mat3X &X, const Mat3X &Xp, Mat3 *R, Vec3 *t)
 
static int IJToPointIndex (int i, int j, int num_points)
 
static int IJToIndex (int i, int j, int num_lambda)
 
static int Sign (double value)
 
static Vec MatrixToConstraint (const Mat &A, int num_k_columns, int num_lambda)
 
static void NormalizeColumnVectors (Mat3X *vectors)
 
void EuclideanResectionAnsarDaniilidis (const Mat2X &x_camera, const Mat3X &X_world, Mat3 *R, Vec3 *t)
 
static void SelectControlPoints (const Mat3X &X_world, Mat *X_centered, Mat34 *X_control_points)
 
static void ComputeBarycentricCoordinates (const Mat3X &X_world_centered, const Mat34 &X_control_points, Mat4X *alphas)
 
static void ComputePointsCoordinatesInCameraFrame (const Mat4X &alphas, const Vec4 &betas, const Eigen::Matrix< double, 12, 12 > &U, Mat3X *X_camera)
 
bool EuclideanResectionEPnP (const Mat2X &x_camera, const Mat3X &X_world, Mat3 *R, Vec3 *t)
 
bool EuclideanResectionPPnP (const Mat2X &x_camera, const Mat3X &X_world, Mat3 *R, Vec3 *t)
 

Typedef Documentation

◆ uint

typedef unsigned int libmv::euclidean_resection::uint

Definition at line 36 of file euclidean_resection.cc.

Enumeration Type Documentation

◆ ResectionMethod

Enumerator
RESECTION_ANSAR_DANIILIDIS 
RESECTION_EPNP 
RESECTION_PPNP 

Definition at line 30 of file euclidean_resection.h.

Function Documentation

◆ AbsoluteOrientation()

void libmv::euclidean_resection::AbsoluteOrientation ( const Mat3X X,
const Mat3X Xp,
Mat3 R,
Vec3 t 
)

The absolute orientation algorithm recovers the transformation between a set of 3D points, X and Xp such that:

      Xp = R*X + t

The recovery of the absolute orientation is implemented after this article: Horn, Hilden, "Closed-form solution of absolute orientation using orthonormal matrices"

Definition at line 77 of file euclidean_resection.cc.

References C, N, R, t, and X.

Referenced by EuclideanResectionAnsarDaniilidis(), EuclideanResectionEPnP(), and TEST().

◆ ComputeBarycentricCoordinates()

static void libmv::euclidean_resection::ComputeBarycentricCoordinates ( const Mat3X X_world_centered,
const Mat34 X_control_points,
Mat4X alphas 
)
static

Definition at line 380 of file euclidean_resection.cc.

References Freestyle::a, and Freestyle::c.

Referenced by EuclideanResectionEPnP().

◆ ComputePointsCoordinatesInCameraFrame()

static void libmv::euclidean_resection::ComputePointsCoordinatesInCameraFrame ( const Mat4X alphas,
const Vec4 betas,
const Eigen::Matrix< double, 12, 12 > &  U,
Mat3X X_camera 
)
static

Definition at line 401 of file euclidean_resection.cc.

References Freestyle::c.

Referenced by EuclideanResectionEPnP().

◆ EuclideanResection() [1/2]

bool libmv::euclidean_resection::EuclideanResection ( const Mat x_image,
const Mat3X X_world,
const Mat3 K,
Mat3 R,
Vec3 t,
ResectionMethod  method = RESECTION_EPNP 
)

Computes the extrinsic parameters, R and t for a calibrated camera from 4 or more 3D points and their images.

Parameters
x_imageImage points in non-normalized image coordinates. The coordates are laid out one per row. The matrix can be Nx2 or Nx3 for euclidean or homogenous 2D coordinates.
X_world3D points in the world coordinate system
KIntrinsic parameters camera matrix
RSolution for the camera rotation matrix
tSolution for the camera translation vector
methodResection method

Definition at line 58 of file euclidean_resection.cc.

References CHECK, EuclideanResection(), libmv::EuclideanToNormalizedCamera(), libmv::HomogeneousToNormalizedCamera(), K, R, and t.

◆ EuclideanResection() [2/2]

bool libmv::euclidean_resection::EuclideanResection ( const Mat2X x_camera,
const Mat3X X_world,
Mat3 R,
Vec3 t,
ResectionMethod  method = RESECTION_EPNP 
)

Computes the extrinsic parameters, R and t for a calibrated camera from 4 or more 3D points and their normalized images.

Parameters
x_cameraImage points in normalized camera coordinates e.g. x_camera = inv(K) * x_image.
X_world3D points in the world coordinate system
RSolution for the camera rotation matrix
tSolution for the camera translation vector
methodThe resection method to use.

Definition at line 38 of file euclidean_resection.cc.

References EuclideanResectionAnsarDaniilidis(), EuclideanResectionEPnP(), EuclideanResectionPPnP(), LOG, R, RESECTION_ANSAR_DANIILIDIS, RESECTION_EPNP, RESECTION_PPNP, and t.

Referenced by libmv::EuclideanResect(), EuclideanResection(), and TEST().

◆ EuclideanResectionAnsarDaniilidis()

void libmv::euclidean_resection::EuclideanResectionAnsarDaniilidis ( const Mat2X x_camera,
const Mat3X X_world,
Mat3 R,
Vec3 t 
)

Computes the extrinsic parameters, R and t for a calibrated camera from 4 or more 3D points and their images.

Parameters
x_cameraImage points in normalized camera coordinates, e.g. x_camera=inv(K)*x_image
X_world3D points in the world coordinate system
RSolution for the camera rotation matrix
tSolution for the camera translation vector

This is the algorithm described in: "Linear Pose Estimation from Points or Lines", by Ansar, A. and Daniilidis, PAMI 2003. vol. 25, no. 5.

Definition at line 205 of file euclidean_resection.cc.

References AbsoluteOrientation(), CHECK, fabs(), IJToIndex(), IJToPointIndex(), K, L, M, MatrixToConstraint(), NormalizeColumnVectors(), R, Sign(), sqrt(), t, V, and X.

Referenced by EuclideanResection().

◆ EuclideanResectionEPnP()

bool libmv::euclidean_resection::EuclideanResectionEPnP ( const Mat2X x_camera,
const Mat3X X_world,
Mat3 R,
Vec3 t 
)

Computes the extrinsic parameters, R and t for a calibrated camera from 4 or more 3D points and their images.

Parameters
x_cameraImage points in normalized camera coordinates, e.g. x_camera = inv(K) * x_image
X_world3D points in the world coordinate system
RSolution for the camera rotation matrix
tSolution for the camera translation vector

This is the algorithm described in: "{EP$n$P: An Accurate $O(n)$ Solution to the P$n$P Problem", by V. Lepetit and F. Moreno-Noguer and P. Fua, IJCV 2009. vol. 81, no. 2

Note
the non-linear optimization is not implemented here.

Definition at line 438 of file euclidean_resection.cc.

References AbsoluteOrientation(), Freestyle::c, CHECK, ComputeBarycentricCoordinates(), ComputePointsCoordinatesInCameraFrame(), K, L, LOG, M, max, R, r, libmv::RootMeanSquareError(), SelectControlPoints(), sqrt(), t, u2, and VLOG.

Referenced by EuclideanResection().

◆ EuclideanResectionPPnP()

bool libmv::euclidean_resection::EuclideanResectionPPnP ( const Mat2X x_camera,
const Mat3X X_world,
Mat3 R,
Vec3 t 
)

Computes the extrinsic parameters, R and t for a calibrated camera from 4 or more 3D points and their images.

Parameters
x_cameraImage points in normalized camera coordinates, e.g. x_camera = inv(K) * x_image
X_world3D points in the world coordinate system
RSolution for the camera rotation matrix
tSolution for the camera translation vector

Straight from the paper: http://www.diegm.uniud.it/fusiello/papers/3dimpvt12-b.pdf

Definition at line 723 of file euclidean_resection.cc.

References A, Freestyle::c, determinant(), e, error(), LG, max, norm(), P(), R, t, transpose(), Y, and Z.

Referenced by EuclideanResection().

◆ IJToIndex()

static int libmv::euclidean_resection::IJToIndex ( int  i,
int  j,
int  num_lambda 
)
static

Definition at line 162 of file euclidean_resection.cc.

References A, B, C, and swap().

Referenced by EuclideanResectionAnsarDaniilidis().

◆ IJToPointIndex()

static int libmv::euclidean_resection::IJToPointIndex ( int  i,
int  j,
int  num_points 
)
static

Definition at line 143 of file euclidean_resection.cc.

References offset, and swap().

Referenced by EuclideanResectionAnsarDaniilidis().

◆ MatrixToConstraint()

static Vec libmv::euclidean_resection::MatrixToConstraint ( const Mat A,
int  num_k_columns,
int  num_lambda 
)
static

Definition at line 181 of file euclidean_resection.cc.

References A, and C.

Referenced by EuclideanResectionAnsarDaniilidis().

◆ NormalizeColumnVectors()

static void libmv::euclidean_resection::NormalizeColumnVectors ( Mat3X vectors)
static

Definition at line 198 of file euclidean_resection.cc.

Referenced by EuclideanResectionAnsarDaniilidis().

◆ SelectControlPoints()

static void libmv::euclidean_resection::SelectControlPoints ( const Mat3X X_world,
Mat X_centered,
Mat34 X_control_points 
)
static

Definition at line 354 of file euclidean_resection.cc.

References Freestyle::c, libmv::MeanAndVarianceAlongRows(), sqrt(), and w().

Referenced by EuclideanResectionEPnP().

◆ Sign()

static int libmv::euclidean_resection::Sign ( double  value)
static

Definition at line 173 of file euclidean_resection.cc.

Referenced by EuclideanResectionAnsarDaniilidis().