当前位置:网站首页>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.
边栏推荐
- 6 - Dictionary
- How to make your WordPress website more secure
- 2022年6月27日-2022年7月3日(ue4视频教程)
- 强化学习在黄页商家智能聊天助手中的探索实践
- Panorama of enterprise power in China SSD industry
- Time effective simulation platform based on dataworks | acquisition technology
- 传统运维不得不会的zabbix监控(你早起,我早起,我们迟早在一起)
- dataworks SQL脚本支持语句块的if else 判断吗
- Does the dataworks SQL script support if else judgment of statement blocks
- 2022年山东省安全员C证考试练习题及模拟考试
猜你喜欢

Redis master-slave replication, sentinel, cluster cluster principle + experiment (wait, it will be later, but it will be better)
Tidb v6.0.0 (DMR): initial test of cache table - tidb Book rush

Idea of capturing mobile terminal variant combination

WPF video hard decoding, rendering and playing (no airspace) (support 4K, 8K and high frame rate video)

CSDN Blogger

节点基础~节点层级

Stackoverflow 2022 developer report: PostgreSQL surpasses MySQL!

此虚拟机的处理器所支持的功能不同于保存虚拟机状态的虚拟机的处理器所支持的功能

Why insert is configured with'select last_ INSERT_ What if id() 'returns 0?

kubernetes可视化界面dashboard
随机推荐
Write your own WordPress template
Idea of capturing mobile terminal variant combination
Time effective simulation platform based on dataworks | acquisition technology
Redis主从复制、哨兵、cluster集群原理+实验(好好等,会晚些,但会更好)
为什么 insert 配置 'SELECT LAST_INSERT_ID()' 返回个0呢?
MySQL high availability MHA (accidentally passed my youth)
MySQL高可用之MHA(一不小心和我的青春擦肩而过)
NP tips: random create random matrix sample = np random. random([19, 64 , 64, 3])
July2022 plan (unreal)
Redis master-slave replication, sentinel, cluster cluster principle + experiment (wait, it will be later, but it will be better)
居家高效远程办公 | 社区征文
国内怎么就做不出 IDEA 那样的产品?
Ten MySQL locks, one article will give you full analysis
IP problem occurs when a virtual system is cloned in VirtualBox
DMS的SQL结果集导出支持传参数吗?
From Mogao Grottoes to the Pacific Ocean, massive data have found new homes
Which securities company is better and safer to choose for opening an exchange fund account by mobile phone
TDengine  × Intel edge insight software package accelerates the digital transformation of traditional industries
Rsync remote synchronization (sunset is especially gentle, and the world is romantic)
如何制作CSR(Certificate Signing Request)文件?