pdf417_bottle.hdev读取pdf417码 相关例程学习

index:.../Application/Data-Codes/pdf417_bottle.hdev


* This programs shows how to read 2d data codes of type PDF 417.

dev_update_off ()
dev_close_window ()
read_image (Image, 'datacode/pdf417/pdf417_bottle_01')
dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle)
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
dev_set_line_width (3)
gen_rectangle1 (Rectangle, 250, 0, 600, 610)
dev_set_color ('green')

* Create a 2d data code model
create_data_code_2d_model ('PDF417', [], [], DataCodeHandle)
set_data_code_2d_param (DataCodeHandle, 'default_parameters', 'maximum_recognition')

NumImages := 6
for Index := 1 to NumImages by 1
    * Read the image and decode the 2d data code
    read_image (Image, 'datacode/pdf417/pdf417_bottle_' + Index$'02')
    reduce_domain (Image, Rectangle, ImageReduced)
    count_seconds (T1)
    find_data_code_2d (ImageReduced, SymbolXLDs, DataCodeHandle, [], [], ResultHandles, DecodedDataStrings)
    count_seconds (T2)
    Time := 1000 * (T2 - T1)
    * 
    * Display the runtime and the found symbols
    dev_set_window (WindowHandle)
    dev_display (Image)
    dev_display (SymbolXLDs)
    disp_message (WindowHandle, 'Data code found in ' + Time$'.1f' + ' ms', 'window', 12, 12, 'black', 'true')
    for I := 1 to |ResultHandles| by 1
        Length := strlen(DecodedDataStrings[I - 1])
        Message := ['Value:',DecodedDataStrings[I - 1]{0:(Length / 2) - 1},DecodedDataStrings[I - 1]{Length / 2:Length - 1}]
        disp_message (WindowHandle, Message, 'image', (I + 1) * 24, 12, 'black', 'true')
    endfor
    if (Index != NumImages)
        disp_continue_message (WindowHandle, 'black', 'true')
        stop ()
    endif
endfor

* Clear the 2d data code model
clear_data_code_2d_model (DataCodeHandle)

简单的程序

实现效果如图

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值