Ocean
TestNonLinearOptimizationLine.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_LINE_H
9 #define META_OCEAN_TEST_TESTGEOMETRY_TEST_NON_LINEAR_OPTIMIZATION_LINE_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 implementations for lines.
26  * @ingroup testgeometry
27  */
28 class OCEAN_TEST_GEOMETRY_EXPORT TestNonLinearOptimizationLine
29 {
30  public:
31 
32  /**
33  * Tests the non linear optimization 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 one 2D line.
44  * @param testDuration Number of seconds for each test
45  * @return True, if succeeded
46  */
47  static bool testNonLinearOptimizationLine(const double testDuration);
48 
49  /**
50  * Tests the non linear optimization function for a 2D line with ideal 2D image points.
51  * @param numberPoints Number of image points to be used
52  * @param testDuration Number of seconds for each test
53  * @param type Estimator type to be used
54  * @param outliers Number of outlier correspondences
55  * @return True, if succeeded
56  */
57  static bool testOptimizeLineIdeal(const unsigned int numberPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const unsigned int outliers = 0);
58 
59  /**
60  * Tests the non linear optimization function for a 2D line with noisy 2D image points.
61  * @param numberPoints Number of image points to be used
62  * @param testDuration Number of seconds for each test
63  * @param type Estimator type to be used
64  * @param standardDeviation Optional standard deviation of the Gaussian normal distribution for noised image points, with range [0, infinity)
65  * @param outliers Number of outlier correspondences
66  * @return True, if succeeded
67  */
68  static bool testOptimizeLineNoisy(const unsigned int numberPoints, const double testDuration, const Geometry::Estimator::EstimatorType type, const Scalar standardDeviation = 0, const unsigned int outliers = 0);
69 };
70 
71 }
72 
73 }
74 
75 }
76 
77 #endif // META_OCEAN_TEST_TESTGEOMETRY_TEST_NON_LINEAR_OPTIMIZATION_H
EstimatorType
Definition of individual robust estimator types.
Definition: Estimator.h:34
This class tests the non linear optimization implementations for lines.
Definition: TestNonLinearOptimizationLine.h:29
static bool testOptimizeLineIdeal(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 2D line with ideal 2D image points.
static bool test(const double testDuration, Worker *worker)
Tests the non linear optimization function.
static bool testNonLinearOptimizationLine(const double testDuration)
Tests the non linear optimization function for one 2D line.
static bool testOptimizeLineNoisy(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 2D line with noisy 2D image points.
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