資源簡介
1.首先單擊載入圖像菜單項(載入背景和前景圖像),圖像在image文件夾下面。
2.然后單擊車輛提取菜單項,依次進行圖像做差、二值化、開運算、圖像去噪、圖像填充處理。
3.再單擊輪廓提取菜單項,提取車輛輪廓。
4.最后單擊車型識別菜單項,對車輛進行識別。

代碼片段和文件信息
//?CarShapeIdentify.cpp?:?定義應(yīng)用程序的類行為。
//
#include?“stdafx.h“
#include?“CarShapeIdentify.h“
#include?“MainFrm.h“
#include?“CarShapeIdentifyDoc.h“
#include?“CarShapeIdentifyView.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#endif
//?CCarShapeIdentifyApp
BEGIN_MESSAGE_MAP(CCarShapeIdentifyApp?CWinApp)
ON_COMMAND(ID_APP_ABOUT?&CCarShapeIdentifyApp::OnAppAbout)
//?基于文件的標準文檔命令
ON_COMMAND(ID_FILE_NEW?&CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN?&CWinApp::OnFileOpen)
//?標準打印設(shè)置命令
ON_COMMAND(ID_FILE_PRINT_SETUP?&CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
//?CCarShapeIdentifyApp?構(gòu)造
CCarShapeIdentifyApp::CCarShapeIdentifyApp()
{
//?TODO:?在此處添加構(gòu)造代碼,
//?將所有重要的初始化放置在?InitInstance?中
}
//?唯一的一個?CCarShapeIdentifyApp?對象
CCarShapeIdentifyApp?theApp;
//?CCarShapeIdentifyApp?初始化
BOOL?CCarShapeIdentifyApp::InitInstance()
{
//?如果一個運行在?Windows?XP?上的應(yīng)用程序清單指定要
//?使用?ComCtl32.dll?版本?6?或更高版本來啟用可視化方式,
//則需要?InitCommonControlsEx()。否則,將無法創(chuàng)建窗口。
INITCOMMONCONTROLSEX?InitCtrls;
InitCtrls.dwSize?=?sizeof(InitCtrls);
//?將它設(shè)置為包括所有要在應(yīng)用程序中使用的
//?公共控件類。
InitCtrls.dwICC?=?ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
//?初始化?OLE?庫
if?(!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return?FALSE;
}
AfxEnableControlContainer();
//?標準初始化
//?如果未使用這些功能并希望減小
//?最終可執(zhí)行文件的大小,則應(yīng)移除下列
//?不需要的特定初始化例程
//?更改用于存儲設(shè)置的注冊表項
//?TODO:?應(yīng)適當修改該字符串,
//?例如修改為公司或組織名
SetRegistryKey(_T(“應(yīng)用程序向?qū)傻谋镜貞?yīng)用程序“));
LoadStdProfileSettings(4);??//?加載標準?INI?文件選項(包括?MRU)
//?注冊應(yīng)用程序的文檔模板。文檔模板
//?將用作文檔、框架窗口和視圖之間的連接
CSingleDocTemplate*?pDocTemplate;
pDocTemplate?=?new?CSingleDocTemplate(
IDR_MAINframe
RUNTIME_CLASS(CCarShapeIdentifyDoc)
RUNTIME_CLASS(CMainframe)???????//?主?SDI?框架窗口
RUNTIME_CLASS(CCarShapeIdentifyView));
if?(!pDocTemplate)
return?FALSE;
AddDocTemplate(pDocTemplate);
//?分析標準外殼命令、DDE、打開文件操作的命令行
CCommandLineInfo?cmdInfo;
ParseCommandLine(cmdInfo);
//?調(diào)度在命令行中指定的命令。如果
//?用?/RegServer、/Register、/Unregserver?或?/Unregister?啟動應(yīng)用程序,則返回?FALSE。
if?(!ProcessShellCommand(cmdInfo))
return?FALSE;
//?唯一的一個窗口已初始化,因此顯示它并對其進行更新
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
//?僅當具有后綴時才調(diào)用?DragAcceptFiles
//??在?SDI?應(yīng)用程序中,這應(yīng)在?ProcessShellCommand?之后發(fā)生
return?TRUE;
}
//?用于應(yīng)用程序“關(guān)于”菜單項的?CAboutDlg?對話框
class?CAboutDlg?:?public?CDialog
{
public:
CAboutDlg();
//?對話框數(shù)據(jù)
enum?{?IDD?=?IDD_ABOUTBOX?};
protected:
virtual?void?DoDataExchange(CDataExchange*?pDX);????//?DDX/DDV?支持
//?實現(xiàn)
protected:
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg()?:?CDialog(CAboutDlg::IDD)
{
}
void?CAboutDlg::DoDataExchange(CDataExchange*?pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAboutDlg?CDialog)
END_MESSAGE_MAP()
//?用于運行對話框的應(yīng)用程序命令
void?CCarShapeIdentifyApp::OnAppAbout()
{
CAboutDlg?aboutDlg;
aboutDlg.DoModal();
}
//?CCarShapeIdentifyApp?消息處理程序
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-08-19?08:42??Images\
?????文件??????921654??2018-06-11?10:02??Images\前景圖像.bmp
?????文件??????921654??2018-06-11?10:02??Images\背景圖像.bmp
?????目錄???????????0??2018-08-19?08:48??可執(zhí)行文件\
?????目錄???????????0??2018-08-19?08:42??可執(zhí)行文件\contour\
?????文件??????152078??2018-06-11?10:02??可執(zhí)行文件\contour\0.bmp
?????文件??????293578??2018-06-11?10:02??可執(zhí)行文件\contour\1.bmp
?????文件??????207646??2018-06-11?10:02??可執(zhí)行文件\contour\2.bmp
?????文件??????477638??2018-06-11?10:02??可執(zhí)行文件\contour\3.bmp
?????文件?????2084352??2018-06-11?10:02??可執(zhí)行文件\cv210.dll
?????文件?????1069056??2018-06-11?10:01??可執(zhí)行文件\cvaux210.dll
?????文件?????2199040??2018-06-11?10:02??可執(zhí)行文件\cxcore210.dll
?????文件??????780800??2018-06-11?10:01??可執(zhí)行文件\highgui210.dll
?????文件??????406528??2018-06-11?10:01??可執(zhí)行文件\ml210.dll
?????目錄???????????0??2018-08-19?08:42??源碼\
?????目錄???????????0??2018-08-19?08:42??源碼\CarShapeIdentify\
?????文件???????68300??2018-06-11?10:02??源碼\CarShapeIdentify\CarShapeIdentify.aps
?????文件????????3425??2018-06-11?10:02??源碼\CarShapeIdentify\CarShapeIdentify.cpp
?????文件?????????536??2018-06-11?10:02??源碼\CarShapeIdentify\CarShapeIdentify.h
?????文件???????11493??2018-06-11?10:02??源碼\CarShapeIdentify\CarShapeIdentify.rc
?????文件????????6296??2018-06-11?10:02??源碼\CarShapeIdentify\CarShapeIdentify.vcproj
?????文件????????8940??2018-06-11?10:02??源碼\CarShapeIdentify\CarShapeIdentifyDoc.cpp
?????文件????????1159??2018-06-11?10:02??源碼\CarShapeIdentify\CarShapeIdentifyDoc.h
?????文件????????2302??2018-06-11?10:02??源碼\CarShapeIdentify\CarShapeIdentifyView.cpp
?????文件????????1078??2018-06-11?10:02??源碼\CarShapeIdentify\CarShapeIdentifyView.h
?????文件????????1865??2018-06-11?10:02??源碼\CarShapeIdentify\MainFrm.cpp
?????文件?????????655??2018-06-11?10:02??源碼\CarShapeIdentify\MainFrm.h
?????文件?????????164??2018-06-11?10:02??源碼\CarShapeIdentify\MyImg.cpp
?????文件?????????162??2018-06-11?10:02??源碼\CarShapeIdentify\MyImg.h
?????文件????????3646??2018-06-11?10:02??源碼\CarShapeIdentify\ReadMe.txt
?????目錄???????????0??2018-08-19?08:42??源碼\CarShapeIdentify\contour\
............此處省略14個文件信息
評論
共有 條評論