How can I do this from Rust? Here how to make OpenCV C++ project
I've used OpenCV a lot from Python, and it can be challenging to get the libraries installed in the right places. The best bet to get up and running quickly is to install OpenCV from a binary, not build from source. OpenCV has quite a few compilation options so take care to get a binary distro with the features you want enabled.