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