【发布时间】:2013-10-28 07:02:11
【问题描述】:
谁能告诉我?我使用directshow和wia但没有找到方法
【问题讨论】:
-
没有研究工作,它必须是可见的。
-
我使用 directshow ISampleGrabberCB ,但它无法收听 USB 摄像头按钮消息
标签: directshow wia
谁能告诉我?我使用directshow和wia但没有找到方法
【问题讨论】:
标签: directshow wia
为什么不使用 OpenCV?
main.cpp
int main(int argc, char** argv) {
CvCapture* capture = cvCaptureFromCAM(0);
int index = 0;
while(cvGrabFrame(capture)) {
/*Get webcam image!*/
IplImage *camImg = cvRetrieveFrame(capture);
/*Save the image to the disk!*/
string fileName = "tmp/" + int2str(index) + ".jpg";
cvSaveImage(fileName.c_str(), screenShotImg);
index++;
int key = cvWaitKey(10);
if(key == 27) {
break;
}
}
cvReleaseCapture(&capture);
return 0;
}
TypeConvert.cpp
#include "TypeConvert.h"
#include <iostream>
#include <sstream>
string int2str(int &num) {
string emptyStr;
stringstream ss(emptyStr);
ss << num;
return ss.str();
}
【讨论】: