Ocean
testopencv/TestFrameInterpolatorBilinear.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_FRAME_INTERPOLATOR_BILINEAR_H
9 #define META_OCEAN_TEST_TESTCV_TESTOPENCV_TEST_FRAME_INTERPOLATOR_BILINEAR_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  * This class benchmarks the performance of bilinear interpolation.
29  * @ingroup testcvopencv
30  */
31 class OCEAN_TEST_CV_OPENCV_EXPORT TestFrameInterpolatorBilinear
32 {
33  public:
34 
35  /**
36  * Benchmarks bilinear interpolation functions.
37  * @param testDuration Number of seconds for each test, with range (0, infinity)
38  */
39  static void test(const double testDuration);
40 
41  private:
42 
43  /**
44  * Benchmarks the homography-based interpolation function.
45  * @param testDuration Number of seconds for each test, with range (0, infinity)
46  */
47  static void testHomography(const double testDuration);
48 
49  /**
50  * Benchmarks the interpolation function based on affine transformations.
51  * @param testDuration Number of seconds for each test, with range (0, infinity)
52  */
53  static void testAffine(const double testDuration);
54 
55  /**
56  * Benchmark test for image resizing
57  * @param testDuration Number of seconds for each test, range: (0, infinity)
58  * @tparam T Data type to be tested (can be either unsigned char, float)
59  */
60  template <typename T>
61  static void testResize(const double testDuration);
62 
63  /**
64  * Benchmarks the homography-based interpolation for a specific frame type.
65  * @param width The width of the frame in pixel, with range [1, infinity)
66  * @param height The height of the frame in pixel, with range [1, infinity)
67  * @param channels The number of channels the frame has, with range [1, infinity)
68  * @param testDuration Number of seconds for each test, with range (0, infinity)
69  */
70  static void testHomography(const unsigned int width, const unsigned int height, const unsigned int channels, const double testDuration);
71 
72  /**
73  * Benchmarks the interpolation function based on affine transformations for a specific frame type.
74  * @param width The width of the frame in pixel, with range [1, infinity)
75  * @param height The height of the frame in pixel, with range [1, infinity)
76  * @param channels The number of channels the frame has, with range [1, infinity)
77  * @param testDuration Number of seconds for each test, with range (0, infinity)
78  */
79  static void testAffine(const unsigned int width, const unsigned int height, const unsigned int channels, const double testDuration);
80 
81  /**
82  * Benchmark the resizing functions of Ocean against OpenCV cv::resize()
83  * @param sourceWidth The width of the source frame in pixels, with range [1, infinity)
84  * @param sourceHeight The height of the source frame in pixels, with range [1, infinity)
85  * @param targetWidth The width of the target frame in pixels, with range [1, infinity)
86  * @param targetHeight The height of the target frame in pixels, with range [1, infinity)
87  * @param channels The number of channels the frame has, with range [1, 4]
88  * @param testDuration Number of seconds for each test, with range (0, infinity)
89  * @tparam T Data type to be tested (can be either unsigned char, float)
90  */
91  template <typename T>
92  static void testResize(const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int targetWidth, const unsigned int targetHeight, const unsigned int channels, const double testDuration);
93 };
94 
95 } // namespace TestOpenCV
96 
97 } // namespace TestCV
98 
99 } // namespace Test
100 
101 } // namespace Ocean
102 
103 #endif // META_OCEAN_TEST_TESTCV_TESTOPENCV_TEST_FRAME_INTERPOLATOR_BILINEAR_H
This class benchmarks the performance of bilinear interpolation.
Definition: testopencv/TestFrameInterpolatorBilinear.h:32
static void testHomography(const double testDuration)
Benchmarks the homography-based interpolation function.
static void testAffine(const unsigned int width, const unsigned int height, const unsigned int channels, const double testDuration)
Benchmarks the interpolation function based on affine transformations for a specific frame type.
static void testAffine(const double testDuration)
Benchmarks the interpolation function based on affine transformations.
static void testResize(const unsigned int sourceWidth, const unsigned int sourceHeight, const unsigned int targetWidth, const unsigned int targetHeight, const unsigned int channels, const double testDuration)
Benchmark the resizing functions of Ocean against OpenCV cv::resize()
static void testHomography(const unsigned int width, const unsigned int height, const unsigned int channels, const double testDuration)
Benchmarks the homography-based interpolation for a specific frame type.
static void test(const double testDuration)
Benchmarks bilinear interpolation functions.
static void testResize(const double testDuration)
Benchmark test for image resizing.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15