mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 14:13:15 +08:00
enabled 3-channels support for cv::createSuperResolution_BTVL1
This commit is contained in:
parent
291458a859
commit
63d8a61b9b
@ -3425,8 +3425,6 @@ static bool ocl_sepColFilter2D(const UMat & buf, UMat & dst, const Mat & kernelY
|
||||
return k.run(2, globalsize, localsize, false);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
const int optimizedSepFilterLocalSize = 16;
|
||||
|
||||
static bool ocl_sepFilter2D_SinglePass(InputArray _src, OutputArray _dst,
|
||||
@ -3484,13 +3482,11 @@ static bool ocl_sepFilter2D_SinglePass(InputArray _src, OutputArray _dst,
|
||||
return k.run(2, gt2, lt2, false);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static bool ocl_sepFilter2D( InputArray _src, OutputArray _dst, int ddepth,
|
||||
InputArray _kernelX, InputArray _kernelY, Point anchor,
|
||||
double delta, int borderType )
|
||||
{
|
||||
// Size imgSize = _src.size();
|
||||
Size imgSize = _src.size();
|
||||
|
||||
if (abs(delta)> FLT_MIN)
|
||||
return false;
|
||||
@ -3515,10 +3511,11 @@ static bool ocl_sepFilter2D( InputArray _src, OutputArray _dst, int ddepth,
|
||||
if (ddepth < 0)
|
||||
ddepth = sdepth;
|
||||
|
||||
// CV_OCL_RUN_(kernelY.rows <= 21 && kernelX.rows <= 21 &&
|
||||
// imgSize.width > optimizedSepFilterLocalSize + (kernelX.rows >> 1) &&
|
||||
// imgSize.height > optimizedSepFilterLocalSize + (kernelY.rows >> 1),
|
||||
// ocl_sepFilter2D_SinglePass(_src, _dst, _kernelX, _kernelY, borderType, ddepth), true)
|
||||
CV_OCL_RUN_(kernelY.rows <= 21 && kernelX.rows <= 21 &&
|
||||
imgSize.width > optimizedSepFilterLocalSize + (kernelX.rows >> 1) &&
|
||||
imgSize.height > optimizedSepFilterLocalSize + (kernelY.rows >> 1) &&
|
||||
(borderType & BORDER_ISOLATED) != 0,
|
||||
ocl_sepFilter2D_SinglePass(_src, _dst, _kernelX, _kernelY, borderType, ddepth), true)
|
||||
|
||||
UMat src = _src.getUMat();
|
||||
Size srcWholeSize; Point srcOffset;
|
||||
|
@ -85,7 +85,7 @@ PARAM_TEST_CASE(SepFilter2D, MatDepth, Channels, BorderType, bool, bool)
|
||||
temp = randomMat(Size(1, ksize.height), CV_MAKE_TYPE(CV_32F, 1), -MAX_VALUE, MAX_VALUE);
|
||||
cv::normalize(temp, kernelY, 1.0, 0.0, NORM_L1);
|
||||
|
||||
Size roiSize = randomSize(ksize.width + 16, MAX_VALUE, ksize.height + 20, MAX_VALUE);
|
||||
Size roiSize = randomSize(ksize.width, MAX_VALUE, ksize.height, MAX_VALUE);
|
||||
int rest = roiSize.width % 4;
|
||||
if (rest != 0)
|
||||
roiSize.width += (4 - rest);
|
||||
@ -115,7 +115,7 @@ PARAM_TEST_CASE(SepFilter2D, MatDepth, Channels, BorderType, bool, bool)
|
||||
|
||||
OCL_TEST_P(SepFilter2D, Mat)
|
||||
{
|
||||
for (int j = 0; j < test_loop_times; j++)
|
||||
for (int j = 0; j < test_loop_times + 1; j++)
|
||||
{
|
||||
random_roi();
|
||||
|
||||
|
@ -1014,10 +1014,8 @@ namespace
|
||||
return;
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
if (isUmat_ && curFrame_.channels() == 1)
|
||||
if (isUmat_)
|
||||
curFrame_.copyTo(ucurFrame_);
|
||||
else
|
||||
isUmat_ = false;
|
||||
#endif
|
||||
++storePos_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user