I would like to access
/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_default.xml
from OpenCV distribution, but in a platform-independent way, e.g. in Python
os.path.join(cv2.OPENCV_DATA_DIR, "haarcascades", "haarcascade_frontalface_default.xml")
Can I? How do I get a reliable `OPENCV_DATA_DIR` equivalent? My question is basically the same to [what this StackOverflow user is asking](https://stackoverflow.com/questions/15227532/python-opencv-root-directory).
For example, Qt has [QCoreApplication::libraryPaths()](https://doc.qt.io/qt-5/qcoreapplication.html#libraryPaths). The correct paths are determined at compile / install time, so it should be possible to make them available to the user.
↧