Commit eb599f68 authored by Marina Kolpakova's avatar Marina Kolpakova

added checking destination matrix size for resize and integral functions

parent 6c0af66f
...@@ -530,7 +530,7 @@ void cv::gpu::integral(const GpuMat& src, GpuMat& sum, Stream& s) ...@@ -530,7 +530,7 @@ void cv::gpu::integral(const GpuMat& src, GpuMat& sum, Stream& s)
void cv::gpu::integralBuffered(const GpuMat& src, GpuMat& sum, GpuMat& buffer, Stream& s) void cv::gpu::integralBuffered(const GpuMat& src, GpuMat& sum, GpuMat& buffer, Stream& s)
{ {
CV_Assert(src.type() == CV_8UC1); CV_Assert(src.type() == CV_8UC1);
if (sum.cols != src.cols + 1 && sum.rows != src.rows + 1)
sum.create(src.rows + 1, src.cols + 1, CV_32S); sum.create(src.rows + 1, src.cols + 1, CV_32S);
NcvSize32u roiSize; NcvSize32u roiSize;
......
...@@ -83,7 +83,7 @@ void cv::gpu::resize(const GpuMat& src, GpuMat& dst, Size dsize, double fx, doub ...@@ -83,7 +83,7 @@ void cv::gpu::resize(const GpuMat& src, GpuMat& dst, Size dsize, double fx, doub
fx = static_cast<double>(dsize.width) / src.cols; fx = static_cast<double>(dsize.width) / src.cols;
fy = static_cast<double>(dsize.height) / src.rows; fy = static_cast<double>(dsize.height) / src.rows;
} }
if (dsize != dst.size())
dst.create(dsize, src.type()); dst.create(dsize, src.type());
if (dsize == src.size()) if (dsize == src.size())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment