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