Hello all, I’m attempting to run a process in a separate thread using ofxRuiThread and need to pass an object as an argument… which is not working out.
if (model.isNewModel() == true ) {
int camW = 640;
int camH = 480;
// I'm using the ofxRuiThread addon
// How can I pass "fern.reInitTracker" to this?
threads[1].updateThread();
// Reinitialize using the new bmp image and points
// Doing this freezes the whole program while the
// new image is processed,
// so I want to put it into a thread. This code works,
// the problem happens when I try to
// combine updateThread and reIntTracker
fern.reInitTracker(model.newModelName(),camW, camH);
// I would like to do something like this
threads[1].updateThread(fern.reInitTracker(model.newModelName(),camW, camH));
}
**The Project
**Using Theo’s ofxFern as a starting point, I added a new class that allows users to add new objects to be tracked. You can take an image from the webcam, select 4 points, and then generate a new classifier. This process takes a few minutes, however, and freezes the program while it’s processing. So, I’m attempting to add it into a thread. To do this, I need to somehow pass fern.reInitTracker() into threads.updateThread()basically passing an object as an argument…
After searching the forums, I found topics suggesting using Pointers or ofEvent. I was not able to get these methods to work. I’m relatively new to C++, so I’m guessing what I’m attempting is possible and that I just don’t know the proper syntax.
**I’m using the following setup:
**of_preRelease_v0061_osxSL_FAT
ofxRuiThread
ofxFern https://github.com/ofTheo/ofxFern
**Download Project Here
**
http://mattmillerart.com/ofxFernCameraCreate-debug.zip
Thanks in advance for you time,
-Matt