mirror of
https://github.com/opencv/opencv.git
synced 2024-11-25 03:30:34 +08:00
Merge pull request #15937 from clunietp:3.4-fix-13577
This commit is contained in:
commit
fb9d59ab15
@ -1383,4 +1383,16 @@ TEST(UMat, testTempObjects_Mat_issue_8693)
|
||||
EXPECT_EQ(0, cvtest::norm(srcUMat.getMat(ACCESS_READ), srcMat, NORM_INF));
|
||||
}
|
||||
|
||||
TEST(UMat, resize_Mat_issue_13577)
|
||||
{
|
||||
// save the current state
|
||||
bool useOCL = cv::ocl::useOpenCL();
|
||||
|
||||
cv::ocl::setUseOpenCL(false);
|
||||
UMat foo(10, 10, CV_32FC1);
|
||||
cv::resize(foo, foo, cv::Size(), .5, .5);
|
||||
|
||||
cv::ocl::setUseOpenCL(useOCL); // restore state
|
||||
}
|
||||
|
||||
} } // namespace opencv_test::ocl
|
||||
|
@ -3738,6 +3738,11 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
|
||||
CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat() && _src.cols() > 10 && _src.rows() > 10,
|
||||
ocl_resize(_src, _dst, dsize, inv_scale_x, inv_scale_y, interpolation))
|
||||
|
||||
// Fake reference to source. Resolves issue 13577 in case of src == dst.
|
||||
UMat srcUMat;
|
||||
if (_src.isUMat())
|
||||
srcUMat = _src.getUMat();
|
||||
|
||||
Mat src = _src.getMat();
|
||||
_dst.create(dsize, src.type());
|
||||
Mat dst = _dst.getMat();
|
||||
|
Loading…
Reference in New Issue
Block a user