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