Skip to content

Instantly share code, notes, and snippets.

@rgov
Created August 3, 2020 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgov/230bb43d137ab90f3df085d412a8bb5f to your computer and use it in GitHub Desktop.
Save rgov/230bb43d137ab90f3df085d412a8bb5f to your computer and use it in GitHub Desktop.
Some notes on OpenCV CUDA APIs

Notes from OpenCV 4.4.0.

The CUDA APIs are mostly in the cv2.cuda module except a few that are in cv2 such as cv2.cuda_GpuMat and cv2.cuda_Stream.

cv2.cuda_FarnebackOpticalFlow has the same interface as cv2.FarnebackOpticalFlow.

cv2.cuda.createMorphologyFilter doesn't support 3 channel filters.

You must provide the output array to cv2.cuda.merge(_, output). The API doesn't return a GpuMat instance.

cv2.cuda.multiply doesn't accept scalar arguments, instead initialize a matrix initialized to the same value everywhere, e.g., cv2.cuda_GpuMat(frame.size(), cv.CV_32FC1, 255 / (2*np.pi)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment