#endif\r
}\r
\r
-int main(int argc, char **argv)\r
+int main(int argc, char** argv)\r
{\r
- CommandLineParser cmd(argc, argv,\r
+ CommandLineParser cmd(argc, (const char**) argv,\r
"{ print_info_only | print_info_only | false | Print information about system and exit }"\r
"{ device | device | 0 | Device on which tests will be executed }"\r
"{ cpu | cpu | false | Run tests on cpu }"\r
cout << "Run tests on device " << device << " [" << info.name() << "] \n" << endl;\r
}\r
\r
- testing::InitGoogleTest(&argc, argv);\r
+ InitGoogleTest(&argc, argv);\r
perf::TestBase::Init(argc, argv);\r
return RUN_ALL_TESTS();\r
}\r
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
\r
#ifdef HAVE_CUDA\r
\r
using namespace cvtest;\r
using namespace testing;\r
\r
-void printInfo()\r
+void printOsInfo()\r
{\r
#if defined _WIN32\r
# if defined _WIN64\r
- puts("OS: Windows x64");\r
+ cout << "OS: Windows x64 \n" << endl;\r
# else\r
- puts("OS: Windows x32");\r
+ cout << "OS: Windows x32 \n" << endl;\r
# endif\r
#elif defined linux\r
# if defined _LP64\r
- puts("OS: Linux x64");\r
+ cout << "OS: Linux x64 \n" << endl;\r
# else\r
- puts("OS: Linux x32");\r
+ cout << "OS: Linux x32 \n" << endl;\r
# endif\r
#elif defined __APPLE__\r
# if defined _LP64\r
- puts("OS: Apple x64");\r
+ cout << "OS: Apple x64 \n" << endl;\r
# else\r
- puts("OS: Apple x32");\r
+ cout << "OS: Apple x32 \n" << endl;\r
# endif\r
#endif\r
+}\r
\r
+void printCudaInfo()\r
+{\r
+#ifndef HAVE_CUDA\r
+ cout << "OpenCV was built without CUDA support \n" << endl;\r
+#else\r
int driver;\r
cudaDriverGetVersion(&driver);\r
\r
- printf("CUDA Driver version: %d\n", driver);\r
- printf("CUDA Runtime version: %d\n", CUDART_VERSION);\r
+ cout << "CUDA Driver version: " << driver << '\n';\r
+ cout << "CUDA Runtime version: " << CUDART_VERSION << '\n';\r
+\r
+ cout << endl;\r
\r
- puts("GPU module was compiled for the following GPU archs:");\r
- printf(" BIN: %s\n", CUDA_ARCH_BIN);\r
- printf(" PTX: %s\n\n", CUDA_ARCH_PTX);\r
+ cout << "GPU module was compiled for the following GPU archs:" << endl;\r
+ cout << " BIN: " << CUDA_ARCH_BIN << '\n';\r
+ cout << " PTX: " << CUDA_ARCH_PTX << '\n';\r
+\r
+ cout << endl;\r
\r
int deviceCount = getCudaEnabledDeviceCount();\r
- printf("CUDA device count: %d\n\n", deviceCount);\r
+ cout << "CUDA device count: " << deviceCount << '\n';\r
+\r
+ cout << endl;\r
\r
for (int i = 0; i < deviceCount; ++i)\r
{\r
DeviceInfo info(i);\r
\r
- printf("Device %d:\n", i);\r
- printf(" Name: %s\n", info.name().c_str());\r
- printf(" Compute capability version: %d.%d\n", info.majorVersion(), info.minorVersion());\r
- printf(" Multi Processor Count: %d\n", info.multiProcessorCount());\r
- printf(" Total memory: %d Mb\n", static_cast<int>(static_cast<int>(info.totalMemory() / 1024.0) / 1024.0));\r
- printf(" Free memory: %d Mb\n", static_cast<int>(static_cast<int>(info.freeMemory() / 1024.0) / 1024.0));\r
+ cout << "Device [" << i << "] \n";\r
+ cout << "\t Name: " << info.name() << '\n';\r
+ cout << "\t Compute capability: " << info.majorVersion() << '.' << info.minorVersion()<< '\n';\r
+ cout << "\t Multi Processor Count: " << info.multiProcessorCount() << '\n';\r
+ cout << "\t Total memory: " << static_cast<int>(static_cast<int>(info.totalMemory() / 1024.0) / 1024.0) << " Mb \n";\r
+ cout << "\t Free memory: " << static_cast<int>(static_cast<int>(info.freeMemory() / 1024.0) / 1024.0) << " Mb \n";\r
if (!info.isCompatible())\r
- puts(" !!! This device is NOT compatible with current GPU module build\n");\r
- printf("\n");\r
+ cout << "\t !!! This device is NOT compatible with current GPU module build \n";\r
+\r
+ cout << endl;\r
}\r
+#endif\r
}\r
\r
-enum OutputLevel\r
-{\r
- OutputLevelNone,\r
- OutputLevelCompact,\r
- OutputLevelFull\r
-};\r
-\r
-extern OutputLevel nvidiaTestOutputLevel;\r
-\r
int main(int argc, char** argv)\r
{\r
try\r
{\r
- CommandLineParser parser(argc, (const char**)argv,\r
- "{ print_info_only | print_info_only | false | Print information about system and exit }"\r
- "{ device | device | -1 | Device on which tests will be executed (-1 means all devices) }"\r
- "{ nvtest_output_level | nvtest_output_level | compact | NVidia test verbosity level }");\r
+ CommandLineParser cmd(argc, (const char**)argv,\r
+ "{ print_info_only | print_info_only | false | Print information about system and exit }"\r
+ "{ device | device | -1 | Device on which tests will be executed (-1 means all devices) }"\r
+ "{ nvtest_output_level | nvtest_output_level | compact | NVidia test verbosity level }"\r
+ );\r
\r
- printInfo();\r
+ printOsInfo();\r
+ printCudaInfo();\r
\r
- if (parser.get<bool>("print_info_only"))\r
+ if (cmd.get<bool>("print_info_only"))\r
return 0;\r
\r
- int device = parser.get<int>("device");\r
+ int device = cmd.get<int>("device");\r
if (device < 0)\r
{\r
DeviceManager::instance().loadAll();\r
- std::cout << "Run tests on all supported devices\n" << std::endl;\r
+\r
+ cout << "Run tests on all supported devices \n" << endl;\r
}\r
else\r
{\r
DeviceManager::instance().load(device);\r
- std::cout << "Run tests on device " << device << '\n' << std::endl;\r
+\r
+ DeviceInfo info(device);\r
+ cout << "Run tests on device " << device << " [" << info.name() << "] \n" << endl;\r
}\r
\r
- string outputLevel = parser.get<string>("nvtest_output_level");\r
+ string outputLevel = cmd.get<string>("nvtest_output_level");\r
\r
if (outputLevel == "none")\r
nvidiaTestOutputLevel = OutputLevelNone;\r
#ifndef __main_test_nvidia_h__
#define __main_test_nvidia_h__
-#include<string>
+#include <string>
enum OutputLevel
{
OutputLevelFull
};
+extern OutputLevel nvidiaTestOutputLevel;
+
bool nvidia_NPPST_Integral_Image(const std::string& test_data_path, OutputLevel outputLevel);
bool nvidia_NPPST_Squared_Integral_Image(const std::string& test_data_path, OutputLevel outputLevel);
bool nvidia_NPPST_RectStdDev(const std::string& test_data_path, OutputLevel outputLevel);
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
\r
namespace {\r
\r
\r
cv::gpu::GpuMat dst;\r
cv::gpu::reprojectImageTo3D(loadMat(disp, useRoi), dst, Q, 3);\r
- \r
+\r
cv::Mat dst_gold;\r
cv::reprojectImageTo3D(disp, dst_gold, Q, false);\r
\r
WHOLE_SUBMAT));\r
\r
} // namespace\r
+\r
+#endif // HAVE_CUDA\r
//
//M*/
-#include "precomp.hpp"
+#include "test_precomp.hpp"
#ifdef HAVE_CUDA
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
\r
namespace {\r
\r
WHOLE_SUBMAT));\r
\r
} // namespace\r
+\r
+#endif // HAVE_CUDA\r
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
\r
namespace {\r
\r
WHOLE_SUBMAT));\r
\r
} // namespace\r
+\r
+#endif // HAVE_CUDA\r
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
\r
namespace {\r
\r
testing::Values(UseMask(false), UseMask(true))));\r
\r
} // namespace\r
+\r
+#endif // HAVE_CUDA\r
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
\r
namespace {\r
\r
WHOLE_SUBMAT));\r
\r
} // namespace\r
+\r
+#endif // HAVE_CUDA\r
//
//M*/
-#include "precomp.hpp"
+#include "test_precomp.hpp"
-#include <iostream>
-using namespace std;
+#ifdef HAVE_CUDA
+using namespace std;
using namespace cv;
struct CompactPoints : testing::TestWithParam<gpu::DeviceInfo>
}
INSTANTIATE_TEST_CASE_P(GPU_GlobalMotion, CompactPoints, ALL_DEVICES);
+
+#endif // HAVE_CUDA
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
\r
namespace {\r
\r
WHOLE_SUBMAT));\r
\r
} // namespace\r
+\r
+#endif // HAVE_CUDA\r
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
\r
namespace {\r
\r
std::string("../cv/shared/pic6.png"))));\r
\r
} // namespace\r
+\r
+#endif // HAVE_CUDA\r
// the use of this software, even if advised of the possibility of such damage.
//M*/
-#include "precomp.hpp"
-#include <string>
-#include <iostream>
+#include "test_precomp.hpp"
#ifdef HAVE_CUDA
INSTANTIATE_TEST_CASE_P(ConnectedComponents, Labeling, ALL_DEVICES);
-#endif
\ No newline at end of file
+#endif // HAVE_CUDA
//\r
//M*/\r
\r
-#include <main_test_nvidia.h>\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+OutputLevel nvidiaTestOutputLevel = OutputLevelCompact;\r
\r
#ifdef HAVE_CUDA\r
\r
using namespace cvtest;\r
using namespace testing;\r
\r
-//enum OutputLevel\r
-//{\r
-// OutputLevelNone,\r
-// OutputLevelCompact,\r
-// OutputLevelFull\r
-//};\r
-\r
struct NVidiaTest : TestWithParam<cv::gpu::DeviceInfo>\r
{\r
cv::gpu::DeviceInfo devInfo;\r
struct NPPST : NVidiaTest {};\r
struct NCV : NVidiaTest {};\r
\r
-OutputLevel nvidiaTestOutputLevel = OutputLevelCompact;\r
-\r
//TEST_P(NPPST, Integral)\r
//{\r
// bool res = nvidia_NPPST_Integral_Image(path, nvidiaTestOutputLevel);\r
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
-#include <string>\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
\r
namespace {\r
\r
\r
TEST_P(LBP_Read_classifier, Accuracy)\r
{\r
- cv::gpu::CascadeClassifier_GPU classifier;
+ cv::gpu::CascadeClassifier_GPU classifier;\r
std::string classifierXmlPath = std::string(cvtest::TS::ptr()->get_data_path()) + "lbpcascade/lbpcascade_frontalface.xml";\r
ASSERT_TRUE(classifier.load(classifierXmlPath));\r
}\r
\r
-INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_Read_classifier,
- testing::Combine(ALL_DEVICES, testing::Values<int>(0)));
+INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_Read_classifier,\r
+ testing::Combine(ALL_DEVICES, testing::Values<int>(0)));\r
\r
\r
PARAM_TEST_CASE(LBP_classify, cv::gpu::DeviceInfo, int)\r
for (; it != rects.end(); ++it)\r
cv::rectangle(markedImage, *it, CV_RGB(0, 0, 255));\r
\r
- cv::gpu::CascadeClassifier_GPU gpuClassifier;
+ cv::gpu::CascadeClassifier_GPU gpuClassifier;\r
ASSERT_TRUE(gpuClassifier.load(classifierXmlPath));\r
\r
cv::gpu::GpuMat gpu_rects;\r
int count = gpuClassifier.detectMultiScale(tested, gpu_rects);\r
\r
cv::Mat downloaded(gpu_rects);\r
- const cv::Rect* faces = downloaded.ptr<cv::Rect>();
+ const cv::Rect* faces = downloaded.ptr<cv::Rect>();\r
for (int i = 0; i < count; i++)\r
{\r
cv::Rect r = faces[i];\r
\r
#if defined (LOG_CASCADE_STATISTIC)\r
- std::cout << r.x << " " << r.y << " " << r.width << " " << r.height << std::endl;
+ std::cout << r.x << " " << r.y << " " << r.width << " " << r.height << std::endl;\r
cv::rectangle(markedImage, r , CV_RGB(255, 0, 0));\r
-#endif
+#endif\r
}\r
\r
#if defined (LOG_CASCADE_STATISTIC)\r
- cv::imshow("Res", markedImage); cv::waitKey();
+ cv::imshow("Res", markedImage); cv::waitKey();\r
#endif\r
}\r
\r
INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_classify,\r
- testing::Combine(ALL_DEVICES, testing::Values<int>(0)));
+ testing::Combine(ALL_DEVICES, testing::Values<int>(0)));\r
\r
} // namespace\r
+\r
+#endif // HAVE_CUDA\r
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
#include <stdexcept>\r
\r
#include "cvconfig.h"\r
+\r
#include "opencv2/core/core.hpp"\r
#include "opencv2/highgui/highgui.hpp"\r
#include "opencv2/calib3d/calib3d.hpp"\r
\r
#include "utility.hpp"\r
#include "interpolation.hpp"\r
+#include "main_test_nvidia.h"\r
\r
#ifdef HAVE_CUDA\r
#include <cuda.h>\r
//
//M*/
-#include "precomp.hpp"
+#include "test_precomp.hpp"
#ifdef HAVE_CUDA
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
\r
#ifdef HAVE_CUDA\r
\r
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
-#include <iostream>\r
+#include "test_precomp.hpp"\r
\r
#ifdef HAVE_CUDA\r
\r
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
\r
#ifdef HAVE_CUDA\r
\r
//
//M*/
-#include "precomp.hpp"
+#include "test_precomp.hpp"
+
+#ifdef HAVE_CUDA
//#define DUMP
INSTANTIATE_TEST_CASE_P(GPU_Video, VideoReader, testing::Combine(
ALL_DEVICES,
testing::Values(std::string("768x576.avi"), std::string("1920x1080.avi"))));
+
+#endif // HAVE_CUDA
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
\r
#ifdef HAVE_CUDA\r
\r
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
\r
#ifdef HAVE_CUDA\r
\r
//\r
//M*/\r
\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
\r
using namespace std;\r
using namespace cv;\r
}\r
}\r
\r
-class DevicesGenerator : public ParamGeneratorInterface<DeviceInfo>\r
-{\r
-public:\r
- ~DevicesGenerator();\r
-\r
- ParamIteratorInterface<DeviceInfo>* Begin() const;\r
- ParamIteratorInterface<DeviceInfo>* End() const;\r
-\r
-private:\r
- class Iterator : public ParamIteratorInterface<DeviceInfo>\r
- {\r
- public:\r
- Iterator(const ParamGeneratorInterface<DeviceInfo>* base, vector<DeviceInfo>::const_iterator iterator);\r
-\r
- virtual ~Iterator();\r
-\r
- virtual const ParamGeneratorInterface<DeviceInfo>* BaseGenerator() const;\r
-\r
- virtual void Advance();\r
-\r
- virtual ParamIteratorInterface<DeviceInfo>* Clone() const;\r
-\r
- virtual const DeviceInfo* Current() const;\r
-\r
- virtual bool Equals(const ParamIteratorInterface<DeviceInfo>& other) const;\r
-\r
- private:\r
- Iterator(const Iterator& other);\r
-\r
- const ParamGeneratorInterface<DeviceInfo>* const base_;\r
- vector<DeviceInfo>::const_iterator iterator_;\r
-\r
- mutable DeviceInfo value_;\r
- };\r
-};\r
-\r
-DevicesGenerator::~DevicesGenerator()\r
-{\r
-}\r
-\r
-ParamIteratorInterface<DeviceInfo>* DevicesGenerator::Begin() const\r
-{\r
- return new Iterator(this, DeviceManager::instance().values().begin());\r
-}\r
-\r
-ParamIteratorInterface<DeviceInfo>* DevicesGenerator::End() const\r
-{\r
- return new Iterator(this, DeviceManager::instance().values().end());\r
-}\r
-\r
-DevicesGenerator::Iterator::Iterator(const ParamGeneratorInterface<DeviceInfo>* base, vector<DeviceInfo>::const_iterator iterator)\r
- : base_(base), iterator_(iterator)\r
-{\r
-}\r
-\r
-DevicesGenerator::Iterator::~Iterator()\r
-{\r
-}\r
-\r
-const ParamGeneratorInterface<DeviceInfo>* DevicesGenerator::Iterator::BaseGenerator() const\r
-{\r
- return base_;\r
-}\r
-\r
-void DevicesGenerator::Iterator::Advance()\r
-{\r
- ++iterator_;\r
-}\r
-\r
-ParamIteratorInterface<DeviceInfo>* DevicesGenerator::Iterator::Clone() const\r
-{\r
- return new Iterator(*this);\r
-}\r
-\r
-const DeviceInfo* DevicesGenerator::Iterator::Current() const\r
-{\r
- value_ = *iterator_;\r
- return &value_;\r
-}\r
-\r
-bool DevicesGenerator::Iterator::Equals(const ParamIteratorInterface<DeviceInfo>& other) const\r
-{\r
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\r
- << "The program attempted to compare iterators "\r
- << "from different generators." << endl;\r
-\r
- return iterator_ == CheckedDowncastToActualType<const Iterator>(&other)->iterator_;\r
-}\r
-\r
-DevicesGenerator::Iterator::Iterator(const Iterator& other) :\r
- ParamIteratorInterface<DeviceInfo>(), base_(other.base_), iterator_(other.iterator_)\r
-{\r
-}\r
-\r
-ParamGenerator<DeviceInfo> DevicesGenerator_()\r
-{\r
- return ParamGenerator<DeviceInfo>(new DevicesGenerator);\r
-}\r
-\r
//////////////////////////////////////////////////////////////////////\r
// Additional assertion\r
\r
std::vector<cv::gpu::DeviceInfo> devices_;\r
};\r
\r
-testing::internal::ParamGenerator<cv::gpu::DeviceInfo> DevicesGenerator_();\r
-\r
-#define ALL_DEVICES DevicesGenerator_()\r
+#define ALL_DEVICES testing::ValuesIn(DeviceManager::instance().values())\r
\r
//////////////////////////////////////////////////////////////////////\r
// Additional assertion\r