Capture video from USB by using OpenCV videoInput
来源:互联网 发布:alias软件购买 编辑:程序博客网 时间:2024/06/06 02:51
1. OS: Win7
IDE: VS2010
2. Include Directories: ....../OpenCV2.2/include
....../OpenCV2.2/include/opencv
....../OpenCV2.2/3rdparty/include
Library Directories: ....../OpenCV2.2/lib
....../OpenCV2.2/3rdparty/lib
Additional Dependencies: opencv_core220d.lib, opencv_highgui220d.lib, videoInput.lib
3. Code:
#include "stdafx.h"
#include <cxcore.h>
#include <cv.h>
#include <highgui.h>
#include <videoInput.h>
// If fatal error LNK1104: cannot open file 'atlthunk.lib'
#pragma comment(linker, "/NODEFAULTLIB:atlthunk.lib")
int _tmain(int argc, _TCHAR* argv[])
{
int key = 0; // Key value
int width = 640; // Video width
int height = 480;// Video Height
// Create IplImage and Window
IplImage *image = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 3);
cvNamedWindow("USB Capture");
// Capture video from device(USB)
videoInput video;
video.setupDevice(0, width, height);
while(key != '/x1b'){ // ESC quit
// Capture the new frame
video.getPixels(0, (unsigned char *)image->imageData, false, true);
// Show the frame
cvShowImage("USB Capture", image);
key = cvWaitKey(1);
}
// Release IplImage and Window
cvReleaseImage(&image);
cvDestroyWindow("USB Capture");
return 0;
}
- Capture video from USB by using OpenCV videoInput
- ios学习--How to capture video frames from the camera as images using AV Foundation
- How to capture video frames from the camera as images using AV Foundation
- How to capture video frames from the camera as images using AV Foundation on iOS
- Using opencv to process the video stream from camera
- videoInput库+opencv+usb采集卡+监控相机
- opencv与videoInput
- Play AVI video using OpenCV 2.2
- Structure from Motion Using OpenCV
- Learning OpenCV: read video from Camera
- DirectShow Video Capture Filters
- Video Capture and play
- V4L2 Video Capture - 01
- V4L2 Video Capture - 02
- V4L2 video capture example
- In-Game HD Video Capture using Real-Time YUYV-DXT Compression
- Capture Thumbnails from Video Files (捕获视频中的屏幕截图)
- Depth Extraction from Video Using Non-parametric Sampling解读
- 类的初始化列表
- LINQ查询一
- 编辑距离(Levenshtein Distance)
- LoadRunner 下载
- 似て非なる言葉「オブジェクト」と「エンティティ」の関係
- Capture video from USB by using OpenCV videoInput
- 安装RFT 8.1安装过程失败,提示:JVMJ9VM015W 初始化实例失败的解决方法
- MVC框架中的模型-视图分离问题(五) —— 分离之评测
- OBJ文件格式分析(一)
- AddressBook 联系人字母排序法
- OBJ文件格式(二)
- Makefile wildcard notdir patsubst 简介
- STUN在SIP中的工作原理及过程(转载)
- H264参数结构一:元素的分层结构