Compile opencv modules in C++ mode, detect OpenCV4 pkgconfig
OpenCV has not supported compiling in C mode for quite some time, and even the remaining C API calls should be compiled in C++ mode. With OpenCV 4, compiling in C mode is no longer possible.
Compile the wrapper in C++ mode, and port the face detection example from the removed C API to its C++ equivalent.
Detect OpenCV 4 pkgconfig, and try fall back to OpenCV 3 when not found.
Tested with OpenCV 4.5.2 and 3.4.10.
This MR updates the code two work with current OpenCV versions. It does not change the behavior or the design of this module.
See #22016
Edited by StefanBruens