diff --git a/modules/videostab/src/cuda/global_motion.cu b/modules/videostab/src/cuda/global_motion.cu index 7eca6ff76b7..c20ccfc2ed4 100644 --- a/modules/videostab/src/cuda/global_motion.cu +++ b/modules/videostab/src/cuda/global_motion.cu @@ -52,6 +52,11 @@ namespace cv { namespace cuda { namespace device { namespace globmotion { __constant__ float cml[9]; __constant__ float cmr[9]; +struct is_zero +{ + __host__ __device__ bool operator()(uchar x) const { return x == 0; } +}; + int compactPoints(int N, float *points0, float *points1, const uchar *mask) { thrust::device_ptr dpoints0((float2*)points0); @@ -60,7 +65,7 @@ int compactPoints(int N, float *points0, float *points1, const uchar *mask) return (int)(thrust::remove_if(thrust::make_zip_iterator(thrust::make_tuple(dpoints0, dpoints1)), thrust::make_zip_iterator(thrust::make_tuple(dpoints0 + N, dpoints1 + N)), - dmask, thrust::not1(thrust::identity())) + dmask, is_zero()) - thrust::make_zip_iterator(make_tuple(dpoints0, dpoints1))); }