多个摄像头打开
·
经常性的图像处理用到一个摄像头就行了,但是有时候也需要用到多个摄像头,这里介绍下如何打开多个摄像头。这里介绍三种打开方式 opencv ,MFC,QT,
其实QT和MFC都是引用opencv的库总体上程序没有太多的变化。。
介绍下QT打开三个摄像头,,,,,,
VideoCapture cap1;
VideoCapture cap2;
VideoCapture cap3;
Mat frameleft,frameright,framecenture,framelefthsv,framegray;
cap1.open(0);
cap2.open(1);
cap3.open(2);
while(1)
{
cap1.read(frameleft);
cap2.read(frameright);
cap3.read(framecenture);
cvtColor(frameleft,framelefthsv,COLOR_BGR2HSV);
cvtColor(frameright,framegray,COLOR_BGR2GRAY);
QImage imgleft=mat2QImage(framelefthsv);
QImage imgright=mat2QImage(framegray);
QImage imgcen=mat2QImage(framecenture);
ui->label->setScaledContents(true);
ui->label_2->setScaledContents(true);
ui->label_3->setScaledContents(true);
ui->label->setPixmap(QPixmap::fromImage(imgleft));
ui->label_2->setPixmap(QPixmap::fromImage(imgright));
ui->label_3->setPixmap(QPixmap::fromImage(imgcen));
waitKey(30);

MFC…
opencv…
好吧,原本想再写个EMGUCV打开多个摄像头的,,突然发现4.0的和3.0的不太一样了,,,以前用的是3.0的。。。要再看看了
更多推荐

所有评论(0)