环境:opencv2.4.9 + vs2013
代码:
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv/cv.h>
using namespace std;
using namespace cv;
int main()
{
VideoCapture capture, capture1, capture2;
capture.open(0); capture1.open(1); capture2.open(2);
// Read options
//read_options(argc, argv, capture);
// Init camera
if (!capture.isOpened())
{
cout << "capture device 0 failed to open!" << endl;
return 1;
}
if (!capture1.isOpened())
{
cout << "capture device 1 failed to open!" << endl;
return 1;
}
if (!capture2.isOpened())
{
cout << "capture device 2 failed to open!" << endl;
return 1;
}
// Register mouse callback to draw the tracking box
namedWindow("0", CV_WINDOW_AUTOSIZE);
namedWindow("1", CV_WINDOW_AUTOSIZE);
namedWindow("2", CV_WINDOW_AUTOSIZE);
char filename_l[15]