Merge pull request #2188 from jet47:gpumat-copyto-fix

pull/2193/merge
Roman Donchenko 11 years ago committed by OpenCV Buildbot
commit 7ff9d7eb2d
  1. 8
      modules/core/src/gpumat.cpp

@ -620,11 +620,19 @@ void cv::gpu::GpuMat::copyTo(GpuMat& m) const
void cv::gpu::GpuMat::copyTo(GpuMat& mat, const GpuMat& mask) const
{
if (mask.empty())
{
copyTo(mat);
}
else
{
uchar* data0 = mat.data;
mat.create(size(), type());
// do not leave dst uninitialized
if (mat.data != data0)
mat.setTo(Scalar::all(0));
gpuFuncTable()->copyWithMask(*this, mat, mask);
}
}

Loading…
Cancel
Save