fix GpuMat::setTo method in case if mask is empty:

it might be called from _OutputArray::setTo
This commit is contained in:
Vladislav Vinogradov 2015-01-15 19:33:27 +03:00
parent df57d038b8
commit f676bfb3d7

View File

@ -390,6 +390,11 @@ GpuMat& cv::cuda::GpuMat::setTo(Scalar value, InputArray _mask, Stream& stream)
GpuMat mask = _mask.getGpuMat();
if (mask.empty())
{
return setTo(value, stream);
}
CV_DbgAssert( size() == mask.size() && mask.type() == CV_8UC1 );
typedef void (*func_t)(const GpuMat& mat, const GpuMat& mask, Scalar scalar, Stream& stream);