more strict checks outside ROI
This commit is contained in:
@@ -1306,9 +1306,10 @@ namespace cv {
|
||||
|
||||
static bool ocl_LUT(InputArray _src, InputArray _lut, OutputArray _dst)
|
||||
{
|
||||
int dcn = _dst.channels(), lcn = _lut.channels(), dtype = _dst.type();
|
||||
int dtype = _dst.type(), lcn = _lut.channels(), dcn = CV_MAT_CN(dtype), ddepth = CV_MAT_DEPTH(dtype);
|
||||
bool doubleSupport = ocl::Device::getDefault().doubleFPConfig() > 0;
|
||||
|
||||
if (_src.dims() > 2)
|
||||
if (_src.dims() > 2 || (!doubleSupport && ddepth == CV_64F))
|
||||
return false;
|
||||
|
||||
UMat src = _src.getUMat(), lut = _lut.getUMat();
|
||||
@@ -1316,8 +1317,9 @@ static bool ocl_LUT(InputArray _src, InputArray _lut, OutputArray _dst)
|
||||
UMat dst = _dst.getUMat();
|
||||
|
||||
ocl::Kernel k("LUT", ocl::core::lut_oclsrc,
|
||||
format("-D dcn=%d -D lcn=%d -D srcT=%s -D dstT=%s", dcn, lcn,
|
||||
ocl::typeToStr(src.depth()), ocl::typeToStr(dst.depth())));
|
||||
format("-D dcn=%d -D lcn=%d -D srcT=%s -D dstT=%s%s", dcn, lcn,
|
||||
ocl::typeToStr(src.depth()), ocl::typeToStr(ddepth),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : ""));
|
||||
k.args(ocl::KernelArg::ReadOnlyNoSize(src), ocl::KernelArg::ReadOnlyNoSize(lut),
|
||||
ocl::KernelArg::WriteOnly(dst));
|
||||
|
||||
|
@@ -92,8 +92,7 @@ PARAM_TEST_CASE(Lut, MatDepth, MatDepth, Channels, bool, bool)
|
||||
|
||||
void Near(double threshold = 0.)
|
||||
{
|
||||
EXPECT_MAT_NEAR(dst, udst, threshold);
|
||||
EXPECT_MAT_NEAR(dst_roi, udst_roi, threshold);
|
||||
OCL_EXPECT_MATS_NEAR(dst, threshold)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -165,14 +164,12 @@ PARAM_TEST_CASE(ArithmTestBase, MatDepth, Channels, bool)
|
||||
|
||||
void Near(double threshold = 0.)
|
||||
{
|
||||
EXPECT_MAT_NEAR(dst1, udst1, threshold);
|
||||
EXPECT_MAT_NEAR(dst1_roi, udst1_roi, threshold);
|
||||
OCL_EXPECT_MATS_NEAR(dst1, threshold)
|
||||
}
|
||||
|
||||
void Near1(double threshold = 0.)
|
||||
{
|
||||
EXPECT_MAT_NEAR(dst2, udst2, threshold);
|
||||
EXPECT_MAT_NEAR(dst2_roi, udst2_roi, threshold);
|
||||
OCL_EXPECT_MATS_NEAR(dst2, threshold)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -532,8 +529,7 @@ OCL_TEST_P(Transpose, SquareInplace)
|
||||
OCL_OFF(cv::transpose(src1_roi, src1_roi));
|
||||
OCL_ON(cv::transpose(usrc1_roi, usrc1_roi));
|
||||
|
||||
EXPECT_MAT_NEAR(src1, usrc1, 0.0);
|
||||
EXPECT_MAT_NEAR(src1_roi, usrc1_roi, 0.0);
|
||||
OCL_EXPECT_MATS_NEAR(src1, 0)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -113,8 +113,7 @@ PARAM_TEST_CASE(MergeTestBase, MatDepth, Channels, bool)
|
||||
|
||||
void Near(double threshold = 0.)
|
||||
{
|
||||
EXPECT_MAT_NEAR(dst, udst, threshold);
|
||||
EXPECT_MAT_NEAR(dst_roi, udst_roi, threshold);
|
||||
OCL_EXPECT_MATS_NEAR(dst, threshold);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user