案例-车牌识别

案例2:识别车牌号

方法流程:采集->图像预处理(滤波、二值化处理、形态学处理)->特征提取->仿射变换->定位->截取->字符识别

程序代码:

dev_close_window()
dev_open_window(0, 0, -1, -1, 'black', WindowHandle)
dev_open_file_dialog('read_image', 'default', 'default', Selection)
read_image (Image,Selection)
mean_image (Image,ImageMean, 5, 5)
decompose3(ImageMean, Image1, Image2, Image3)
trans_from_rgb(Image1, Image2, Image3, ImageResult1, ImageResult2,ImageResult3, 'hsv')
threshold(ImageResult2, Regions, 144, 251)
fill_up (Regions,RegionFillUp)
closing_rectangle1(RegionFillUp, RegionClosing, 10, 10)
connection(RegionClosing, ConnectedRegions)
select_shape(ConnectedRegions, SelectedRegions, 'area', 'and', 8788.99, 13009.2)
shape_trans(SelectedRegions, RegionTrans, 'rectangle2')
orientation_region(RegionTrans, Phi)
hom_mat2d_identity(HomMat2DIdentity)
area_center(RegionTrans, Area, Row, Column)
*vector_angle_to_rigid
(Row, Column, Phi, Row, Column, 0, HomMat2D)
hom_mat2d_rotate(HomMat2DIdentity, -Phi, Row, Column, HomMat2DRotate)
affine_trans_region(RegionTrans, RegionAffineTrans, HomMat2DRotate, 'nearest_neighbor')
affine_trans_image(Image, ImageAffinTrans, HomMat2DRotate, 'constant', 'false')
reduce_domain(ImageAffinTrans, RegionAffineTrans, ImageReduced)
rgb1_to_gray(ImageReduced, GrayImage)
invert_image(GrayImage, ImageInvert)
threshold(GrayImage, Regions1, 175, 241)
opening_circle(Regions1, RegionOpening, 1)
connection(RegionOpening, ConnectedRegions1)
select_shape(ConnectedRegions1, SelectedRegions1, 'area', 'and', 95.87, 500)
closing_circle(SelectedRegions1, RegionClosing1, 2)
sort_region(RegionClosing1, SortedRegions, 'character', 'false', 'column')
read_ocr_class_mlp('Industrial_0-9A-Z_NoRej.omc', OCRHandle)
do_ocr_multi_class_mlp(RegionClosing1, ImageInvert, OCRHandle, Class, Confidence)
disp_message(WindowHandle, Class, 'window', 0, 0, 'black', 'true')

实验结果:

在这里插入图片描述在这里插入图片描述图2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值