Ocean
|
This class implements epipolar geometry functions for multiple views. More...
Data Structures | |
class | TrifocalTensor |
Definition of a trifocal tensor matrix. More... | |
Static Public Member Functions | |
static bool | projectiveReconstructionFrom6PointsIF (const ImagePoint *points1, const ImagePoint *points2, const ImagePoint *points3, const size_t correspondences, HomogenousMatrix4 &iFlippedProjectionMatrix1, HomogenousMatrix4 &iFlippedProjectionMatrix2, HomogenousMatrix4 &iFlippedProjectionMatrix3, const Scalar squaredSuccessThreshold=(2.5 *2.5), Scalar *squaredProjectionError=nullptr) |
Computes geometric valid camera projection matrices which are determined up to a common 3d projection transformation. More... | |
static bool | projectiveReconstructionFrom6PointsIF (const ConstIndexedAccessor< ImagePoints > &imagePointsPerPose, NonconstIndexedAccessor< HomogenousMatrix4 > *posesIF, const Scalar squaredSuccessThreshold=Scalar(2.5 *2.5), Scalar *squaredProjectionError=nullptr) |
Computes geometric valid camera projection matrices which are determined up to a common 3d projection transformation. More... | |
static bool | trifocalTensorIF (const ImagePoint *points1, const ImagePoint *points2, const ImagePoint *points3, const size_t correspondences, HomogenousMatrix4 &iFlippedProjectionMatrix1, HomogenousMatrix4 &iFlippedProjectionMatrix2, HomogenousMatrix4 &iFlippedProjectionMatrix3, TrifocalTensor *trifocalTensor=nullptr) |
The normalized linear algorithm of computation of trifocal tensor. More... | |
static bool | calibrateFromProjectionsMatricesIF (const ConstIndexedAccessor< HomogenousMatrix4 > &iFlippedProjectionMatrices, const unsigned int imageWidth, const unsigned int imageHeight, SquareMatrix3 &cameraIntrinsic, HomogenousMatrix4 *iFlippedPoses) |
Calibrate multiple projection matrices from a single camera. More... | |
static bool | calibrateFromProjectionsMatricesIF (const HomogenousMatrix4 &iFlippedProjectionMatrix1, const HomogenousMatrix4 &iFlippedProjectionMatrix2, const HomogenousMatrix4 &iFlippedProjectionMatrix3, const unsigned int imageWidth, const unsigned int imageHeight, SquareMatrix3 &cameraIntrinsics, HomogenousMatrix4 &iFlippedPose1, HomogenousMatrix4 &iFlippedPose2, HomogenousMatrix4 &iFlippedPose3) |
Calibrate three projection matrices from a single camera. More... | |
Static Protected Member Functions | |
static bool | trifocalTensorNormalizedLinear (const ImagePoint *points1, const ImagePoint *points2, const ImagePoint *points3, const size_t correspondences, TrifocalTensor &trifocal) |
The normalized linear algorithm of computation of trifocal tensor. More... | |
static bool | trifocalTensorMinimizingError (const ImagePoint *points1, const ImagePoint *points2, const ImagePoint *points3, const size_t correspondences, TrifocalTensor &trifocal) |
Computing a geometric valid trifocal tensor minimizing algebraic error. More... | |
static bool | trifocalTensorFromProjectionMatrices (const HomogenousMatrix4 &iFlippedProjectionMatrixB, const HomogenousMatrix4 &iFlippedProjectionMatrixC, TrifocalTensor &trifocal) |
Calculates the trifocal tensor by two projection matrix given: P_1 = [I | 0], P_2 = [A | a4], P_3 = [B | b4] and P = C * [Rt]. More... | |
static bool | trifocalTensorFromProjectionMatrices (const HomogenousMatrix4 &iFlippedProjectionMatrixA, const HomogenousMatrix4 &iFlippedProjectionMatrixB, const HomogenousMatrix4 &iFlippedProjectionMatrixC, TrifocalTensor &trifocal) |
Calculates the trifocal tensor by three projection matrix given: P_1 = [A | a4], P_2 = [B | b4], P_3 = [C | c4] and P = CameraInstrinsics * [Rt]. More... | |
static bool | epipoles (const TrifocalTensor &trifocal, Vector3 &normedEpipole2, Vector3 &normedEpipole3) |
Calculates the normalized epipoles of second and third view from trifocal tensor. More... | |
static bool | epipolesIF (const TrifocalTensor &trifocal, Vector3 &iFlippedNormedEpipole2, Vector3 &iFlippedNormedEpipole3) |
Calculates the normalized epipoles of second and third view from trifocal tensor for inverted flipped cameras. More... | |
static bool | fundamentalMatricesIF (const TrifocalTensor &trifocal, const Vector3 &iFlippedEpipole2, const Vector3 &iFlippedEpipole3, SquareMatrix3 &fundamental21, SquareMatrix3 &fundamental31) |
Calculates the fundamental matrices of second view and third view from trifocal tensor. More... | |
static bool | cameraProjectionMatricesIF (const TrifocalTensor &trifocal, const Vector3 &iFlippedNormedEpipole2, const Vector3 &iFlippedNormedEpipole3, HomogenousMatrix4 &iFlippedProjectionMatrix2, HomogenousMatrix4 &iFlippedProjectionMatrix3) |
Calculates the camera projection matrices of second and third view. More... | |
template<bool tUseIF> | |
static bool | epipoles (const Scalar *const trifocal1, const Scalar *const trifocal2, const Scalar *const trifocal3, Vector3 &normedEpipole2, Vector3 &normedEpipole3) |
Calculates the normalized epipoles of second and third view from trifocal tensor. More... | |
Static Private Member Functions | |
static bool | trifocalTensorLinear (const ImagePoint *points1, const ImagePoint *points2, const ImagePoint *points3, const size_t correspondences, Scalar *trifocal3x9, Matrix *matrixA=nullptr) |
Calculates the trifocal tensor using linear system. More... | |
static bool | trifocalTensorNormalizedLinear (const ImagePoint *points1, const ImagePoint *points2, const ImagePoint *points3, const size_t correspondences, Scalar *trifocal3x9, Matrix *matrixA=nullptr) |
The normalized linear algorithm of computation of trifocal tensor. More... | |
static Scalar | errorMatrix (const TrifocalTensor &trifocal, const ImagePoint *points1, const ImagePoint *points2, const ImagePoint *points3, const size_t correspondences, SquareMatrix3 *errorMatrix=nullptr) |
Calculates the trifocal tensor error in point–point–point correspondence equation: [x_2]_x * (sum_i(x_1^i * T_i) * [x_3]_x). More... | |
static bool | calculateProjectiveBasisTransform (const Vector2 &imagePointForTargetPoint100, const Vector2 &imagePointForTargetPoint010, const Vector2 &imagePointForTargetPoint001, const Vector2 &imagePointForTargetPoint111, SquareMatrix3 &baseTransformation) |
Calculates a transformation for a projective basis defined by four individual (image) target points each corresponding to a specific (projective/3D) reference points. More... | |
static bool | pointIsCollinear (const Triangle2 &triangle, const Vector2 &point, const Scalar threshold=Scalar(0.01)) |
Checks if a given 2D point is collinear to three given 2D points (defined by a 2D triangle). More... | |
This class implements epipolar geometry functions for multiple views.
|
staticprivate |
Calculates a transformation for a projective basis defined by four individual (image) target points each corresponding to a specific (projective/3D) reference points.
The following projective reference points are used: e_i = (1, 0, 0), (0, 1, 0), (0, 0, 1), (1, 1, 1).
The resulting transformation transforms the provided image points to projective references points:
si * ei = H * pi, each up to a scale factor si.
imagePointForTargetPoint100 | Image point p0 corresponding to s0 * (1, 0, 0) |
imagePointForTargetPoint010 | Image point p1 corresponding to s1 * (0, 1, 0) |
imagePointForTargetPoint001 | Image point p2 corresponding to s2 * (0, 0, 1) |
imagePointForTargetPoint111 | Image point p3 corresponding to s3 * (1, 1, 1) |
baseTransformation | Resulting transformation |
|
static |
Calibrate multiple projection matrices from a single camera.
The projection matrices are transformed into metric transformation matrix using absolute conic ω and absolute dual quadric Q∞:
ω = P * Q∞ * P^T.
Q∞ = H * Î * H^T.
P_metric = P * H.
The camera intrinsics are determined by Cholesky decomposition of absolute conic ω = K * K^T.
iFlippedProjectionMatrices | The camera projection matrices (at least 3, inverted flipped) |
imageWidth | Width of image |
imageHeight | Height of image |
cameraIntrinsic | The resulting intrinsic camera matrix |
iFlippedPoses | Resulting inverted and flipped camera poses, one for each given camera projection matrix |
|
static |
Calibrate three projection matrices from a single camera.
The projection matrices are transformed into metric transformation matrix using absolute conic ω and absolute dual quadric Q∞:
ω = P * Q∞ * P^T.
Q∞ = H * Î * H^T.
P_metric = P * H.
The camera intrinsics are determined by Cholesky decomposition of absolute conic ω = KK^T.
iFlippedProjectionMatrix1 | First camera projection matrices (inverted flipped) |
iFlippedProjectionMatrix2 | Second camera projection matrices (inverted flipped) |
iFlippedProjectionMatrix3 | Third camera projection matrices (inverted flipped) |
imageWidth | Width of image |
imageHeight | Height of image |
cameraIntrinsics | Resulting camera intrinsics matrix |
iFlippedPose1 | Resulting first camera pose (inverted flipped) |
iFlippedPose2 | Resulting second camera pose (inverted flipped) |
iFlippedPose3 | Resulting third camera pose (inverted flipped) |
|
staticprotected |
Calculates the camera projection matrices of second and third view.
The matrices are determined only up to a common projective transformation of 3-space. The projection matrix of first camera must be P_0 = [I | 0]
trifocal | Trifocal tensor matrices |
iFlippedNormedEpipole2 | Normalized epipole in second view |
iFlippedNormedEpipole3 | Normalized epipole in third view |
iFlippedProjectionMatrix2 | Resulting camera projection matrices of second view (determined only up to a common projective 3d transformation) |
iFlippedProjectionMatrix3 | Resulting camera projection matrices of third view (determined only up to a common projective 3d transformation) |
|
staticprotected |
Calculates the normalized epipoles of second and third view from trifocal tensor.
trifocal1 | First trifocal tensor matrix T_1 |
trifocal2 | Second trifocal tensor matrix T_2 |
trifocal3 | Third trifocal tensor matrix T_3 |
normedEpipole2 | Resulting (normalized) epipole in second view |
normedEpipole3 | Resulting (normalized) epipole in third view |
tUseIF | Calculation for inverted flipped camera system, if set |
|
staticprotected |
Calculates the normalized epipoles of second and third view from trifocal tensor.
trifocal | Trifocal tensor matrices |
normedEpipole2 | Resulting (normalized) epipole in second view |
normedEpipole3 | Resulting (normalized) epipole in third view |
|
staticprotected |
Calculates the normalized epipoles of second and third view from trifocal tensor for inverted flipped cameras.
trifocal | Trifocal tensor matrices |
iFlippedNormedEpipole2 | Resulting (normalized) epipole in second view |
iFlippedNormedEpipole3 | Resulting (normalized) epipole in third view |
|
staticprivate |
Calculates the trifocal tensor error in point–point–point correspondence equation: [x_2]_x * (sum_i(x_1^i * T_i) * [x_3]_x).
trifocal | Trifocal tensor matrices |
points1 | Image points of first set |
points2 | Image points of second set |
points3 | Image points of third set |
correspondences | Number of point correspondences (at least 7) |
errorMatrix | Resulting 3x3 error matrix is needed |
|
staticprotected |
Calculates the fundamental matrices of second view and third view from trifocal tensor.
trifocal | Trifocal tensor matrices |
iFlippedEpipole2 | Epipole in second view |
iFlippedEpipole3 | Epipole in third view |
fundamental21 | Resulting fundamental matrix between second view and first view |
fundamental31 | Resulting fundamental matrix between third view and first view |
|
inlinestaticprivate |
Checks if a given 2D point is collinear to three given 2D points (defined by a 2D triangle).
triangle | The triangle defining the three points |
point | The point to be check |
threshold | Threshold of variance from linearity condition, with range (0, 1] |
|
static |
Computes geometric valid camera projection matrices which are determined up to a common 3d projection transformation.
The calculation uses 6 point correspondences in which three of them are not collinear in any view The projection matrices are defined in inverted flipped coordinates system and are not metric and orthogonally: x_k = P_k * X.
imagePointsPerPose | Image points per view (at least 3 views and at least 6 point correspondences) |
posesIF | Resulting camera projection matrices per view (inverted flipped) |
squaredSuccessThreshold | Threshold indicating successful matrices determination, optionally |
squaredProjectionError | Squared back-projection error, optionally |
|
static |
Computes geometric valid camera projection matrices which are determined up to a common 3d projection transformation.
The calculation uses 6 point correspondences in which three of them are not collinear in any view The projection matrices are defined in inverted flipped coordinates system and are necessary metric and orthogonally: x_k = P_k * X.
points1 | Image points of first view |
points2 | Image points of second view |
points3 | Image points of third view |
correspondences | Number of point correspondences (at least 6) |
iFlippedProjectionMatrix1 | Resulting camera projection matrix of first view (inverted flipped) |
iFlippedProjectionMatrix2 | Resulting camera projection matrix of second view (inverted flipped) |
iFlippedProjectionMatrix3 | Resulting camera projection matrix of third view (inverted flipped) |
squaredSuccessThreshold | Threshold indicating successful matrices determination, optionally |
squaredProjectionError | Squared back-projection error, optionally |
|
staticprotected |
Calculates the trifocal tensor by three projection matrix given: P_1 = [A | a4], P_2 = [B | b4], P_3 = [C | c4] and P = CameraInstrinsics * [Rt].
iFlippedProjectionMatrixA | projection matrix P_1 in homogeneous format |
iFlippedProjectionMatrixB | projection matrix P_2 in homogeneous format |
iFlippedProjectionMatrixC | projection matrix P_3 in homogeneous format |
trifocal | Resulting trifocal tensor matrices |
|
staticprotected |
Calculates the trifocal tensor by two projection matrix given: P_1 = [I | 0], P_2 = [A | a4], P_3 = [B | b4] and P = C * [Rt].
iFlippedProjectionMatrixB | projection matrix P_2 in homogeneous format |
iFlippedProjectionMatrixC | projection matrix P_3 in homogeneous format |
trifocal | Resulting trifocal tensor matrices |
|
static |
The normalized linear algorithm of computation of trifocal tensor.
Calculates the trifocal tensor by three sets of at least seven corresponding image points and generates geometric valid camera projection matrices. The projection matrices are defined in inverted flipped coordinates system and are not metric and orthogonally: x_k = P_k * X.
points1 | Image points of first view |
points2 | Image points of second view |
points3 | Image points of third view |
correspondences | Number of point correspondences (at least 7) |
iFlippedProjectionMatrix1 | Resulting camera projection matrix of first view (inverted flipped) |
iFlippedProjectionMatrix2 | Resulting camera projection matrix of second view (inverted flipped) |
iFlippedProjectionMatrix3 | Resulting camera projection matrix of third view (inverted flipped) |
trifocalTensor | Optional pointer to resulting trifocal tensor |
|
staticprivate |
Calculates the trifocal tensor using linear system.
points1 | Image points of first set |
points2 | Image points of second set |
points3 | Image points of third set |
correspondences | Number of point correspondences (at least 7) |
trifocal3x9 | Pointer to resulting values of trifocal tensor matrices |
matrixA | Pointer to constructed linear system, if needed |
|
staticprotected |
Computing a geometric valid trifocal tensor minimizing algebraic error.
Calculates the trifocal tensor by three sets of at least seven corresponding image points.
points1 | Image points of first set |
points2 | Image points of second set |
points3 | Image points of third set |
correspondences | Number of point correspondences (at least 7) |
trifocal | Resulting trifocal tensor matrices |
|
staticprivate |
The normalized linear algorithm of computation of trifocal tensor.
Calculates the trifocal tensor by three sets of at least seven corresponding image points.
points1 | Image points of first set |
points2 | Image points of second set |
points3 | Image points of third set |
correspondences | Number of point correspondences (at least 7) |
trifocal3x9 | Pointer to resulting values of trifocal tensor matrices |
matrixA | Pointer to constructed linear system, if needed |
|
staticprotected |
The normalized linear algorithm of computation of trifocal tensor.
Calculates the trifocal tensor by three sets of at least seven corresponding image points.
points1 | Image points of first set |
points2 | Image points of second set |
points3 | Image points of third set |
correspondences | Number of point correspondences (at least 7) |
trifocal | Resulting trifocal tensor matrices |