kedasanlang

导航

halcon车牌的识别

 1 read_image (Audi2, 'audi2')
 2 fill_interlace (Audi2, ImageFilled, 'odd')
 3 dev_set_color('green')
 4 threshold (ImageFilled, Region, 0, 90)
 5 connection (Region, ConnectedRegions)
 6 select_shape (ConnectedRegions, SelectedRegions, 'width', 'and', 30, 70)
 7 select_shape (SelectedRegions, Letters, 'height', 'and', 60, 110)
 8 *dev_clear_window ()
 9 *dev_set_colored (12)
10 *dev_display (ImageFilled)
11 *dev_display (Letters)
12  
13     
14 read_ocr_class_mlp('Industrial_0-9A-Z.omc',OCRHandle) 
15 do_ocr_multi_class_mlp(Letters,Audi2,OCRHandle, Class, Confidence)
16    
17 *显示识别的结果
18 area_center(Letters, Area, Row, Column)
19 for Index := 0 to 6 by 1
20      disp_message(3600, Class[Index], 'window', Row[Index], Column[Index], 'black', 'true')
21  endfor

初始图片:

处理后的图片,将车牌所在的区域识别出来:

显示输出结果:

*Class[0]--class[6]分别为GAPV329

area_center(Letters, Area, Row, Column)
for Index := 0 to 6 by 1
     disp_message(3600, Class[Index], 'window', Row[Index], Column[Index], 'black', 'true')
 endfor

 

posted on 2016-05-04 15:54  刘泽北  阅读(1128)  评论(0编辑  收藏  举报