* 分割读取啤酒瓶子上的数字
* bottle.hdev: Segment and read numbers on a beer bottle
* 第0步
* Step 0: Preparations
*定义字体名称,用来读取瓶子上的数据/或者可以这么理解,定义瓶子上数据的字体
* Specify the name of the font to use for reading the date on the bottle.
*用训练好的0-9通用字体是最简单的。如果已经运行过这个程序,你可以第二行名称,是用这个项目训练的字体
* It is easiest to use the pre-trained font Universal_0-9_NoRej. If you
* have run the program bottlet.hdev in this directory, you can activate
* the second line to use the font trained with this program.
FontName := 'Universal_0-9_NoRej'
* 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)
*设置显示字体
set_display_font (WindowID, 16, 'mono', 'true', 'false')
*显示图像
dev_display (Bottle)
*显示'Press F5 to continiue'这个信息
disp_continue_message (WindowID, 'black', 'true')
stop ()
* 创建自动文字读取器以及设置一些参数
* Create Automatic Text Reader and set some parameters
*创建文字读取器
create_text_model_reader ('auto', FontName, TextModel)
* The printed date has a significantly higher stroke width
*设置文字读取参数的最小宽度
set_text_model_param (TextModel, 'min_stroke_width', 6)
*最佳日期(表示多级之前引用是最佳的)有一个特殊和已知的结构
* The "best before" date has a particular and known structure
*设置文字组成格式,'2 2 2'便是由三段数字构成,中间由空白或者分隔符分开 '19'表示没有分隔符或者空白
set_text_model_param (TextModel, 'text_line_structure', '2 2 2')
* 读取最佳日期
* Read the "best before" date
find_text (Bottle, TextModel, TextResultID)
* 获取最佳日期文字并显示
* Display the segmentation results
get_text_object (Characters, TextResultID, 'all_lines')
*显示瓶子图像
dev_display (Bottle)
*显示读取到的字符
dev_display (Characters)
stop ()
*显示读取到的结果
* Display the reading results
*获取文字结果
get_text_result (TextResultID, 'class', Classes)
*求区域面积和中心坐标
area_center (Characters, Area, Row, Column)
*显示读取到的文字信息
disp_message (WindowID, Classes, 'image', 80, Column - 3, 'green', 'false')
* 释放内存
* Free memory
*清楚文字结果
clear_text_result (TextResultID)
*清楚Text模型
clear_text_model (TextModel)

Blob分析之bottle.hdev的更多相关文章

  1. Blob分析之board.hdev

    * board.hdev: Detection of missing solder* 获取当前系统参数get_system ('clip_region', Information)*设置当前系统参数s ...

  2. Blob分析之ball_seq.hdev

    * ball_seq.hdev: Inspection of Ball Bonding * 关闭更新dev_update_off ()*图像集合ImageNames := 'die/' + ['die ...

  3. Blob分析之 ball.hdev

    * ball.hdev: Inspection of Ball Bonding * 关闭窗体更新 dev_update_window ('off')*关闭窗体dev_close_window ()*打 ...

  4. 常用机器视觉工具----图像分析工具(blob分析)

    http://blog.sina.com.cn/s/blog_67cc4eb70100ivnt.html Blob分析:Blob分析目的在于对图像中的2-D形状进行检测和分析,得到诸如目标位置.形状. ...

  5. opencv 在工业中的应用:blob分析

    在工业中经常要检测一副图像中物体的数量,位置,大小,面积等信息,这就要用到BLOB分析,我用OPENCV做了个BLOB分析的DEMO. (1)打开一幅图像 (2)进行参数设置,设定二值化阙值,并选择是 ...

  6. Blob分析--粘连颗粒检测 基于距离变换的分水岭区域分割 盆地与原连通域求交集

    文章转自微信公众号:机器视觉那些事 *******************************************************************公众号:机器视觉那些事儿*** ...

  7. HALCON示例:BOTTLE.HDEV 光学字符识别(分割OCR)

    * * bottle.hdev: Segment and read numbers on a beer bottle 分割读取啤酒瓶上的数字* * Step 0: Preparations* Spec ...

  8. Halcon 笔记2 Blob分析

    1. 数组操作 2. 可视化-更新窗口 (1)单步模式-总是:则可以自动显示图像: (2)单步模式-从不:需要调用显示函数才能显示图像. (3)单步模式-清空显示:将原图清除,再显示新图 3. 图像处 ...

  9. Halcon blob分析基本处理步骤

    Halcon,blob分析 应用场景,二值化后的灰度图像对比度清晰 基本处理流程 1 读取图片 read_image(变量名,'路径') //halcon字符串使用单引号'' 2 预处理 2.1 RO ...

随机推荐

  1. Mybatis 报错

    Mybatis 报错 builder.BuilderException: Error parsing SQL Mapper Configuration Caused by: org.apache.ib ...

  2. HTML5(二)音频视频画布

    HTML5 Audio(音频) 定义和用法 <audio src="someaudio.wav" controls="controls"> 您的浏览 ...

  3. embedded database (H2, HSQL or Derby), please put it on the classpath

    Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded data ...

  4. Spark 两种方法计算分组取Top N

    Spark 分组取Top N运算 大数据处理中,对数据分组后,取TopN是非常常见的运算. 下面我们以一个例子来展示spark如何进行分组取Top的运算. 1.RDD方法分组取TopN from py ...

  5. 6.28日模拟考试总结(T1:翻转游戏;T2:抢掠计划,T3:测绘,T4:奖学金)

    今天的考试有结束了,又一次被右边的同桌虐了(额,排名第三的大佬)但是考试还是进步了一名,算是有进步吧 成绩: 那个12名就是我,一个AC都没有,太难受了. T1: 题目链接:http://hzoi.c ...

  6. HDU 2236 无题II 题解

    题目 这是一个简单的游戏,在一个n*n的矩阵中,找n个数使得这n个数都在不同的行和列里并且要求这n个数中的最大值和最小值的差值最小. 输入格式 输入一个整数\(T\)表示\(T\)组数据. 对于每组数 ...

  7. 虚拟机 - 桥接模式下,虚拟网卡没有 ip

    背景 Linux 虚拟机,用桥接模式,敲 ifconfig命令,ens33 没有 ip 即没有红色圈住那部分 解决方案 修改配置文件 vim /etc/sysconfig/network-script ...

  8. python读取EXCEL是去掉空白行和表头全部重命名

    当读取进来的表格如图所示,转换成图2. import pandas as pd # header:指定作为列名的行,默认0,即取第一行的值为列名.数据为列名行以下的数据:若数据不含列名, # 则设定 ...

  9. 管理用户和组 、 tar备份与恢复 、 cron计划任务-云计算学习(4)

    配置用户和组账号 问题 本例要求创建下列用户.组以及组的成员关系: 新建用户 alex,其用户ID为3456,密码是flectrag 创建一个名为 adminuser 的组 创建一个名为 natash ...

  10. Configurate vim tool

    vim tool is a commom editor, for the sake of improving effeicient, it is necessary to configurate vi ...