Halcon 解码算子详解 一

  • create_data_code_2d_model
    • SymbolType (输入参数)
    • GenParamName(输入参数)
    • GenParamValue(输入参数)
    • DataCodeHandle(输出参数)
    • 案例

create_data_code_2d_model

create_data_code_2d_model( : : SymbolType, GenParamName, GenParamValue : DataCodeHandle)
create_data_code_2d_model (‘Data Matrix ECC 200’, [], [], DataCodeHandle)
创建数据二维代码模型

SymbolType (输入参数)

二维数据代码类型
默认值: ‘Data Matrix ECC 200’
参数集合:
‘Aztec Code’,
‘Data Matrix ECC 200’,
‘GS1 Aztec Code’,
‘GS1 DataMatrix’,
‘GS1 QR Code’,
‘Micro QR Code’,
‘PDF417’,
‘QR Code’

GenParamName(输入参数)

对模型进行调整的参数名称
**默认值:‘[ ]’
参数集合: ‘additional_levels’, ‘contrast_min’, ‘contrast_tolerance’, ‘default_parameters’, ‘finder_pattern_tolerance’, ‘mirrored’, ‘model_type’, ‘module_aspect’, ‘module_aspect_max’, ‘module_aspect_min’, ‘module_gap’, ‘module_gap_col’, ‘module_gap_col_max’, ‘module_gap_col_min’, ‘module_gap_max’, ‘module_gap_min’, ‘module_gap_row’, ‘module_gap_row_max’, ‘module_gap_row_min’, ‘module_grid’, ‘module_size’, ‘module_size_max’, ‘module_size_min’, ‘module_width’, ‘module_width_max’, ‘module_width_min’, ‘persistence’, ‘polarity’, ‘position_pattern_min’, ‘slant_max’, ‘small_modules_robustness’, ‘strict_model’, ‘strict_quiet_zone’, ‘symbol_cols’, ‘symbol_cols_max’, ‘symbol_cols_min’, ‘symbol_rows’, ‘symbol_rows_max’, ‘symbol_rows_min’, ‘symbol_shape’, ‘symbol_size’, ‘symbol_size_max’, ‘symbol_size_min’, ‘timeout’, ‘version’, ‘version_max’, ‘version_min’

在使用过程中常使用默认值‘[ ]’,详细设置会在创建模型后,set_data_code_2d_param中进行已知的、不同参数进行设置,来提高解码的精确性。

GenParamValue(输入参数)

对模型进行调整的参数的值
默认值:[ ]
参数集合:
‘standard_recognition’, ‘enhanced_recognition’, ‘maximum_recognition’, ‘yes’, ‘no’, ‘any’, ‘dark_on_light’, ‘’, ‘square’, ‘rectangle’, ‘small’, ‘big’, ‘fixed’, ‘variable’, ‘low’, ‘high’, 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 30, 50, 70, 90, 12, 14, 16, 18, 20, 22, 24, 26, 32, 36, 40, 44, 48, 52, 64, 72, 80, 88, 96, 104, 120, 132, 144

在使用过程中常使用默认值‘[ ]’,详细设置会在创建模型后,set_data_code_2d_param中进行已知的、不同参数进行设置,来提高解码的精确性。

DataCodeHandle(输出参数)

用于模型操作的句柄

案例

以下是找的隐形DM码,拍照后,进行解码测试的案例

* This example program shows how to read ECC200 symbols
* with heavily disturbed finder pattern. In this example,
* one or more sides of the finder pattern are deformed.
* Therefore some example images that contain ECC200 symbols
* with similar disturbances are used to train a data code model
* which is then used to find the data codes.
*
* Note that alternatively, you can also set the parameter
* 'finder_pattern_tolerance' to 'high' with the operator
* set_data_code_2d_param or create_data_code_2d_model.
*
* Initialize image path and visual settings
dev_update_off ()
dev_close_window ()
ImageFiles := 'E:/桌面/临时文件夹/img'
ImageFilesTrain := 'E:/桌面/临时文件夹/img'
read_image (Image, 'E:/桌面/临时文件夹/img/Image_20220216145827610.bmp')
dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle)
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
dev_set_line_width (3)
dev_set_color ('green')*
* Step 1: Create a 2d data code model
* ----------------------------------------------------
* Create a 2d data code model of the 2d data code class
* 'Data Matrix ECC 200'.
create_data_code_2d_model ('Data Matrix ECC 200', [], [], DataCodeHandle)
list_image_files ('E:/桌面/临时文件夹/img', 'default', [], ImageFiles1)
for Index := 0 to |ImageFiles| - 1 by 1read_image (Image, ImageFiles1[Index])* * Find and decode the data codesfind_data_code_2d (Image, SymbolXLDs, DataCodeHandle, 'train', 'all', ResultHandles, DecodedDataStrings)dev_display (Image)dev_display (SymbolXLDs)
*     TitleMessage := 'Train on image ' + Index + ' of ' + ImageTrainNum
*     display_found_data_codes (SymbolXLDs, WindowHandle, DecodedDataStrings, TitleMessage, [], 'forest green', 'black')disp_continue_message (WindowHandle, 'black', 'true')stop ()
endfor
*
* Display message about the next step
* dev_clear_window ()
* Message := 'The trained data code model is now used to find the data codes'
* Message[1] := 'in a sequence of images with similar disturbances.'
* disp_message (WindowHandle, Message, 'window', 12, 12, 'black', 'true')
* disp_continue_message (WindowHandle, 'black', 'true')
* stop ()
*
* Step 3: Read the data codes
* -------------------------------------------------------
* Search and read the data codes with the trained model
* in each image and display the decoded string for each
* found data code
for Index := 0 to |ImageFiles| - 1 by 1read_image (Image, ImageFiles1[Index])dev_display (Image)* * Find and decode the data codes and measure the runtimecount_seconds (T1)find_data_code_2d (Image, SymbolXLDs, DataCodeHandle, [], [], ResultHandles, DecodedDataStrings)count_seconds (T2)Time := (T2 - T1) * 1000.0* * Display the results
*     TitleMessage := 'Image ' + Index + ' of ' + ImageNumResultMessage := 'Data code found in ' + Time$'.1f' + ' ms'display_found_data_codes (SymbolXLDs, WindowHandle, DecodedDataStrings, '', ResultMessage, 'forest green', 'black')* * If no data codes are foundif (|ResultHandles| == 0)disp_message (WindowHandle, 'No Symbol found (in ' + Time$'.1f' + ' ms )', 'window', 12, 12, 'black', 'true')endif* * Deactivate the following lines to run the program without breaksstop ()
endfor*
* Clear the data code model
clear_data_code_2d_model (DataCodeHandle)

Halcon 解码算子详解 一相关推荐

  1. Halcon —— 边缘检测算子详解

    一.算子介绍 1.1 种类 halcon内常用的边缘检测算子包括如下几种: 1.edges_image: 提取2D 图像边缘 2.edges_sub_pix:提取2D图像亚像素边缘 3.edges_o ...

  2. halcon calculate_lines_gauss_parameters算子详解

    calculate_lines_gauss_parameters 原型 calculate_lines_gauss_parameters( : : MaxLineWidth, Contrast : S ...

  3. Halcon矩阵(Matrix)算子详解

    Halcon矩阵(Matrix)算子详解 创建(Creation) create_matrix copy_matrix repeat_matrix clear_matrix 访问(Access) ge ...

  4. html圆形圆心坐标,halcon找圆心坐标(拟合圆算子详解)

    Contours(in):输入轮廓 Algorithm(in):拟合圆的算法 MaxNumPoints(in):用于计算的最大轮廓点个数 MaxClosureDist(in):一个轮廓的末尾点最大间距 ...

  5. 【H.264/AVC视频编解码技术详解】十九:熵编码算法(5)——H.264的CABAC(上):语法元素的二值化方法...

    <H.264/AVC视频编解码技术详解>视频教程已经在"CSDN学院"上线,视频中详述了H.264的背景.标准协议和实现,并通过一个实战工程的形式对H.264的标准进行 ...

  6. H.264/AVC视频编解码技术详解 第一章 视频信息与压缩编码

    H.264/AVC视频编解码技术详解系列笔记 是对 H.264/AVC视频编解码技术详解 课程的学习 文章目录 人与世界的交互 视频信号的表示方法 视频压缩编码 视频信息为什么可以被压缩? 视频压缩编 ...

  7. 【H.264/AVC视频编解码技术详解】七、 熵编码算法(1):基础知识

    <H.264/AVC视频编解码技术详解>视频教程已经在"CSDN学院"上线,视频中详述了H.264的背景.标准协议和实现,并通过一个实战工程的形式对H.264的标准进行 ...

  8. 各种音视频编解码学习详解之 编解码学习笔记(三):Mpeg系列——Mpeg 1和Mpeg 2

    最近在研究音视频编解码这一块儿,看到@bitbit大神写的[各种音视频编解码学习详解]这篇文章,非常感谢,佩服的五体投地.奈何大神这边文章太长,在这里我把它分解很多小的篇幅,方便阅读.大神博客传送门: ...

  9. 各种音视频编解码学习详解之 编解码学习笔记(四):Mpeg系列——Mpeg 4

    最近在研究音视频编解码这一块儿,看到@bitbit大神写的[各种音视频编解码学习详解]这篇文章,非常感谢,佩服的五体投地.奈何大神这边文章太长,在这里我把它分解成很多小的篇幅,方便阅读.大神博客传送门 ...

最新文章

  1. python怎么知道用哪个库使用-Python绘图库讲解:4大常用库你准备学哪个?
  2. python学习第二十八节(进程,线程)
  3. hdu 1050 Moving Tables
  4. SAP Spartacus PageLayoutComponent 如何知道自己应该显示哪些具体内容
  5. iOS NSTextAttachment - 图文混排
  6. JQuery 中选择多选择框,和单选框,实现获取相应选择的值
  7. 七牛云上传视频如何有效做到节省空间
  8. 从学习 Paddle 开始学习深度学习
  9. 允许其他网络用户通过此计算机的internet连接来连_「Azure云」什么是Azure虚拟网络?...
  10. 学习日记12、list集合中根据某个字段进行去重复操作
  11. 打造专业化FTTD布线产品解决方案
  12. 三星g9500Android9.0,三星G9550/9500刷机包 V9.0 国行港行通刷 极光设置功能微调 完美ROOT权限 稳定流畅省电...
  13. golang 对象转json
  14. React移动web极致优化
  15. 微信公众号授权登录(应用免登陆)
  16. 《Dreamweaver CS6 完全自学教程》笔记 第四章:创建站点
  17. windows10下F1-F11快捷键及window+Dor+E快捷键打开关闭控制
  18. idea的几个好用快捷键、常用配置(包括git)、jdk和javaSE和javaEE、创建一个SE工程、debug、创建一个Web工程、打war包
  19. cad二次开发-C#-VS-镜像-判断用户当前是否已选择实体-将实体对象添加到模型空间-添加实体到块表记录-将块定义插入到模型空间
  20. PX4添加外置IMU传感器MPU-9250

热门文章

  1. python technique
  2. PMP试题 | 每日一练,快速提分 6.4
  3. CRP(Confrence Room Pilot)
  4. Windows11管理开机启动项
  5. INDIRECT实现多表汇总
  6. ORA-01017(:用户名/口令无效; 登录被拒绝)Oracle新建用户并授权
  7. ArcGIS Engine怎样快速合并一个图层的所有线面要素
  8. 基于SpringBoot的图书管理系统[毕业设计]
  9. ShaderJoy —— 果冻般的弹性 “抖抖抖“ 特效【GLSL】
  10. MTK camera驱动浅析(2)