当前位置:网站首页>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.
边栏推荐
- The fourth largest operator cannot be a "catfish"
- Use PEGA to develop a simple RPA program
- NP tips: random create random matrix sample = np random. random([19, 64 , 64, 3])
- Idea of capturing mobile terminal variant combination
- HTNL introduction
- Spruce network deepflow helps 5g core network and telecom cloud build observability
- rsync 远程同步(日落尤其温柔的人间皆是浪漫)
- MySQL High available MHA (accidentellement avec ma jeunesse)
- Visubit "ai+3d vision" product series | loading assembly workstation
- A few lines of code can realize complex excel import and export. This tool class is really powerful!
猜你喜欢

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

Redis master-slave replication, sentinel, cluster cluster principle + experiment (wait, it will be later, but it will be better)

Use PEGA to develop a simple RPA program

Win10 compiles curl library source code with cmake3.22 and vs2019 and calls

DNSLog注入

MySQL high availability MHA (accidentally passed my youth)

Stackoverflow 2022 developer report: PostgreSQL surpasses MySQL!

58 Technology Salon issue 31 flutter dynamic special Salon

Squid proxy server application (I came from afar to make an appointment with you)

2022危险化学品经营单位主要负责人复训题库及在线模拟考试
随机推荐
期货开户怎么开?在哪里开户更安全?
kubernetes资源对象介绍及常用命令
Stackoverflow 2022 developer report: PostgreSQL surpasses MySQL!
Finally quit, full-time UE
TDengine  × Intel edge insight software package accelerates the digital transformation of traditional industries
Spark Tuning (submit job resource parameter tuning)
The fourth largest operator cannot be a "catfish"
IP problem occurs when a virtual system is cloned in VirtualBox
全力冲unreal了
oracle cdc 但是使用的服务名没有sid 该怎么配置呢?
Time effective simulation platform based on dataworks | acquisition technology
How to solve the problem of Caton screen when easycvr plays video?
Discrete mathematics single shot, full shot and double shot
"Jay bear" plummeted by 96.6%. Why is NFT with star goods cold?
通达信能开户炒股吗?安全吗?
Metaq installation deployment document
Logback log output format
Dpdk 20.11 compiling, installing and running program
2022A特种设备相关管理(电梯)特种作业证考试题库及在线模拟考试
[dark horse morning post] Tencent responded that a large number of users' QQ numbers were stolen; Weiya's husband company was fined 190000 yuan; China Evergrande is applied for liquidation; Guanxiaoto