Image compression sampling method and assembly

文档序号:861603 发布日期:2021-03-16 浏览:16次 中文

阅读说明:本技术 一种图像压缩采样方法及组件 (Image compression sampling method and assembly ) 是由 葛沅 史宏志 赵健 于 2020-11-27 设计创作,主要内容包括:本申请公开了一种图像压缩采样方法及组件。本申请利用初始稀疏矩阵对目标图像进行稀疏表示后,量化稀疏表示初始结果得到稀疏表示优化结果,据此得到优化稀疏矩阵;利用优化稀疏矩阵和初始测量矩阵构造乘积矩阵,将乘积矩阵中的非对角元素的绝对值调整至小于相关性阈值;对乘积矩阵进行奇异值分解得到对角矩阵和左奇异矩阵,根据初始测量矩阵的采样数更新对角矩阵;利用左奇异矩阵和更新后的对角矩阵优化初始测量矩阵得到优化测量矩阵,利用优化稀疏矩阵和优化测量矩阵采集图像数据。本申请对稀疏矩阵和测量矩阵进行优化,既能对复杂图像进行采样,又可使恢复效果更佳。本申请提供的一种图像压缩采样组件,也同样具有上述技术效果。(The application discloses an image compression sampling method and an image compression sampling assembly. After the target image is sparsely represented by the initial sparse matrix, quantifying the sparse representation initial result to obtain a sparse representation optimization result, and accordingly obtaining an optimized sparse matrix; constructing a product matrix by using the optimized sparse matrix and the initial measurement matrix, and adjusting the absolute value of off-diagonal elements in the product matrix to be smaller than a correlation threshold value; performing singular value decomposition on the product matrix to obtain a diagonal matrix and a left singular matrix, and updating the diagonal matrix according to the sampling number of the initial measurement matrix; and optimizing the initial measurement matrix by using the left singular matrix and the updated diagonal matrix to obtain an optimized measurement matrix, and acquiring image data by using the optimized sparse matrix and the optimized measurement matrix. The method and the device optimize the sparse matrix and the measurement matrix, can sample the complex image, and can enable the recovery effect to be better. The image compression sampling assembly also has the technical effects.)

1. An image compression sampling method, comprising:

carrying out sparse representation on the target image by using the initial sparse matrix to obtain a sparse representation initial result;

quantizing the initial sparse representation result to obtain a sparse representation optimization result, and optimizing the initial sparse matrix according to the sparse representation optimization result to obtain an optimized sparse matrix;

constructing a product matrix by using the optimized sparse matrix and the initial measurement matrix, and adjusting the absolute value of off-diagonal elements in the product matrix to be smaller than a correlation threshold value;

performing singular value decomposition on the adjusted product matrix to obtain a diagonal matrix and a left singular matrix, and updating the diagonal matrix according to the sampling number of the initial measurement matrix;

and optimizing the initial measurement matrix by using the left singular matrix and the updated diagonal matrix to obtain an optimized measurement matrix, and acquiring image data by using the optimized sparse matrix and the optimized measurement matrix.

2. The image compression sampling method according to claim 1, wherein the sparsely representing the target image by using the initial sparse matrix to obtain a sparsely represented initial result comprises:

dividing the target image into a plurality of blocks, and representing each block by a single column;

splicing the single columns to obtain an image matrix of the target image;

determining a product of the image matrix and the initial sparse matrix as the sparse representation initial result.

3. The image compression sampling method according to claim 1, wherein the sparsely representing the target image by using the initial sparse matrix to obtain a sparsely represented initial result comprises:

performing sparse representation on the target image by using the initial sparse matrix, and rearranging according to a preset rule to obtain an initial sparse representation result; the preset rules are zigzag, zigzag or recombined in columns/rows after the columns are stretched.

4. The method according to claim 1, wherein the quantizing the sparse representation initial result to obtain a sparse representation optimization result comprises:

and setting 0 to partial elements in the initial sparse representation result according to a preset quantization table to obtain the sparse representation optimization result.

5. The image compression sampling method according to claim 2, wherein the updating the initial sparse matrix according to the sparse representation optimization result to obtain an optimized sparse matrix comprises:

determining a sparse error between the sparse representation optimization result and the sparse representation initial result, and solving a minimum value of the sparse error according to an objective function to obtain the optimized sparse matrix;

