Ocean
TestFASTDetector.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_FAST_DETECTOR_H
9 #define META_OCEAN_TEST_TESTCV_TESTDETECTOR_TEST_FAST_DETECTOR_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 a FAST feature detector test.
29  * @ingroup testcvdetector
30  */
31 class OCEAN_TEST_CV_DETECTOR_EXPORT TestFASTDetector
32 {
33  public:
34 
35  /**
36  * Tests the FAST feature detector.
37  * @param frame Test frame to be used for feature detection, must be valid with a dimension larger than 7x7
38  * @param testDuration Number of seconds for each test, with range (0, infinity)
39  * @param worker The worker object
40  * @return True, if succeeded
41  */
42  static bool test(const Frame& frame, const double testDuration, Worker& worker);
43 
44  /**
45  * Tests the FAST feature detector with standard strength determination.
46  * @param yFrame The frame which will be used for testing, with pixel format FORMAT_Y8, must be valid
47  * @param testDuration Number of seconds for each test, with range (0, infinity)
48  * @param worker The worker object
49  * @return True, if succeeded
50  */
51  static bool testStandardStrength(const Frame& yFrame, const double testDuration, Worker& worker);
52 
53  /**
54  * Tests the FAST feature detector with precise strength determination.
55  * @param yFrame The frame which will be used for testing, with pixel format FORMAT_Y8, must be valid
56  * @param testDuration Number of seconds for each test, with range (0, infinity)
57  * @param worker The worker object
58  * @return True, if succeeded
59  */
60  static bool testPreciseStrength(const Frame& yFrame, const double testDuration, Worker& worker);
61 
62  private:
63 
64  /**
65  * Validates already detected FAST features.
66  * @param yFrame The frame in which the features have been detected, must be valid
67  * @param threshold FAST feature detection threshold
68  * @param features Already detected FAST features
69  * @return True, if succeeded
70  */
71  static bool validate(const Frame& yFrame, const unsigned int threshold, const CV::Detector::FASTFeatures& features);
72 
73  /**
74  * Sorts two detector points.
75  * @param first First detector point
76  * @param second Second detector point
77  * @return True, if the first point should be located before the second point
78  */
79  static bool sortPoints(const CV::Detector::FASTFeature& first, const CV::Detector::FASTFeature& second);
80 };
81 
82 }
83 
84 }
85 
86 }
87 
88 }
89 
90 #endif // META_OCEAN_TEST_TESTCV_TESTDETECTOR_TEST_FAST_DETECTOR_H
This class implements a FAST feature.
Definition: FASTFeature.h:37
This class implements Ocean's image class.
Definition: Frame.h:1792
This class implements a FAST feature detector test.
Definition: TestFASTDetector.h:32
static bool testStandardStrength(const Frame &yFrame, const double testDuration, Worker &worker)
Tests the FAST feature detector with standard strength determination.
static bool testPreciseStrength(const Frame &yFrame, const double testDuration, Worker &worker)
Tests the FAST feature detector with precise strength determination.
static bool validate(const Frame &yFrame, const unsigned int threshold, const CV::Detector::FASTFeatures &features)
Validates already detected FAST features.
static bool test(const Frame &frame, const double testDuration, Worker &worker)
Tests the FAST feature detector.
static bool sortPoints(const CV::Detector::FASTFeature &first, const CV::Detector::FASTFeature &second)
Sorts two detector points.
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
std::vector< FASTFeature > FASTFeatures
Definition of a vector holding FAST features.
Definition: FASTFeature.h:24
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15