2
2
* @file FundamentalMatrix.h
3
3
* @brief FundamentalMatrix classes
4
4
* @author Frank Dellaert
5
- * @date Oct 23, 2024
5
+ * @date October 2024
6
6
*/
7
7
8
8
#pragma once
@@ -34,17 +34,19 @@ class GTSAM_EXPORT FundamentalMatrix {
34
34
double s_; // /< Scalar parameter for S
35
35
Rot3 V_; // /< Right rotation
36
36
37
+ static constexpr double kScale = 1000 ; // s is stored in s_ as s/kScale
38
+
37
39
public:
38
40
// / Default constructor
39
- FundamentalMatrix () : U_(Rot3()), sign_(1.0 ), s_(1.0 ), V_(Rot3()) {}
41
+ FundamentalMatrix () : U_(Rot3()), sign_(1.0 ), s_(1.0 / kScale ), V_(Rot3()) {}
40
42
41
43
/* *
42
44
* @brief Construct from U, V, and scalar s
43
45
*
44
46
* Initializes the FundamentalMatrix From the SVD representation
45
47
* U*diag(1,s,0)*V^T. It will internally convert to using SO(3).
46
48
*/
47
- FundamentalMatrix (const Matrix & U, double s, const Matrix & V);
49
+ FundamentalMatrix (const Matrix3 & U, double s, const Matrix3 & V);
48
50
49
51
/* *
50
52
* @brief Construct from a 3x3 matrix using SVD
@@ -60,7 +62,9 @@ class GTSAM_EXPORT FundamentalMatrix {
60
62
* @brief Construct from essential matrix and calibration matrices
61
63
*
62
64
* Initializes the FundamentalMatrix from the given essential matrix E
63
- * and calibration matrices Ka and Kb.
65
+ * and calibration matrices Ka and Kb, using
66
+ * F = Ka^(-T) * E * Kb^(-1)
67
+ * and then calls constructor that decomposes F via SVD.
64
68
*
65
69
* @param E Essential matrix
66
70
* @param Ka Calibration matrix for the left camera
@@ -111,8 +115,8 @@ class GTSAM_EXPORT FundamentalMatrix {
111
115
// / @}
112
116
private:
113
117
// / Private constructor for internal use
114
- FundamentalMatrix (const Rot3& U, double sign, double s , const Rot3& V)
115
- : U_(U), sign_(sign), s_(s ), V_(V) {}
118
+ FundamentalMatrix (const Rot3& U, double sign, double scaled_s , const Rot3& V)
119
+ : U_(U), sign_(sign), s_(scaled_s ), V_(V) {}
116
120
117
121
// / Initialize SO(3) matrices from general O(3) matrices
118
122
void initialize (const Matrix3& U, double s, const Matrix3& V);
0 commit comments