halcon一维码识别
1.创建模板
create_bar_code_model (GenParamName, GenParamValue, BarCodeHandle)
GenParamName
可以为条形码模型调整的通用参数的名称。
默认值: []
值的列表: ‘barcode_height_min’, ‘barcode_width_min’, ‘check_char’, ‘composite_code’, ‘element_size_max’, ‘element_size_min’, ‘element_size_variable’, ‘meas_thresh’, ‘meas_thresh_abs’, ‘min_code_length’, ‘min_identical_scanlines’, ‘num_scanlines’, ‘orientation’, ‘orientation_tol’, ‘persistence’, ‘quiet_zone’, ‘start_stop_tolerance’, ‘stop_after_result_num’, ‘timeout’, ‘train’, ‘upce_encodation’
GenParamValue
可以为条形码模型调整的通用参数的值。
Default value: []
Suggested values: 0, 0.1, 1, 1.5, 2, 8, 32, 45, ‘present’, ‘absent’, ‘none’, ‘CC-A/B’, ‘auto’, ‘high’, ‘low’, ‘true’, ‘false’
BarCodeHandle
使用和访问条形码模型的句柄。
2.修改 调整读码参数 set
设置条形码模型的选定参数。
set_bar_code_param 描述
操作员用于设置或更改条形码模型的不同参数,以适应条形码的特殊属性或图像中的特定外观。在使用创建条形码模型时,还可以设置所有参数 。可以使用来查询条形码模型的当前配置。 set_bar_code_paramcreate_bar_code_modelget_bar_code_param
以下概述列出了不同的通用参数以及各自的值范围和默认值:
set_bar_code_param ( BarCodeHandle, GenParamName, GenParamValue )
3.开始读码
读取图片
read_image (Image, 地址)
检测并读取图像中的条形码符号。
1.输入图像 2.输出识别到的一维码区域 3.输入识别模型 4.识别什么种类的一维码 是输入 5. 输出 解码内容字符串
find_bar_code (Image : SymbolRegions : BarCodeHandle, CodeType : DecodedDataStrings)
disp_message (窗口句柄, 显示的蚊子, 图形或句柄 ,显示的行, 显示的列,颜色, 边框)
4.清理读码模型句柄 防止内存泄漏 节省电脑资源开销
删除条形码模型并释放分配的内存
clear_bar_code_model (模型)