Ocean
TestLineEvaluator.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_TESTDETECTOR_TEST_LINE_EVALUATOR_H
9 #define META_OCEAN_TEST_TESTCV_TESTDETECTOR_TEST_LINE_EVALUATOR_H
10 
12 
14 
15 namespace Ocean
16 {
17 
18 namespace Test
19 {
20 
21 namespace TestCV
22 {
23 
24 namespace TestDetector
25 {
26 
27 /**
28  * This class implements tests for the LineEvaluator.
29  * @ingroup testcvdetector
30  */
31 class OCEAN_TEST_CV_DETECTOR_EXPORT TestLineEvaluator
32 {
33  public:
34 
35  /**
36  * Invokes all test for the LineEvaluator.
37  * @param testDuration Number of seconds for each test, with range (0, infinity)
38  * @param worker The worker object
39  * @return True, if succeeded
40  */
41  static bool test(const double testDuration, Worker& worker);
42 
43  /**
44  * Tests the match determination.
45  * @param testDuration Number of seconds for each test, with range (0, infinity)
46  * @return True, if succeeded
47  * @tparam T The data type of a scalar value, e.g,. 'float' or 'double'
48  */
49  template <typename T>
50  static bool testMatchDetermination(const double testDuration);
51 
52  protected:
53 
54  /**
55  * Verifies a given match.
56  * @param match The match to verify, must be valid
57  * @param matchType The expected type of the match
58  * @param targetIds The expected target ids of the match, at least one
59  * @return True, if the match is correct
60  */
62 };
63 
64 }
65 
66 }
67 
68 }
69 
70 }
71 
72 #endif // META_OCEAN_TEST_TESTCV_TESTDETECTOR_TEST_LINE_EVALUATOR_H
MatchType
Definition of individual match types.
Definition: LineEvaluator.h:65
std::unordered_set< Id > IdSet
Definition of an unordered set of ids.
Definition: LineEvaluator.h:46
std::shared_ptr< LineMatch > LineMatchRef
Definition of a shared pointer for a LineMatch object.
Definition: LineEvaluator.h:113
This class implements tests for the LineEvaluator.
Definition: TestLineEvaluator.h:32
static bool testMatchDetermination(const double testDuration)
Tests the match determination.
static bool test(const double testDuration, Worker &worker)
Invokes all test for the LineEvaluator.
static bool verifyMatch(const CV::Detector::LineEvaluator::LineMatchRef &match, const CV::Detector::LineEvaluator::LineMatch::MatchType matchType, const CV::Detector::LineEvaluator::IdSet &targetIds)
Verifies a given match.
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15