I would like to run an OpenCV C++ Interface using the CascadeClassifier Objects in multiple threads.
The way my program works is my main thread loads "some_file.xml" into a CascadeClassifier object. Three or more threads are spawned and they are passed the cascade object. The program soon crashes thereafter. I have done several tests and concluded that the CascadeClassifier object is not thread-safe when doing a "detectmultiscale" function.
I would like to avoid having to read the same file off of the hard drive every time a new thread is spawned. How can this be avoided?