Search

CN-108287807-B - Hadamard matrix multi-scale ordering method and system

CN108287807BCN 108287807 BCN108287807 BCN 108287807BCN-108287807-B

Abstract

The invention discloses a multi-scale ordering method and system of a Hadamard matrix, wherein the method comprises the steps of initializing parameters, constructing a Hadamard matrix of M rows and M columns, extracting vectors of each row or column of the Hadamard matrix, carrying out normalization, rearranging elements of each row or column of the Hadamard matrix to form a square matrix H i of 2 n rows and 2 n columns, carrying out n-layer two-dimensional Haar wavelet decomposition on the square matrix H i to obtain a coefficient matrix H a , taking absolute value |H a | of the coefficient matrix H a , summing the sigma|H a |, recording I into a sequence number value I (I), storing values of Sa (I) and I (I) into a vector Sa and a vector I respectively, taking i=i+1, judging whether I is larger than M, arranging elements in the vector Sa according to a sequence from small to large, extracting the elements of the Hadamard matrix again according to the new sequence R, carrying out normalization after each row or each column of the Hadamard matrix, carrying out traversal for 34M times to obtain M two-dimensional matrix RH 3556. The invention solves the problem that the existing coding can not simultaneously realize rapid imaging and high signal-to-noise ratio imaging.

Inventors

  • LI MINGFEI
  • HUO LIJUN
  • HUO JUAN
  • YANG RAN
  • DONG PENG

Assignees

  • 北京航天控制仪器研究所
  • 北京航天控制仪器研究所

Dates

Publication Date
20260421
Application Date
20171220
Priority Date
20171220

