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