mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
Merge pull request #5235 from philippefoubert:issue_5234
This commit is contained in:
commit
6c42112555
@ -744,7 +744,7 @@ void UMat::convertTo(OutputArray _dst, int _type, double alpha, double beta) con
|
|||||||
|
|
||||||
char cvt[2][40];
|
char cvt[2][40];
|
||||||
ocl::Kernel k("convertTo", ocl::core::convert_oclsrc,
|
ocl::Kernel k("convertTo", ocl::core::convert_oclsrc,
|
||||||
format("-D srcT=%s -D WT=%s -D dstT=%s -D convertToWT=%s -D convertToDT=%s%s",
|
format("-D srcT=%s -D WT=%s -D dstT=%s -D convertToWT=%s -D convertToDT=%s%s%s",
|
||||||
ocl::typeToStr(sdepth), ocl::typeToStr(wdepth), ocl::typeToStr(ddepth),
|
ocl::typeToStr(sdepth), ocl::typeToStr(wdepth), ocl::typeToStr(ddepth),
|
||||||
ocl::convertTypeStr(sdepth, wdepth, 1, cvt[0]),
|
ocl::convertTypeStr(sdepth, wdepth, 1, cvt[0]),
|
||||||
ocl::convertTypeStr(wdepth, ddepth, 1, cvt[1]),
|
ocl::convertTypeStr(wdepth, ddepth, 1, cvt[1]),
|
||||||
|
@ -85,7 +85,7 @@ PARAM_TEST_CASE(ConvertTo, MatDepth, MatDepth, Channels, bool)
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
OCL_TEST_P(ConvertTo, Accuracy)
|
OCL_TEST_P(ConvertTo, WithScale_Accuracy)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < test_loop_times; j++)
|
for (int j = 0; j < test_loop_times; j++)
|
||||||
{
|
{
|
||||||
@ -101,6 +101,20 @@ OCL_TEST_P(ConvertTo, Accuracy)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OCL_TEST_P(ConvertTo, NoScale_Accuracy)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < test_loop_times; j++)
|
||||||
|
{
|
||||||
|
generateTestData();
|
||||||
|
|
||||||
|
OCL_OFF(src_roi.convertTo(dst_roi, dstType, 1, 0));
|
||||||
|
OCL_ON(usrc_roi.convertTo(udst_roi, dstType, 1, 0));
|
||||||
|
|
||||||
|
double eps = CV_MAT_DEPTH(dstType) >= CV_32F ? 2e-4 : 1;
|
||||||
|
OCL_EXPECT_MATS_NEAR(dst, eps);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////// CopyTo /////////////////////////////////////////////////
|
//////////////////////////////// CopyTo /////////////////////////////////////////////////
|
||||||
|
|
||||||
PARAM_TEST_CASE(CopyTo, MatDepth, Channels, bool, bool)
|
PARAM_TEST_CASE(CopyTo, MatDepth, Channels, bool, bool)
|
||||||
|
Loading…
Reference in New Issue
Block a user