资源描述:
《汽车牌照识别系统软件设计总体》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、汽车牌照识别系统软件设计总体汽车牌照识别系统软件设计总体主程序获取触发信号,启动识别过程,获得识别号码Cap图像采集)GetAVI(获取视频图像)GetImg(获取一帧图像)SetCap(设置视频参数)LPR(图像处理)GetLPR(获取车牌号码)根据参数保存图片,传回号牌图片GetLPRAVI(转Cap)SetLPR(设置参数)SetLPRCap(转Cap)SetLPRReco(转Reco)Reco(字符识别)GetReco(识别字符)SetReco(设置参数,学习)部分代码展示:/*--------------------------------------
2、----------------------------*以下声明全局变量------------------------------------------------------------------*/intg_LPHeight=80;intg_LPWidth=220;intg_LPAccurateHeight=40;intg_BYDiff=10;intg_BWDiff=20;intg_BlackLP=80;intg_WhiteLP=220;intg_BYLP=60;intg_Threshold=160;intg_Threshold_HLP=100;in
3、tg_LeftOffset=0;intg_RightOffset=0;intg_TopOffset=0;intg_BottomOffset=0;intInteEqualize(PGrayImgpDestImg,PGrayImgpSrcImg){intres=0;intHistoGram[256];intbMap[256];intTemp,i,j;TGrayImgTempImg;res=CalHistoGram(HistoGram,pSrcImg);if(res==0)return0;res=GrayImg_Malloc(&TempImg,pSrcImg->Wid
4、th,pSrcImg->Height);if(res==0)return0;for(i=0;i<256;i++){Temp=0;for(j=0;j<=i;j++)Temp=Temp+HistoGram[j];bMap[i]=(int)(Temp*255.0/pSrcImg->Height/pSrcImg->Width+0.5);}for(i=0;iHeight;i++)for(j=0;jWidth;j++){*(TempImg.pImg+i*TempImg.Width+j)=(BYTE)bMap[*(pSrcImg->pI
5、mg+i*pSrcImg->Width+j)];}pDestImg->Width=TempImg.Width;pDestImg->Height=TempImg.Height;if(pDestImg->pImg){pDestImg->pImg=NULL;}pDestImg->pImg=TempImg.pImg;returnres;}intCalHistoGram(intHistoGram[],PGrayImgpSrcImg){inti,j;for(i=0;i<256;i++)HistoGram[i]=0;for(i=0;iHeight;i++)
6、for(j=0;jWidth;j++)HistoGram[*(pSrcImg->pImg+i*pSrcImg->Width+j)]++;return1;}intMedianFilter(PGrayImgpDestImg,PGrayImgpSrcImg,intiFilterH,intiFilterW,intiFilterMX,intiFilterMY){inti,j,l,k;intres=0;BYTE*aValue;TGrayImgTempImg;res=GrayImg_Malloc(&TempImg,pSrcImg->Width,pSrcIm
7、g->Height);if(res==0)return0;aValue=(BYTE*)malloc(iFilterH*iFilterW);if(aValue==NULL)return0;for(i=iFilterMY;i<=TempImg.Height-iFilterH+iFilterMY;i++)for(j=iFilterMX;j<=TempImg.Width-iFilterW+iFilterMX;j++){for(k=0;k8、mg->pImg+(i-