Merge pull request #12563 from cv3d:bug/cuda_msseg

This commit is contained in:
Alexander Alekhin 2018-09-17 18:09:11 +00:00
commit b4fd3e8674
3 changed files with 24 additions and 0 deletions

View File

@ -238,6 +238,14 @@ void Mat::copyTo( OutputArray _dst ) const
{
CV_INSTRUMENT_REGION();
#ifdef HAVE_CUDA
if (_dst.isGpuMat())
{
_dst.getGpuMat().upload(*this);
return;
}
#endif
int dtype = _dst.type();
if( _dst.fixedType() && dtype != type() )
{

View File

@ -1146,6 +1146,10 @@ void _InputArray::copyTo(const _OutputArray& arr) const
}
else if( k == UMAT )
((UMat*)obj)->copyTo(arr);
#ifdef HAVE_CUDA
else if (k == CUDA_GPU_MAT)
((cuda::GpuMat*)obj)->copyTo(arr);
#endif
else
CV_Error(Error::StsNotImplemented, "");
}
@ -1163,6 +1167,10 @@ void _InputArray::copyTo(const _OutputArray& arr, const _InputArray & mask) cons
}
else if( k == UMAT )
((UMat*)obj)->copyTo(arr, mask);
#ifdef HAVE_CUDA
else if (k == CUDA_GPU_MAT)
((cuda::GpuMat*)obj)->copyTo(arr, mask);
#endif
else
CV_Error(Error::StsNotImplemented, "");
}

View File

@ -874,6 +874,14 @@ void UMat::copyTo(OutputArray _dst) const
{
CV_INSTRUMENT_REGION();
#ifdef HAVE_CUDA
if (_dst.isGpuMat())
{
_dst.getGpuMat().upload(*this);
return;
}
#endif
int dtype = _dst.type();
if( _dst.fixedType() && dtype != type() )
{