车牌识别系统基于开发系统代码大全.doc
《车牌识别系统基于开发系统代码大全.doc》由会员分享,可在线阅读,更多相关《车牌识别系统基于开发系统代码大全.doc(45页珍藏版)》请在三一办公上搜索。
1、 / 图像字符识别毕业设计View.cpp : CMyView 类的实现/#include stdafx.h#include 图像字符识别毕业设计.h#include 图像字符识别毕业设计Doc.h#include 图像字符识别毕业设计View.h#include .图像字符识别毕业设计view.h#ifdef _DEBUG#define new DEBUG_NEW#endif/ CMyViewIMPLEMENT_DYNCREATE(CMyView, CView)BEGIN_MESSAGE_MAP(CMyView, CView)/ 标准打印命令ON_COMMAND(ID_FILE_PRINT,
2、 CView:OnFilePrint)ON_COMMAND(ID_FILE_PRINT_DIRECT, CView:OnFilePrint)ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView:OnFilePrintPreview)ON_COMMAND(ID_FILE_OPEN, OnFileOpen)ON_COMMAND(ID_IMAGE_PARAMENT, OnImageParament)ON_COMMAND(ID_FIND_CARNUMBER, OnFindCarnumber)ON_COMMAND(ID_COLOR_CRAY, OnColorCray)ON_CO
3、MMAND(ID_MEDIAN5, OnMedian5)ON_COMMAND(ID_LOG_BORDDETEC, OnLogBorddetec)ON_COMMAND(ID_OTSU_THRESHOLD, OnOtsuThreshold)ON_COMMAND(ID_CATCH_NUMBERONCE, OnCatchNumberonce)ON_COMMAND(ID_Lap_Borddetec, OnLapBorddetec)ON_COMMAND(ID_CATCH_BNUMBER, OnCatchBnumber)ON_COMMAND(ID_GET_CARNUMBER, OnGetCarnumber)
4、ON_COMMAND(ID_GET_HCARNUMBER, OnGetHcarnumber)ON_COMMAND(ID_NUMBER_CUT, OnNumberCut)ON_COMMAND(ID_ADD_ALL, OnAddAll)ON_COMMAND(ID_NUMBER_STUDY, OnNumberStudy)ON_COMMAND(ID_FIRSTNUMBER_RECOGNISE, OnFirstnumberRecognise)ON_COMMAND(ID_SECONDNUMBER_RECOGNISE, OnSecondnumberRecognise)ON_COMMAND(ID_THIRDN
5、UMBER_RECOGNISE, OnThirdnumberRecognise)ON_COMMAND(ID_FOURTHNUMBER_RECOGNISE, OnFourthnumberRecognise)ON_COMMAND(ID_FIFTHNUMBER_RECOGNISE, OnFifthnumberRecognise)ON_COMMAND(ID_SISTHNUMBER_RECOGNISE, OnSisthnumberRecognise)ON_COMMAND(ID_SEVENTHNUMBER_RECOGNISE, OnSeventhnumberRecognise)ON_COMMAND(ID_
6、ZIMU_STUDY, OnZimuStudy)ON_COMMAND(ID_HANZI_STUDY, OnHanziStudy)ON_COMMAND(ID_ZHIFUSHIBIE_ZONGHE, OnZhifushibieZonghe)END_MESSAGE_MAP()/ CMyView 构造/析构CMyView:CMyView()/ TODO: 在此处添加构造代码CMyView:CMyView()BOOL CMyView:PreCreateWindow(CREATESTRUCT& cs)/ TODO: 在此处通过修改 CREATESTRUCT cs 来修改窗口类或/ 样式return CVi
7、ew:PreCreateWindow(cs);/ CMyView 绘制void CMyView:OnDraw(CDC* pDC)CMyDoc* pDoc = GetDocument();ASSERT_VALID(pDoc);if (!pDoc)return;/ TODO: 在此处为本机数据添加绘制代码if (!m_Image.IsNull()m_Image.Draw(pDC-m_hDC,0,0);/ CMyView 打印BOOL CMyView:OnPreparePrinting(CPrintInfo* pInfo)/ 默认准备return DoPreparePrinting(pInfo);v
8、oid CMyView:OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)/ TODO: 打印前添加额外的初始化void CMyView:OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)/ TODO: 打印后添加清除过程/ CMyView 诊断#ifdef _DEBUGvoid CMyView:AssertValid() constCView:AssertValid();void CMyView:Dump(CDumpContext& dc) constCView:Dump(dc);CMyD
9、oc* CMyView:GetDocument() const / 非调试版本是内联的ASSERT(m_pDocument-IsKindOf(RUNTIME_CLASS(CMyDoc);return (CMyDoc*)m_pDocument;#endif /_DEBUG/ CMyView 消息处理程序void CMyView:OnFileOpen()/ TODO: 在此添加命令处理程序代码CString strFilter;CSimpleArray aguidFileTypes;HRESULT hResult;/ 获取CImage支持的图像文件的过滤字符串hResult = m_Image.G
10、etExporterFilterString(strFilter,aguidFileTypes,_T( All Image Files) );if (FAILED(hResult) MessageBox(GetExporterFilter调用失败!);return;CFileDialog dlg(TRUE, NULL, NULL, OFN_FILEMUSTEXIST, strFilter);if(IDOK != dlg.DoModal() return;m_Image.Destroy();/ 将外部图像文件装载到CImage对象中hResult = m_Image.Load(dlg.GetFi
11、leName();if (FAILED(hResult) MessageBox(调用图像文件失败!);return;/ 设置主窗口标题栏内容CString str;str.LoadString(AFX_IDS_APP_TITLE);AfxGetMainWnd()-SetWindowText(str + - +dlg.GetFileName();Invalidate(); / 强制调用OnDrawvoid CMyView:OnImageParament()/ TODO: 在此添加命令处理程序代码CClientDC dc(this);HBRUSH hBrush;HPEN hPen;int i,x,
12、y,k,nYChar;CString str;TEXTMETRIC tm;char *textbuf=像素行的存储顺序,像素宽度,像素高度,每像素位数,每行字节数;x=775;y=120;hPen=(HPEN) GetStockObject(WHITE_PEN);hBrush=(HBRUSH) GetStockObject(WHITE_BRUSH);dc.SelectObject(hPen);dc.SelectObject(hBrush);dc.GetTextMetrics(&tm);dc.SetTextColor(RGB(0,0,0);nYChar=(tm.tmHeight+tm.tmExt
13、ernalLeading)*3/2;dc.TextOut(x+60,y-nYChar*3/2,图像特征参数);for(i=0;i5;i+)dc.TextOut (x,y+nYChar*i,textbufi);x+=175;k=m_Image.GetPitch();if(kIsNull() return;ppImgParam-nWidth = pImg-GetWidth();ppImgParam-nHeight = pImg-GetHeight();ppImgParam-nBitCount = pImg-GetBPP();ppImgParam-nBytesPerLine = (pImg-GetW
14、idth()*pImg-GetBPP()+31)/32*4;ppImgParam-nBytesPerPixel = pImg-GetBPP()/8;if (pImg-GetBPP()nNumColors= 1 GetBPP();else ppImgParam-nNumColors= 0;ppImgParam-nSize = ppImgParam-nBytesPerLine*ppImgParam-nHeight;void ImageCopy(CImage *pImgn,CImage *pImgm) structIMAGEPARAMENT P; RGBQUADColorTab256; CDC*pO
15、rigDC,*pDC; GetImageParament(pImgm,&P); if (!pImgn-IsNull() pImgn-Destroy(); pImgn-Create(P.nWidth,P.nHeight,P.nBitCount,0); if (P.nNumColors0) pImgm-GetColorTable(0,P.nNumColors,ColorTab);pImgn-SetColorTable(0,P.nNumColors,ColorTab); pOrigDC= CDC:FromHandle(pImgm-GetDC(); pDC = CDC:FromHandle(pImgn
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 车牌 识别 系统 基于 开发 代码 大全
链接地址:https://www.31ppt.com/p-2393128.html