* bottle.hdev: Segment and read numbers on a beer bottle
* 用于读取酒瓶上的数字
FontName:='Universal_0-9_NoRej'
*Step 1:Segmentation
*分割
dev_update_window('off')
*关闭窗口刷新。如果只在图形窗口中显示选定对象,则该选项应该设置为“off”。在这种情况下,对象应该由*dev_display显示。
read_image(Bottle,'bottle2')
*read_image( : Image : FileName : )
get_image_size(Bottle,Width,Height)
dev_close_window()
dev_open_window(0,0,2*Width,2*Heigth,'black',WindowID)
*dev_open_window( : : Row, Column, Width, Height, Background : WindowHandle)
set_display_font(WindowID, 16, 'mono', 'true', 'false') (all in)
*set_display_font( : : WindowHandle, Size, Font, Bold, Slant : )
*此过程设置当前窗口的文本字体,并具有指定的属性大小
*Font:字体的名字。“mono”、“sans”、“serif”或特定的字体名称都可以使用。“mono”将被映射到Windows上的“Courier *New”,Linux上的“Courier”,以及OS X上的“Menlo”。“sans”将被映射到Windows和OS X上的“Arial”,以及Linux上
*的“helvetica”。“serif”将被映射到Windows和OS X上的“Times New Roman”,以及Linux上的“Times”。
*Bold,设置为true则为粗体
*Slant 设置为true则为斜体
dev_display(Bottle)
disp_continue_message(WindowID, 'black', 'true')
*disp_continue_message( : : WindowHandle, Color, Box : )
*这个过程显示在屏幕右下角的特定颜色中“点击”运行“继续”。
*如果参数框设置为“true”,则文本将在一个白盒中编写,这在不规则背景下是有用的。
stop()
*创建自动文本阅读器并设置一些参数
create_text_model_reader('auto',FontName, TextModel)