Ocean
testopencv/TestPointTracking.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_TESTOPENCV_TEST_POINT_TRACKING_H
9 #define META_OCEAN_TEST_TESTCV_TESTOPENCV_TEST_POINT_TRACKING_H
10 
12 
13 #include <opencv2/core.hpp>
14 
15 namespace Ocean
16 {
17 
18 namespace Test
19 {
20 
21 namespace TestCV
22 {
23 
24 namespace TestOpenCV
25 {
26 
27 
28 /**
29  * This class tests the performance of the different patch tracking functions in OpenCV.
30  * @ingroup testcvopencv
31  */
32 class OCEAN_TEST_CV_OPENCV_EXPORT TestPointTracking
33 {
34  public:
35 
36  /**
37  * Test patch tracking in OpenCV with random image.
38  * @param testDuration Number of seconds for each test, with range (0, infinity)
39  * @return True, if succeeded
40  */
41  static bool testPointTracking(const double testDuration);
42 
43  /**
44  * Test patch tracking in OpenCV with provided image.
45  * @param frame Image that is used for the test, must be valid
46  * @param testDuration Number of seconds for each test, with range (0, infinity)
47  * @return True, if succeeded
48  */
49  static bool testPointTracking(const cv::Mat& frame, const double testDuration);
50 
51  private:
52 
53  /**
54  * Test sparse optical flow in OpenCV with random image
55  * @param width The width of the random image to be tested
56  * @param height The height of the random image to be tested
57  * @param window Size of the search window in each direction
58  * @param testDuration Number of seconds for each test, with range (0, infinity)
59  * @return True, if succeeded
60  */
61  static bool testSparseOpticalFlow(int width, int height, int window, const double testDuration);
62 
63  /**
64  * Test sparse optical flow in OpenCV with provided image.
65  * @param frame Image that is used for the test, must be valid
66  * @param window Size of the search window in each direction
67  * @param testDuration Number of seconds for each test, with range (0, infinity)
68  * @return True, if succeeded
69  */
70  static bool testSparseOpticalFlow(const cv::Mat& frame, int window, const double testDuration);
71 
72  /**
73  * Test template matching in OpenCV with provided image.
74  * @param frame Image that is used for the test, must be valid
75  * @return True, if succeeded
76  */
77  static bool testTemplateMatching(const cv::Mat& frame);
78 };
79 
80 }
81 
82 }
83 
84 }
85 
86 }
87 
88 #endif // META_OCEAN_TEST_TESTCV_TESTOPENCV_TEST_POINT_TRACKING_H
This class tests the performance of the different patch tracking functions in OpenCV.
Definition: testopencv/TestPointTracking.h:33
static bool testSparseOpticalFlow(const cv::Mat &frame, int window, const double testDuration)
Test sparse optical flow in OpenCV with provided image.
static bool testPointTracking(const double testDuration)
Test patch tracking in OpenCV with random image.
static bool testTemplateMatching(const cv::Mat &frame)
Test template matching in OpenCV with provided image.
static bool testPointTracking(const cv::Mat &frame, const double testDuration)
Test patch tracking in OpenCV with provided image.
static bool testSparseOpticalFlow(int width, int height, int window, const double testDuration)
Test sparse optical flow in OpenCV with random image.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15