Ocean
Loading...
Searching...
No Matches
TestNonLinearOptimizationObjectPoint.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_NON_LINEAR_OPTIMIZATION_OBJECT_POINT_H
9#define META_OCEAN_TEST_TESTGEOMETRY_TEST_NON_LINEAR_OPTIMIZATION_OBJECT_POINT_H
10
12
15
18
20
21namespace Ocean
22{
23
24namespace Test
25{
26
27namespace TestGeometry
28{
29
30/**
31 * This class tests the non linear optimization plane implementations.
32 * @ingroup testgeometry
33 */
35{
36 public:
37
38 /**
39 * Tests the non linear optimization orientation function.
40 * @param testDuration Number of seconds for each test
41 * @param worker Optional worker object
42 * @param selector Selector for sub-tests
43 * @return True, if the entire function test has succeeded
44 */
45 static bool test(const double testDuration, Worker* worker, const TestSelector& selector);
46
47 /**
48 * Tests the non linear optimization function for several 3D object points and a pinhole camera.
49 * @param testDuration Number of seconds for each test, with range (0, infinity)
50 * @param worker Optional worker object
51 * @return True, if succeeded
52 */
53 static bool testNonLinearOptimizationObjectPointsPinholeCamera(const double testDuration, Worker* worker);
54
55 /**
56 * Tests the non linear optimization function for object points with a specific camera and a specified number of random point correspondences.
57 * @param patternCamera The camera profile pattern which will be used for the test
58 * @param poses Number of camera poses
59 * @param numberObjectPoints Number of object point points
60 * @param testDuration Number of seconds for each test, with range (0, infinity)
61 * @param type Estimator type to be used
62 * @param standardDeviation Optional standard deviation of the Gaussian normal distribution for noised image points
63 * @param outliers Number of outliers correspondences
64 * @param worker Optional worker object
65 * @return True, if succeeded
66 */
67 static bool testNonLinearOptimizationObjectPointsPinholeCamera(const PinholeCamera& patternCamera, const unsigned int poses, const unsigned int numberObjectPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation = 0, const unsigned int outliers = 0u, Worker* worker = nullptr);
68
69 /**
70 * Tests the non linear optimization function for one 3D object point and a fisheye camera.
71 * @param testDuration Number of seconds for each test, with range (0, infinity)
72 * @return True, if succeeded
73 */
74 static bool testNonLinearOptimizationObjectPointFisheyeCamera(const double testDuration);
75
76 /**
77 * Tests the non linear optimization function for one object point with a specific a specific number of random point correspondences.
78 * @param poses Number of camera poses
79 * @param testDuration Number of seconds for each test, with range (0, infinity)
80 * @param type Estimator type to be used
81 * @param standardDeviation Optional standard deviation of the Gaussian normal distribution for noised image points
82 * @param outliers Number of outliers correspondences
83 * @return True, if succeeded
84 */
85 static bool testNonLinearOptimizationObjectPointFisheyeCamera(const unsigned int poses, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation = 0, const unsigned int outliers = 0u);
86
87 /**
88 * Tests the non linear optimization function for one 3D object point and any camera.
89 * @param testDuration Number of seconds for each test, with range (0, infinity)
90 * @return True, if succeeded
91 */
92 static bool testNonLinearOptimizationObjectPointAnyCamera(const double testDuration);
93
94 /**
95 * Tests the non linear optimization function for one object point with a specific a specific number of random point correspondences.
96 * @param anyCamera The camera profile to be used, must be valid
97 * @param poses Number of camera poses, with range [2, infinity)
98 * @param testDuration Number of seconds for each test, with range (0, infinity)
99 * @param type Estimator type to be used
100 * @param standardDeviation Optional standard deviation of the Gaussian normal distribution for noised image points
101 * @param outliers Number of outliers correspondences, with range [0, poses - 1]
102 * @return True, if succeeded
103 */
104 static bool testNonLinearOptimizationObjectPointAnyCamera(const AnyCamera& anyCamera, const unsigned int poses, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation = 0, const unsigned int outliers = 0u);
105
106 /**
107 * Tests the non linear optimization function for one 3D object point and any camera.
108 * @param testDuration Number of seconds for each test, with range (0, infinity)
109 * @return True, if succeeded
110 */
111 static bool testNonLinearOptimizationObjectPointStereoAnyCamera(const double testDuration);
112
113 /**
114 * Tests the non linear optimization function for one object point with a specific a specific number of random point correspondences.
115 * @param anyCameraA The first camera profile to be used, must be valid
116 * @param anyCameraB The second camera profile to be used, must be valid
117 * @param poses Number of camera poses, with range [2, infinity)
118 * @param testDuration Number of seconds for each test, with range (0, infinity)
119 * @param type Estimator type to be used
120 * @param standardDeviation Optional standard deviation of the Gaussian normal distribution for noised image points
121 * @param outliers Number of outliers correspondences, with range [0, poses - 1]
122 * @return True, if succeeded
123 */
124 static bool testNonLinearOptimizationObjectPointStereoAnyCamera(const AnyCamera& anyCameraA, const AnyCamera& anyCameraB, const unsigned int poses, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation = 0, const unsigned int outliers = 0u);
125
126 /**
127 * Tests the non linear optimization function for one 3D object point and any cameras.
128 * @param testDuration Number of seconds for each test, with range (0, infinity)
129 * @return True, if succeeded
130 */
131 static bool testNonLinearOptimizationObjectPointAnyCameras(const double testDuration);
132
133 /**
134 * Tests the non linear optimization function for one object point with a specific a specific number of random point correspondences.
135 * @param poses Number of camera poses, with range [2, infinity)
136 * @param testDuration Number of seconds for each test, with range (0, infinity)
137 * @param type Estimator type to be used
138 * @param standardDeviation Optional standard deviation of the Gaussian normal distribution for noised image points
139 * @param outliers Number of outliers correspondences, with range [0, poses - 1]
140 * @return True, if succeeded
141 */
142 static bool testNonLinearOptimizationObjectPointAnyCameras(const unsigned int poses, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation = 0, const unsigned int outliers = 0u);
143
144
145 /**
146 * Tests the non linear optimization function for one 3D object point and a stereo fisheye camera.
147 * @param testDuration Number of seconds for each test, with range (0, infinity)
148 * @return True, if succeeded
149 */
150 static bool testNonLinearOptimizationObjectPointStereoFisheyeCamera(const double testDuration);
151
152 /**
153 * Tests the non linear optimization function for one object point with a specific a specific number of random point correspondences.
154 * @param poses Number of camera poses
155 * @param testDuration Number of seconds for each test, with range (0, infinity)
156 * @param type Estimator type to be used
157 * @param standardDeviation Optional standard deviation of the Gaussian normal distribution for noised image points
158 * @param outliers Number of outliers correspondences
159 * @return True, if succeeded
160 */
161 static bool testNonLinearOptimizationObjectPointStereoFisheyeCamera(const unsigned int poses, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation = 0, const unsigned int outliers = 0u);
162
163 /**
164 * Tests the non linear optimization function for one static and one dynamic 6DOF poses and several dynamic 3D object points.
165 * @param testDuration Number of seconds for each test, with range (0, infinity)
166 * @return True, if succeeded
167 */
168 static bool testNonLinearOptimizationOnePoseObjectPoints(const double testDuration);
169
170 /**
171 * Tests the non linear optimization function for one static and one dynamic camera pose and several dynamic object points.
172 * @param numberObjectPoints Number of object points
173 * @param testDuration Number of seconds for each test, with range (0, infinity)
174 * @param type Estimator type to be used
175 * @param standardDeviation Optional standard deviation of the Gaussian normal distribution for noised image points
176 * @param outliers Number of outliers correspondences
177 * @param useCovariances True, to create and use perfect covariance matrices
178 * @return True, if succeeded
179 */
180 static bool testNonLinearOptimizationOnePoseObjectPoints(const unsigned int numberObjectPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation = 0, const unsigned int outliers = 0u, const bool useCovariances = false);
181
182 /**
183 * Tests the non linear optimization function for one static and one dynamic 6DOF poses and several dynamic 3D object points.
184 * @param testDuration Number of seconds for each test, with range (0, infinity)
185 * @return True, if succeeded
186 */
187 static bool testNonLinearOptimizationTwoPosesObjectPoints(const double testDuration);
188
189 /**
190 * Tests the non linear optimization function for two dynamic camera pose and several dynamic object points.
191 * @param pinholeCamera The pinhole camera to test
192 * @param numberObjectPoints Number of object points
193 * @param testDuration Number of seconds for each test, with range (0, infinity)
194 * @param type Estimator type to be used
195 * @param standardDeviation Optional standard deviation of the Gaussian normal distribution for noised image points
196 * @param outliers Number of outliers correspondences
197 * @param useCovariances True, to create and use perfect covariance matrices
198 * @return True, if succeeded
199 */
200 static bool testNonLinearOptimizationTwoPosesObjectPoints(const PinholeCamera& pinholeCamera, const unsigned int numberObjectPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation = 0, const unsigned int outliers = 0u, const bool useCovariances = false);
201
202 /**
203 * Tests the non linear optimization function for several 6DOF poses and several 3D object points.
204 * @param testDuration Number of seconds for each test, with range (0, infinity)
205 * @return True, if succeeded
206 */
207 static bool testNonLinearOptimizationPosesObjectPoints(const double testDuration);
208
209 /**
210 * Tests the non linear optimization function for poses, and object points, and a specified number of random point correspondences.
211 * @param numberPoses The number of camera poses, with range [2, infinity)
212 * @param numberObjectPoints Number of object points, with range [4, infinity)
213 * @param testDuration Number of seconds for each test, with range (0, infinity)
214 * @param type The estimator type to be used
215 * @param noiseStandardDeviation The standard deviation of the Gaussian normal distribution for noised image points, with range [0, infinity)
216 * @param numberOutliers The number of outliers correspondences, with range [0, numberObjectPoints]
217 * @return True, if succeeded
218 */
219 static bool testNonLinearOptimizationPosesObjectPoints(const unsigned int numberPoses, const unsigned int numberObjectPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar noiseStandardDeviation = Scalar(0), const unsigned int numberOutliers = 0u);
220
221 /**
222 * Tests the non linear optimization function for several 6DOF poses (with fixed translations) and several 3D object points.
223 * @param testDuration Number of seconds for each test, with range (0, infinity)
224 * @return True, if succeeded
225 */
226 static bool testNonLinearOptimizationOrientationalPosesObjectPoints(const double testDuration);
227
228 /**
229 * Tests the non linear optimization function for poses (with fixed translations), and object points, and a specified number of random point correspondences.
230 * @param numberPoses The number of camera poses, with range [2, infinity)
231 * @param numberObjectPoints Number of object points, with range [4, infinity)
232 * @param testDuration Number of seconds for each test, with range (0, infinity)
233 * @param type The estimator type to be used
234 * @param noiseStandardDeviation The standard deviation of the Gaussian normal distribution for noised image points, with range [0, infinity)
235 * @param numberOutliers The number of outliers correspondences, with range [0, numberObjectPoints]
236 * @return True, if succeeded
237 */
238 static bool testNonLinearOptimizationOrientationalPosesObjectPoints(const unsigned int numberPoses, const unsigned int numberObjectPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar noiseStandardDeviation = Scalar(0), const unsigned int numberOutliers = 0u);
239
240 /**
241 * Tests the non linear optimization function for a 3D object point observed in several cameras with rotational motion.
242 * @param testDuration Number of seconds for each test
243 * @return True, if succeeded
244 */
245 static bool testOptimizeObjectPointRotationalPoses(const double testDuration);
246
247 /**
248 * Tests the non linear optimization function for a 3D object point observed in several cameras with rotational motion with noisy image points optional in combination with a RANSAC algorithm.
249 * @param patternCamera The camera profile pattern which will be used for the test
250 * @param numberObservations Number of observations to be used, with range [1, infinity)
251 * @param testDuration Number of seconds for each test, with range (0, infinity)
252 * @param type Estimator type to be used
253 * @param standardDeviation Optional standard deviation of the Gaussian normal distribution for noised image points, with range [0, infinity)
254 * @param outliers Number of outliers correspondences
255 * @param useRoughObjectPoint True, to use a rough object point as start for the optimization; False, to use a RANSAC approach for a initial object point
256 * @return True, if succeeded
257 */
258 static bool testOptimizeObjectPointRotationalPoses(const PinholeCamera& patternCamera, const unsigned int numberObservations, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation, const unsigned int outliers, const bool useRoughObjectPoint);
259};
260
261}
262
263}
264
265}
266
267#endif // META_OCEAN_TEST_TESTGEOMETRY_TEST_NON_LINEAR_OPTIMIZATION_OBJECT_POINT_H
This class implements the abstract base class for all AnyCamera objects.
Definition AnyCamera.h:131
EstimatorType
Definition of individual robust estimator types.
Definition Estimator.h:34
This class implements least square or robust optimization algorithms optimizing the locations of 3D o...
Definition NonLinearOptimizationObjectPoint.h:33
This class tests the non linear optimization plane implementations.
Definition TestNonLinearOptimizationObjectPoint.h:35
static bool testNonLinearOptimizationPosesObjectPoints(const double testDuration)
Tests the non linear optimization function for several 6DOF poses and several 3D object points.
static bool testNonLinearOptimizationObjectPointStereoAnyCamera(const double testDuration)
Tests the non linear optimization function for one 3D object point and any camera.
static bool testNonLinearOptimizationPosesObjectPoints(const unsigned int numberPoses, const unsigned int numberObjectPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar noiseStandardDeviation=Scalar(0), const unsigned int numberOutliers=0u)
Tests the non linear optimization function for poses, and object points, and a specified number of ra...
static bool testNonLinearOptimizationObjectPointAnyCamera(const AnyCamera &anyCamera, const unsigned int poses, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation=0, const unsigned int outliers=0u)
Tests the non linear optimization function for one object point with a specific a specific number of ...
static bool testOptimizeObjectPointRotationalPoses(const PinholeCamera &patternCamera, const unsigned int numberObservations, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation, const unsigned int outliers, const bool useRoughObjectPoint)
Tests the non linear optimization function for a 3D object point observed in several cameras with rot...
static bool testNonLinearOptimizationObjectPointStereoFisheyeCamera(const unsigned int poses, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation=0, const unsigned int outliers=0u)
Tests the non linear optimization function for one object point with a specific a specific number of ...
static bool test(const double testDuration, Worker *worker, const TestSelector &selector)
Tests the non linear optimization orientation function.
static bool testNonLinearOptimizationOrientationalPosesObjectPoints(const unsigned int numberPoses, const unsigned int numberObjectPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar noiseStandardDeviation=Scalar(0), const unsigned int numberOutliers=0u)
Tests the non linear optimization function for poses (with fixed translations), and object points,...
static bool testNonLinearOptimizationObjectPointsPinholeCamera(const PinholeCamera &patternCamera, const unsigned int poses, const unsigned int numberObjectPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation=0, const unsigned int outliers=0u, Worker *worker=nullptr)
Tests the non linear optimization function for object points with a specific camera and a specified n...
static bool testNonLinearOptimizationObjectPointFisheyeCamera(const double testDuration)
Tests the non linear optimization function for one 3D object point and a fisheye camera.
static bool testNonLinearOptimizationObjectPointAnyCamera(const double testDuration)
Tests the non linear optimization function for one 3D object point and any camera.
static bool testOptimizeObjectPointRotationalPoses(const double testDuration)
Tests the non linear optimization function for a 3D object point observed in several cameras with rot...
static bool testNonLinearOptimizationOnePoseObjectPoints(const unsigned int numberObjectPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation=0, const unsigned int outliers=0u, const bool useCovariances=false)
Tests the non linear optimization function for one static and one dynamic camera pose and several dyn...
static bool testNonLinearOptimizationObjectPointAnyCameras(const unsigned int poses, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation=0, const unsigned int outliers=0u)
Tests the non linear optimization function for one object point with a specific a specific number of ...
static bool testNonLinearOptimizationObjectPointsPinholeCamera(const double testDuration, Worker *worker)
Tests the non linear optimization function for several 3D object points and a pinhole camera.
static bool testNonLinearOptimizationTwoPosesObjectPoints(const double testDuration)
Tests the non linear optimization function for one static and one dynamic 6DOF poses and several dyna...
static bool testNonLinearOptimizationObjectPointFisheyeCamera(const unsigned int poses, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation=0, const unsigned int outliers=0u)
Tests the non linear optimization function for one object point with a specific a specific number of ...
static bool testNonLinearOptimizationOnePoseObjectPoints(const double testDuration)
Tests the non linear optimization function for one static and one dynamic 6DOF poses and several dyna...
static bool testNonLinearOptimizationOrientationalPosesObjectPoints(const double testDuration)
Tests the non linear optimization function for several 6DOF poses (with fixed translations) and sever...
static bool testNonLinearOptimizationTwoPosesObjectPoints(const PinholeCamera &pinholeCamera, const unsigned int numberObjectPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation=0, const unsigned int outliers=0u, const bool useCovariances=false)
Tests the non linear optimization function for two dynamic camera pose and several dynamic object poi...
static bool testNonLinearOptimizationObjectPointStereoFisheyeCamera(const double testDuration)
Tests the non linear optimization function for one 3D object point and a stereo fisheye camera.
static bool testNonLinearOptimizationObjectPointAnyCameras(const double testDuration)
Tests the non linear optimization function for one 3D object point and any cameras.
static bool testNonLinearOptimizationObjectPointStereoAnyCamera(const AnyCamera &anyCameraA, const AnyCamera &anyCameraB, const unsigned int poses, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation=0, const unsigned int outliers=0u)
Tests the non linear optimization function for one object point with a specific a specific number of ...
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
float Scalar
Definition of a scalar type.
Definition Math.h:129
The namespace covering the entire Ocean framework.
Definition Accessor.h:15