Skip to content

cuda: update videostab for cuda 13.0 #3984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from
Open
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