Skip to main content
. 2023 May 13;23(10):4724. doi: 10.3390/s23104724
Algorithm 1: Pseudo-code of the proposed zoom quality metric

Input: Zoom photo I, over-completer DCT dictionary D, mean and variances of pristine MVG parameters μy, Σy, weighting parameters k1, w and l.

1

Initialization:

2

Compute the photo gradient I using Sobel operator;

3

Partition the photo I into non-overlapping 96 x 96 patches xk

4

The measurement of sharpness:

5

foreach k=1,2,,Ndo

6   

 Solve the sparse coding coefficients αk* using the OMP algorithm [73];

7  

 Calculate the patch variance σk2;

8  

 Sort and select the top l% patches according to the variance σk2;

9

end(

10

Compute mean KL-divergence or energy: k=1Ns(αk*)Tαk*σk2

11

Compute the residual gradient image: II

12

Compute entropy of the residual: E(log1P(S(|II|)|α)) 

13

The sharpness index: SS=k=1Ns(αk*)Tαk*σk2+k1·E(log1P(S(|II|)|α)) 

14

The measurement of naturalness:

15

foreach k=1,2,,N do((

16

Compute the MSCN map of I using (20)

17

Compute the GGD and AGGD parameters of each patch using (21), (23), (24)

18

end(

19

Estimate the μx and Σx through (25)

20

The naturalness index:  NS=(μxμy)TΣx+Σy21(μxμy) 

Output: Zoom quality metric Q=SS+w·NS