09-Halcon机器视觉实例入门:矩阵创建与运算

更新时间:2023-05-17 21:13:08 阅读: 评论:0

09-Halcon机器视觉实例⼊门:矩阵创建与运算* 矩阵创建及运算
* 创建矩阵
m := [1,2,3,4]
create_matrix(2,2,[1.0,2.0,3.0,4.0],matrix_id)
create_matrix(2,2,[2,3,1,3],matrix_1_id)
* 获取矩阵的值
* 获取单个值
get_value_matrix(matrix_id,1,0,value)
* 获取所有值
get_full_matrix(matrix_id,values)
* 设置矩阵元素值
flightt_value_matrix(matrix_1_id,1,1,-10)
*设置整个矩阵元素值
t_full_matrix(matrix_1_id,1)
* 获取矩阵⼤⼩
phbget_size_matrix(matrix_id,rows,cols)
* 矩阵的逆
invert_matrix(matrix_id,'general',0,matrix_inv_id)
get_full_matrix(matrix_inv_id,values_inv)
nv* 矩阵的范数
norm_matrix(matrix_id,'2-norm',value_norm)
m1 := [3.0,-3.0,2.0,-5.0,-3.0,2.0]
m2 := [3.0,-3.0,1.0,1.0,2.0,-1.0,-2.0,-1.0]
m3 := [1.0,0.5,2.0]
create_matrix(3,2,m1,matrix_a_id)
create_matrix(2,4,m2,matrix_b_id)
create_matrix(3,1,m3,matrix_c_id)
m3 := [1,2,3,4,5,6,7,8,9]
m4 := [1,2,3,1,2,3,1,2,3]
create_matrix(3,3,m3,matrix_3_id)
create_matrix(3,3,m4,matrix_4_id)
* 矩阵求和运算
* 按列求和
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)
* 矩阵相加
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)
* 矩阵相乘
deg是什么意思mult_matrix(matrix_a_id,matrix_b_id,'AB',matrix_mult_id)
get_full_matrix(matrix_mult_id,values_mult)
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-wi相乘
mult_element_matrix(matrix_3_id,matrix_4_id,mult_elems_id)
get_full_matrix(mult_elems_id,values_mult_elems)
* 获取对⾓矩阵
get_diagonal_matrix(matrix_3_id,0,vector_id)
get_full_matrix(vector_id,values_diagonal)
* 获取矩阵均值
* 按列求均值
mean_matrix(matrix_3_id,'columns',matrix_mean_cols_id)
get_full_matrix(matrix_mean_cols_id,values_mean_cols)
* 按⾏求均值overbearing
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)
* 矩阵 element-wi 指数运算
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)
* 矩阵开⽅运算
sqrt_matrix(matrix_3_id,matrix_sqrt_id)
get_full_matrix(matrix_sqrt_id,values_sqrt)
自己申请出国留学* 获取⼦矩阵
get_sub_matrix(matrix_3_id,0,0,2,2,matrix_submatrix_id)
get_full_matrix(matrix_submatrix_id,values_submatrix)
* 获取矩阵最⼤值
* 按列获取
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)
* 获取矩阵最⼩值
* 按列获取
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)drawingroom
get_full_matrix(matrix_min_full_id,values_min_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)
* 矩阵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)
ecuadorget_full_matrix(matrix_s_id,values_s)
get_full_matrix(matrix_v_id,values_v)
* 矩阵转置
transpo_matrix(matrix_3_id,matrix_trans_id)
get_full_matrix(matrix_trans_id,values_trans)
* 矩阵保存
write_matrix(matrix_3_id,'binary','../../temp/matrix_3_id.dat')
计算机翻译器>samd* 读取矩阵
read_matrix('../../temp/matrix_3_id.dat',matrix_3_3_id)
get_full_matrix(matrix_3_3_id,values_read)

本文发布于:2023-05-17 21:13:08,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/112417.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:矩阵   运算   获取   创建   留学   申请
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图