当前位置:网站首页>Halcon knowledge: matrix topic [01]
Halcon knowledge: matrix topic [01]
2022-06-28 17:58:00 【Mr anhydrous】
One 、 summary
This article talks about Halcon The matrix operation of . When doing some experiments , Often use matlab convenient , Actually , be familiar with halcon Of scholars , Also available halcon Realize the routine mathematical experiment . I think halcon It is a very rich resource , Even more than Opencv, Specialized in extrusion time research halcon The matrix is a very accounting effort .
Two 、 Matrix correlation operator
2.1 How to create a matrix
create_matrix( : : Rows, Columns, Value : MatrixID)
Parameter table :( : : Rows- Number of matrix lines , Columns- Number of matrix columns , Value- Matrix element value tuple : MatrixID- Matrix index number )
explain : Here you create the matrix , It is required to pass all elements of the matrix into , The format for 1X(rows*columns) dimension .
Rows:=4
Cols:=4
Value:=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
create_matrix(Rows,Cols,Value,MatrixID )2.2 Reading of matrix elements
get_value_matrix( : : MatrixID, Row, Column : Value)
Parameter table :( : : MatrixID-- The index number of the matrix , Row-- use tuple Specified multiline , Column-- use tuple Specified multiple columns : Value-- use tuple Specified output )
Another situation , If only one value is accessed , that Row, Column Just give it in the form of quantity
explain : The reference sample
1) Access a value
get_value_matrix( MatrixID, 5, 7 ,Value) *Value gain 5 That's ok 7 The value of the column
2) Accessing multiple values

2.3 Get matrix size
get_size_matrix(matrix_id,rows,cols)
2.4 Create a diagonal matrix or get the diagonal elements of the matrix
Operator get_diagonal_matrix Generate a new matrix Vector And will Matrix The diagonal elements of are copied to this new matrix . A matrix consists of a matrix handle MatrixID Definition . A matrix vector has a column sum n That's ok , among n = The number of diagonal elements . Operator returns matrix Vector Matrix handle for VectorID. You can access the elements of the matrix , For example, use the operator .
1 For squares
The diagonals of the square matrix have the th 0、-1、1、-2、2... Geru :

2 Non square matrix

2.5 Get all the elements of the matrix
- get_full_matrix(MatrixID, Values)
Get all the elements of the matrix :

2.6 Get the submatrix of the matrix
- get_sub_matrix( : : MatrixID, Row, Column, RowsSub, ColumnsSub : MatrixSubID)
obtain MatrixID Matrix , With Row, Column Start unit , RowsSub Row , ColumnsSub Submatrix of columns .
2.7 Set matrix element values
- set_value_matrix(matrix_1_id,1,1,-10)
This sentence will matrix matrix_1_id Of 1 That's ok 1 The column is assigned the value -10
2.8 Set the value of the entire matrix element
- set_full_matrix(matrix_1_id,1)
This sentence takes the entire matrix matrix_1_id The element is refreshed to 1.
2.9 Inverse matrix
- invert_matrix( : : MatrixID, MatrixType, Epsilon : MatrixInvID)
Operator invert_matrix The calculation is performed by the matrix handle MatrixID The inverse of a defined matrix . Use the results to generate a new matrix MatrixInv, And return the matrix handle of the matrix MatrixInvID. It can be used get_full_matrix Access the elements of the matrix .
about Epsilon = 0, Count the reciprocal . Can pass MatrixType choice Matrix The type of . The following values are supported :“general” In general ,“symmetric” Indicates symmetry ,“positive_defined” Denotes symmetric positive definite ,“tridiagonal” Represents a three diagonal line ,“upper_triangular” Represents the upper triangle ,“permuted_upper_triangular” Represents the upper triangle of the displacement ,“lower_triangular” For lower triangular matrix ,'permuted_lower_triangular' For permutation of lower triangular matrix .

about Epsilon > 0, Using singular value decomposition (SVD) Compute pseudo inverse . During calculation , All less than Epsilon * The singular values of the maximum singular value are all set to 0. For these values , No internal division to prevent division by zero . If you use SVD The algorithm calculates the square matrix , It takes more time to calculate . The type of the matrix must be set to MatrixType = 'general'.

2.10 Take the inverse of the matrix
invert_matrix_mod
Operator invert_matrix_mod The calculation is performed by the matrix handle MatrixID The inverse of a defined matrix .
The input matrix is covered by the result . You can access the elements of the matrix , For example, use the operator get_full_matrix.
Other contents are the same as invert_matrix.
边栏推荐
- Squid proxy server application (I came from afar to make an appointment with you)
- Redis持久化(少年一贯快马扬帆,道阻且长不转弯)
- 7-user input and while loop
- Redis 原理 - Hash
- ZABBIX monitoring of traditional operation and maintenance (you get up early, I get up early, and we will get together sooner or later)
- Does DMS SQL result set export support parameter transfer?
- 2022 practice questions and mock examination of Shandong Province safety officer C certificate examination
- Spark调优(提交作业资源参数调优)
- Spruce network deepflow helps 5g core network and telecom cloud build observability
- 麻醉不止“打一针”那么简单,无痛、安全、舒适为患者首选
猜你喜欢

2022年化工自动化控制仪表考试模拟100题模拟考试平台操作

2022起重机械指挥考试题库模拟考试平台操作

Time effective simulation platform based on dataworks | acquisition technology

Flutter 小技巧之 MediaQuery 和 build 优化你不知道的秘密

2022危险化学品生产单位安全生产管理人员复习题及答案

kubeadm创建kubernetes集群

工业数字化与新一代数字化系统设计平台----讲座

Use PEGA to develop a simple RPA program

58技术沙龙第三十一期|Flutter动态化专题沙龙

Redis6笔记04 主从复制,集群,应用问题,Redis6新功能
随机推荐
TDengine  × Intel edge insight software package accelerates the digital transformation of traditional industries
Metaq installation deployment document
Redis principle - hash
2022 practice questions and mock examination of Shandong Province safety officer C certificate examination
Time effective simulation platform based on dataworks | acquisition technology
oracle cdc 但是使用的服务名没有sid 该怎么配置呢?
全网最全360无死角编写软件测试用例模板【建议收藏】
WPF video hard decoding, rendering and playing (no airspace) (support 4K, 8K and high frame rate video)
Summary and Thinking on interface test automation
MySQL high availability MHA (accidentally passed my youth)
How to do a good job of gateway high availability protection in the big promotion scenario
How to make your WordPress website more secure
[tcapulusdb knowledge base] modify business modify cluster
Flutter 小技巧之 MediaQuery 和 build 优化你不知道的秘密
Node foundation ~ node level
Squid代理服务器应用(我从远方赶来,赴你一面之约)
Solve the problem of sqoop error manager SqlManager: Generic SqlManager. listDatabases() not implemented
In rhel6.4, cacti+spine monitoring host is used to send email alarm
Redis persistence (les adolescents naviguent toujours rapidement, obstruent et ne tournent jamais)
halcon知识:矩阵专题【01】