Claims (1)

  1. 1. A Hadamard matrix multi-scale ordering method, comprising: Step S1, initializing parameters, setting i=1, m=2 2n , n=4, 5, 6..n is a positive integer, and constructing a Hadamard matrix of M rows and M columns; Step S2, reading the ith row of the Hadamard matrix generated in the step S1, wherein i belongs to an integer, normalizing to a section [01] to obtain M obtained vectors A i , sequentially reading the 1 st to 2 nd n th elements of A i as the first row of a square matrix H i , the n +1 to 2 n+1 nd elements as the second row of the square matrix H i , and the like until the ( n -1)×2 n +1 to 2 2n th elements are read as the 2 n th row of the square matrix H i , traversing the M vectors A i to obtain a two-dimensional 2 4 ×2 4 square matrix H i , wherein the square matrix H i data are displayed in an image format; S3, carrying out n layers of two-dimensional Haar wavelet decomposition on a square matrix H i to obtain a coefficient matrix H a , taking an absolute value |H a | of the coefficient matrix H a , summing up Sigma|H a | and marking as Sa (I) = Σ|H a |, recording I into a sequence number value I (I), wherein the vector Sa and the vector I are M multiplied by 1-dimensional vectors, carrying out 4 layers of Haar wavelet decomposition on n=4, taking an absolute value of each element of the matrix H a corresponding to a 2 4 ×2 4 square matrix, and carrying out summation and traversal on each element for 256 elements; step S4, storing the values of Sa (I) and I (I) into a vector Sa and a vector I, respectively, wherein when n=4, the vector Sa and the vector I each have m=2 8 =256 element values; step S5, taking i=i+1, and judging whether i is greater than M; Step S6, if i is less than or equal to M, repeating steps S2-S4 until i is more than M, wherein when i=256+1, i is more than M=256, and the step S6 is repeated 256 times at the moment, so as to obtain a pattern generated according to the sequence of initial Hadamard columns, and recording the pattern as a pattern 2; Step S7, reading the M multiplied by 1 dimension vector Sa and the M multiplied by 1 dimension vector I stored in the step S4, sorting the values of the vector Sa from small to large, correspondingly adjusting the value sequence of I (I) corresponding to Sa (I) in the one-dimensional vector I according to the initial sequence, and keeping the initial corresponding relation unchanged; if the value of Sa (I) is equal to the value of Sa (I-1)) or Sa (i+1), the value of Sa (I), sa (I-1) or Sa (i+1) is unchanged according to the initial sequence, and a new sequence R, namely the Hadamard matrix multi-scale sequence number, is obtained and output after sequencing; after the values in the vector Sa are ordered greatly, i= [1,2, 3..256 ] is used as a variable to draw, and at the moment, the corresponding vector I ordering is changed into a new sequence R from I (I) = [ I, i= [1,2, 3..256 ]; Step S8, setting different M values and n values according to the steps S1-S7 to obtain sequence values of new sequences R with different lengths, and generating multi-layer and multi-scale coding patterns according to the sequence values with different lengths according to the steps S1-S2, wherein the coding patterns are sequentially arranged from low to high according to multi-resolution scales and are used for obtaining images with resolution from low to high in the process of imaging objects, the coding patterns only comprise 0 and 1 matrix elements, the number of the matrix elements 0 and 1 is equal, and the coding patterns are physically equivalent to 'on' corresponding to the matrix element 1 and 'off' corresponding to the matrix element 0; in practical application, after the image meeting the requirements is obtained, the process is finished; the method is applied to calculation of correlation imaging, ghost imaging, quantum imaging, single-pixel camera, structured light illumination imaging or three-dimensional single-pixel laser radar imaging, does not need to store a coding matrix, and realizes imaging through fast Hadamard transformation, correlation iteration or compressed sensing algorithm so as to improve the image reconstruction speed and imaging signal-to-noise ratio.

Description

Hadamard matrix multi-scale ordering method and system Technical Field The invention belongs to the technical field of images, and particularly relates to a Hadamard matrix multi-scale ordering method and system. Background In the technologies of calculation correlation imaging, calculation ghost imaging, calculation quantum imaging, single-pixel camera, structured light illumination imaging or three-dimensional single-pixel laser radar imaging, the selection and optimization of a coding matrix determine the image reconstruction speed and the image signal-to-noise ratio, which are core technologies and key technologies in the technical field. The selection of the coding matrix directly affects the execution efficiency and image reconstruction effect of the reconstruction algorithm, and optimization of the algorithm also requires consideration of the nature of the coding matrix. Disclosure of Invention The invention solves the technical problems of overcoming the defects of the prior art and providing a Hadamard matrix multi-scale ordering method and a Hadamard matrix multi-scale ordering system to solve the problem that the existing coding cannot simultaneously realize fast imaging and high signal-to-noise ratio imaging. In order to solve the technical problems, the invention discloses a Hadamard matrix multi-scale ordering method, which comprises the following steps: Step S1, initializing parameters, setting i=1, m=2 2n, n=4, 5, 6..n is a positive integer, and constructing a Hadamard matrix of M rows and M columns; Step S2, extracting each row or column vector of the Hadamard matrix, then normalizing, and rearranging each row or column vector element to form a square matrix H i with 2 n rows and 2 n columns; S3, carrying out n layers of two-dimensional Haar wavelet decomposition on the square matrix H i to obtain a coefficient matrix H a, taking the absolute value |H a | of the coefficient matrix H a, and summing up Sigma|H a | and marking as Sa (I) = Σ|H a |; step S4, storing the values of Sa (I) and I (I) into a vector Sa and a vector I respectively; step S5, taking i=i+1, and judging whether i is greater than M; step S6, if i is less than or equal to M, repeating the steps S2-S4 until i is more than M; Step S7, arranging elements in the vector Sa in order from small to large to obtain a new sequence R; And S8, extracting each row or each column of vectors of the Hadamard matrix again according to the new sequence R, and normalizing the extracted vectors, and traversing the extracted vectors for M times to obtain M two-dimensional 2 n×2n square matrixes RH i,RHi which are the ith multi-scale coding matrixes generated according to the sequence of the new sequence R. In the above Hadamard matrix multi-scale ordering method, extracting each row or column vector of the Hadamard matrix, performing normalization, and rearranging each row or column vector element to form a square matrix H i of 2 n rows and 2 n columns, including: Reading the ith row of the Hadamard matrix, and normalizing to a [0,1] interval to obtain a vector A i; Sequentially reading the 1 st to 2 nd n th elements of A i as a first row of a square matrix H i, and the 2 nd 2 n +1 to 2 n+1 nd elements as a second row of the square matrix H i until the (n-1)×2n +1 to 2 2n th elements are read as the 2 n th row of the square matrix H i, and traversing M vectors A i to obtain a two-dimensional 2 n×2n square matrix H i, wherein i=1, 2,3. In the Hadamard matrix multi-scale ordering method, the elements in the vector Sa are arranged in order from small to large to obtain a new sequence R, which includes: the reading step S4 stores the mx1-dimensional vector Sa and the mx1-dimensional vector I; sequencing the values of the vector Sa from small to large, correspondingly adjusting the sequence of the I (I) values corresponding to the Sa (I) in the vector I according to the initial sequence, and keeping the initial corresponding relation, wherein if the value of the Sa (I) is equal to the value of the Sa (I-1) or the value of the Sa (i+1), the values of the Sa (I), the Sa (I-1) or the value of the Sa (i+1) are unchanged according to the initial sequence, and sequencing to obtain a new sequence R; setting different M values and n values to obtain sequence values of new sequences R with different lengths. Correspondingly, the invention also discloses a Hadamard matrix multi-scale ordering system, which comprises: The initialization module is used for initializing parameters, setting i=1, M=2 2n, n=4, 5,6, wherein n is a positive integer, and constructing a Hadamard matrix of M rows and M columns; The normalization module is used for extracting each row or column vector of the Hadamard matrix and then normalizing, and rearranging each row or column vector element to form a square matrix H i with 2 n rows and 2 n columns; The wavelet decomposition module is used for carrying out n layers of two-dimensional Haar wavelet decomposition on the square matrix H i