Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion modules/videostab/src/cuda/global_motion.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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<float2> dpoints0((float2*)points0);
Expand All @@ -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<uchar>()))
dmask, is_zero())
- thrust::make_zip_iterator(make_tuple(dpoints0, dpoints1)));
}

Expand Down