ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
geometry.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <Eigen/Core>
11 #include <vector>
12 
13 namespace colmap {
14 namespace retrieval {
15 
17  float scale = 0.0f;
18  float angle = 0.0f;
19  float tx = 0.0f;
20  float ty = 0.0f;
21 };
22 
24  // Compute the similarity that transforms the shape of feature 1 to
25  // feature 2.
27  const FeatureGeometry& feature1, const FeatureGeometry& feature2);
28  static Eigen::Matrix<float, 2, 3> TransformMatrixFromMatch(
29  const FeatureGeometry& feature1, const FeatureGeometry& feature2);
30 
31  // Get the approximate area occupied by the feature.
32  float GetArea() const;
33 
34  // Get the approximate area occupied by the feature after applying an affine
35  // transformation to the feature geometry.
36  float GetAreaUnderTransform(const Eigen::Matrix2f& A) const;
37 
38  float x = 0.0f;
39  float y = 0.0f;
40  float scale = 0.0f;
41  float orientation = 0.0f;
42 };
43 
44 // 1-to-M feature geometry match.
47  std::vector<FeatureGeometry> geometries2;
48 };
49 
50 } // namespace retrieval
51 } // namespace colmap
std::vector< FeatureGeometry > geometries2
Definition: geometry.h:47
float GetAreaUnderTransform(const Eigen::Matrix2f &A) const
Definition: geometry.cc:82
static FeatureGeometryTransform TransformFromMatch(const FeatureGeometry &feature1, const FeatureGeometry &feature2)
Definition: geometry.cc:37
static Eigen::Matrix< float, 2, 3 > TransformMatrixFromMatch(const FeatureGeometry &feature1, const FeatureGeometry &feature2)
Definition: geometry.cc:59