Ocean
testcv/testopencv/TestGeometry.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_TESTCV_TESTOPENCV_TEST_GEOMETRY_H
9 #define META_OCEAN_TEST_TESTCV_TESTOPENCV_TEST_GEOMETRY_H
10 
12 
14 
15 namespace Ocean
16 {
17 
18 namespace Test
19 {
20 
21 namespace TestCV
22 {
23 
24 namespace TestOpenCV
25 {
26 
27 /**
28  * This class tests the performance of several OpenCV functions from the module calib3d (aka geometry in Ocean).
29  * @ingroup testcvopencv
30  */
31 class OCEAN_TEST_CV_OPENCV_EXPORT TestGeometry
32 {
33  public:
34 
35  /**
36  * Tests all functions of relevant feature detectors in OpenCV.
37  * @param testDuration Number of seconds for each test, with range (0, infinity)
38  * @return True, if succeeded
39  */
40  static bool test(const double testDuration);
41 
42  /**
43  * Returns the name of this test.
44  * @return The name of this test
45  */
46  static const std::string& testName();
47 
48  protected:
49 
50  /**
51  * Test for the OpenCV PnP functionality
52  * @param testDuration Duration in seconds that each of the sub-tests is run
53  * @param pinholeCamera The pinhole camera model; all necessary information for OpenCV is extracted from this model
54  * @param numberOfPoints Number of (random) image-object point pairs to be used for the test (default: 3, must be >= 3)
55  * @return True if all included test succeeded, otherwise false
56  */
57  static bool testPnP(const double testDuration, const PinholeCamera& pinholeCamera, const size_t numberOfPoints = 3);
58 
59  /**
60  * Test for the OpenCV PnP functionality (including RANSAC)
61  * @param testDuration Duration in seconds that each of the sub-tests is run
62  * @param pinholeCamera The pinhole camera model; all necessary information for OpenCV is extracted from this model
63  * @param numberOfPoints Number of (random) image-object point pairs to be used for the test (default: 3, must be >= 3)
64  * @return True if all included test succeeded, otherwise false
65  */
66  static bool testPnPRANSAC(const double testDuration, const PinholeCamera& pinholeCamera, const size_t numberOfPoints = 3);
67 };
68 
69 } // namespace TestOpenCV
70 
71 } // namespace TestCV
72 
73 } // namespace Test
74 
75 } // namespace Ocean
76 
77 #endif // META_OCEAN_TEST_TESTCV_TESTOPENCV_TEST_GEOMETRY_H
This class tests the performance of several OpenCV functions from the module calib3d (aka geometry in...
Definition: testcv/testopencv/TestGeometry.h:32
static bool test(const double testDuration)
Tests all functions of relevant feature detectors in OpenCV.
static const std::string & testName()
Returns the name of this test.
static bool testPnPRANSAC(const double testDuration, const PinholeCamera &pinholeCamera, const size_t numberOfPoints=3)
Test for the OpenCV PnP functionality (including RANSAC)
static bool testPnP(const double testDuration, const PinholeCamera &pinholeCamera, const size_t numberOfPoints=3)
Test for the OpenCV PnP functionality.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15