Ask Your Question

keelix's profile - activity

2016-09-05 12:22:00 -0600 commented question How to access OpenCV data root directory?

At install time, it could write a line into some config file that some static function then could fetch. It's still a good idea. :)

2016-09-05 12:16:57 -0600 commented question How to access OpenCV data root directory?

@berak What about on Windos where the lib can be installed .. anywhere?

2016-09-05 11:59:29 -0600 received badge  Student (source)
2016-09-05 11:46:37 -0600 asked a question How to access OpenCV data root directory?

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.