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.
For example, Qt has QCoreApplication::libraryPaths(). The correct paths are determined at compile / install time, so it should be possible to make them available to the user.