halcon ocr 生成样本变体_Halcon示例:bottlet.hdev 光学字符识别(创建OCR)

*

* 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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值