From 26eebb3ee34fe3e004606a7f0b993dc96c728e86 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Tue, 3 Mar 2015 13:15:23 +0300 Subject: [PATCH] increased EPS for cvtColor for NVIDIA --- modules/core/include/opencv2/core/ocl.hpp | 1 + modules/imgproc/test/ocl/test_color.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/core/include/opencv2/core/ocl.hpp b/modules/core/include/opencv2/core/ocl.hpp index f87e15ee6a..173722f61f 100644 --- a/modules/core/include/opencv2/core/ocl.hpp +++ b/modules/core/include/opencv2/core/ocl.hpp @@ -184,6 +184,7 @@ public: // After fix restore code in arithm.cpp: ocl_compare() inline bool isAMD() const { return vendorID() == VENDOR_AMD; } inline bool isIntel() const { return vendorID() == VENDOR_INTEL; } + inline bool isNVidia() const { return vendorID() == VENDOR_NVIDIA; } int maxClockFrequency() const; int maxComputeUnits() const; diff --git a/modules/imgproc/test/ocl/test_color.cpp b/modules/imgproc/test/ocl/test_color.cpp index c53607fdbd..6e117cdd5f 100644 --- a/modules/imgproc/test/ocl/test_color.cpp +++ b/modules/imgproc/test/ocl/test_color.cpp @@ -128,7 +128,7 @@ OCL_TEST_P(CvtColor, BGR2GRAY) { performTest(3, 1, CVTCODE(BGR2GRAY)); } OCL_TEST_P(CvtColor, GRAY2BGR) { performTest(1, 3, CVTCODE(GRAY2BGR)); } OCL_TEST_P(CvtColor, RGBA2GRAY) { performTest(4, 1, CVTCODE(RGBA2GRAY)); } OCL_TEST_P(CvtColor, GRAY2RGBA) { performTest(1, 4, CVTCODE(GRAY2RGBA)); } -OCL_TEST_P(CvtColor, BGRA2GRAY) { performTest(4, 1, CVTCODE(BGRA2GRAY)); } +OCL_TEST_P(CvtColor, BGRA2GRAY) { performTest(4, 1, CVTCODE(BGRA2GRAY), cv::ocl::Device::getDefault().isNVidia() ? 1 : 1e-3); } OCL_TEST_P(CvtColor, GRAY2BGRA) { performTest(1, 4, CVTCODE(GRAY2BGRA)); } // RGB <-> YUV