Several Image Quality Evaluation Methods of Sparse Aperture Optical System

        Here are a few sparse aperture optical systems, which are often used to compare and evaluate the restoration effect of the imaged image, and can also be used to evaluate the imaging effect of different optical systems.

        The first category is a general image quality evaluation algorithm, which can be applied to any image. Since it is not the core of this time, I just go through the formula and code briefly. In the following, f represents the reference image (original image), and g represents the restored image. The size is m*n.

        (1) Mean Square Error (MSE)

Root Mean Square Error (RMSE) and Mean Absolute Error (MAE) of MSE and the same series

        

f=imread('f.jpg');
g=imread('g.jpg');
MSE=mean2((double(f)-double(g)).^2);
%RMSE=sqrt(MSE);
RMSE=sqrt(mean2((double(f)-double(g)).^2));
MAE=mean2(abs(double(f)-double(g)));

For convenience, grayscale images can be used directly, and color images can be converted to grayscale images first. Since the image is read in uin8 format, in uint8 format, the minimum is 0, in order to prevent uint8(2)-uint8(22)= 0(uint8) This kind of error is changed to double format. RMSE can be obtained directly from MSE.

        (2) Peak Signal to Noise Ratio (PSNR)

The signal-to-noise ratio (SNR) is as follows, and the PSNR can be obtained indirectly by MSE.

SNR=10*log10(sum(sum(double(f).^2))/sum(sum((double(f)-double(g).^2))));
PSNR=10*log10(255^2/MSE);

        (3) Information entropy

Pi is the probability of the gray value i of g, max is the gray level, generally 255, and the probability of each gray value can be obtained from the histogram.

 

plist=imhist(g);
plist=plist/(sum(sum(plist)));
E=-sum(plist.*log2(plist));

        (4) Clarity

For writing convenience, convert f and g to double format (should be converted first).

G=0;
f=double(f);
g=double(g);
for i=1:m-1
    for j=1:n-1
        G=G+(g(i+1,j)-g(i,j))^2+(g(i,j+1)-g(i,j))^2;
    end
end
D=sqrt(G/2)/(m*n);

        (5) Correlation coefficient

It is the correlation coefficient in mathematics. If it is greater than 0 and less than 1, it is a positive correlation, if it is equal to 0, it is irrelevant, and it is greater than -1 and less than 0, it is a negative correlation.

In the formula, E[·] is the mathematical expectation, that is, the mean value.

% cormatrix=corrcoef(f,g);
% cor=cormatrix(1,2);
cor=mean2((f-mean2(f)).*(g-mean2(g)))/(sqrt(mean2(f.^2)-mean2(f)^2)*sqrt(mean2(g.^2)-mean2(g)^2));

        (6) Structural similarity

C1 and C2 are two constants, miu represents the average brightness (mean value), sigma_x represents the standard deviation, and sigma_fg represents the covariance of f and g. This algorithm is the most widely used, and the code is easy to get, including Matlab also comes with it, so I won't repeat it.

       The second category is the algorithms proposed for sparse aperture optical systems. Compared with the first category of methods, this type of method is more targeted at sparse apertures or other imaging systems, and the algorithms used are more convincing.

(1) Peak to Intergrated-Sidelobe Ratio (PISLR)

PISLR is an algorithm that describes the amount of concentrated energy in the main peak of the PSF function of the imaging system. It is defined as the ratio of the energy inside and outside the main lobe circle of the PSF, namely

A PSF function plane and three-dimensional surface are shown below

The main peak (the circle of the main lobe) can be regarded as the highest (bright) part in the middle of the three-dimensional (planar) image, and other places are regarded as side lobes. The first thing to do is to define the peak width (diameter) as the limit of the main peak (main lobe circle). In the paper "Sparse Aperture Optical Imaging System Image Restoration Algorithm Research Jiang Yanchao" mentioned here: the diameter of the main lobe circle can be expressed as the multiple relationship of the full width half maximum (FWHM):

