我们时常在电视上看见监控的画面,可以使在不同地方的摄像头采集的图像画面显示在一个大的屏幕上,这样就方便了人们去管理。其实代码方面很简单。下面是我编写的简单程序,处理时间也是相当的快,而且都是opencv中比较基本的函数。
#include "stdafx.h"
#include "D:\lib\opencv\include\opencv2\core\core.hpp"
#include "D:\lib\opencv\include\opencv2\highgui\highgui.hpp"
#include "D:\lib\opencv\include\opencv2\imgproc\imgproc.hpp"
using namespace std;
using namespace cv;
VideoCapture cap(0);
VideoCapture cap1(1);
Mat frame,frame1,frame2,frame3,frame4,mergeframe;
Rect RoiRect1,RoiRect2,RoiRect3,RoiRect4;
int _tmain(int argc, _TCHAR* argv[])
{
int frameheight=cap.get(CV_CAP_PROP_FRAME_HEIGHT);
int framewidth =cap.get(CV_CAP_PROP_FRAME_WIDTH);
// int height=frameheight/2;