我们可以利用OpenCV读取视频文件或者摄像头的数据,将其保存为图像,以用于后期处理.下面的实例代码展示了简单的读取和显示操作: // This is a demo introduces you to reading a video and camera #include <iostream> #include <string> #include <sstream> using namespace std; // OpenCV includes #include <…
一.鼠标截图 #include<opencv2/opencv.hpp> #include<iostream> using namespace cv; using namespace std; Mat img=imread("E://1.jpg"); Mat temp=img.clone(); Mat ROI; Point pt; bool flag=false; void onMouse(int event,int x,int y,int flag,void*…