Opencv&C++获取摄像头
2015-03-14 15:21
260 查看
#include <stdio.h> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> using namespace cv; using namespace std; int main() { //抓取摄影栈 VideoCapture cap(0); //尝试开放摄影栈 if (!cap.isOpened()) return -1; //用矩阵记录抓取的每张frame Mat frame; //建立一个视窗,名称为camera namedWindow("camera", 1); for (;;) { //把取得的影像放置到矩阵中 cap >> frame; //演示frame到camera名称的视窗 imshow("frame", frame); if (waitKey(30) >= 0) break; } system("PAUSE"); return 0; }
相关文章推荐
- OpenCV 使用C++获取摄像头数据并保存示例
- G++编译时 , C++中的getline,获取到的字符串是带回车的,即'/r'
- OpenCV 获取摄像头,新建窗口显示摄像头视频
- c++ opencv调用摄像头程序
- OpenCV 获取摄像头,新建窗口显示摄像头视频
- [OpenCV]获取摄像头视频
- How to get the file's icon using C++ - 用C++如何获取文件的图标
- opencv打开摄像头获取视频程序
- VisualStudio2012 & OpenCV & OpenNi编写运行C++代码使用配置的详细说明
- C/C++&nbsp;中如何获取数组长度
- OpenCV 获取摄像头并显示摄像头视频
- openCV系列——第4周:获取iPhone摄像头
- opencv 获取摄像头图像
- arm摄像头获取jpeg图像后,从内存中解压jpeg图像,并用openCV处理
- OpenCV摄像头视频的获取
- OpenCV摄像头视频的获取
- OpenCV之获取摄像头,显示图像
- win7 安装Eclipse IDE for C C++&Opencv
- Win7 64bit下MexOpenCV的安装,Matlab和C++ & OpenCV的完美结合
- visual studio 中C/C++获取计时方法 &Linux 下获取系统时间方法