#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
VideoCapture camera1(0);
camera1.set(CV_CAP_PROP_FRAME_WIDTH,320);
camera1.set(CV_CAP_PROP_FRAME_HEIGHT,240);
VideoCapture camera2(1);
camera2.set(CV_CAP_PROP_FRAME_WIDTH,320);
camera2.set(CV_CAP_PROP_FRAME_HEIGHT,240);
Mat image01,image02;
camera1 >>image01;
camera2 >>image02;
imshow("camera1",image01);
imshow("camera2",image02);