如何在vs 2010中使用open mp和opencv读取两个视频文件

时间:2014-10-16 11:56:40

标签: c++ opencv openmp

任何人都可以向我解释如何编写一个程序来并行读取两个视频文件(使用open mp)?

我已经安装了与vs 2010链接的opencv,它是否可以使用此配置?我已经编写了代码来阅读视频文件但它没有工作。

#pragma omp parallel sections num_threads(2)
{
#pragma omp section
{
pMOG= new BackgroundSubtractorMOG(); //MOG approach
// pMOG2= new BackgroundSubtractorMOG2(); //MOG2 approach

if(strcmp("test.avi", "-vid") == 1) {
//input data coming from a video
processVideo(argv[2]);
}
else if(strcmp(argv[1], "-img") == 0) {
//input data coming from a sequence of images
processImages(argv[2]);
}
else {
//error in reading input parameters
printf("Please, check the input parameters.");
printf("Exiting...");
// return EXIT_FAILURE;
}
//destroy GUI windows
destroyAllWindows();
// return EXIT_SUCCESS;
cout<<"I'm Venky"<<endl;
}
#pragma omp section
{
// pMOG= new BackgroundSubtractorMOG(); //MOG approach
pMOG2= new BackgroundSubtractorMOG2(); //MOG2 approach

if(strcmp("test8.avi", "-vid") == 1) {
//input data coming from a video
processVideo1(argv[2]);
}
else if(strcmp(argv[1], "-img") == 0) {
//input data coming from a sequence of images
processImages(argv[2]);
}
else {
//error in reading input parameters
printf("Please, check the input parameters.");
printf("Exiting...");
// return EXIT_FAILURE;
}
destroyAllWindows();
cout<<"I'm Venky"<<endl;
}
} 

0 个答案:

没有答案