27 P->block<3, 3>(0, 0) =
R;
34 Mat3 K =
P.block(0, 0, 3, 3);
43 double l =
sqrt(c * c + s * s);
53 Q = Qx.transpose() * Q;
59 double l =
sqrt(c * c + s * s);
69 Q = Qy.transpose() * Q;
75 double l =
sqrt(c * c + s * s);
85 Q = Qz.transpose() * Q;
122 p <<
P(0, 3),
P(1, 3),
P(2, 3);
125 Vec3 t =
K.inverse() * p;
136 const Vec2& principal_point,
137 const Vec2& principal_point_new,
141 T << 1, 0, principal_point_new(0) - principal_point(0),
142 0, 1, principal_point_new(1) - principal_point(1),
149 const Vec2& principal_point,
151 double aspect_ratio_new,
156 0, aspect_ratio_new / aspect_ratio, 0,
167 int d =
H.rows() - 1;
170 for (
size_t i = 0; i < n; ++i) {
172 for (
int j = 0; j < d; ++j) {
173 (*X)(j, i) =
H(j, i) / h;
179 e->resize(2, h.cols());
180 e->row(0) = h.row(0).array() / h.row(2).array();
181 e->row(1) = h.row(1).array() / h.row(2).array();
184 e->resize(3, h.cols());
185 e->row(0) = h.row(0).array() / h.row(3).array();
186 e->row(1) = h.row(1).array() / h.row(3).array();
187 e->row(2) = h.row(2).array() / h.row(3).array();
192 *
X <<
H(0) /
w,
H(1) /
w;
197 *
X <<
H(0) /
w,
H(1) /
w,
H(2) /
w;
204 H->block(0, 0, d, n) =
X;
213 *
H <<
X(0),
X(1),
X(2), 1;
220 Mat3X x_camera_h =
K.inverse() * x_image_h;
225 Mat3X x_camera_h =
K.inverse() *
x;
230 return (
R *
X)(2) + t(2);
234 Vec3 Xe =
X.head<3>() /
X(3);
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void EuclideanToHomogeneous(const Mat &X, Mat *H)
Eigen::Matrix< double, 3, 3 > Mat3
void HomogeneousToEuclidean(const Mat &H, Mat *X)
void HomogeneousToNormalizedCamera(const Mat3X &x, const Mat3 &K, Mat2X *n)
void ProjectionShiftPrincipalPoint(const Mat34 &P, const Vec2 &principal_point, const Vec2 &principal_point_new, Mat34 *P_new)
double Depth(const Mat3 &R, const Vec3 &t, const Vec3 &X)
void KRt_From_P(const Mat34 &P, Mat3 *Kp, Mat3 *Rp, Vec3 *tp)
Eigen::Matrix< double, 3, 4 > Mat34
Eigen::Matrix< double, 4, Eigen::Dynamic > Mat4X
Eigen::Matrix< double, 3, Eigen::Dynamic > Mat3X
void ProjectionChangeAspectRatio(const Mat34 &P, const Vec2 &principal_point, double aspect_ratio, double aspect_ratio_new, Mat34 *P_new)
Eigen::Matrix< double, 2, Eigen::Dynamic > Mat2X
void P_From_KRt(const Mat3 &K, const Mat3 &R, const Vec3 &t, Mat34 *P)
void EuclideanToNormalizedCamera(const Mat2X &x, const Mat3 &K, Mat2X *n)