资源简介
一个小工具用来检测电脑设备中摄像头的ID,其中有生成好的exe,点击运行即可,还有源码
代码片段和文件信息
#include
#include
#include “windows.h“
#include “dshow.h“
#include
#pragma comment(lib “strmiids.lib“)
#pragma comment(lib “quartz.lib“)
using namespace cv;
using namespace std;
int listDevices(vector& list) {
//COM Library Initialization
//comInit();
//if (!silent) DebugPrintOut(“\nVIDEOINPUT SPY MODE!\n\n“);
ICreateDevEnum *pDevEnum = NULL;
IEnumMoniker *pEnum = NULL;
int deviceCounter = 0;
CoInitialize(NULL);
HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum NULL
CLSCTX_INPROC_SERVER IID_ICreateDevEnum
reinterpret_cast(&pDevEnum));
if (SUCCEEDED(hr))
{
// Create an enumerator for the video capture category.
hr = pDevEnum->CreateClassEnumerator(
CLSID_VideoInputDeviceCategory
&pEnum 0);
if (hr == S_OK) {
printf(“SETUP: Looking For Capture Devices\n“);
IMoniker *pMoniker = NULL;
while (pEnum->Next(1 &pMoniker NULL) == S_OK) {
IPropertyBag *pPropBag;
hr = pMoniker->BindToStorage(0 0 IID_IPropertyBag
(void**)(&pPropBag));
if (FAILED(hr)) {
pMoniker->Release();
continue; // Skip this one maybe the next one will work.
}
// Find the description or friendly name.
VARIANT varName;
VariantInit(&varName);
hr = pPropBag->Read(L“Description“ &varName 0);
if (FAILED(hr)) hr = pPropBag->Read(L“FriendlyName“ &varName 0);
if (SUCCEEDED(hr))
{
hr = pPropBag->Read(L“FriendlyName“ &varName 0);
int count = 0;
char tmp[255] = { 0 };
//int maxLen = sizeof(deviceNames[0]) / sizeof(deviceNames[0][0]) - 2;
while (varName.bstrVal[count] != 0x00 && count < 255)
{
tmp[count] = (char)varName.bstrVal[count];
count++;
}
list.push_back(tmp);
//deviceNames[deviceCounter][count] = 0;
//if (!silent) DebugPrintOut(“SETUP: %i) %s\n“ deviceCounter deviceNames[deviceCounter]);
}
pPropBag->Release();
pPropBag = NULL;
pMoniker->Release();
pMoniker = NULL;
deviceCounter++;
}
pDevEnum->Release();
pDevEnum = NULL;
pEnum->Release();
pEnum = NULL;
}
//if (!silent) DebugPrintOut(“SETUP: %i Device(s) found\n\n“ deviceCounter);
}
//comUnInit();
return deviceCounter;
}
int main()
{
vector list;
listDevices(list);
cout << “dev_size = “ << list.size() << endl;
for (int i = 0; i {
cout << “device lists: “ << list[i] <<“ i = “< }
getchar();
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 32775680 2019-02-15 11:02 发现摄像头设备ID\FindVideoDevice.exe
文件 2648 2019-02-15 11:23 发现摄像头设备ID\mainTest.cpp
文件 119 2019-02-15 11:22 发现摄像头设备ID\说明.txt
目录 0 2019-02-15 11:23 发现摄像头设备ID
----------- --------- ---------- ----- ----
32778447 4
- 上一篇:Dijkstra算法最短路的可视化实现
- 下一篇:FX2N-1PG(中文).pdf
相关资源
- opencv实现PCASift算法
- opencv中的cxcore200.dll
- Opencv3编程案例详解源码
- 基于图像的火柴和钢筋数量检测
- 基于opencv的交通标志识别
- opencv自带SVM分类器使用程序
- OpenCV使用随机森林实现对图像分类
- opencv行人检测,新鲜出炉
- OpenCV之人脸,眼睛,鼻子,嘴巴的识
- OpenCv相似度比较
- 手写识别的opencv代码
- 棋盘格生成小工具
-
opencv haar检测训练成功xm
l - opencv实现的手势识别,石头剪刀布的
- 基于opencv的手势识别程序,亲测可用
- 人脸识别系统设计-毕业设计
- 相机标定完整工程vs
- 基于opencv的绊线检测代码
- OPENCV人眼检测
-
haarcascades人脸特征分类器xm
l文件 - opencv实现只有xy方向平移的图像拼接算
- Qt+Opencv-PCA人脸识别+视频
- 答题卡识别小程序
- Opencv2.1 的dll和lib文件 win系统的
- HDR_Code_Image.rar for opencv
- opencv毕业设计
- opencv3.4.1+opencv_contrib经vs2015编译后生成
- opencv交叉编译过程中boostdesc_bgm.i等一
- opencv网络摄像头功能和文件传输功能
- opencv410编译好的32位库
评论
共有 条评论