Ocean
TestSumSquareDifferencesNoCenter.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_SUM_SQUARE_DIFFERENCES_NO_CENTER_H
9 #define META_OCEAN_TEST_TESTCV_TESTADVANCED_SUM_SQUARE_DIFFERENCES_NO_CENTER_H
10 
12 
13 namespace Ocean
14 {
15 
16 namespace Test
17 {
18 
19 namespace TestCV
20 {
21 
22 namespace TestAdvanced
23 {
24 
25 /**
26  * This class implements sum square differences omitting the center pixel tests.
27  * @ingroup testcvadvanced
28  */
29 class OCEAN_TEST_CV_ADVANCED_EXPORT TestSumSquareDifferencesNoCenter
30 {
31  protected:
32 
33  /**
34  * Definition of individual types of implementation.
35  */
36  enum ImplementationType : uint32_t
37  {
38  /// The naive implementation.
40  /// The template-based implementation.
42  /// The SSE-based implementation.
44  /// The NEON-based implementation.
46  /// The default implementation (which is actually used by default).
47  IT_DEFAULT
48  };
49 
50  public:
51 
52  /**
53  * Invokes all test functions.
54  * @param testDuration Number of seconds for each test, with range (0, infinity)
55  * @return True, if succeeded
56  */
57  static bool test(const double testDuration);
58 
59  /**
60  * Tests the sum square differences function for two pixel accurate patches in two images.
61  * @param testDuration Number of seconds for each test, with range (0, infinity)
62  * @return True, if succeeded
63  */
64  static bool testPatch8BitPerChannel(const double testDuration);
65 
66  private:
67 
68  /**
69  * Tests the sum square differences function for two pixel accurate patches in two images.
70  * @param width The width of the test image, in pixel, with range [tSize, infinity)
71  * @param height The height of the test image, in pixel, with range [tSize, infinity)
72  * @param testDuration Number of seconds for each test, with range (0, infinity)
73  * @return True, if succeeded
74  * @tparam tChannels The number of frame channels, with range [1, infinity)
75  * @tparam tPatchSize The size of the patch, with range [1, infinity)
76  */
77  template <unsigned int tChannels, unsigned int tPatchSize>
78  static bool testPatch8BitPerChannel(const unsigned int width, const unsigned int height, const double testDuration);
79 };
80 
81 }
82 
83 }
84 
85 }
86 
87 }
88 
89 #endif // META_OCEAN_TEST_TESTCV_TESTADVANCED_SUM_SQUARE_DIFFERENCES_NO_CENTER_H
This class implements sum square differences omitting the center pixel tests.
Definition: TestSumSquareDifferencesNoCenter.h:30
ImplementationType
Definition of individual types of implementation.
Definition: TestSumSquareDifferencesNoCenter.h:37
@ IT_NAIVE
The naive implementation.
Definition: TestSumSquareDifferencesNoCenter.h:39
@ IT_TEMPLATE
The template-based implementation.
Definition: TestSumSquareDifferencesNoCenter.h:41
@ IT_SSE
The SSE-based implementation.
Definition: TestSumSquareDifferencesNoCenter.h:43
@ IT_NEON
The NEON-based implementation.
Definition: TestSumSquareDifferencesNoCenter.h:45
static bool test(const double testDuration)
Invokes all test functions.
static bool testPatch8BitPerChannel(const double testDuration)
Tests the sum square differences function for two pixel accurate patches in two images.
static bool testPatch8BitPerChannel(const unsigned int width, const unsigned int height, const double testDuration)
Tests the sum square differences function for two pixel accurate patches in two images.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15