OpenCV CUDA for Video Preprocessing
No camera required. (Built on Jetson Nano.)
Published in
3 min readNov 1, 2020
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.