其他分享
首页 > 其他分享> > Halcon_识别DataMatrix二维码

Halcon_识别DataMatrix二维码

作者:互联网

*读取图像
read_image (Image_slanted, 'C:/Users/username/Desktop/test')
dev_open_window_fit_image (Image_slanted, 0, 0, -1, -1, WindowHandle)

*设置外框颜色及线条宽度
dev_set_color ('green')
dev_set_line_width (3)

*创建二维码句柄
create_data_code_2d_model ('Data Matrix ECC 200', [], [], DataCodeHandle)
*识别图像中的二维码
find_data_code_2d (Image_slanted, SymbolXLDs, DataCodeHandle, [], [], ResultHandles, DecodedDataStrings)

*显示图像
dev_display (Image_slanted)
*显示二维码外框
dev_display (SymbolXLDs)

*设置字体
set_display_font (WindowHandle, 12, 'mono', 'true', 'false')
*显示解码信息
disp_message (WindowHandle, DecodedDataStrings, 'window', 350, 70, 'forest green', 'true')

stop ()

运行:

标签:DataMatrix,set,Image,dev,Halcon,二维码,slanted,WindowHandle
来源: https://blog.csdn.net/qq_36917144/article/details/121394003