资源简介
vs2005-camshift.rar
代码片段和文件信息
//////////////////////////////////////////////////////////////////////
// Video Capture using DirectShow
// Author: Shiqi Yu (shiqi.yu@gmail.com)
// Thanks to:
// HardyAI@OpenCV China
// flymanbox@OpenCV China (for his contribution to function CameraName and frame width/height setting)
// Last modification: April 9 2009
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
// 使用说明:
// 1. 将CameraDS.h CameraDS.cpp以及目录DirectShow复制到你的项目中
// 2. 菜单 Project->Settings->Settings for:(All configurations)->C/C++->Category(Preprocessor)->Additional include directories
// 设置为 DirectShow/Include
// 3. 菜单 Project->Settings->Settings for:(All configurations)->link->Category(Input)->Additional library directories
// 设置为 DirectShow/Lib
//////////////////////////////////////////////////////////////////////
// CameraDS.cpp: implementation of the CCameraDS class.
//
//////////////////////////////////////////////////////////////////////
#include “stdafx.h“
#include “CameraDS.h“
#pragma comment(lib“Strmiids.lib“)
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CCameraDS::CCameraDS()
{
m_bConnected = false;
m_nWidth = 0;
m_nHeight = 0;
m_bLock = false;
m_bChanged = false;
m_pframe = NULL;
m_nBufferSize = 0;
m_pNullFilter = NULL;
m_pMediaEvent = NULL;
m_pSampleGrabberFilter = NULL;
m_pGraph = NULL;
CoInitialize(NULL);
}
CCameraDS::~CCameraDS()
{
CloseCamera();
CoUninitialize();
}
void CCameraDS::CloseCamera()
{
if(m_bConnected)
m_pMediaControl->Stop();
m_pGraph = NULL;
m_pDeviceFilter = NULL;
m_pMediaControl = NULL;
m_pSampleGrabberFilter = NULL;
m_pSampleGrabber = NULL;
m_pGrabberInput = NULL;
m_pGrabberOutput = NULL;
m_pCameraOutput = NULL;
m_pMediaEvent = NULL; //这里出错了
m_pNullFilter = NULL;
m_pNullInputPin = NULL;
if (m_pframe)
cvReleaseImage(&m_pframe);
m_bConnected = false;
m_nWidth = 0;
m_nHeight = 0;
m_bLock = false;
m_bChanged = false;
m_nBufferSize = 0;
}
bool CCameraDS::OpenCamera(int nCamID bool bDisplayProperties int nWidth int nHeight)
{
HRESULT hr = S_OK;
CoInitialize(NULL);
// Create the Filter Graph Manager.
hr = CoCreateInstance(CLSID_FilterGraph NULL CLSCTX_INPROC
IID_IGraphBuilder (void **)&m_pGraph);
hr = CoCreateInstance(CLSID_SampleGrabber NULL CLSCTX_INPROC_SERVER
IID_IbaseFilter (LPVOID *)&m_pSampleGrabberFilter);
hr = m_pGraph->QueryInterface(IID_IMediaControl (void **) &m_pMediaControl);
hr = m_pGraph->QueryInterface(IID_IMediaEvent (void **) &m_pMediaEvent);
hr = CoCreateInstance(CLSID_NullRenderer NULL CLSCTX_INPROC_SERVER
IID_IbaseFilter (LPVOID*) &m_pNullFilter);
hr = m_pGraph->AddFilter(m_pNullFilter L“Nu
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 26 2013-05-31 17:22 opencv-1\debug\b.bat
文件 106496 2013-06-08 08:47 opencv-1\debug\opencv-1.exe
文件 693720 2013-06-08 08:47 opencv-1\debug\opencv-1.ilk
文件 1625088 2013-06-08 08:47 opencv-1\debug\opencv-1.pdb
文件 11651 2013-05-30 13:28 opencv-1\opencv-1\CameraDS.cpp
文件 3302 2009-04-09 23:23 opencv-1\opencv-1\CameraDS.h
文件 187961 2013-05-31 18:02 opencv-1\opencv-1\Debug\blobtrack.obj
文件 6930 2013-06-08 08:47 opencv-1\opencv-1\Debug\BuildLog.htm
文件 221112 2013-05-30 18:27 opencv-1\opencv-1\Debug\CameraDS.obj
文件 65 2013-06-08 08:47 opencv-1\opencv-1\Debug\mt.dep
文件 406 2013-05-30 16:40 opencv-1\opencv-1\Debug\opencv-1.exe.em
文件 472 2013-05-30 16:40 opencv-1\opencv-1\Debug\opencv-1.exe.em
文件 388 2013-06-08 08:47 opencv-1\opencv-1\Debug\opencv-1.exe.intermediate.manifest
文件 132215 2013-05-30 16:40 opencv-1\opencv-1\Debug\opencv-1.obj
文件 1048576 2013-05-30 16:40 opencv-1\opencv-1\Debug\opencv-1.pch
文件 132635 2013-06-08 08:47 opencv-1\opencv-1\Debug\opencv-CamShift.obj
文件 111433 2013-05-31 18:16 opencv-1\opencv-1\Debug\opencv-t.obj
文件 11032 2013-05-30 16:40 opencv-1\opencv-1\Debug\stdafx.obj
文件 969728 2013-06-08 08:47 opencv-1\opencv-1\Debug\vc80.idb
文件 897024 2013-06-08 08:47 opencv-1\opencv-1\Debug\vc80.pdb
文件 631 2008-02-27 14:52 opencv-1\opencv-1\DirectShow\Include\activecf.h
文件 1826 2008-02-27 14:52 opencv-1\opencv-1\DirectShow\Include\amaudio.h
文件 1065 2008-02-27 14:52 opencv-1\opencv-1\DirectShow\Include\amparse.h
文件 73261 2008-02-27 14:52 opencv-1\opencv-1\DirectShow\Include\amstream.h
文件 3974 2008-02-27 14:52 opencv-1\opencv-1\DirectShow\Include\amva.h
文件 19851 2008-02-27 14:52 opencv-1\opencv-1\DirectShow\Include\Amvideo.h
文件 1097 2008-02-27 14:52 opencv-1\opencv-1\DirectShow\Include\atsmedia.h
文件 1532 2008-02-27 14:52 opencv-1\opencv-1\DirectShow\Include\audevcod.h
文件 20543 2008-02-27 14:52 opencv-1\opencv-1\DirectShow\Include\austream.h
文件 13805 2008-02-27 14:52 opencv-1\opencv-1\DirectShow\Include\aviriff.h
............此处省略155个文件信息
- 上一篇:V3.4(源码).e
- 下一篇:OK2.exe
相关资源
- OK2.exe
- V3.4(源码).e
- 4532.rar
- AUTOSAR_SWS_CANNetworkManagementAUTOSARCAN总线
- 21987909FTP.rar
- 第11章益智游戏——推箱子.rar
- SINGLEYS2.rar
- 1987ASaltpilestabilityamathematicalmodel.pdf
- Clock.rar100619
- BusHound_v6.0.1正式版(串_并_IDE_SATA_US
- englishpde.pdf
- jjcohuidalang_10024782.zip
- 局域网即时通讯软件.rar
- 同步专家网吧版破解.rar
- 99273910opengl-3d-car.zip
- 文艺青年搜索引擎V2.zip
- Km_System.rar
- Modscan32.zip
- 华为杯第十五届中国研究生数学建模
- SmaliInjector_Src_自己写的smali注入工具
- _电子万年历DS12C887温度18B20LCD12864显示
- ye776t.rar
- Saber_H-2012.12安装说明和破解.zip
- jixinyuan2007_5314826.zip
- Virtuoso版图设计基础教程.rar
- myeclise-2017-CI8破解文件-new.zip
- 最优化理论与算法答案.rar
- Djangobook2.0中文版.pdf
- 196-信息安全技术大数据服务安全能力
- R-REC-M.1371-4-201004-I!!PDF-E.pdf
评论
共有 条评论