(Note: The multiplier in the paper "Optimization and Analysis of the Imaging Performance of Optical Synthetic Aperture System" is 1.18) 

Peak FWHM, also known as FWHM and FWHM, is the width of the function value corresponding to the two points before and after the largest peak (maximum value) in the function that is half of the maximum value corresponding to the largest peak of the function. That is, the maximum value of a certain function is 1, and the peak half-height width is the distance between two points with a value of 0.5 near the maximum value.

Since the PSF has rotational symmetry, and the PSF is expressed in Matlab as discretization (read the file directly in the form of a matrix), in the implementation, first find the coordinates (r, c) where the maximum value is located through the find function, and then Search right until the value corresponding to this coordinate is less than the maximum value of 0.5 times. The traversal length (not including the last coordinate less than 0.5 times) twice is the peak half-height width after discretization. Because of the discretization, the minimum interval is 1. The accuracy can be improved by sampling or fitting. The peak half-height width is obtained, and the diameter of the main lobe circle is obtained. According to the previous formula, the final PISLR is obtained. Also due to discretization, the numerator on the right side of the formula is essentially equal to the distance from the peak coordinate and less than the radius (previously calculated The sum of PSF values ​​corresponding to all coordinates of half the diameter), and the denominator is equal to the sum of PSF values ​​corresponding to all coordinates greater than the radius.

[h,w]=size(Psf);
[r,c]=find(Psf==max(max(Psf)));
FHWM=0;
for i=c+1:w
    if Psf(r,i)<0.5*max(max(Psf))
        break
    else
        FHWM=FHWM+1;
    end
end
wpeak=2.37*FHWM;
Smain=0;
Sside=0;
for i=1:h
    for j=1:w
        if sqrt((i-r)^2+(j-c)^2)<=0.5*wpeak
            Smain=Smain+Psf(i,j);
        else
            Sside=Sside+Psf(i,j);
        end
    end
end
PISLR=10*log10(Smain/Sside);

(2) Medium and high frequency MTF

Reflects the transmission ability of different frequency components of the object. Generally speaking, the high frequency part reflects the detail transfer of the object, and the middle frequency part reflects the level transfer condition of the object. The low frequency part reflects the contour transfer condition of the object. Different imaging systems are manifested in the speed at which the mid and high frequencies of the MTF drop, so the average MTF in the mid and high frequencies can be used as a standard to measure the imaging performance of the imaging system.

OTF is obtained by the normalized Fourier transform of PSF, and MTF is the modulus of OTF.

Since OTF is a complex matrix, its modulus is equivalent to the square of the real number of each element plus the square of the imaginary number and then the root sign. The abs() function can be used to express the modulus directly in matlab, so the calculation is as follows:

OTF=fftshift(fft2(Psf))./(sum(sum(Psf)));
MTF=abs(OTF);

The obtained MTF three-dimensional surface and frequency change curve:

 

The formula for calculating the medium and high frequency MTF is as follows:

rou_Dc and rou_dc are the system cut-off frequency and sub-aperture cut-off frequency respectively:

lambda is the wavelength, D is the diameter of the circumscribed circle of the sub-aperture, d is the diameter of the sub-aperture, and di is the distance from the exit pupil to the image plane. Since the author compares dishes, the proportional relationship between frequency and matrix can only be established manually.

[rm,cm]=find(MTF==max(max(MTF)));
di=10;
d=0.5;
D=1;
lambda=7e-10;
mtf=MTF(rm,cm:w);
DC=D/lambda/di;
dc=d/lambda/di;
midfre=0;
r=43;%截止频率对应的矩阵内的半径
for i=1:h
    for j=1:w
        if sqrt((i-rm)^2+(j-cm)^2)>=r && sqrt((i-rm)^2+(j-cm)^2)<=r*(DC/dc)
            midfre=midfre+MTF(i,j);
        end
    end
end
midfre=midfre/(2*pi^2*(DC^2/dc^2-1));

 

Guess you like

Origin blog.csdn.net/qq_36614557/article/details/108473601