Ocean
TestMotion.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_TEST_MOTION_H
9 #define META_OCEAN_TEST_TESTCV_TEST_MOTION_H
10 
12 
13 #include "ocean/base/Frame.h"
14 #include "ocean/base/Worker.h"
15 
16 namespace Ocean
17 {
18 
19 namespace Test
20 {
21 
22 namespace TestCV
23 {
24 
25 /**
26  * This class test the motion functions.
27  * @ingroup testcv
28  */
29 class OCEAN_TEST_CV_EXPORT TestMotion
30 {
31  public:
32 
33  /**
34  * Tests the entire motion functionality.
35  * @param testDuration Number of seconds for each test, with range (0, infinity)
36  * @param worker The worker object to be used for computation distribution
37  * @return True, if succeeded
38  */
39  static bool test(const double testDuration, Worker& worker);
40 
41  /**
42  * Tests the simple motion calculation for two images.
43  * Pixels inside the blocks mapping outside the frames are mirrored back into the frame.<br>
44  * @param testDuration Number of seconds for each test, with range (0, infinity)
45  * @tparam tChannels The number of data channels each frame has
46  * @return True, if succeeded
47  */
48  template <unsigned int tChannels>
49  static bool testMotionMirroredBorder(const double testDuration);
50 
51  /**
52  * Tests the simple motion calculation for two images.
53  * Pixels inside the blocks mapping outside the frames are mirrored back into the frame.<br>
54  * @param testDuration Number of seconds for each test, with range (0, infinity)
55  * @tparam tChannels The number of data channels each frame has
56  * @tparam tSize The block size of the image patch that is applied for measurements, with range [1, infinity)
57  * @return True, if succeeded
58  */
59  template <unsigned int tChannels, unsigned int tSize>
60  static bool testMotionMirroredBorder(const double testDuration);
61 
62  protected:
63 
64  /**
65  * Tests the simple motion calculation for two images.
66  * Pixels inside the blocks mapping outside the frames are mirrored back into the frame.<br>
67  * @param width0 Width of the first test frame in pixel
68  * @param height0 Height of the first test frame in pixel
69  * @param width1 Width of the second test frame in pixel
70  * @param height1 Height of the second test frame in pixel
71  * @param testDuration Number of seconds for each test, with range (0, infinity)
72  * @tparam TMetric The metric that is applied for measurements
73  * @tparam tChannels The number of data channels each frame has
74  * @tparam tSize The block size of the image patch that is applied for measurements, with range [1, infinity)
75  * @return True, if succeeded
76  */
77  template <typename TMetric, unsigned int tChannels, unsigned int tSize>
78  static bool testMotionMirroredBorder(const unsigned int width0, const unsigned int height0, const unsigned int width1, const unsigned int height1, const double testDuration);
79 };
80 
81 }
82 
83 }
84 
85 }
86 
87 #endif // META_OCEAN_TEST_TESTCV_TEST_MOTION_H
This class test the motion functions.
Definition: TestMotion.h:30
static bool testMotionMirroredBorder(const unsigned int width0, const unsigned int height0, const unsigned int width1, const unsigned int height1, const double testDuration)
Tests the simple motion calculation for two images.
static bool testMotionMirroredBorder(const double testDuration)
Tests the simple motion calculation for two images.
static bool testMotionMirroredBorder(const double testDuration)
Tests the simple motion calculation for two images.
static bool test(const double testDuration, Worker &worker)
Tests the entire motion functionality.
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