Ocean
TestNonLinearOptimizationPlane.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_PLANE_H
9 #define META_OCEAN_TEST_TESTGEOMETRY_TEST_NON_LINEAR_OPTIMIZATION_PLANE_H
10 
12 
14 
15 namespace Ocean
16 {
17 
18 namespace Test
19 {
20 
21 namespace TestGeometry
22 {
23 
24 /**
25  * This class tests the non linear optimization plane implementations.
26  * @ingroup testgeometry
27  */
28 class OCEAN_TEST_GEOMETRY_EXPORT TestNonLinearOptimizationPlane
29 {
30  public:
31 
32  /**
33  * Tests the non linear optimization plane function.
34  * @param testDuration Number of seconds for each test
35  * @param worker Optional worker object
36  * @return True, if the entire function test has succeeded
37  */
38  static bool test(const double testDuration, Worker* worker);
39 
40  private:
41 
42  /**
43  * Tests the non linear optimization function for a plane.
44  * @param testDuration Number of seconds for each test
45  * @return True, if succeeded
46  */
47  static bool testOptimizePlane(const double testDuration);
48 
49  /**
50  * Tests the non linear optimization function for two cameras capturing 3D object points lying on a plane.
51  * @param testDuration Number of seconds for each test, with range (0, infinity)
52  * @return True, if succeeded
53  */
54  static bool testOptimizeOnePoseOnePlane(const double testDuration);
55 
56  /**
57  * Tests the non linear optimization function for several cameras capturing 3D object points lying on a plane.
58  * @param testDuration Number of seconds for each test, with range (0, infinity)
59  * @return True, if succeeded
60  */
61  static bool testOptimizePosesOnePlane(const double testDuration);
62 
63  /**
64  * Tests the non linear optimization function for a 3D plane with ideal 3D object points.
65  * @param numberPoints Number of image points to be used
66  * @param testDuration Number of seconds for each test
67  * @param type Estimator type to be used
68  * @param outliers Number of outlier correspondences
69  * @return True, if succeeded
70  */
71  static bool testOptimizePlaneIdeal(const unsigned int numberPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const unsigned int outliers = 0);
72 
73  /**
74  * Tests the non linear optimization function for a 3D plane with noisy 3D object points in combination with a RANSAC algorithm.
75  * @param numberPoints Number of image points to be used
76  * @param testDuration Number of seconds for each test
77  * @param type Estimator type to be used
78  * @param standardDeviation Optional standard deviation of the Gaussian normal distribution for noised image points, with range [0, infinity)
79  * @param outliers Number of outlier correspondences
80  * @return True, if succeeded
81  */
82  static bool testOptimizePlaneNoisy(const unsigned int numberPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation = 0, const unsigned int outliers = 0);
83 
84  /**
85  * Tests the non linear optimization function for two cameras capturing 3D object points lying on a plane.
86  * @param correspondences Number of point correspondences
87  * @param testDuration Number of seconds for each test, with range (0, infinity)
88  * @param type Estimator type to be used
89  * @return True, if succeeded
90  */
91  static bool testOptimizeOnePoseOnePlane(const unsigned int correspondences, const double testDuration, const Geometry::Estimator::EstimatorType type);
92 
93  /**
94  * Tests the non linear optimization function for several cameras capturing 3D object points lying on a plane.
95  * @param numberPoses Number of poses to be used
96  * @param correspondences Number of point correspondences
97  * @param testDuration Number of seconds for each test, with range (0, infinity)
98  * @param type Estimator type to be used
99  * @return True, if succeeded
100  */
101  static bool testOptimizePosesOnePlane(const unsigned int numberPoses, const unsigned int correspondences, const double testDuration, const Geometry::Estimator::EstimatorType type);
102 };
103 
104 }
105 
106 }
107 
108 }
109 
110 #endif // META_OCEAN_TEST_TESTGEOMETRY_TEST_NON_LINEAR_OPTIMIZATION_PLANE_H
EstimatorType
Definition of individual robust estimator types.
Definition: Estimator.h:34
This class tests the non linear optimization plane implementations.
Definition: TestNonLinearOptimizationPlane.h:29
static bool testOptimizeOnePoseOnePlane(const double testDuration)
Tests the non linear optimization function for two cameras capturing 3D object points lying on a plan...
static bool test(const double testDuration, Worker *worker)
Tests the non linear optimization plane function.
static bool testOptimizePosesOnePlane(const double testDuration)
Tests the non linear optimization function for several cameras capturing 3D object points lying on a ...
static bool testOptimizePlaneIdeal(const unsigned int numberPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const unsigned int outliers=0)
Tests the non linear optimization function for a 3D plane with ideal 3D object points.
static bool testOptimizePlane(const double testDuration)
Tests the non linear optimization function for a plane.
static bool testOptimizeOnePoseOnePlane(const unsigned int correspondences, const double testDuration, const Geometry::Estimator::EstimatorType type)
Tests the non linear optimization function for two cameras capturing 3D object points lying on a plan...
static bool testOptimizePlaneNoisy(const unsigned int numberPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation=0, const unsigned int outliers=0)
Tests the non linear optimization function for a 3D plane with noisy 3D object points in combination ...
static bool testOptimizePosesOnePlane(const unsigned int numberPoses, const unsigned int correspondences, const double testDuration, const Geometry::Estimator::EstimatorType type)
Tests the non linear optimization function for several cameras capturing 3D object points lying on a ...
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:128
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15