OpenCV CUDA for Video Preprocessing

No camera required. (Built on Jetson Nano.)

Winston Robson
Dropout Analytics

--

Code to Reproduce this Display (original video source)

cv.cuda

OpenCV’s CUDA python module is a lot of fun, but it’s a work in progress.

For starters, we have to load in the video on CPU before passing it (frame-by-frame) to GPU. cv.cuda.imread() has not been built yet.

Step 1 — .upload()

cv.VideoCapture() can be used to load and iterate through video frames on CPU. Let’s read the corn.mp4 file with it;

After .read()ing the 1st image, we’re ready to make a GPU matrix (picture frame) so that image can be .upload()ed to our GPU.

--

--

Winston Robson
Dropout Analytics

https://gumdropsteve.github.io/blog — “Energy may be likened to the bending of a crossbow, decision to the releasing of a trigger.”