*
* Training of the OCR
* The font is used in "bottle.hdev"
*
*
* Step 0: Preparations
FontName := 'bottle'
*
* 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)
dev_display (Bottle)
dev_set_draw ('fill')
set_display_font (WindowID, 27, 'mono', 'true', 'false')
threshold (Bottle, RawSegmentation, 0, 95)
fill_up_shape (RawSegmentation, RemovedNoise, 'area', 1, 5)
*圆形结构开运算 可以平滑区域的边缘和消除小的区域 形态学————Region
opening_circle (RemovedNoise, ThickStructures, 2.5)
fill_up (ThickStructures, Solid)
* dilation_rectangle1 (Solid, RegionDilat