Ocean
TestCV.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_TESTCV_H
9 #define META_OCEAN_TEST_TESTCV_TESTCV_H
10 
11 #include "ocean/test/Test.h"
12 
13 #include "ocean/cv/CV.h"
14 #include "ocean/cv/PixelPosition.h"
15 
17 
18 #include "ocean/base/Frame.h"
19 #include "ocean/base/Worker.h"
20 
21 namespace Ocean
22 {
23 
24 namespace Test
25 {
26 
27 namespace TestCV
28 {
29 
30 /**
31  * @ingroup test
32  * @defgroup testcv Ocean Test CV Library
33  * @{
34  * The Ocean Test CV Library provides several function to test the performance and validation of the computer vision functionalities.
35  * The library is platform independent.
36  * @}
37  */
38 
39 /**
40  * @namespace Ocean::Test::TestCV Namespace of the CV Test library.<p>
41  * The Namespace Ocean::Test::TestCV is used in the entire Ocean CV Test Library.
42  */
43 
44 // Defines OCEAN_TEST_CV_EXPORT for dll export and import.
45 #if defined(_WINDOWS) && defined(OCEAN_RUNTIME_SHARED)
46  #ifdef USE_OCEAN_TEST_CV_EXPORT
47  #define OCEAN_TEST_CV_EXPORT __declspec(dllexport)
48  #else
49  #define OCEAN_TEST_CV_EXPORT __declspec(dllimport)
50  #endif
51 #else
52  #define OCEAN_TEST_CV_EXPORT
53 #endif
54 
55 /**
56  * Tests the entire Computer Vision library.
57  * @param testDuration Number of seconds for each test, with range (0, infinity)
58  * @param worker The worker object to distribute some computation on as many CPU cores as defined in the worker object
59  * @param testWidth Width of the test frame in pixel, with range [32, infinity)
60  * @param testHeight Height of the test frame in pixel, with range [32, infinity)
61  * @param testFunctions Optional name of the functions to be tested
62  * @return True, if the entire test succeeded
63  * @ingroup testcv
64  */
65 OCEAN_TEST_CV_EXPORT bool testCV(const double testDuration, Worker& worker, const unsigned int testWidth = 1280u, const unsigned int testHeight = 720u, const std::string& testFunctions = std::string());
66 
67 /**
68  * Tests the entire Computer Vision library.
69  * This function returns directly as the actual test is invoked in an own thread.<br>
70  * Use this function in intendet for non-console applications like e.g., mobile devices.
71  * @param testDuration Number of seconds for each test, with range (0, infinity)
72  * @param testWidth Width of the test frame in pixel, with range [32, infinity)
73  * @param testHeight Height of the test frame in pixel, with range [32, infinity)
74  * @param testFunctions Optional name of the functions to be tested
75  * @ingroup testcv
76  */
77 OCEAN_TEST_CV_EXPORT void testCVAsynchron(const double testDuration, const unsigned int testWidth = 1280u, const unsigned int testHeight = 720u, const std::string& testFunctions = std::string());
78 
79 }
80 
81 }
82 
83 }
84 
85 #endif // META_OCEAN_TEST_TESTCV_TESTCV_H
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
OCEAN_TEST_CV_EXPORT void testCVAsynchron(const double testDuration, const unsigned int testWidth=1280u, const unsigned int testHeight=720u, const std::string &testFunctions=std::string())
Tests the entire Computer Vision library.
OCEAN_TEST_CV_EXPORT bool testCV(const double testDuration, Worker &worker, const unsigned int testWidth=1280u, const unsigned int testHeight=720u, const std::string &testFunctions=std::string())
Tests the entire Computer Vision library.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15