Commit b4fd3e86 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #12563 from cv3d:bug/cuda_msseg

parents 43f889ae ecc9bd09
...@@ -238,6 +238,14 @@ void Mat::copyTo( OutputArray _dst ) const ...@@ -238,6 +238,14 @@ void Mat::copyTo( OutputArray _dst ) const
{ {
CV_INSTRUMENT_REGION(); CV_INSTRUMENT_REGION();
#ifdef HAVE_CUDA
if (_dst.isGpuMat())
{
_dst.getGpuMat().upload(*this);
return;
}
#endif
int dtype = _dst.type(); int dtype = _dst.type();
if( _dst.fixedType() && dtype != type() ) if( _dst.fixedType() && dtype != type() )
{ {
......
...@@ -1146,6 +1146,10 @@ void _InputArray::copyTo(const _OutputArray& arr) const ...@@ -1146,6 +1146,10 @@ void _InputArray::copyTo(const _OutputArray& arr) const
} }
else if( k == UMAT ) else if( k == UMAT )
((UMat*)obj)->copyTo(arr); ((UMat*)obj)->copyTo(arr);
#ifdef HAVE_CUDA
else if (k == CUDA_GPU_MAT)
((cuda::GpuMat*)obj)->copyTo(arr);
#endif
else else
CV_Error(Error::StsNotImplemented, ""); CV_Error(Error::StsNotImplemented, "");
} }
...@@ -1163,6 +1167,10 @@ void _InputArray::copyTo(const _OutputArray& arr, const _InputArray & mask) cons ...@@ -1163,6 +1167,10 @@ void _InputArray::copyTo(const _OutputArray& arr, const _InputArray & mask) cons
} }
else if( k == UMAT ) else if( k == UMAT )
((UMat*)obj)->copyTo(arr, mask); ((UMat*)obj)->copyTo(arr, mask);
#ifdef HAVE_CUDA
else if (k == CUDA_GPU_MAT)
((cuda::GpuMat*)obj)->copyTo(arr, mask);
#endif
else else
CV_Error(Error::StsNotImplemented, ""); CV_Error(Error::StsNotImplemented, "");
} }
......
...@@ -874,6 +874,14 @@ void UMat::copyTo(OutputArray _dst) const ...@@ -874,6 +874,14 @@ void UMat::copyTo(OutputArray _dst) const
{ {
CV_INSTRUMENT_REGION(); CV_INSTRUMENT_REGION();
#ifdef HAVE_CUDA
if (_dst.isGpuMat())
{
_dst.getGpuMat().upload(*this);
return;
}
#endif
int dtype = _dst.type(); int dtype = _dst.type();
if( _dst.fixedType() && dtype != type() ) if( _dst.fixedType() && dtype != type() )
{ {
......
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