dev_close_window ()
read_image (Image, ‘11.bmp’)
*read_image (Image, ‘oc.bmp’)
add_image(Image,Image,Image,0.5,0)
mean_image (Image, Img_m1, 3, 3)
mean_image (Img_m1, Img_m2, 17, 17)
dyn_threshold (Img_m1, Img_m2, Reg_th, 5, ‘light’)
connection (Reg_th, Reg_con)
select_shape (Reg_con, Reg_sel, [‘height’, ‘width’], ‘and’, [50, 15], [70, 45])
sort_region (Reg_sel, Reg_sort, ‘character’, ‘true’, ‘row’)
dilation_circle (Reg_sort, Reg_dil, 1.5)
invert_image (Img_m1, Img_inv)
smallest_rectangle1 (Reg_dil, Row1, Column1, Row2, Column2)
read_ocr_class_mlp (‘E:/Program Files/MVTec/HALCON-18.11-Progress/ocr/Pharma_0-9A-Z_NoRej.omc’, OCRHandle)
do_ocr_multi_class_mlp (Reg_dil, Img_inv, OCRHandle, Class, Confidence)
dev_open_window_fit_image(Image, 0, 0, -1, -1, WindowHandle)
disp_image(Image, WindowHandle)
smallest_rectangle1(Reg_sort, R1, C1, R2, C2)
set_display_font (WindowHandle, 14, ‘mono’, ‘true’, ‘false’)
for i:= 0 to |Class|-1 by 1
dev_disp_text (Class, 'image', R1-25, C1, 'black', [], [])
dev_display (Reg_sort)
endfor
stop()
dev_close_window ()
clear_ocr_class_mlp (OCRHandle)