Ocean
TestDatabase.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_TESTTRACKING_TEST_DATABASE_H
9 #define META_OCEAN_TEST_TESTTRACKING_TEST_DATABASE_H
10 
12 
14 
16 
17 namespace Ocean
18 {
19 
20 namespace Test
21 {
22 
23 namespace TestTracking
24 {
25 
26 /**
27  * This class implements tests for the Database class.
28  * @ingroup testtracking
29  */
30 class OCEAN_TEST_TRACKING_EXPORT TestDatabase
31 {
32  public:
33 
34  /**
35  * Starts all tests for the database class.
36  * @param testDuration Number of seconds for each test, with range (0, infinity)
37  * @return True, if succeeded
38  */
39  static bool test(const double testDuration);
40 
41  /**
42  * Tests the addObjectPointFromDatabase function.
43  * @param testDuration Number of seconds for each test, with range (0, infinity)
44  * @return True, if succeeded
45  */
46  static bool testAddObjectPointFromDatabase(const double testDuration);
47 
48  /**
49  * Tests the serialization of the database.
50  * @param testDuration Number of seconds for each test, with range (0, infinity)
51  * @return True, if succeeded
52  */
53  static bool testSerialization(const double testDuration);
54 
55  protected:
56 
57  /**
58  * Creates a database with random topology.
59  * The database will not contain meaninful geometric information.
60  * @param randomGenerator The random generator object to be used
61  * @param lowerPoseId The id of the lower border defining the allowed pose range, with range [0, infinity)
62  * @param upperPoseId The id of the upper border defining the allowed pose range, with range [lowerPoseId, infinity)
63  * @param numberPoses The number of poses that will be created with the defined pose range, with range [1, upperPoseId - lowerPoseId + 1]
64  * @param numberObjectPoints The number of object points the database will store, with range [1, infinity)
65  * @param minimalNumberObservations The minimal number of observations in each pose (the minimal number of image points in each pose), with range [0, numberObjectPoints]
66  * @param maximalNumberObservations The maximal number of observations in each pose (the maximal number of image points in each pose), with range [max(1, minimalNumberObservations), numberObjectPoints]
67  */
68  static Tracking::Database createDatabaseWithRandomTopology(RandomGenerator& randomGenerator, const unsigned int lowerPoseId, const unsigned int upperPoseId, const unsigned int numberPoses, const unsigned int numberObjectPoints, const unsigned int minimalNumberObservations, const unsigned int maximalNumberObservations);
69 };
70 
71 }
72 
73 }
74 
75 }
76 
77 #endif // META_OCEAN_TEST_TESTTRACKING_TEST_DATABASE_H
This class implements a generator for random numbers.
Definition: RandomGenerator.h:42
This class implements tests for the Database class.
Definition: TestDatabase.h:31
static bool test(const double testDuration)
Starts all tests for the database class.
static Tracking::Database createDatabaseWithRandomTopology(RandomGenerator &randomGenerator, const unsigned int lowerPoseId, const unsigned int upperPoseId, const unsigned int numberPoses, const unsigned int numberObjectPoints, const unsigned int minimalNumberObservations, const unsigned int maximalNumberObservations)
Creates a database with random topology.
static bool testSerialization(const double testDuration)
Tests the serialization of the database.
static bool testAddObjectPointFromDatabase(const double testDuration)
Tests the addObjectPointFromDatabase function.
This class implements a database for 3D object points, 2D image points and 6DOF camera poses.
Definition: Database.h:67
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15