OpenCV extremely slow and not using GPU or CUDA

I’m attempting to run some basic face detection on a Jetson TX2 using a USB camera and OpenCV. I used the provided OpenCV examples and found them to be extremely slow.

I used the profiling tool and see that the majority of the CPU time is spent in the Cascade filters, so I tried to change those for their CUDA versions. Unfortunately the included OpenCV module doesn’t seem to have the CUDA object detection or the CUDA resizing libraries.

Surely I am missing something here? How do we leverage the Jetson hardware in OpenCV?

The openCV you installed from jetpack does not have cuda enabled. If you want to use CUDA functionality in openCV, please install it from source with CUDA enabled.