提交 d5d88efd 编写于 作者: V Vladislav Vinogradov 提交者: Alexander Smorkalov

fix GpuMat::copyTo method with mask:

fill destination matrix with zeros if it was reallocated(cherry picked from commit dda99954)
上级 6cb7a7be
......@@ -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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册