Ocean
Loading...
Searching...
No Matches
TestAdvancedMotion.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_TESTADVANCED_TEST_ADVANCED_MOTION_H
9#define META_OCEAN_TEST_TESTCV_TESTADVANCED_TEST_ADVANCED_MOTION_H
10
12
14#include "ocean/base/Worker.h"
15
17
18namespace Ocean
19{
20
21namespace Test
22{
23
24namespace TestCV
25{
26
27namespace TestAdvanced
28{
29
30/**
31 * This class implements tests for AdvancedMotion.
32 * @ingroup testcvadvanced
33 */
34class OCEAN_TEST_CV_ADVANCED_EXPORT TestAdvancedMotion
35{
36 public:
37
38 /**
39 * Invokes all tests for AdvancedMotion.
40 * @param width The width of the test frame in pixel, with range [32, infinity)
41 * @param height The height of the test frame in pixel, with range [32, infinity)
42 * @param testDuration The number of seconds for each test, with range (0, infinity)
43 * @param worker The worker object
44 * @param selector The test selector to filter tests
45 * @return True, if succeeded
46 */
47 static bool test(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker, const TestSelector& selector);
48
49 /**
50 * Invokes the test of trackPointSubPixelMirroredBorder().
51 * @param width The width of the test frame in pixel, with range [32, infinity)
52 * @param height The height of the test frame in pixel, with range [32, infinity)
53 * @param testDuration The number of seconds for each test, with range (0, infinity)
54 * @param worker The worker object
55 * @return True, if succeeded
56 */
57 static bool testTrackPointSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker);
58
59 /**
60 * Invokes the test of trackPointSubPixelMirroredBorder() with specified metric type.
61 * @param width The width of the test frame in pixel, with range [32, infinity)
62 * @param height The height of the test frame in pixel, with range [32, infinity)
63 * @param testDuration The number of seconds for each test, with range (0, infinity)
64 * @param worker The worker object
65 * @return True, if succeeded
66 * @tparam T The data type of the motion class to be tested, either 'AdvancedMotionSSD' or 'AdvancedMotionZeroMeanSSD'
67 */
68 template <typename T>
69 static bool testTrackPointSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker);
70
71 /**
72 * Invokes the test of trackPointSubPixelMirroredBorder() with specified metric type and channel number.
73 * @param width The width of the test frame in pixel, with range [32, infinity)
74 * @param height The height of the test frame in pixel, with range [32, infinity)
75 * @param testDuration The number of seconds for each test, with range (0, infinity)
76 * @param worker The worker object
77 * @return True, if succeeded
78 * @tparam T The data type of the motion class to be tested, either 'AdvancedMotionSSD' or 'AdvancedMotionZeroMeanSSD'
79 * @tparam tChannels The number of channels the frame has, with range [1, infinity)
80 */
81 template <typename T, unsigned int tChannels>
82 static bool testTrackPointSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker);
83
84 /**
85 * Invokes the test of trackPointSubPixelMirroredBorder() with specified metric type, channel number, and patch size.
86 * @param width The width of the test frame in pixel, with range [32, infinity)
87 * @param height The height of the test frame in pixel, with range [32, infinity)
88 * @param testDuration The number of seconds for each test, with range (0, infinity)
89 * @param worker The worker object
90 * @return True, if succeeded
91 * @tparam T The data type of the motion class to be tested, either 'AdvancedMotionSSD' or 'AdvancedMotionZeroMeanSSD'
92 * @tparam tChannels The number of channels the frame has, with range [1, infinity)
93 * @tparam tPatchSize The size of the image patch to be used, with range [1, infinity), must be odd
94 */
95 template <typename T, unsigned int tChannels, unsigned int tPatchSize>
96 static bool testTrackPointSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker);
97
98 /**
99 * Invokes the test of trackPointsSubPixelMirroredBorder().
100 * @param width The width of the test frame in pixel, with range [32, infinity)
101 * @param height The height of the test frame in pixel, with range [32, infinity)
102 * @param testDuration The number of seconds for each test, with range (0, infinity)
103 * @param worker The worker object
104 * @return True, if succeeded
105 */
106 static bool testTrackPointsSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker);
107
108 /**
109 * Invokes the test of trackPointsSubPixelMirroredBorder() with specified metric type.
110 * @param width The width of the test frame in pixel, with range [32, infinity)
111 * @param height The height of the test frame in pixel, with range [32, infinity)
112 * @param testDuration The number of seconds for each test, with range (0, infinity)
113 * @param worker The worker object
114 * @return True, if succeeded
115 * @tparam T The data type of the motion class to be tested, either 'AdvancedMotionSSD' or 'AdvancedMotionZeroMeanSSD'
116 */
117 template <typename T>
118 static bool testTrackPointsSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker);
119
120 /**
121 * Invokes the test of trackPointsSubPixelMirroredBorder() with specified metric type and channel number.
122 * @param width The width of the test frame in pixel, with range [32, infinity)
123 * @param height The height of the test frame in pixel, with range [32, infinity)
124 * @param testDuration The number of seconds for each test, with range (0, infinity)
125 * @param worker The worker object
126 * @return True, if succeeded
127 * @tparam T The data type of the motion class to be tested, either 'AdvancedMotionSSD' or 'AdvancedMotionZeroMeanSSD'
128 * @tparam tChannels The number of channels the frame has, with range [1, infinity)
129 */
130 template <typename T, unsigned int tChannels>
131 static bool testTrackPointsSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker);
132
133 /**
134 * Invokes the test of trackPointsSubPixelMirroredBorder() with specified metric type, channel number, and patch size.
135 * @param width The width of the test frame in pixel, with range [32, infinity)
136 * @param height The height of the test frame in pixel, with range [32, infinity)
137 * @param testDuration The number of seconds for each test, with range (0, infinity)
138 * @param worker The worker object
139 * @return True, if succeeded
140 * @tparam T The data type of the motion class to be tested, either 'AdvancedMotionSSD' or 'AdvancedMotionZeroMeanSSD'
141 * @tparam tChannels The number of channels the frame has, with range [1, infinity)
142 * @tparam tPatchSize The size of the image patch to be used, with range [1, infinity), must be odd
143 */
144 template <typename T, unsigned int tChannels, unsigned int tPatchSize>
145 static bool testTrackPointsSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker);
146
147 /**
148 * Invokes the test of trackPointsBidirectionalSubPixelMirroredBorder().
149 * @param width The width of the test frame in pixel, with range [32, infinity)
150 * @param height The height of the test frame in pixel, with range [32, infinity)
151 * @param testDuration The number of seconds for each test, with range (0, infinity)
152 * @param worker The worker object
153 * @return True, if succeeded
154 */
155 static bool testTrackPointsBidirectionalSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker);
156
157 /**
158 * Invokes the test of trackPointsBidirectionalSubPixelMirroredBorder() with specified metric type.
159 * @param width The width of the test frame in pixel, with range [32, infinity)
160 * @param height The height of the test frame in pixel, with range [32, infinity)
161 * @param testDuration The number of seconds for each test, with range (0, infinity)
162 * @param worker The worker object
163 * @return True, if succeeded
164 * @tparam T The data type of the motion class to be tested, either 'AdvancedMotionSSD' or 'AdvancedMotionZeroMeanSSD'
165 */
166 template <typename T>
167 static bool testTrackPointsBidirectionalSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker);
168
169 /**
170 * Invokes the test of trackPointsBidirectionalSubPixelMirroredBorder() with specified metric type and channel number.
171 * @param width The width of the test frame in pixel, with range [32, infinity)
172 * @param height The height of the test frame in pixel, with range [32, infinity)
173 * @param testDuration The number of seconds for each test, with range (0, infinity)
174 * @param worker The worker object
175 * @return True, if succeeded
176 * @tparam T The data type of the motion class to be tested, either 'AdvancedMotionSSD' or 'AdvancedMotionZeroMeanSSD'
177 * @tparam tChannels The number of channels the frame has, with range [1, infinity)
178 */
179 template <typename T, unsigned int tChannels>
180 static bool testTrackPointsBidirectionalSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker);
181
182 /**
183 * Invokes the test of trackPointsBidirectionalSubPixelMirroredBorder() with specified metric type, channel number, and patch size.
184 * @param width The width of the test frame in pixel, with range [32, infinity)
185 * @param height The height of the test frame in pixel, with range [32, infinity)
186 * @param testDuration The number of seconds for each test, with range (0, infinity)
187 * @param worker The worker object
188 * @return True, if succeeded
189 * @tparam T The data type of the motion class to be tested, either 'AdvancedMotionSSD' or 'AdvancedMotionZeroMeanSSD'
190 * @tparam tChannels The number of channels the frame has, with range [1, infinity)
191 * @tparam tPatchSize The size of the image patch to be used, with range [1, infinity), must be odd
192 */
193 template <typename T, unsigned int tChannels, unsigned int tPatchSize>
194 static bool testTrackPointsBidirectionalSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker& worker);
195
196 /**
197 * Invokes the stress test of trackPointsBidirectionalSubPixelMirroredBorder().
198 * @param testDuration The number of seconds for each test, with range (0, infinity)
199 * @param worker The worker object
200 * @return True, if succeeded
201 */
202 static bool stressTestTrackPointsBidirectionalSubPixelMirroredBorder(const double testDuration, Worker& worker);
203
204 /**
205 * Invokes the stress test of trackPointsBidirectionalSubPixelMirroredBorder().
206 * @param randomGenerator Random number generator to use for test
207 * @param worker The worker object
208 * @return True, if succeeded
209 * @tparam T The data type of the motion class to be tested, either 'AdvancedMotionSSD' or 'AdvancedMotionZeroMeanSSD'
210 */
211 template <typename T>
213
214 /**
215 * Invokes the stress test of trackPointsBidirectionalSubPixelMirroredBorder().
216 * @param randomGenerator Random number generator to use for test
217 * @param worker The worker object
218 * @return True, if succeeded
219 * @tparam T The data type of the motion class to be tested, either 'AdvancedMotionSSD' or 'AdvancedMotionZeroMeanSSD'
220 * @tparam tPatchSize The size of the image patch to be used, with range [1, infinity), must be odd
221 */
222 template <typename T, unsigned int tPatchSize>
224
225 protected:
226
227 /**
228 * Creates a random image which is suitable for patch tracking.
229 * @param frameType The frame type of the resulting image, must be valid
230 * @param randomGenerator The random generator to be used
231 * @return The resulting frame
232 */
233 static Frame createRandomTrackableFrame(const FrameType& frameType, RandomGenerator& randomGenerator);
234};
235
236}
237
238}
239
240}
241
242}
243
244#endif // META_OCEAN_TEST_TESTCV_TESTADVANCED_TEST_ADVANCED_MOTION_H
This class implements Ocean's image class.
Definition Frame.h:1879
Definition of a frame type composed by the frame dimension, pixel format and pixel origin.
Definition Frame.h:30
This class implements a generator for random numbers.
Definition RandomGenerator.h:42
This class implements tests for AdvancedMotion.
Definition TestAdvancedMotion.h:35
static bool testTrackPointsSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Invokes the test of trackPointsSubPixelMirroredBorder() with specified metric type.
static bool test(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker, const TestSelector &selector)
Invokes all tests for AdvancedMotion.
static bool testTrackPointsBidirectionalSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Invokes the test of trackPointsBidirectionalSubPixelMirroredBorder() with specified metric type,...
static Frame createRandomTrackableFrame(const FrameType &frameType, RandomGenerator &randomGenerator)
Creates a random image which is suitable for patch tracking.
static bool testTrackPointSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Invokes the test of trackPointSubPixelMirroredBorder() with specified metric type.
static bool stressTestTrackPointsBidirectionalSubPixelMirroredBorder(RandomGenerator &randomGenerator, Worker &worker)
Invokes the stress test of trackPointsBidirectionalSubPixelMirroredBorder().
static bool testTrackPointsBidirectionalSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Invokes the test of trackPointsBidirectionalSubPixelMirroredBorder().
static bool testTrackPointsBidirectionalSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Invokes the test of trackPointsBidirectionalSubPixelMirroredBorder() with specified metric type.
static bool testTrackPointSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Invokes the test of trackPointSubPixelMirroredBorder() with specified metric type and channel number.
static bool stressTestTrackPointsBidirectionalSubPixelMirroredBorder(const double testDuration, Worker &worker)
Invokes the stress test of trackPointsBidirectionalSubPixelMirroredBorder().
static bool testTrackPointSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Invokes the test of trackPointSubPixelMirroredBorder().
static bool stressTestTrackPointsBidirectionalSubPixelMirroredBorder(RandomGenerator &randomGenerator, Worker &worker)
Invokes the stress test of trackPointsBidirectionalSubPixelMirroredBorder().
static bool testTrackPointsBidirectionalSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Invokes the test of trackPointsBidirectionalSubPixelMirroredBorder() with specified metric type and c...
static bool testTrackPointSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Invokes the test of trackPointSubPixelMirroredBorder() with specified metric type,...
static bool testTrackPointsSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Invokes the test of trackPointsSubPixelMirroredBorder().
static bool testTrackPointsSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Invokes the test of trackPointsSubPixelMirroredBorder() with specified metric type,...
static bool testTrackPointsSubPixelMirroredBorder(const unsigned int width, const unsigned int height, const double testDuration, Worker &worker)
Invokes the test of trackPointsSubPixelMirroredBorder() with specified metric type and channel number...
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