宝贝菲儿

活到老学到老

车牌识别

read_image (Image, 'C:/Users/Administrator/Desktop/车牌识别.jpg')    *读取图像
get_image_size (Image, Width, Height)                                                       *获取图像尺寸
dev_close_window ()
dev_open_window (0, 0, Width/2, Height/2, 'black', WindowHandle)       *打开窗口
rgb1_to_gray (Image, GrayImage)                                                                  *rgd转灰度图
threshold (GrayImage, Regions, 82, 255)                                                       *二值化,获取车牌号区域
opening_rectangle1 (Regions, RegionOpening, 10, 10)                               *开运算,去除噪声
connection (RegionOpening, ConnectedRegions)                                        *将整个区域断开成各个连接区域
select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 93963.7, 150776)        *形状选择
fill_up (SelectedRegions, RegionFillUp)                                                           *填充孔洞
shape_trans (RegionFillUp, RegionTrans, 'rectangle2')                                  *形成外接矩形
area_center (RegionTrans, Area, Row, Column)                                               *求区域面积和中心坐标
orientation_region (RegionTrans, Phi)                                                              *旋转角度
vector_angle_to_rigid (Row, Column, Phi, Row, Column, 0, HomMat2D)      *求旋转矩阵
affine_trans_region (RegionTrans, RegionAffineTrans, HomMat2D, 'false')  *区域矫正
affine_trans_image (GrayImage, ImageAffinTrans, HomMat2D, 'constant', 'false')  *图像矫正
reduce_domain (ImageAffinTrans, RegionAffineTrans, ImageReduced)        *提取感兴趣区域
invert_image (ImageReduced, ImageInvert)threshold (ImageReduced, Regions1, 172, 255)  *灰度反转,求反色
connection (Regions1, ConnectedRegions1)                                                     *求连接区域
select_shape (ConnectedRegions1, SelectedRegions1, ['area','column'], 'and', [2785,339.54], [6786,919.59]) *形状选择
sort_region (SelectedRegions1, SortedRegions, 'character', 'true', 'column')    *区域排序

read_ocr_class_mlp ('Industrial_0-9A-Z_NoRej.omc', OCRHandle)                     *读分类器

do_ocr_multi_class_mlp (SortedRegions, ImageInvert, OCRHandle, Class, Confidence) *OCR识别
dev_display (ImageAffinTrans)

disp_message (WindowHandle, Class, 'window', 0, 0, 'blue', 'true')

阅读更多
个人分类: HALCON学习
上一篇导航车体驱动代码
下一篇汉字识别之膨胀连接
想对作者说点什么? 我来说一句

高识别率Android车牌识别SDK Demo

2017年08月05日 1.61MB 下载

linux下的车牌识别c语言代码

2016年03月06日 3.97MB 下载

基于MATLAB的车牌识别

2016年05月20日 1.16MB 下载

没有更多推荐了,返回首页

关闭
关闭