- OCR训练
- Training of the OCR
*字体在"bottle.hdev"项目中用过 - The font is used in “bottle.hdev”
- 第0步:准备工作
- Step 0: Preparations
FontName := ‘bottle’ - 第1步:分割
- Step 1: Segmentation
*关闭窗体更新
dev_update_window (‘off’)
*读取图像
read_image (Bottle, ‘bottle2’)
*获取图像尺寸
get_image_size (Bottle, Width, Height)
*关闭窗体
dev_close_window ()
*打开窗体
dev_open_window (0, 0, 2 * Width, 2 * Height, ‘black’, WindowID)
*设置显示字体
set_display_font (WindowID, 27, ‘mono’, ‘true’, ‘false’)
*阈值分割
threshold (Bottle, RawSegmentation, 0, 95)
*填充阈值分割的区域
fill_up_shape (RawSegmentation, RemovedNoise, ‘area’, 1, 5)
*开运算:先腐蚀后膨胀,去除小连接的斑点
opening_circle (RemovedNoise, ThickStructures, 2.5)
*填充
fill_up (ThickStructures, Solid)
*以矩形算子做开运算
opening_rectangle1 (Solid, Cut, 1, 7)
*联通区域
connection (