Ocean
TestHomography.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_TEST_TESTGEOMETRY_TEST_HOMOGRAPHY_H
9 #define META_OCEAN_TEST_TESTGEOMETRY_TEST_HOMOGRAPHY_H
10 
12 
13 #include "ocean/base/Worker.h"
14 
15 namespace Ocean
16 {
17 
18 namespace Test
19 {
20 
21 namespace TestGeometry
22 {
23 
24 /**
25  * This class implements homography tests.
26  * @ingroup testgeometry
27  */
28 class OCEAN_TEST_GEOMETRY_EXPORT TestHomography
29 {
30  public:
31 
32  /**
33  * Tests all homography functions.
34  * @param testDuration Number of seconds for each test, with range (0, infinity)
35  * @param worker The worker object to distribute the computation
36  * @return True, if succeeded
37  */
38  static bool test(const double testDuration, Worker& worker);
39 
40  /**
41  * Tests the rotational homography for one pose.
42  * @param testDuration Number of seconds for each test, with range (0, infinity)
43  * @return True, if succeeded
44  */
45  static bool testRotationalHomographyOnePose(const double testDuration);
46 
47  /**
48  * Tests the rotational homography for two poses.
49  * @param testDuration Number of seconds for each test, with range (0, infinity)
50  * @return True, if succeeded
51  */
52  static bool testRotationalHomographyTwoPoses(const double testDuration);
53 
54  /**
55  * Tests the planar homography with one idenity camera pose and one variable camera pose.
56  * @param testDuration Number of seconds for each test, with range (0, infinity)
57  * @return True, if succeeded
58  */
59  static bool testPlanarHomographyOnePose(const double testDuration);
60 
61  /**
62  * Tests the planar homography with two variable camera poses.
63  * @param testDuration Number of seconds for each test, with range (0, infinity)
64  * @return True, if succeeded
65  */
66  static bool testPlanarHomographyTwoPoses(const double testDuration);
67 
68  /**
69  * Tests the factorization of the planar homography with one idenity camera pose and one variable camera pose.
70  * @param testDuration Number of seconds for each test, with range (0, infinity)
71  * @return True, if succeeded
72  */
73  static bool testFactorizationPlanarHomographyOnePose(const double testDuration);
74 
75  /**
76  * Tests the factorization of the planar homography with two variable camera poses.
77  * @param testDuration Number of seconds for each test, with range (0, infinity)
78  * @return True, if succeeded
79  */
80  static bool testFactorizationPlanarHomographyTwoPoses(const double testDuration);
81 
82  /**
83  * Tests the 3D planar 2D-2D homography.
84  * @param testDuration Number of seconds for each test, with range (0, infinity)
85  * @return True, if succeeded
86  */
87  static bool testFaultlessPlanarHomography2D(const double testDuration);
88 
89  /**
90  * Tests the 3D planar 2D-2D homography.
91  * @param testDuration Number of seconds for each test, with range (0, infinity)
92  * @return True, if succeeded
93  */
94  static bool testFaultlessNoisedPlanarHomography2D(const double testDuration);
95 
96  /**
97  * Tests homography determination.
98  * @param testDuration Number of seconds for each test, with range (0, infinity)
99  * @return True, if succeeded
100  */
101  static bool testFaultlessHomography(const double testDuration);
102 
103  /**
104  * Tests homography determination.
105  * @param testDuration Number of seconds for each test, with range (0, infinity)
106  * @return True, if succeeded
107  */
108  static bool testFaultlessNoisedHomography(const double testDuration);
109 
110  /**
111  * Tests intrinsic camera matrix determination.
112  * @param testDuration Number of seconds for each test, with range (0, infinity)
113  * @return True, if succeeded
114  */
115  static bool testIntrinsic(const double testDuration);
116 
117  /**
118  * Tests the function determining the homothetic matrix.
119  * @param testDuration Number of seconds for each test, with range (0, infinity)
120  * @return True, if succeeded
121  */
122  static bool testHomotheticMatrix(const double testDuration);
123 
124  /**
125  * Tests the function determining the homothetic matrix with a specified number of point correspondences
126  * @param testDuration Number of seconds for each test, with range (0, infinity)
127  * @param points The number of point correspondences to be used, with range [3, infinity)
128  * @return True, if succeeded
129  */
130  static bool testHomotheticMatrix(const double testDuration, const size_t points);
131 
132  /**
133  * Tests the function determining the similarity matrix.
134  * @param testDuration Number of seconds for each test, with range (0, infinity)
135  * @return True, if succeeded
136  */
137  static bool testSimilarityMatrix(const double testDuration);
138 
139  /**
140  * Tests the function determining the similarity matrix with a specified number of point correspondences
141  * @param testDuration Number of seconds for each test, with range (0, infinity)
142  * @param points The number of point correspondences to be used, with range [3, infinity)
143  * @return True, if succeeded
144  */
145  static bool testSimilarityMatrix(const double testDuration, const size_t points);
146 
147  /**
148  * Tests the function determining the affine matrix.
149  * @param testDuration Number of seconds for each test, with range (0, infinity)
150  * @return True, if succeeded
151  */
152  static bool testAffineMatrix(const double testDuration);
153 
154  /**
155  * Tests the function determining the affine matrix with a specified number of point correspondences
156  * @param testDuration Number of seconds for each test, with range (0, infinity)
157  * @param points The number of point correspondences to be used, with range [3, infinity)
158  * @return True, if succeeded
159  */
160  static bool testAffineMatrix(const double testDuration, const size_t points);
161 
162  /**
163  * Tests the function determining the homography matrix.
164  * @param testDuration Number of seconds for each test, with range (0, infinity)
165  * @param useSVD True, to use the slower SVD approach (i.e., homographyMatrixSVD); False, to use the two-step approach (i.e., homographyMatrixLinear)
166  * @return True, if succeeded
167  */
168  static bool testHomographyMatrix(const double testDuration, const bool useSVD);
169 
170  /**
171  * Tests the function determining the homography matrix based on points and lines.
172  * @param testDuration Number of seconds for each test, with range (0, infinity)
173  * @return True, if succeeded
174  */
175  static bool testHomographyMatrixFromPointsAndLinesSVD(const double testDuration);
176 
177  /**
178  * Tests the function determining the homography matrix with a specified number of point correspondences
179  * @param testDuration Number of seconds for each test, with range (0, infinity)
180  * @param points The number of point correspondences to be used, with range [4, infinity)
181  * @param useSVD True, to use the slower SVD approach (i.e., homographyMatrixSVD); False, to use the two-step approach (i.e., homographyMatrixLinear)
182  * @return True, if succeeded
183  */
184  static bool testHomographyMatrix(const double testDuration, const size_t points, const bool useSVD);
185 
186  /**
187  * Tests the function determining the homography matrix based on points and lines.
188  * @param testDuration Number of seconds for each test, with range (0, infinity)
189  * @param correspondences The number of point or line correspondences to be used, with range [4, infinity)
190  * @return True, if succeeded
191  */
192  static bool testHomographyMatrixFromPointsAndLinesSVD(const double testDuration, const size_t correspondences);
193 };
194 
195 }
196 
197 }
198 
199 }
200 
201 #endif // META_OCEAN_TEST_TESTGEOMETRY_TEST_HOMOGRAPHY_H
This class implements homography tests.
Definition: TestHomography.h:29
static bool testFaultlessNoisedPlanarHomography2D(const double testDuration)
Tests the 3D planar 2D-2D homography.
static bool testFactorizationPlanarHomographyTwoPoses(const double testDuration)
Tests the factorization of the planar homography with two variable camera poses.
static bool testFaultlessPlanarHomography2D(const double testDuration)
Tests the 3D planar 2D-2D homography.
static bool testPlanarHomographyTwoPoses(const double testDuration)
Tests the planar homography with two variable camera poses.
static bool testSimilarityMatrix(const double testDuration)
Tests the function determining the similarity matrix.
static bool testHomographyMatrix(const double testDuration, const size_t points, const bool useSVD)
Tests the function determining the homography matrix with a specified number of point correspondences...
static bool testHomotheticMatrix(const double testDuration)
Tests the function determining the homothetic matrix.
static bool testHomotheticMatrix(const double testDuration, const size_t points)
Tests the function determining the homothetic matrix with a specified number of point correspondences...
static bool testPlanarHomographyOnePose(const double testDuration)
Tests the planar homography with one idenity camera pose and one variable camera pose.
static bool testHomographyMatrixFromPointsAndLinesSVD(const double testDuration)
Tests the function determining the homography matrix based on points and lines.
static bool testFactorizationPlanarHomographyOnePose(const double testDuration)
Tests the factorization of the planar homography with one idenity camera pose and one variable camera...
static bool testSimilarityMatrix(const double testDuration, const size_t points)
Tests the function determining the similarity matrix with a specified number of point correspondences...
static bool testHomographyMatrixFromPointsAndLinesSVD(const double testDuration, const size_t correspondences)
Tests the function determining the homography matrix based on points and lines.
static bool testIntrinsic(const double testDuration)
Tests intrinsic camera matrix determination.
static bool testAffineMatrix(const double testDuration, const size_t points)
Tests the function determining the affine matrix with a specified number of point correspondences.
static bool testHomographyMatrix(const double testDuration, const bool useSVD)
Tests the function determining the homography matrix.
static bool testFaultlessNoisedHomography(const double testDuration)
Tests homography determination.
static bool testFaultlessHomography(const double testDuration)
Tests homography determination.
static bool test(const double testDuration, Worker &worker)
Tests all homography functions.
static bool testRotationalHomographyOnePose(const double testDuration)
Tests the rotational homography for one pose.
static bool testAffineMatrix(const double testDuration)
Tests the function determining the affine matrix.
static bool testRotationalHomographyTwoPoses(const double testDuration)
Tests the rotational homography for two poses.
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15