44 const float sin_angle = std::sin(tform.
angle);
45 const float cos_angle = std::cos(tform.
angle);
48 R << cos_angle, -sin_angle, sin_angle, cos_angle;
50 const Eigen::Vector2f t =
51 Eigen::Vector2f(feature2.
x, feature2.
y) -
52 tform.
scale * R * Eigen::Vector2f(feature1.
x, feature1.
y);
61 Eigen::Matrix<float, 2, 3> T;
66 const float sin_angle = std::sin(angle);
67 const float cos_angle = std::cos(angle);
69 T.leftCols<2>() << cos_angle, -sin_angle, sin_angle, cos_angle;
70 T.leftCols<2>() *=
scale;
72 T.rightCols<1>() = Eigen::Vector2f(feature2.
x, feature2.
y) -
73 T.leftCols<2>() * Eigen::Vector2f(feature1.
x, feature1.
y);
83 const Eigen::Matrix2f M = Eigen::Matrix2f::Identity() / (
scale *
scale);
84 const Eigen::Matrix2f N = A.transpose() * M * A;
85 const float B = N(1, 0) + N(0, 1);
86 return 1.0f / std::sqrt(4.0f * N(0, 0) * N(1, 1) - B * B);
float GetAreaUnderTransform(const Eigen::Matrix2f &A) const
static FeatureGeometryTransform TransformFromMatch(const FeatureGeometry &feature1, const FeatureGeometry &feature2)
static Eigen::Matrix< float, 2, 3 > TransformMatrixFromMatch(const FeatureGeometry &feature1, const FeatureGeometry &feature2)