#include<opencv2/opencv.hpp>
#include<thread>
using namespace cv;
int main()
{
VideoCapture CapLeft(0);
VideoCapture CapRight(1);
Mat frameLeft;
Mat frameRight;
if (!CapRight.isOpened())return 0;
if (!CapLeft.isOpened())return 0;
while (waitKey(30) != 27)
{
CapRight >> frameRight;
imshow("右摄像头", frameRight);
CapLeft >> frameLeft;
imshow("左摄像头", frameLeft);
}
return 0;
}