Ocean
Loading...
Searching...
No Matches
TestLineDetectorHough.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_DETECTOR_HOUGH_H
9#define META_OCEAN_TEST_TESTCV_TESTDETECTOR_TEST_LINE_DETECTOR_HOUGH_H
10
12
14
16
17namespace Ocean
18{
19
20namespace Test
21{
22
23namespace TestCV
24{
25
26namespace TestDetector
27{
28
29/**
30 * This class implements houg-transformation-based line detector tests.
31 * @ingroup testcvdetector
32 */
33class OCEAN_TEST_CV_DETECTOR_EXPORT TestLineDetectorHough
34{
35 public:
36
37 /**
38 * Tests the line detector functions.
39 * @param testDuration Number of seconds for each test, with range (0, infinity)
40 * @param worker The worker object
41 * @param selector The test selector to filter tests
42 * @return True, if succeeded
43 */
44 static bool test(const double testDuration, Worker& worker, const TestSelector& selector);
45
46 /**
47 * Tests the accumulator joining function.
48 * @param width The width of the test frame, with range [7, infinity)
49 * @param height The height of the test frame, with range [7, infinity)
50 * @param worker The worker object
51 * @return True, if succeeded
52 */
53 static bool testAccumulatorJoin(const unsigned int width, const unsigned int height, Worker& worker);
54
55 /**
56 * Tests the line detector on a random frame without any distinct edges.
57 * @param testDuration Number of seconds for each test, with range (0, infinity)
58 * @param worker The worker object
59 * @return True, if succeeded
60 */
61 static bool testLineDetectorRandomFrame(const double testDuration, Worker& worker);
62
63 /**
64 * Tests the line detector on an artificial frame with strong edges.
65 * @param width The width of the test frame, with range [7, infinity)
66 * @param height The height of the test frame, with range [7, infinity)
67 * @param testDuration Number of seconds for each test, with range (0, infinity)
68 * @param worker The worker object
69 * @return True, if succeeded
70 */
71 static bool testLineDetectorArtificialFrame(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker);
72
73 private:
74
75 /**
76 * Validates the mirrored smooth function of the accumulator array.
77 * @param original The original buffer which has been filtered
78 * @param smoothAccumulator Filtered buffer to be validated
79 * @param width The width of the accumulator buffer in pixel, with range [3, infinity)
80 * @param height The height of the accumulator buffer in pixel, with range [3, infinity)
81 * @return True, if succeeded
82 */
83 static bool validateSmooth(const unsigned int* original, const unsigned int* smoothAccumulator, const unsigned int width, const unsigned int height);
84
85 /**
86 * Validates joined accumulator arrays.
87 * @param original The original accumulator objects
88 * @param joined The joined accumulator object
89 * @param accumulators Number of accumulators to be joined
90 * @return True, if succeeded
91 */
92 static bool validateJoin(const CV::Detector::LineDetectorHough::Accumulator* original, const CV::Detector::LineDetectorHough::Accumulator* joined, const unsigned int accumulators);
93};
94
95}
96
97}
98
99}
100
101}
102
103#endif // META_OCEAN_TEST_TESTCV_TESTDETECTOR_TEST_LINE_DETECTOR_HOUGH_H
Vote accumulator array.
Definition LineDetectorHough.h:173
This class implements houg-transformation-based line detector tests.
Definition TestLineDetectorHough.h:34
static bool validateSmooth(const unsigned int *original, const unsigned int *smoothAccumulator, const unsigned int width, const unsigned int height)
Validates the mirrored smooth function of the accumulator array.
static bool testAccumulatorJoin(const unsigned int width, const unsigned int height, Worker &worker)
Tests the accumulator joining function.
static bool validateJoin(const CV::Detector::LineDetectorHough::Accumulator *original, const CV::Detector::LineDetectorHough::Accumulator *joined, const unsigned int accumulators)
Validates joined accumulator arrays.
static bool testLineDetectorArtificialFrame(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Tests the line detector on an artificial frame with strong edges.
static bool testLineDetectorRandomFrame(const double testDuration, Worker &worker)
Tests the line detector on a random frame without any distinct edges.
static bool test(const double testDuration, Worker &worker, const TestSelector &selector)
Tests the line detector functions.
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
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