diff --git a/modules/calib3d/test/test_fisheye.cpp b/modules/calib3d/test/test_fisheye.cpp index 774364df79..1ea47ab4e1 100644 --- a/modules/calib3d/test/test_fisheye.cpp +++ b/modules/calib3d/test/test_fisheye.cpp @@ -60,8 +60,6 @@ protected: protected: std::string combine(const std::string& _item1, const std::string& _item2); - std::string combine_format(const std::string& item1, const std::string& item2, ...); - cv::Mat mergeRectification(const cv::Mat& l, const cv::Mat& r); }; @@ -427,10 +425,10 @@ TEST_F(fisheyeTest, rectify) cv::Mat rectification = mergeRectification(lundist, rundist); - cv::Mat correct = cv::imread(combine_format(datasets_repository_path, "rectification_AB_%03d.png", i)); + cv::Mat correct = cv::imread(combine(datasets_repository_path, cv::format("rectification_AB_%03d.png", i))); if (correct.empty()) - cv::imwrite(combine_format(datasets_repository_path, "rectification_AB_%03d.png", i), rectification); + cv::imwrite(combine(datasets_repository_path, cv::format("rectification_AB_%03d.png", i)), rectification); else EXPECT_MAT_NEAR(correct, rectification, 1e-10); } @@ -599,17 +597,6 @@ std::string fisheyeTest::combine(const std::string& _item1, const std::string& _ return item1 + (last != '/' ? "/" : "") + item2; } -std::string fisheyeTest::combine_format(const std::string& item1, const std::string& item2, ...) -{ - std::string fmt = combine(item1, item2); - char buffer[1 << 16]; - va_list args; - va_start( args, item2 ); - vsprintf( buffer, fmt.c_str(), args ); - va_end( args ); - return std::string(buffer); -} - cv::Mat fisheyeTest::mergeRectification(const cv::Mat& l, const cv::Mat& r) { CV_Assert(l.type() == r.type() && l.size() == r.size()); diff --git a/modules/highgui/src/cap_qtkit.mm b/modules/highgui/src/cap_qtkit.mm index 6b915977fe..580e8a0406 100644 --- a/modules/highgui/src/cap_qtkit.mm +++ b/modules/highgui/src/cap_qtkit.mm @@ -450,13 +450,12 @@ double CvCaptureCAM::getProperty(int property_id){ QTFormatDescription* format = [[connections objectAtIndex:0] formatDescription]; NSSize s1 = [[format attributeForKey:QTFormatDescriptionVideoCleanApertureDisplaySizeAttribute] sizeValue]; - int width=s1.width, height=s1.height; switch (property_id) { case CV_CAP_PROP_FRAME_WIDTH: - retval = width; + retval = s1.width; break; case CV_CAP_PROP_FRAME_HEIGHT: - retval = height; + retval = s1.height; break; default: retval = 0; @@ -1013,22 +1012,22 @@ bool CvVideoWriter_QT::writeFrame(const IplImage* image) { cvCvtColor(image, argbimage, CV_BGR2BGRA); - unsigned char* imagedata = (unsigned char*)argbimage->imageData; + unsigned char* imagedata_ = (unsigned char*)argbimage->imageData; //BGRA --> ARGB for (int j = 0; j < argbimage->height; j++) { int rowstart = argbimage->widthStep * j; for (int i = rowstart; i < rowstart+argbimage->widthStep; i+=4) { - unsigned char temp = imagedata[i]; - imagedata[i] = 255; - imagedata[i+3] = temp; - temp = imagedata[i+2]; - imagedata[i+2] = imagedata[i+1]; - imagedata[i+1] = temp; + unsigned char temp = imagedata_[i]; + imagedata_[i] = 255; + imagedata_[i+3] = temp; + temp = imagedata_[i+2]; + imagedata_[i+2] = imagedata_[i+1]; + imagedata_[i+1] = temp; } } - NSBitmapImageRep* imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:&imagedata + NSBitmapImageRep* imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:&imagedata_ pixelsWide:movieSize.width pixelsHigh:movieSize.height bitsPerSample:8 diff --git a/modules/ocl/include/opencv2/ocl/cl_runtime/cl_runtime.hpp b/modules/ocl/include/opencv2/ocl/cl_runtime/cl_runtime.hpp index 86e7ebcc39..5472e0616f 100644 --- a/modules/ocl/include/opencv2/ocl/cl_runtime/cl_runtime.hpp +++ b/modules/ocl/include/opencv2/ocl/cl_runtime/cl_runtime.hpp @@ -6,6 +6,17 @@ #if defined(HAVE_OPENCL_STATIC) #if defined __APPLE__ +// APPLE ignores CL_USE_DEPRECATED_OPENCL_1_1_APIS so use this hack: +#include +#ifdef CL_EXT_PREFIX__VERSION_1_1_DEPRECATED +#undef CL_EXT_PREFIX__VERSION_1_1_DEPRECATED +#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED +#endif +#ifdef CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED +#undef CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED +#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED +#endif + #include #else #include diff --git a/modules/superres/test/test_superres.cpp b/modules/superres/test/test_superres.cpp index 5cb078f77c..14d8eaf35a 100644 --- a/modules/superres/test/test_superres.cpp +++ b/modules/superres/test/test_superres.cpp @@ -278,6 +278,16 @@ TEST_F(SuperResolution, BTVL1_GPU) #if defined(HAVE_OPENCV_OCL) && defined(HAVE_OPENCL) TEST_F(SuperResolution, BTVL1_OCL) { + try + { + const cv::ocl::DeviceInfo& dev = cv::ocl::Context::getContext()->getDeviceInfo(); + std::cout << "Device name:" << dev.deviceName << std::endl; + } + catch (...) + { + std::cout << "Device name: N/A" << std::endl; + return; // skip test + } RunTest(cv::superres::createSuperResolution_BTVL1_OCL()); } #endif