*创建OCR训练文件
- gen_training_file.hdev: create a training file for OCR
- 关闭窗体更新
dev_update_off ()
*关闭窗体
dev_close_window () - ****第一步,获取图像
- step1: acquire image
*读取图像
read_image (Image, ‘numbers_scale’)
*获取图像指针
get_image_pointer1 (Image, Pointer, Type, Width, Height)
*打开窗体
dev_open_window (0, 0, Width, Height, ‘black’, WindowID)
*使图像适应窗体大小
dev_set_part (0, 0, Height - 1, Width - 1)
*设置线宽
dev_set_line_width (2)
*设置显示颜色
dev_set_color (‘yellow’)
*设置填充方式
dev_set_draw (‘margin’)
*显示图像
dev_display (Image)
*右下角显示’Press F5 to continue’
disp_continue_message (WindowID, ‘black’, ‘true’)
stop ()
*第二步 定义要识别的字符
- step2: specify character names
*字符为0-9
Chars := [‘0’,‘1’,‘2’,‘3’,‘4’,‘5’,‘6’,‘7’,‘8’,‘9’]
*总共有5行文字可以训练
- index of the line used for