工控编程吧
标题:
上位机工业视觉识别激光打印的二维码
[打印本页]
作者:
qq263946146
时间:
2019-7-26 17:15
标题:
上位机工业视觉识别激光打印的二维码
结果如图
(, 下载次数: 0)
上传
点击文件名下载附件
激光打印后,其打印结果可以通过视觉识别与读取
上面图片的二维码是
Data Matrix ECC 200类型,几行代码就可以识别出来
代码如下
read_image (Image, '1.bmp')
dev_close_window ()
dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle)
dev_display (Image)
SymbolType := []
SymbolType := [SymbolType,'QR Code']
SymbolType := [SymbolType,'Micro QR Code']
SymbolType := [SymbolType,'PDF417']
SymbolType := [SymbolType,'Aztec Code']
SymbolType := [SymbolType,'Data Matrix ECC 200']
create_data_code_2d_model (SymbolType[4], 'default_parameters', 'standard_recognition', DataCodeHandleStandard)
find_data_code_2d (Image, SymbolXLDs, DataCodeHandleStandard, [], [], ResultHandles, DecodedDataStrings)
clear_data_code_2d_model (DataCodeHandleStandard)
dev_display (Image)
if(|DecodedDataStrings|)
get_string_extents (WindowHandle, 'test_string', Ascent, Descent, Width, Height)
area_center_xld (SymbolXLDs, Area, Row, Column, PointOrder)
dev_disp_text (DecodedDataStrings, 'window', 'top', 'left', 'black', [], [])
dev_display (SymbolXLDs)
endif
复制代码
(, 下载次数: 0)
上传
点击文件名下载附件
可以下载附件,学习。基于17版本halcon
欢迎光临 工控编程吧 (https://www.gkbc8.com/)
Powered by Discuz! X3.4