I have the following code as my main function:
int main(int argc,char** argv)
{
CommandLineParser cmd(argc,argv,keys);
if (cmd.has("help")) {
cmd.about("");
cmd.printMessage();
return 0;
}
String alphaFile = cmd.get<String>("alpha");
String betaFile = cmd.get<String>("beta");
String gammaFile = cmd.get<String>("gamma");
String deltaFile = cmd.get<String>("delta");
int featureToUse = cmd.get<int>("feature");
int classifier = cmd.get<int>("classifier");
runOnSingleCamera(alphaFile, featureToUse, classifier);
runOnSingleCamera(betaFile, featureToUse, classifier);
runOnSingleCamera(gammaFile, featureToUse, classifier);
runOnSingleCamera(deltaFile, featureToUse, classifier);
return 0;
}
runOnSingleCamera is one of my other functions, and each call runs the same thing on different video files. The code needs to run simultaneously on all video files and access the same global array.
What would be the best way of doing this?
If the solution is multithreading, please advise as to what should be included in my cmake file, as I have experimented with this but could not get it to work.