资源简介
控制台应用程序:camshift_kalman 项目概述
本文件概要介绍组成 camshift_kalman 应用程序的的每个文件的内容。
camshift_kalman.vcproj
这是使用应用程序向导生成的 VC++ 项目的主项目文件,
其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。
camshift_kalman.cpp
这是主应用程序源文件。
其他标准文件:
StdAfx.h, StdAfx.cpp
这些文件用于生成名为 camshift_kalman.pch 的预编译头 (PCH) 文件和名为 StdAfx.obj 的预编译类型文件。
代码片段和文件信息
//////////////////////////////////////////////////////////////////////
// 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“NullRenderer“);
hr = m_pSampleGrabberFilter->QueryInterface(IID_ISampleGrabber (void**)&m_pSampleGrabber);
A
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 11137 2014-02-11 16:52 camshift_kalman\CameraDS.cpp
文件 3202 2014-02-11 16:52 camshift_kalman\CameraDS.h
文件 14159 2014-02-20 14:43 camshift_kalman\camshift_kalman.cpp
文件 5166 2014-02-11 16:52 camshift_kalman\camshift_kalman.vcproj
文件 23820 2014-02-20 14:42 camshift_kalman\Debug\BuildLog.htm
文件 262150 2014-02-20 14:36 camshift_kalman\Debug\CameraDS.obj
文件 663 2014-02-11 16:52 camshift_kalman\Debug\camshift_kalman.exe.em
文件 728 2014-02-11 16:52 camshift_kalman\Debug\camshift_kalman.exe.em
文件 621 2014-02-20 14:42 camshift_kalman\Debug\camshift_kalman.exe.intermediate.manifest
文件 212448 2014-02-20 14:42 camshift_kalman\Debug\camshift_kalman.obj
文件 3211264 2014-02-11 16:52 camshift_kalman\Debug\camshift_kalman.pch
文件 60 2014-02-20 14:42 camshift_kalman\Debug\mt.dep
文件 12861 2014-02-11 16:52 camshift_kalman\Debug\stdafx.obj
文件 1051648 2014-02-20 14:42 camshift_kalman\Debug\vc90.idb
文件 1347584 2014-02-20 14:42 camshift_kalman\Debug\vc90.pdb
文件 612 2014-02-11 16:52 camshift_kalman\DirectShow\Include\activecf.h
文件 1772 2014-02-11 16:52 camshift_kalman\DirectShow\Include\amaudio.h
文件 1027 2014-02-11 16:52 camshift_kalman\DirectShow\Include\amparse.h
文件 70966 2014-02-11 16:52 camshift_kalman\DirectShow\Include\amstream.h
文件 3889 2014-02-11 16:52 camshift_kalman\DirectShow\Include\amva.h
文件 19418 2014-02-11 16:52 camshift_kalman\DirectShow\Include\Amvideo.h
文件 1063 2014-02-11 16:52 camshift_kalman\DirectShow\Include\atsmedia.h
文件 1479 2014-02-11 16:52 camshift_kalman\DirectShow\Include\audevcod.h
文件 19828 2014-02-11 16:52 camshift_kalman\DirectShow\Include\austream.h
文件 13403 2014-02-11 16:52 camshift_kalman\DirectShow\Include\aviriff.h
文件 6488 2014-02-11 16:52 camshift_kalman\DirectShow\Include\ba
文件 121498 2014-02-11 16:52 camshift_kalman\DirectShow\Include\bdaiface.h
文件 52985 2014-02-11 16:52 camshift_kalman\DirectShow\Include\bdamedia.h
文件 51777 2014-02-11 16:52 camshift_kalman\DirectShow\Include\Bdatif.h
文件 14919 2014-02-11 16:52 camshift_kalman\DirectShow\Include\bdatypes.h
............此处省略146个文件信息
- 上一篇:C++图书管理系统课程设计
- 下一篇:中文分词C++代码
评论
共有 条评论