基于HALCON 字符识别

read_image(img,'Z:/result/3.jpg')

var_threshold (img, Region, 15, 15, 0.2, 2, 'dark')
connection (Region, Connection)
select_shape(Connection,SelectedRegions, 'area', 'and', 150, 99999)
connection(SelectedRegions, ConnectedRegions)
sort_region(ConnectedRegions,SortRegions,'upper_left','true','column')
read_ocr_class_mlp('Document_A-Z+.omc', OCRHandle)
do_ocr_multi_class_mlp(SortRegions, img, OCRHandle, Class, Confidence)
area_center(SortRegions, Area, Row, Column)
for Index := 0 to 5 by 1
    disp_message(3600, Class[Index], 'window', Row[Index], Column[Index], 'black', 'true')

endfor

1 识别错误的X(原因:模型read_ocr_class_mlp('Industrial_0-9A-Z.omc',OCRHandle1)) 选择有关,根据自己的字符特征选择不同的模型来识别。

基于HALCON 字符识别_第1张图片

识别正确S

基于HALCON 字符识别_第2张图片

说明:http://wenku.baidu.com/link?url=w_Fbr3Bp4nLoMf1LCT1x1ot8YV4aV4Rnj2TGliepLqvRsEYSENFcaEcDWLdfEw0qOhXhH2kLjxA_9yymjAazjipSPVxNcJLThZ46WeN7V77

你可能感兴趣的:(05,那么年触摸过的图像处理(去模糊,去噪),HALCON,字符识别)