the objective function is: min { | | S- ψ0X||F 2S is the sparse representation optimization result, psi0Is the initial sparse matrix, and X is the image matrix; f is an F norm.

6. The method according to claim 5, wherein solving the minimum of the sparse errors according to an objective function to obtain the optimized sparse matrix comprises:

updating each column in the initial sparse matrix according to a first formula to solve the minimum value to obtain the optimized sparse matrix; the first formula is psin=SnXn T×(XnXn T)-1

Wherein psinFor the n-th column, S, in the optimized sparse matrixnOptimizing the nth column, X, in the result for the sparse representationnFor the n-th column, X, in the image matrixn TIs the nth column of the transposed matrix of the image matrix.

7. The method according to claim 5, wherein solving the minimum of the sparse errors according to an objective function to obtain the optimized sparse matrix comprises:

updating the initial sparse matrix according to a second formula to solve the minimum value to obtain the optimized sparse matrix; the second formula is psi ═ SXT×(XXT)-1

Where ψ is the optimized sparse matrix, S is the sparse representation optimization result, X is the image matrix, X isTIs a transposed matrix of the image matrix.

8. The method according to claim 1, wherein said adjusting the absolute value of the off-diagonal elements in the product matrix to be less than a correlation threshold comprises:

determining a non-diagonal element in the product matrix, the absolute value of which is greater than the correlation threshold, as a target element;

and calculating the product of any one target element and a preset iteration factor, and replacing the current target element with the product until the absolute values of off-diagonal elements in the product matrix are all smaller than a correlation threshold value.

9. The method according to claim 1, wherein the updating the diagonal matrix according to the sampling number of the initial measurement matrix comprises:

randomly reserving M non-zero elements in the diagonal matrix, and setting the rest non-zero elements to be 0 so as to update the diagonal matrix; and M is the row number of the initial measurement matrix.

10. The method according to claim 1, wherein the updating the initial measurement matrix with the left singular matrix and the updated diagonal matrix to obtain an optimized measurement matrix comprises:

optimizing the initial measurement matrix according to a third formula to obtain an optimized measurement matrix; the third formula is:

wherein φ is the optimized measurement matrix, W is the updated diagonal matrix, and U is the left singular matrix.

11. An image compression sampling apparatus, comprising:

the sparse representation module is used for carrying out sparse representation on the target image by utilizing the initial sparse matrix to obtain a sparse representation initial result;

the first optimization module is used for quantizing the initial sparse representation result to obtain a sparse representation optimization result, and optimizing the initial sparse matrix according to the sparse representation optimization result to obtain an optimized sparse matrix;

the adjusting module is used for constructing a product matrix by utilizing the optimized sparse matrix and the initial measurement matrix and adjusting the absolute value of off-diagonal elements in the product matrix to be smaller than a correlation threshold value;

the dimension reduction module is used for carrying out singular value decomposition on the adjusted product matrix to obtain a diagonal matrix and a left singular matrix, and updating the diagonal matrix according to the sampling number of the initial measurement matrix;

and the second optimization module is used for optimizing the initial measurement matrix by using the left singular matrix and the updated diagonal matrix to obtain an optimized measurement matrix, and acquiring image data by using the optimized sparse matrix and the optimized measurement matrix.

12. An image compression sampling apparatus, comprising:

a memory for storing a computer program;

a processor for executing the computer program to implement the image compression sampling method according to any one of claims 1 to 10.

13. A readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the image compression sampling method according to any one of claims 1 to 10.

Technical Field

The present application relates to the field of image processing technologies, and in particular, to an image compression sampling method and an image compression sampling assembly.

Background

Image compression sampling generally utilizes a sparse matrix and a measurement matrix for signal acquisition. The sparsity of the transformation result of the traditional sparse transformation matrix is difficult to meet the sparsity requirement, the cross correlation of the measurement matrix and the sparse transformation matrix needs to be calculated and verified for multiple times, the process is complicated, and the proper sparse matrix and the measurement matrix are difficult to determine for image compression sampling.

Therefore, how to determine a suitable sparse matrix and a measurement matrix for image compression sampling is a problem to be solved by those skilled in the art.

Disclosure of Invention

In view of the above, an object of the present application is to provide an image compression sampling method and an image compression sampling component for determining an appropriate sparse matrix and a measurement matrix for image compression sampling. The specific scheme is as follows:

in a first aspect, the present application provides an image compression sampling method, including:

carrying out sparse representation on the target image by using the initial sparse matrix to obtain a sparse representation initial result;

quantizing the initial sparse representation result to obtain a sparse representation optimization result, and optimizing the initial sparse matrix according to the sparse representation optimization result to obtain an optimized sparse matrix;

constructing a product matrix by using the optimized sparse matrix and the initial measurement matrix, and adjusting the absolute value of off-diagonal elements in the product matrix to be smaller than a correlation threshold value;

performing singular value decomposition on the adjusted product matrix to obtain a diagonal matrix and a left singular matrix, and updating the diagonal matrix according to the sampling number of the initial measurement matrix;

and optimizing the initial measurement matrix by using the left singular matrix and the updated diagonal matrix to obtain an optimized measurement matrix, and acquiring image data by using the optimized sparse matrix and the optimized measurement matrix.

Preferably, the sparsely representing the target image by using the initial sparse matrix to obtain a sparsely represented initial result includes:

dividing the target image into a plurality of blocks, and representing each block by a single column;

splicing the single columns to obtain an image matrix of the target image;

determining a product of the image matrix and the initial sparse matrix as the sparse representation initial result.

Preferably, the sparsely representing the target image by using the initial sparse matrix to obtain a sparsely represented initial result includes:

performing sparse representation on the target image by using the initial sparse matrix, and rearranging according to a preset rule to obtain an initial sparse representation result; the preset rules are zigzag, zigzag or recombined in columns/rows after the columns are stretched.

Preferably, the quantizing the sparse representation initial result to obtain a sparse representation optimization result includes:

and setting 0 to partial elements in the initial sparse representation result according to a preset quantization table to obtain the sparse representation optimization result.

Preferably, the updating the initial sparse matrix according to the sparse representation optimization result to obtain an optimized sparse matrix includes:

determining a sparse error between the sparse representation optimization result and the sparse representation initial result, and solving a minimum value of the sparse error according to an objective function to obtain the optimized sparse matrix;

the objective function is: min { | | S- ψ0X||F 2S is the sparse representation optimization result, psi0Is the initial sparse matrix, and X is the image matrix; f is an F norm.

Preferably, solving the minimum value of the sparse error according to an objective function to obtain the optimized sparse matrix includes:

updating each column in the initial sparse matrix according to a first formula to obtain the optimized sparse matrix; the first formula is psin=SnXn T×(XnXn T)-1

Wherein psinFor the n-th column, S, in the optimized sparse matrixnOptimizing the nth column, X, in the result for the sparse representationnFor the n-th column, X, in the image matrixn TIs the nth column of the transposed matrix of the image matrix.

Preferably, solving the minimum value of the sparse error according to an objective function to obtain the optimized sparse matrix includes:

updating the initial sparse matrix according to a second formula to solve the minimum value to obtain the optimized sparse matrix; the second formula is psi ═ SXT×(XXT)-1

Where ψ is the optimized sparse matrix, S is the sparse representation optimization result, X is the image matrix, X isTIs a transposed matrix of the image matrix.

Preferably, the adjusting the absolute value of the off-diagonal elements in the product matrix to be less than a correlation threshold comprises:

determining a non-diagonal element in the product matrix, the absolute value of which is greater than the correlation threshold, as a target element;

and calculating the product of any one target element and a preset iteration factor, and replacing the current target element with the product until the absolute values of off-diagonal elements in the product matrix are all smaller than a correlation threshold value.

Preferably, the updating the diagonal matrix according to the sampling number of the initial measurement matrix includes:

randomly reserving M non-zero elements in the diagonal matrix, and setting the rest non-zero elements to be 0 so as to update the diagonal matrix; and M is the row number of the initial measurement matrix.

Preferably, the updating the initial measurement matrix by using the left singular matrix and the updated diagonal matrix to obtain an optimized measurement matrix includes:

optimizing the initial measurement matrix according to a third formula to obtain an optimized measurement matrix; the third formula is:

wherein φ is the optimized measurement matrix, W is the updated diagonal matrix, and U is the left singular matrix.

In a second aspect, the present application provides an image compression and sampling apparatus, including:

the sparse representation module is used for carrying out sparse representation on the target image by utilizing the initial sparse matrix to obtain a sparse representation initial result;

the first optimization module is used for quantizing the initial sparse representation result to obtain a sparse representation optimization result, and optimizing the initial sparse matrix according to the sparse representation optimization result to obtain an optimized sparse matrix;

the adjusting module is used for constructing a product matrix by utilizing the optimized sparse matrix and the initial measurement matrix and adjusting the absolute value of off-diagonal elements in the product matrix to be smaller than a correlation threshold value;

the dimension reduction module is used for carrying out singular value decomposition on the adjusted product matrix to obtain a diagonal matrix and a left singular matrix, and updating the diagonal matrix according to the sampling number of the initial measurement matrix;

and the second optimization module is used for optimizing the initial measurement matrix by using the left singular matrix and the updated diagonal matrix to obtain an optimized measurement matrix, and acquiring image data by using the optimized sparse matrix and the optimized measurement matrix.

In a third aspect, the present application provides an image compression sampling apparatus, including:

a memory for storing a computer program;

a processor for executing the computer program to implement the image compression sampling method disclosed in the foregoing.

In a fourth aspect, the present application provides a readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the image compression sampling method disclosed in the foregoing.

According to the scheme, the application provides an image compression sampling method, which comprises the following steps: carrying out sparse representation on the target image by using the initial sparse matrix to obtain a sparse representation initial result; quantizing the initial sparse representation result to obtain a sparse representation optimization result, and optimizing the initial sparse matrix according to the sparse representation optimization result to obtain an optimized sparse matrix; constructing a product matrix by using the optimized sparse matrix and the initial measurement matrix, and adjusting the absolute value of off-diagonal elements in the product matrix to be smaller than a correlation threshold value; performing singular value decomposition on the adjusted product matrix to obtain a diagonal matrix and a left singular matrix, and updating the diagonal matrix according to the sampling number of the initial measurement matrix; and optimizing the initial measurement matrix by using the left singular matrix and the updated diagonal matrix to obtain an optimized measurement matrix, and acquiring image data by using the optimized sparse matrix and the optimized measurement matrix.

Therefore, the sparse matrix and the measurement matrix can be optimized, the sparsity of the sparse matrix and the sampling number of the measurement matrix are reasonably valued, the correlation of the sparse matrix and the measurement matrix is reduced, and the more uncorrelated the sparse matrix and the measurement matrix, the better the signal reconstruction effect is. It can be seen that the sparse matrix and the measurement matrix are optimized as much as possible, so that the complex image can be sampled, and the recovery effect is better.

Accordingly, the present application provides an image compression and sampling component (i.e., an apparatus, a device, and a readable storage medium), which also has the above technical effects.

Drawings

In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.

FIG. 1 is a flow chart of a method for compressive sampling of an image according to the present disclosure;

FIG. 2 is a flow chart of another method for compressive sampling of an image disclosed herein;

FIG. 3 is a schematic diagram of an image signal acquisition and reconstruction process disclosed herein;

FIG. 4 is a schematic diagram of an image compression sampling apparatus according to the present disclosure;

fig. 5 is a schematic diagram of an image compression sampling apparatus disclosed in the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

At present, the sparsity of a transformation result of a traditional sparse transformation matrix is difficult to meet the sparsity requirement, the cross correlation of a measurement matrix and the sparse transformation matrix needs to be calculated and verified for multiple times, the process is complicated, and a proper sparse matrix and a proper measurement matrix are difficult to determine for image compression sampling. Therefore, the image compression sampling scheme is provided, and a proper sparse matrix and a proper measurement matrix can be determined for image compression sampling.

Prior to the introduction of the present application, the following description is made in connection with the background.

Image compressed sensing includes two core techniques: compressed sampling and signal reconstruction. The compressed sampling comprises the following steps: finding a signal sparse representation method to realize sparse transformation of the original signals in the nature, and obtaining sparse representation only containing K nonzero values; and designing a stable measurement matrix, reducing the dimensionality of the signal to generate a measured value, and ensuring that K non-zero values are not damaged after the dimensionality of the signal is reduced. Signal reconstruction namely: the original signal is recovered from the measured values as accurately as possible, which determines the computational complexity, accuracy and robustness of the reconstruction algorithm.

Sparse representation is: many natural signals are somewhat sparse or compressible, and many simplified expressions of a signal are possible when represented by the appropriate base Ψ. Sparse transformation of signals in a certain representation mode is the basis of compressed sensing theory signal processing. The classical sparse transform mode mainly comprises wavelet transform, Fourier transform and DCT transform. The sparse representation methods are simple in structure, fast in calculation, and suitable for being applied to compression imaging which needs large-scale data operation and has simple original signal information.

When the transform coefficients of the signal x on a certain sparse transform are sparse, if the sparse coefficients are linearly transformed by using a measurement matrix irrelevant to the sparse transform matrix to obtain an observed value y, the signal x can be reconstructed by solving an optimization problem. The design of the measurement matrix determines the range of the minimum sampling times or the sparsity of measurement, and is an important direction of a compressed sensing theory. The constraint condition for deciding whether the reconstruction is successful is that a sensing matrix meets the RIP characteristics (constraint equidistant property), and the sensing matrix is the product of a measurement matrix and a sparse matrix. The compressed sensing measurement matrixes which are proved to satisfy the constraint condition approximately are independent and identically distributed random Gaussian matrixes and random Bernoulli matrixes.

The sensing matrix is divided into a sparse transformation matrix and a measurement matrix. Ideal lossless DCT, FT and wavelet transform are the mainstream methods of sparse transform, the structure is simple, but the sparse effect is not ideal for signals with complex images and rich details, and the recovery precision can easily reach the bottleneck.

The current mainstream measurement matrix implementation method comprises the following steps: in order to ensure that the compressed sensing obtains a better reconstruction effect, a measurement matrix with stable structure needs to be designed, and K nonzero parts of a signal are reserved while the dimensionality is reduced. The measurement matrix mainly satisfies the conditions: one to satisfy the random measurement and the other to be uncorrelated with Ψ. RIP is typically used as a constraint on the measurement matrix. The random Gaussian matrix and the random Bernoulli matrix belong to a measurement matrix with complete randomness, and theoretically prove that the random Gaussian matrix and the random Bernoulli matrix can be used as the measurement matrix and are almost irrelevant to any sparse signal, so that the required measurement times are minimum, and the reconstruction precision is superior to a deterministic measurement matrix. However, the specific implementation occupies a large amount of storage resources, and is not suitable for large-scale application.

In practical application, a measurement matrix with partial randomness is more prone to be selected. Some randomness is reduced compared to a completely random measurement matrix, but is better suited for practical applications. At present, a design method of a part of random measurement matrixes is very simple, and a basic construction idea is to randomly extract M rows from N rows of an orthogonal square matrix to construct the measurement matrixes. However, the extraction method greatly reduces randomness, only meets the RIP characteristics of a certain order, the probability of successful reconstruction is highly dependent on random row vectors, and if the cross correlation of the extracted row vectors is relatively large, certain reconstruction failure is possible. Meanwhile, the recoverable sparsity K value is small, so that the method is only suitable for signals with sparse time domain and cannot meet most of natural images.

In order to improve the reconstruction precision of the compressed sensing signal and adapt to more signals with complex image structures, the sampling rate can be reduced as much as possible and the measured values can be generated as few as possible on the premise of ensuring the accurate recovery of the signals.

It can be seen that the nature of RIP characteristics of the sensing matrix can be regarded as the degree of similarity between a matrix and a normal orthogonal matrix, that is, the measurement matrix is as much as possible to ensure that its basis vector is uncorrelated with the basis of the sparse transform matrix. The less correlated the measurement matrix and the sparse matrix, the better the signal recovery. By measuring matricesThe product of the sparse transformation matrix psi constitutes the perceptual matrix A, i.e.Constructing a product matrix F ═ATA. The maximum of the off-diagonal of F can be used to measure the cross-correlation of the measurement matrix and the sparse matrix. The condition for a generally exact reconstruction is that the matrix cross-correlation is smaller than the welch bound lower bound. And fixing the sparse transformation matrix unchanged, constructing a product matrix F of the sensing matrix and a transposed matrix thereof, reducing the absolute value of the non-diagonal of the product matrix F to the lower boundary of the welch bound, decomposing the singular value of the adjusted product matrix F, and reversely deducing the measurement matrix. And repeating iteration until the values of the non-zero elements of the matrix are all within Welch lower boundary threshold values, thereby achieving the purpose of reducing the cross correlation of the measurement matrix and the sparse transformation matrix.

Referring to fig. 1, an embodiment of the present application discloses an image compression sampling method, including:

s101, carrying out sparse representation on the target image by using the initial sparse matrix to obtain a sparse representation initial result.

Wherein the initial sparse matrix may be: wavelet Transform matrix, DCT (Discrete Cosine Transform) Transform matrix, fourier Transform matrix, and the like. The target image may be a one-dimensional, two-dimensional or three-dimensional image.

It should be noted that, for a three-dimensional image, the three-dimensional image needs to be converted into a two-dimensional image before S101 is executed. The conversion process comprises the following steps: the three-dimensional image is sliced in the x-direction or y-direction or z-direction to obtain a plurality of two-dimensional figures (i.e., slices). Generally, one direction with the least pixel points is selected as a slicing direction, so that the information amount in the two-dimensional graph is relatively maximum. For example: a 3-dimensional signal of 256(x) × 480(y) × 512(z) is divided into 256 two-dimensional pictures of size 480 × 512 on [ y, z ] planes in the x direction, and each two-dimensional picture is taken as a target image to perform S101 to S105.

Accordingly, since the three-dimensional image is sliced before the compression sampling, each slice needs to be reconstructed in the slice direction after the sampling to obtain each slice, so as to reconstruct and obtain the three-dimensional data volume.

In a specific embodiment, the sparse representation of the target image by using the initial sparse matrix to obtain a sparse representation initial result includes: dividing a target image into a plurality of blocks, and representing each block by a single column; splicing the single columns to obtain an image matrix of the target image; the product of the image matrix and the initial sparse matrix is determined as the sparse representation initial result. When the target image is sparsely represented, the image is divided into small blocks and an image matrix is constructed, so that image information can be scattered and distributed, and more useful information is prevented from being lost. Of course, the original image may be directly expressed in a matrix without performing the blocking process on the image.

In a specific embodiment, the sparse representation of the target image by using the initial sparse matrix to obtain a sparse representation initial result includes: performing sparse representation on a target image by using an initial sparse matrix, and rearranging according to a preset rule to obtain a sparse representation initial result; the preset rules are zigzag, zigzag or recombination in columns/rows after column stretching. And (3) recombining according to the columns/rows after column stretching: the image is stretched into column vectors, which are then recombined column-wise or row-wise.

After the target image is sparsely represented by the initial sparse matrix, most of the energy is concentrated in the upper left corner (the upper left corner represents the low-frequency components of the image, and the lower right corner represents the high-frequency components of the image). Therefore, the low-frequency components can be scattered to different positions by rearranging according to a preset rule, so that the image information is scattered and distributed, and more useful information is prevented from being lost.

If the initial sparse representation result is obtained after rearrangement according to a preset rule, then rearrangement is needed to be performed in the reverse direction according to the preset rule in the process of acquiring image data by utilizing the optimized sparse matrix and the optimized measurement matrix so as to recover signals.

S102, quantizing the sparse representation initial result to obtain a sparse representation optimization result, and optimizing the initial sparse matrix according to the sparse representation optimization result to obtain an optimized sparse matrix.

In one embodiment, quantizing the sparse representation initial result to obtain a sparse representation optimization result includes: and setting 0 for partial elements in the initial sparse representation result according to a preset quantization table to obtain a sparse representation optimization result. Sparse representation the optimization result needs to be as sparse as possible, namely: the non-zero elements in the matrix are as few as possible. And recording which elements can be approximate to 0 in the preset quantization table, and therefore, setting 0 to partial elements in the sparse representation initial result according to the preset quantization table, so that nonzero elements in the sparse representation initial result are as few as possible.

In a specific embodiment, updating the initial sparse matrix according to the sparse representation optimization result to obtain an optimized sparse matrix, includes: determining a sparse error between a sparse representation optimization result and a sparse representation initial result, and solving a minimum value of the sparse error according to an objective function to obtain an optimized sparse matrix; the objective function is: min { | | S- ψ0X||F 2S is the sparse representation optimization result, psi0Is an initial sparse matrix, and X is an image matrix; f is an F norm.

The initial sparse matrix can be updated by columns, or the whole matrix can be updated at one time.

In one embodiment, solving a minimum of the sparse error according to the objective function to obtain an optimized sparse matrix includes: updating each column in the initial sparse matrix according to a first formula to obtain an optimized sparse matrix; the first formula is psin=SnXn T×(XnXn T)-1(ii) a Wherein psinTo optimize the n-th column, S, in a sparse matrixnOptimizing the nth column, X, in the result for sparse representationnFor the n-th column, X, in the image matrixn TIs the nth column of the transposed matrix of the image matrix.

In one embodiment, solving a minimum of the sparse error according to the objective function to obtain an optimized sparse matrix includes: updating the initial sparse matrix according to a second formula to solve a minimum value to obtain an optimized sparse matrix; the second formula is psi ═ SXT×(XXT)-1(ii) a Wherein psi is an optimized sparse matrix, S is a sparse representation optimization result, X is an image matrix, X isTIs a transposed matrix of the image matrix.

S103, constructing a product matrix by using the optimized sparse matrix and the initial measurement matrix, and adjusting the absolute value of off-diagonal elements in the product matrix to be smaller than a correlation threshold value.

In one embodiment, adjusting the absolute value of the off-diagonal elements in the product matrix to be less than the correlation threshold comprises: determining non-diagonal elements with absolute values larger than a correlation threshold value in the product matrix as target elements; and calculating the product of any one target element and a preset iteration factor, and replacing the current target element with the product until the absolute values of off-diagonal elements in the product matrix are all smaller than a correlation threshold value. The preset iteration factor takes a value between 0 and 1, different values can be taken in each iteration process, and the larger the value of the preset iteration factor is along with the incremental increase of the iteration process. For example: the value of the preset iteration factor in the first iteration process is 0.2, and the value of the preset iteration factor in the second iteration process is 0.5. Of course, the predetermined iteration factor may also take a constant value.

Assuming that 5 off-diagonal elements with absolute values larger than a correlation threshold value exist in a product matrix, multiplying the 5 off-diagonal elements by preset iteration factors respectively, and then correspondingly replacing the original 5 off-diagonal elements with the 5 products, if the 5 products still have values larger than the correlation threshold value, reducing the preset iteration factors, and then multiplying the number of the products larger than the correlation threshold value by the reduced preset iteration factors until the absolute values of all the off-diagonal elements are smaller than the correlation threshold value.

Wherein, the correlation threshold may be the lower boundary of the welch bound and the RIP constant.

S104, performing singular value decomposition on the adjusted product matrix to obtain a diagonal matrix and a left singular matrix, and updating the diagonal matrix according to the sampling number of the initial measurement matrix.

Wherein, the singular value decomposition is performed on the adjusted product matrix F, and then: f ═ U × W × VTU is left singular matrix, U is FFT=UΛ1UT(ii) a V is right singular matrix, V ═ FTF=VΛ2VTAnd W is a diagonal matrix. The non-zero elements on the Λ 1 and Λ 2 diagonals are the same if the non-zero elements of Λ 1 or Λ 2 correspond to λ12,……,λkAnd k is less than or equal to N. Then the non-zero elements of the W diagonal correspond to σ, respectively12,……,σkAnd exist of

Definition of singular value decomposition: given an mxn matrix a, the singular value decomposition of a is expressed as a ═ P Σ QT。P=AAT=PΛ1PTA symmetric matrix of m × m; q is ATA=QΛ2QTIs a symmetric matrix of n multiplied by n; the elements on the sigma diagonal are called singular values, and are m × n matrices. Where P and Q are required to be unity quadrature arrays. Obviously, Λ1And Λ2The sizes are different, but the non-zero elements on the diagonal are the same. If Λ1Or Λ2Is λ1,λ2,……,λKK ≦ min (m, n), then the non-zero elements of the sigma diagonal correspond to σ 1, σ 2, … … σ K, respectively, present(i=1,2,…k)。

In one embodiment, updating the diagonal matrix according to the number of samples of the initial measurement matrix comprises: randomly reserving M non-zero elements in the diagonal matrix, and setting the rest non-zero elements to be 0 so as to update the diagonal matrix; m is the number of rows of the initial measurement matrix.

And S105, optimizing the initial measurement matrix by using the left singular matrix and the updated diagonal matrix to obtain an optimized measurement matrix, and acquiring image data by using the optimized sparse matrix and the optimized measurement matrix.

In one embodiment, updating the initial measurement matrix with the left singular matrix and the updated diagonal matrix to obtain the optimized measurement matrix includes: optimizing the initial measurement matrix according to a third formula to obtain an optimized measurement matrix; the third formula is:where phi is the optimized measurement matrixW is the updated diagonal matrix, U is the left singular matrix, UTIs the transposed matrix of U.

Therefore, the sparse matrix and the measurement matrix can be optimized, the sparsity of the sparse matrix and the sampling number of the measurement matrix are reasonably valued, the correlation between the sparse matrix and the measurement matrix is reduced, and the more uncorrelated the sparse matrix and the measurement matrix, the better the signal reconstruction effect is. It can be seen that the sparse matrix and the measurement matrix are optimized as much as possible, so that the complex image can be sampled, and the recovery effect is better.

Referring to fig. 2, the embodiment of the present application discloses another image compression sampling method by taking a two-dimensional image as an example, and the specific implementation steps thereof are as follows:

step 1: a series of images are found as a data set for training a sparse matrix.

Partitioning each original image: the image is divided into small blocks by n × n, and if the rows or columns of the original image are not integer multiples of n, the edges are aligned with 0 complement.

Step 2: for each block (image segment) x1,x2,…xNIf, for example, one image is represented by X ═ X1,x2,…xN]. For each block xiAnd performing column item quantization and converting into a single column. For example, an original image of 512 × 512 pixels is divided into blocks of 16 × 16 pixels, each 16 × 16 block is stretched into 256 × 1 single columns, and the single columns are sequentially spliced into an image matrix X.

And step 3: the wavelet transformation matrix or the DCT transformation matrix is used as the initial sparse matrix psi to carry out sparse transformation on the picture, so that the picture is sparsely transformed from a space domain to a frequency domain, and the sparse transformation can be realized by matrix multiplication. For example: s1Psi X, wherein S1=[s1,s2,s3,…sn],S1Is a sparse representation of X the initial result.

And 4, step 4: for better sparse effect, pair S1Quantization is done to obtain a sparse representation optimization result, S1The error from the sparse representation optimization result is called E.

And 5: E-S1,S1And psi X, and S is a sparse representation optimization result. The sparse error is defined as: | E | non-conducting phosphorF 2=||S-ψX||F 2Wherein F is the F norm of the matrix, and the objective function solved in the following steps is expressed as min { | | S- ψ X | | luminous fluxF 2Satisfy | S | calculation of the luminance0K is less than or equal to K. K is the number of nonzero elements in S and is generally taken according to experience.

Step 6: ψ is updated column by column according to S.

For the n-th column psi of psinAnd n-th row S of SnThere is:

||S-ψX||F 2=||SnnXn||F 2=||E||F 2. Wherein N is 1,2, … N, XnIs the nth row of X.

And 7: with SnFor example, the two-sided derivation of the equation in step 6 includes: (S)n–ψnXn)Xn T=0。

And 8: updating psin,ψn=SnXn T×(Xn×Xn T)-1

And step 9: the above steps are repeated to calculate other columns of psi, so that an optimized sparse matrix can be obtained. The optimization process is formulated as: psin=SnXn T×(XnXn T)-1

Step 10: generating a random Gaussian matrix or a random Bernoulli matrix which is multiplied by M and is used as an initial measurement matrix phi, wherein N is the signal length (column) and M is the sampling number (row);

step 11: and constructing a perception matrix A phi psi and psi as an optimized sparse matrix. Since the column vector length of the perceptual matrix is not 1, we first normalize A, generating a normalized matrix A#. Constructing a product matrix F ═ A# TA#(ii) a Where A is an M by N matrix and F is an N by N square matrix.

Step 12: calculating a correlation threshold, taking the welch lower boundary as an example, the correlation threshold

Calculate the absolute value x of all off-diagonal elements in FijI and j are 0,1 and … M. Wherein, the ith row and the jth column of the matrix F are xijComprises the following steps: the column coherence of the ith column of the initial measurement matrix phi and the jth column of the optimized sparse matrix psi is determined. If the column coherence is below the correlation threshold, it can theoretically be satisfied that the measurement matrix and the sparse transform matrix are incoherent.

Step 13: for off-diagonal elements x whose absolute value is greater than the correlation thresholdijLet x' be axij. The iteration factor a has a value e (0, 1). X' < x for each iteration. Each iteration factor a can be selected from small to large according to the difference between the absolute value of the off-diagonal element and the correlation threshold. And repeating the step 13 until all off-diagonal elements of the matrix F are smaller than the correlation threshold, stopping iteration, keeping the off-diagonal elements with absolute values smaller than the welch threshold unchanged, and outputting a final F matrix.

Step 14: performing singular value decomposition on the new F to make F equal to U multiplied by W multiplied by VT

Step 15: generally, the number of diagonal elements in W is greater than M, then M nonzero elements in W are unchanged, and other elements are set to zero to obtain new W.

Step 16: updating the measurement matrix with W and U, optimizing the measurement matrix

And step 17: the optimized sparse matrix psi and the optimized measurement matrix phi participate in the compressive sampling of the signal and signal reconstruction is performed accordingly to recover the signal. The image signal acquisition and reconstruction process can be referred to fig. 3.

In fig. 3, psi is psi, and a is phi psi. The patient is connected to a whole-body MR scanner and the sensors collect clinical data. A respiratory and cardiac motion correction system for simultaneous clinical settings. The original signal is A/D converted by communication modes such as TCP/IP and the like, and then is sent to a workstation server provided with a compressed sensing program system. The compressed sensing system receives an original signal X with the length of N, conducts sparse transformation on the signal, transforms the signal from a space domain to a frequency domain to generate S, projects the S to an M-dimensional space by using a measurement matrix to obtain a measurement value Y with the length of M, and completes the compressed sampling process. And recovering the original signal X by a reconstruction algorithm. And sending the recovery result to an external scanner, and displaying the reconstruction result on a display screen.

The embodiment can be applied to medical nuclear magnetic instruments, seismic exploration instruments, nuclear magnetic resonance instruments, remote sensing reconnaissance instruments, multispectral imaging instruments, synthetic aperture imaging radars and the like which use compressed sensing imaging. The method mainly aims at optimizing a compression sampling module in the compressed sensing imaging technology.

In the embodiment, the sensing matrix is disassembled, and the sparse matrix and the measurement matrix are optimized respectively, so that the signal sparsity of the sparse matrix after transformation is improved, and the correlation between the measurement matrix and the sparse matrix is reduced. The method is suitable for the image with more complex picture characteristics, and the image with better effect can be recovered. Therefore, the column correlation of the sparse matrix and the measurement matrix is reduced as the objective function, the sparsity and the irrelevance of the sensing matrix are improved, and the compressive sampling effect is optimized.

An image compression and sampling apparatus provided in the embodiments of the present application is described below, and an image compression and sampling apparatus described below and an image compression and sampling method described above may be referred to each other.

Referring to fig. 4, an embodiment of the present application discloses an image compression sampling apparatus, including:

the sparse representation module 401 is configured to perform sparse representation on the target image by using the initial sparse matrix to obtain an initial sparse representation result;

a first optimization module 402, configured to quantize the sparse representation initial result to obtain a sparse representation optimization result, and optimize the initial sparse matrix according to the sparse representation optimization result to obtain an optimized sparse matrix;

an adjusting module 403, configured to construct a product matrix by using the optimized sparse matrix and the initial measurement matrix, and adjust an absolute value of an off-diagonal element in the product matrix to be less than a correlation threshold;

a dimension reduction module 404, configured to perform singular value decomposition on the adjusted product matrix to obtain a diagonal matrix and a left singular matrix, and update the diagonal matrix according to the sampling number of the initial measurement matrix;

and a second optimization module 405, configured to optimize the initial measurement matrix by using the left singular matrix and the updated diagonal matrix to obtain an optimized measurement matrix, and acquire image data by using the optimized sparse matrix and the optimized measurement matrix.

In a specific embodiment, the sparse representation module is specifically configured to: dividing a target image into a plurality of blocks, and representing each block by a single column; splicing the single columns to obtain an image matrix of the target image; the product of the image matrix and the initial sparse matrix is determined as the sparse representation initial result.

In a specific embodiment, the sparse representation module is specifically configured to: performing sparse representation on the target image by using the initial sparse matrix, and rearranging according to a preset rule to obtain an initial sparse representation result; the preset rules are zigzag, zigzag or recombined in columns/rows after the columns are stretched.

In a specific embodiment, the first optimization module is specifically configured to:

determining a sparse error between the sparse representation optimization result and the sparse representation initial result, and solving a minimum value of the sparse error according to an objective function to obtain the optimized sparse matrix; the objective function is: min { | | S- ψ0X||F 2S is the sparse representation optimization result, psi0Is the initial sparse matrix, and X is the image matrix; f is an F norm.

In a specific embodiment, the first optimization module is specifically configured to:

updating the initial sparse matrix according to a second formula to solve the minimum value to obtain the optimized sparse matrix; the second formula is psi ═ SXT×(XXT)-1

Where ψ is the optimized sparse matrix, S is the sparse representation optimization result, X is the image matrix, X isTIs a transposed matrix of the image matrix.

In a specific embodiment, the first optimization module is specifically configured to:

and setting 0 for partial elements in the initial sparse representation result according to a preset quantization table to obtain a sparse representation optimization result.

In a specific embodiment, the first optimization module is specifically configured to:

updating each column in the initial sparse matrix according to a first formula to obtain an optimized sparse matrix; the first formula is psin=SnXn T×(XnXn T)-1

Wherein psinTo optimize the n-th column, S, in a sparse matrixnOptimizing the nth column, X, in the result for sparse representationnFor the n-th column, X, in the image matrixn TIs the nth column of the transposed matrix of the image matrix.

In a specific embodiment, the adjusting module is specifically configured to:

determining non-diagonal elements with absolute values larger than a correlation threshold value in the product matrix as target elements;

and calculating the product of any one target element and a preset iteration factor, and replacing the current target element with the product until the absolute values of off-diagonal elements in the product matrix are all smaller than a correlation threshold value.

In a specific embodiment, the adjusting module is specifically configured to:

randomly reserving M non-zero elements in the diagonal matrix, and setting the rest non-zero elements to be 0 so as to update the diagonal matrix; m is the number of rows of the initial measurement matrix.

In a specific embodiment, the second optimization module is specifically configured to:

optimizing the initial measurement matrix according to a third formula to obtain an optimized measurement matrix; the third formula is:

wherein phi is an optimized measurement matrix, W is an updated diagonal matrix, and U is a left singular matrix.

For more specific working processes of each module and unit in this embodiment, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not described here again.

Therefore, the embodiment provides an image compression sampling device, which can optimize a sparse matrix and a measurement matrix, so that the sparsity of the sparse matrix and the sampling number of the measurement matrix are reasonably valued, meanwhile, the correlation between the sparse matrix and the measurement matrix is reduced, and the more uncorrelated the sparse matrix and the measurement matrix, the better the signal reconstruction effect is. It can be seen that the sparse matrix and the measurement matrix are optimized as much as possible, so that the complex image can be sampled, and the recovery effect is better.

In the following, an image compression and sampling apparatus provided by an embodiment of the present application is introduced, and an image compression and sampling apparatus described below and an image compression and sampling method and apparatus described above may be referred to each other.

Referring to fig. 5, an embodiment of the present application discloses an image compression sampling apparatus, including:

a memory 501 for storing a computer program;

a processor 502 for executing the computer program to implement the method disclosed in any of the embodiments above.

The following describes a readable storage medium provided by an embodiment of the present application, and a readable storage medium described below and an image compression and sampling method, apparatus, and device described above may be referred to each other.

A readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the image compression sampling method disclosed in the foregoing embodiments. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, which are not described herein again.

References in this application to "first," "second," "third," "fourth," etc., if any, are intended to distinguish between similar elements and not necessarily to describe a particular order or sequence. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, or apparatus.

It should be noted that the descriptions in this application referring to "first", "second", etc. are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.

The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other.

The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of readable storage medium known in the art.

The principle and the implementation of the present application are explained herein by applying specific examples, and the above description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种编解码方法、装置及其设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类