# Optimization Methods of Compressively Sensed Image Reconstruction Based on Single-Pixel Imaging
## 3 Methods
### Imaging Method in Our Single-Pixel Camera
Thus, in order to realize the distribution of the Hadamard matrix in DMD, our approach is: before coding the Hadamard matrix, first we set all the effective micromirror pixel units of DMD to on (\"+1\"), and the photodetector acquires the corresponding measurement value as Y1. Then the elements \"\(-1\)\" and \"+1\" of the Hadamard matrix code the pixel micromirror units of DMD to off and on respectively (at this time, the element \"\(-1\)\" is equivalent to the element \"0\" of 0-1 binary matrix, which sets pixel micromirror unit to off), detecting the corresponding measurement value as Y2. The \"+1\" states in Y2 can correctly and truly represent the \"+1\" elements of the Hadamard matrix, while the \"\(-1\)\" states in Y2 represent the off states (elements \"0\") of micromirror units and the photodetector can't acquire the corresponding signals of \"\(-1\)\". There are the same and common \"+1\" states of micromirror units in Y1 and Y2. Thus, in the Hadamard matrix, for the \"+1\" elements, 2Y2-Y1 means \(2\times^{\prime\prime}+1^{\prime\prime}-1\times^{\prime\prime}+1^{\prime\prime }=1\times^{\prime\prime}+1^{\prime\prime}\) that is exactly the \"+1\" elements of the Hadamard matrix, while for the \"\(-1\)\" elements, 2Y2-Y1 means \(2\times^{\prime\prime}0^{\prime\prime}-1\times^{\prime\prime}+1^{\prime \prime}=-1\times^{\prime\prime}+1^{\prime\prime}=^{\prime\prime}-1^{\prime\prime}\) that can actually achieve the representation of \"\(-1\)\" elements of the Hadamard matrix. Consequently, for Hadamard matrix, the measurement value is obtained as Y = 2Y2 - Y1. We measure m times in this same way as Y and obtain the measurement vector \(y\), \(y=\left[y_{1},y_{2},\ldots,y_{m}\right]^{T}\). In order to eliminate the interference of system noise and dark noise as much as possible, our adopted method is to set all the effective micromirror pixel units of DMD to \"0\", which means that all the micromirror units are turned off and SPM detects the background noise as Y0. Thus, the effective measurement value at each measurement is Y-Y0 that has most of the ambient noise and dark noise removed. In addition, to avoid the influence of ambient light noise, our whole imaging system was blackened and sealed with a cover. In our single-pixel imaging system, the projection method of column-by-column scanning is adopted to acquire the imaging information, and the imaging resolution of image reconstruction is \(256\times 256\). Because of the stable and efficient operation of OMP algorithm [41; 42] in reconstructing small data (column signals of length 256 are small data), we choose OMP algorithm as the imaging algorithm to reconstruct imaging scenes in our single-pixel camera. During the process of SPM signal detection, due to the fact the light intensity fluctuates over time, the detected electric signal intensity at each imaging session may also fluctuate with the optical signal. In order to as much as possible eliminate the dynamic deviation of grayscale at each imaging and make the grayscale distribution of reconstructed images more balanced and more stable, we normalize the grayscale range of every imaging picture and equalize the reconstructed images into the grayscale range of 0 to 255. The grayscale equalization equation is expressed as:  
\[\hat{x}(i,j)\leftarrow\frac{\hat{x}(i,j)-\min\{\hat{x}(i,j)\}}{\max\{\hat{x}(i,j)\}-\min\{\hat{x}(i,j)\}}\times 255, \tag{9}\]  
the final reconstructed images are obtained by Equation (9).