cuda: fix inplace condition in cv::cuda::flip
authorAlexander Alekhin <alexander.a.alekhin@gmail.com>
Thu, 1 Apr 2021 02:26:59 +0000 (02:26 +0000)
committerAlexander Alekhin <alexander.a.alekhin@gmail.com>
Thu, 1 Apr 2021 02:26:59 +0000 (02:26 +0000)
modules/cudaarithm/src/core.cpp

index 368c2fcc419072600d20398acb117c131929bdd6..223929881fd3a7056a1635d00e43cd8e68b84864 100644 (file)
@@ -163,7 +163,7 @@ void cv::cuda::flip(InputArray _src, OutputArray _dst, int flipCode, Stream& str
 
     _dst.create(src.size(), src.type());
     GpuMat dst = getOutputMat(_dst, src.size(), src.type(), stream);
-    bool isInplace = (src.data == dst.data) || (src.refcount == dst.refcount);
+    bool isInplace = (src.data == dst.data);
     bool isSizeOdd = (src.cols & 1) == 1 || (src.rows & 1) == 1;
     if (isInplace && isSizeOdd)
         CV_Error(Error::BadROISize, "In-place version of flip only accepts even width/height");