* This example shows how OCR results can be improved by restricting the
* allowed results using a regular expression or a lexicon. Note, that the
* classification results are artificially distorted for demonstration purposes.
dev_update_pc ('off')
dev_update_window ('off')
dev_update_var ('off')
dev_close_window ()
*图片的完整路径由环境变量决定,软件安装时,自动会添加该环境变量。
read_image (Image, 'label/label_01.png')
get_image_size (Image, Width, Height)
*新建一个背景为黑色的窗口
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
set_display_font (WindowHandle, 20, 'mono', 'true', 'false')
* Load pretrained font for character classification
*可能是破解软件,Industrial.omc文件的路径虽没有环境变量,但仍然可以到%安装路径%OCR中找到
read_ocr_class_mlp ('Industrial', OCRHandle)
* Create a lexicon of 3 allowed words
*创建OCR用的词典lexicon或者正则表达式
create_lexicon ('label', ['BEST','BEFORE','END'], LexiconHandle)
for i := 1 to 9 by 1
* Read image
* +运算符连接字符串
read_image (Image, 'label/label_
halcon学习笔记之(一)label_word_process_mlp.hdev
最新推荐文章于 2025-06-24 17:18:53 发布