Disclosure of Invention
The invention aims to overcome the defects in the prior art and provide an optimization method for the problem that compressed sensing needs a large amount of memory during correlated imaging reconstruction.
The technical scheme provided by the invention is as follows:
an optimization method for compressed sensing application in correlated imaging comprises the following steps:
performing longitudinal column selection on the compressed sensing matrix A according to requirements, and performing compressed sensing image reconstruction;
and performing horizontal row selection on the compressed sensing matrix A according to requirements, and performing compressed sensing image reconstruction.
Performing a correlation imaging experiment to obtain each frame of reference arm light field required by image reconstruction and obtain corresponding bucket data;
reading a reference arm light field of the first frame to obtain an M x M light field intensity matrix;
rotating the light field intensity matrix by 90 degrees clockwise to obtain a rotated light field intensity matrix;
preferably, the results obtained will be column-selected in the longitudinal direction of the a-matrix. The method specifically comprises the following steps:
changing the rotated light field intensity matrix into a one-dimensional array containing M × N elements through reshape operation;
intercepting continuous P x N elements (continuous P rows of the rotated light intensity matrix) in the one-dimensional array according to requirements;
carrying out reshape operation on the intercepted one-dimensional array, and recombining the one-dimensional array into a light field intensity matrix of P x N;
traversing the obtained light field intensity matrix and writing the light field intensity matrix into a new file;
the same operation is carried out on each frame of reference arm light field matrix and the light field matrix is written into a corresponding new file according to the sequence number;
preferably, after column selection in the compressed sensing a matrix is performed longitudinally, compressed sensing image reconstruction is performed, and how to construct the a matrix specifically includes:
reading the processed light field intensity matrix file frame by frame;
reading the first frame of light field to obtain a light field matrix of P x N, and performing reshape operation to change the light field matrix into a one-dimensional array containing P x N elements;
constructing an empty A matrix, and adding the one-dimensional array after reshape into the A matrix as a first row;
and continuously reading the light field intensity matrix file of the second frame, and taking the file as a second row of the A matrix after reshape is carried out. The above operation is performed until all the light field intensity matrix files are read and processed.
Preferably, the compressed sensing image reconstruction further comprises:
reading the bucket data measured by the experiment, carrying out normalization processing on the bucket data, and carrying out normalization processing on each row of the matrix A;
and performing compressed sensing image reconstruction on the A matrix and the bucket data after the normalization processing to obtain an expected reconstructed image.
Preferably, the compressed sensing a matrix is selected horizontally, and before performing horizontal row selection, the method further includes:
reading a bucket data file, and performing Gaussian fitting on the bucket data file to obtain a mean E and a variance sigma of the bucket data file;
and subtracting n times of sigma from the mean value E obtained by Gaussian fitting to obtain an upper limit a, and adding n times of sigma to the mean value E to obtain a lower limit b.
Preferably, the a matrix construction and the image reconstruction are characterized in that the processing of the light field intensity matrix file comprises:
reading a first frame light field intensity matrix file, and judging whether a corresponding bucket numerical value is smaller than a or larger than b;
if the corresponding bucket data does not meet the requirements, discarding and reading the next frame of file;
if the corresponding bucket data meet the requirements, clockwise rotating the read M x N light field matrix by 90 degrees, and forming reshape of the light field matrix into a one-dimensional array containing M x N elements;
taking the one-dimensional array as the first row of the A matrix, and taking the corresponding bucket value as the first element of the one-dimensional array bucket 0;
reading a second frame of light field intensity matrix file, carrying out the same judgment, abandoning if the requirement is not met, taking reshape of the second frame as a second row of the A matrix if the requirement is met, and taking a corresponding bucket numerical value as a second element of the bucket 0;
the above operations are repeated until all the light field intensity matrix files are read and processed.
Reading the reconstructed one-dimensional array bucket0, performing normalization processing on the reconstructed one-dimensional array bucket0, and performing normalization processing on each row of the matrix A;
and performing compressed sensing image reconstruction on the A matrix and the bucket0 data after the normalization processing to obtain an expected reconstructed image.
The invention at least comprises the following beneficial effects: after the associated imaging experiment data is acquired, an attempt is made to reconstruct the image using a compressed sensing method. When the method is realized by using the longitudinal column selection method of the matrix A, a part of an ideal image can be successfully reconstructed according to the selected size, and the data volume read in by a computer can be effectively reduced, so that the requirement of compressed sensing on the memory of the computer is reduced. When the transverse row selection method of the matrix A is used for realizing the transverse row selection, a partial light field intensity matrix which has the largest contribution to image information can be obtained, and an image is successfully reconstructed, so that the requirement of compressed sensing on a computer memory is reduced.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
In order to make the advantages of the technical solutions of the present invention clearer, the present invention is described in detail below with reference to the accompanying drawings and examples.
As shown in fig. 1, the method for optimizing a compressive sensing application in correlated imaging according to an embodiment of the present invention includes the following steps:
s1, taking the associated imaging experiment data as input, performing longitudinal column selection of the matrix A, and writing a new file;
as shown in fig. 2, the specific process of step S1 is as follows:
s11, firstly, reading a frame of light field of a correlation imaging experiment reference arm to obtain an M x M light field intensity matrix;
s12, clockwise rotating the light field intensity matrix by 90 degrees to obtain a rotated light field intensity matrix;
s13, changing the rotated light field intensity matrix into a one-dimensional array containing M × N elements through reshape operation;
s14, intercepting continuous P x N elements (continuous P rows of the rotated light intensity matrix) in the one-dimensional array according to requirements;
s15, carrying out reshape operation on the intercepted one-dimensional array, and recombining the one-dimensional array into a light field intensity matrix of P × N;
s16, traversing the obtained light field intensity matrix and writing the light field intensity matrix into a new file;
s17, performing the same operation on each frame of reference arm light field matrix and writing the same operation into a corresponding new file according to the sequence number;
s2, reading the new file to perform compressed sensing image reconstruction;
as shown in fig. 3, the specific process of step S2 is as follows:
s21, constructing an empty A matrix;
s22, reading the processed light field intensity matrix file;
s23, reading the first frame of light field to obtain a light field matrix of P x N, and performing reshape operation to change the light field matrix into a one-dimensional array containing P x N elements;
s24, adding the one-dimensional array after reshape into the matrix A as a current tail row;
s25, judging whether the reading of the file is finished or not, if not, reading the file of the next frame and repeating the above operations, and if so, performing the next step;
s26, reading the bucket data and carrying out normalization processing on the bucket data;
s27, normalizing each line of the A matrix;
and S28, carrying out compressed sensing image reconstruction on the A matrix and the bucket data after the normalization processing, and obtaining an expected reconstructed image.
S3, performing bucket data preprocessing operation before the matrix A is transversely selected as follows;
as shown in fig. 5, the specific method of step S3 includes:
s31, reading the bucket data measured by the experiment;
s32, performing Gaussian fitting on the bucket data to obtain a mean value E and a variance sigma of the bucket data;
and S33, subtracting n times of sigma from the mean value E obtained by Gaussian fitting to obtain an upper limit a, and adding n times of sigma to the mean value E to obtain a lower limit b.
And S4, constructing an A matrix and reconstructing an image, wherein the processing of the light field intensity matrix file comprises the following steps.
As shown in fig. 6, the step S4 of determining the distortion target includes the following steps:
s41, reading a frame of light field intensity matrix file, and judging whether a bucket value corresponding to the file is smaller than a or larger than b;
s42, if the corresponding bucket data do not meet the requirements, discarding and reading the next frame of file;
s43, if the corresponding bucket data meet the requirements, clockwise rotating the read M x N light field matrix by 90 degrees, and reshape the light field matrix into a one-dimensional array containing M x N elements;
s44, taking the one-dimensional array as the first row of the matrix A, and taking the corresponding bucket numerical value as the first element of the one-dimensional array bucket 0;
and S45, reading the light field intensity matrix file of the second frame, carrying out the same judgment, abandoning if the light field intensity matrix file does not meet the requirement, taking reshape of the second frame as the current tail row of the A matrix if the light field intensity matrix file meets the requirement, and taking the corresponding bucket numerical value as the second element of the bucket 0.
And S46, repeating the operation until all the light field intensity matrix files are read and processed.
S47, reading the reconstructed one-dimensional array bucket0, carrying out normalization processing on the reconstructed one-dimensional array bucket, and carrying out normalization processing on each row of the matrix A;
and S48, carrying out compressed sensing image reconstruction on the A matrix and the bucket0 data after normalization processing, and obtaining an expected reconstructed image.
In order to verify the wide applicability of the embodiment of the present invention, two sets of experiments are prepared in the embodiment of the present invention, which respectively correspond to the horizontal row selection image reconstruction of the a matrix and the vertical column selection image reconstruction of the a matrix.
The horizontal row-selection image reconstruction of the a-matrix is based on experimental data provided by a correlation imaging experiment using the capital GI as the target object. And performing horizontal row selection operation on the experimental data of the A matrix, and then performing image reconstruction, wherein the image reconstructed by the experiment is a complete GI letter, and the image reconstructed by the experiment is a first group of experiments. The longitudinally-selected column image reconstruction of the A matrix is to perform the longitudinally-selected column operation of the A matrix according to the same data provided by the above experiment and then perform image reconstruction, and the experimentally reconstructed image should be a part of GI letters.
Therefore, the specific contents of the embodiment of the invention in the actual experiment are as follows:
(1) a matrix horizontal row selection image reconstruction experiment
And inputting 5000 frames of light field intensity files of associated imaging experimental data, and calculating the mean E and the variance sigma of the bucket. And then, calculating the selected upper limit and the selected lower limit of the bucket data. Let the upper limit a equal E-n σ and the lower limit b equal E + n σ. And transforming the value of n to select the rows of the matrix A. In this experiment, n is equal to 1.28, 1.07, 0.71, 0.5, 0.35, 0.21 and 0.1 respectively, seven groups of experiments are carried out, the number of frames actually used for reconstruction is 617, 998, 1951, 2905, 3410, 4072 and 4503 respectively, and the experimental results are shown in the following fig. 6. The computer memory and time required to perform the calculations were examined during the experiment as shown in fig. 7 below. The experimental result graph was subjected to SNR analysis with reference to the graph, and the result is shown in fig. 10.
(2) A matrix longitudinal column selection image reconstruction experiment
Firstly, 5000 frames of light field intensity files of related imaging experimental data are input, column selection operation of the matrix A is carried out, and the front 1/2, 1/3, 1/4, 1/5/, 1/6 groups of data of the matrix A are selected respectively. And after the column selection operation is finished, respectively storing the data into new folders. Then, the compressed sensing image reconstruction experiments are performed, and the experimental results are shown in fig. 8 below. The computer memory required for the calculation was examined during the experiment as shown in fig. 9 below. The experimental results were concatenated and then analyzed for SNR with the reference map, the results are shown in fig. 11.
According to the experimental results, the compressed sensing matrix A column selection operation provided by the embodiment of the invention can well reduce the consumed computer memory and successfully reconstruct the expected image when a large amount of associated imaging data is utilized to reconstruct the image. The image can be reconstructed by utilizing data which contributes more to the image well when the compressed sensing A matrix column selection operation is carried out. The experimental data and the operation time required by operation can be effectively reduced.
While embodiments of the invention have been described above, it is not limited to the applications set forth in the description and the embodiments, which are fully applicable in various fields of endeavor to which the invention pertains, and further modifications may readily be made by those skilled in the art, it being understood that the invention is not limited to the details shown and described herein without departing from the general concept defined by the appended claims and their equivalents.