⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 base.cpp

📁 动态场景中运动目标检测提取与跟踪 对新手很有用
💻 CPP
字号:
// Base.cpp : implementation file
//

#include "stdafx.h"
#include "ObjectExtraction.h"
#include "Base.h"
//#include <string>

//using namespace std;

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBase dialog


CBase::CBase(CWnd* pParent /*=NULL*/)
	: CDialog(CBase::IDD, pParent)
{
	pCapture=NULL;
	//{{AFX_DATA_INIT(CBase)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}
CBase::~CBase()
{
	if(pCapture!=NULL)
	{
		cvReleaseCapture(&pCapture);
	}
}


void CBase::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CBase)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CBase, CDialog)
	//{{AFX_MSG_MAP(CBase)
	ON_BN_CLICKED(IDC_OPENFILE, OnOpenfile)
	ON_BN_CLICKED(IDC_PROCESS, OnProcess)
	ON_BN_CLICKED(IDC_OPENCAM, OnOpencam)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBase message handlers



void CBase::OnOpenfile() 
{
	// TODO: Add your control notification handler code here
	CFileDialog dlg(TRUE,0,0,OFN_HIDEREADONLY,"*.avi|所有文件|*.*||",this);
	if (dlg.DoModal()==IDOK)
	{
		CString lpszPathName=dlg.GetPathName();
		char* path=(LPTSTR)(LPCTSTR)(lpszPathName);
		if(pCapture!=NULL)
		{
			cvReleaseCapture(&pCapture);
		}
		if((pCapture=cvCreateFileCapture(path))==NULL)
		{
			AfxMessageBox("in CBase.OnOpenfile(),the pCapture is null");
		}
		ASSERT(pCapture);
	}
	
}

void CBase::OnOpencam() 
{
	// TODO: Add your control notification handler code here
	if(pCapture!=NULL)
	{
		cvReleaseCapture(&pCapture);
	}
	if((pCapture=cvCreateCameraCapture(-1))==NULL)
	{
		AfxMessageBox("in CBase.OnOpencam(),the pCapture is null");
	}
		ASSERT(pCapture);
	
}

void CBase::OnProcess() 
{
	// TODO: Add your control notification handler code here
	
	
}

UINT CBase::processImage(LPVOID lpParam)
{
	return 0;
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -