当前位置:网站首页>halcon知识:矩阵专题【02】
halcon知识:矩阵专题【02】
2022-06-30 15:44:00 【无水先生】
一、提要
在上文《 halcon知识:矩阵专题【01】》中,记录10条halcon矩阵基本操作算子。本篇将继续矩阵的算子,包括算术运算、保存、读入等10条算子操作。
二、矩阵算子
2.1 矩阵转置
transpose_matrix(matrix_3_id,matrix_trans_id)
get_full_matrix(matrix_trans_id,values_trans)
2.2 矩阵求和
矩阵求和运算
- 按列求和
sum_matrix(matrix_3_id,‘columns’,matrix_sum_cols_id)
get_full_matrix(matrix_sum_cols_id,values_sum_cols)
- 按行求和
sum_matrix(matrix_3_id,‘rows’,matrix_sum_rows_id)
get_full_matrix(matrix_sum_rows_id,values_sum_rows)
- 整个矩阵求和
sum_matrix(matrix_3_id,‘full’,matrix_sum_full_id)
get_full_matrix(matrix_sum_full_id,values_sum_full)
2.3 加减法
- 矩阵相加
add_matrix(matrix_3_id,matrix_4_id,matrix_add_id)
get_full_matrix(matrix_add_id,values_add)
- 矩阵相减
sub_matrix(matrix_3_id,matrix_4_id,matrix_sub_id)
get_full_matrix(matrix_sub_id,values_sub)
2.4 矩阵乘除法
- 矩阵相乘
mult_matrix(matrix_a_id,matrix_b_id,‘AB’,matrix_mult_id)
get_full_matrix(matrix_mult_id,values_mult)
- 矩阵与常量相乘
scale_matrix(matrix_3_id,1.5,matrix_scale_id)
get_full_matrix(matrix_scale_id,values_scale)
- 矩阵相除
div_element_matrix(matrix_3_id,matrix_4_id,matrix_div_id)
get_full_matrix(matrix_div_id,values_matrix_div)
- 矩阵 element-wise相乘
mult_element_matrix(matrix_3_id,matrix_4_id,mult_elems_id)
get_full_matrix(mult_elems_id,values_mult_elems)
2.5 矩阵的范数
我们知道,做为向量有1范数,2范数,N范数和无穷范数,矩阵也有相同属性。
- norm_matrix( : : MatrixID, NormType : Value)
比如:norm_matrix( matrix_id, ‘2-norm’, value_norm )得到矩阵的二范数。
范数:
'1-norm':1范数,就是所有矩阵内元素绝对值之和。
‘2-norm’:2范数,计算 2 范数。结果是矩阵的最大奇异值。结果的计算公式为:
'frobenius-norm':就是欧几里得范数,即所有矩阵内元素平方之和、对此和开方。
'infinity-norm':无穷范数,就是矩阵中所有元素分别取绝对值,最大者。
2.6 元素之统计
获取矩阵均值
- 按列求均值
mean_matrix(matrix_3_id,‘columns’,matrix_mean_cols_id)
get_full_matrix(matrix_mean_cols_id,values_mean_cols)
- 按行求均值
mean_matrix(matrix_3_id,‘rows’,matrix_mean_rows_id)
get_full_matrix(matrix_mean_rows_id,values_mean_rows)
- 整个矩阵的均值
mean_matrix(matrix_3_id,‘full’,matrix_mean_full_id)
get_full_matrix(matrix_mean_full_id,values_mean_full)
2.7 最大最小值
- 获取矩阵最小值
按列获取
min_matrix(matrix_3_id,‘columns’,matrix_min_cols_id)
get_full_matrix(matrix_min_cols_id,values_min_cols)
按行获取
min_matrix(matrix_3_id,‘rows’,matrix_min_rows_id)
get_full_matrix(matrix_min_rows_id,values_min_rows)
整个矩阵最大值
min_matrix(matrix_3_id,‘full’,matrix_min_full_id)
get_full_matrix(matrix_min_full_id,values_min_full)
- 获取矩阵最大值
按列获取
max_matrix(matrix_3_id,‘columns’,matrix_max_cols_id)
get_full_matrix(matrix_max_cols_id,values_max_cols)
按行获取
max_matrix(matrix_3_id,‘rows’,matrix_max_rows_id)
get_full_matrix(matrix_max_rows_id,values_max_rows)
整个矩阵最大值
max_matrix(matrix_3_id,‘full’,matrix_max_full_id)
get_full_matrix(matrix_max_full_id,values_max_full)
矩阵线性求解
solve_matrix(matrix_3_id,‘general’,0,matrix_c_id,matrix_solve_result_id)
get_full_matrix(matrix_solve_result_id,values_matrix_solve)
2.8 指数运算
矩阵 element-wise 指数运算
pow_element_matrix(matrix_3_id,matrix_4_id,matrix_pow_elem_id)
get_full_matrix(matrix_pow_elem_id,values_pow_elem)
矩阵指数运算
pow_scalar_element_matrix(matrix_3_id,3,matrix_pow_scale_id)
get_full_matrix(matrix_pow_scale_id,values_pow_scale)
2.9 矩阵开方运算
sqrt_matrix(matrix_3_id,matrix_sqrt_id)
get_full_matrix(matrix_sqrt_id,values_sqrt)
2.10 矩阵SVD求解
svd_matrix(matrix_3_id,‘full’,‘right’,matrix_u_id,matrix_s_id,matrix_v_id)
get_full_matrix(matrix_u_id,values_u)
get_full_matrix(matrix_s_id,values_s)
get_full_matrix(matrix_v_id,values_v)
2.11 矩阵存取
矩阵保存
write_matrix(matrix_3_id,‘binary’,’…/…/temp/matrix_3_id.dat’)
读取矩阵
read_matrix(’…/…/temp/matrix_3_id.dat’,matrix_3_3_id)
get_full_matrix(matrix_3_3_id,values_read)
(持续更新中)
边栏推荐
- Cloud XR, how to help industrial upgrading
- ASP. Net core signalr tutorial
- Hundreds of lines of code to implement a JSON parser
- Deep understanding Net (2) kernel mode 1 Kernel mode construct event event
- 附加:(还没写,别看~~~)WebMvcConfigurer接口;
- Policy Center > Google Play‘s Target API Level Policy
- Go-Micro安装
- 2022新消费半年盘点:行业遇冷,但这九个赛道依然吸金
- Cesium-1.72 learning (earth model creation online offline tile)
- 【活动报名】探秘元宇宙,就差你了!7月2号我在深圳现场等你!
猜你喜欢

Smart wind power: operation and maintenance of digital twin 3D wind turbine intelligent equipment

Is your light on? Before you start to solve a problem, you need to know what the "real problem" is

Map reduce case super detailed explanation

云技能提升好伙伴,亚马逊云师兄今天正式营业

快照和备份

ASP. Net core Middleware

【活动报名】探秘元宇宙,就差你了!7月2号我在深圳现场等你!
![[download attached] installation and use of penetration test artifact Nessus](/img/ef/b6a37497010a8320cf5a49a01c2dff.png)
[download attached] installation and use of penetration test artifact Nessus

Cloud XR, how to help industrial upgrading

'<', Hexadecimal value 0x3c, is an invalid problem solving
随机推荐
Practical cases of data visualization (timeline rotation diagram, streamlit control year metabase visualization tutorial) 2.0
[CVE-2019-0193] - Apache Solr DataImport 远程命令执行分析
超 Nice 的表格响应式布局小技巧
Policy Center-Permissions and APIs that Access Sensitive Information
[unity ugui] scrollrect dynamically scales the grid size and automatically locates the middle grid
猎头5万挖我去VC
360数科、蚂蚁集团等入选中国信通院“业务安全推进计划”成员单位
Mysql事务/锁/日志总结
Which direction should college students choose to find jobs after graduation?
ASP. Net core signalr tutorial
Two methods for MySQL to open remote connection permission
备战数学建模34-BP神经网络预测2
深入分析GadgetInspector核心代码
Parameter optimization - bias and variance
【活动报名】探秘元宇宙,就差你了!7月2号我在深圳现场等你!
Warning: [antd: Menu] `children` will be removed in next major version. Please use `items` instead.
Types of waveguides
I 用c I 实现“栈”
KDD 2022 | how far are we from the general pre training recommendation model? Universal sequence representation learning model unisrec for recommender system
There are so many kinds of coupons. First distinguish them clearly and then collect the wool!