200 likes | 594 Views
Image Quality Estimation for JPEG-Compressed Images without the Original Images. Atanas Petkov and Scott Cottier EE 398: Winter 2007-2008. Overview. PSNR estimation with and without the availability of the JPEG quantization matrix Description of PSNR estimation techniques
E N D
Image Quality Estimation for JPEG-Compressed Images without the Original Images Atanas Petkov and Scott Cottier EE 398: Winter 2007-2008
Overview • PSNR estimation with and without the availability of the JPEG quantization matrix • Description of PSNR estimation techniques • PSNR estimation using Lambda (l) [Brandão and Queluz ‘07] • l Estimation using known quantization matrix • Quantization matrix estimation from source characteristics • Assuming matrix is multiple of JPEG Standard • Assuming random quantization matrix • PSNR estimation via the J.240 standard • Conclusions [ITU-T Rec. J.240]
PSNR Via Lambda Estimation (1) • JPEG Images are generated with the 8x8 DCT • The DCT AC coefficients of natural images are approximated by Laplacian distributions • Sample image DCT DC distribution and low frequency AC distributions
JPEG Stream Extract Q-Table Lambda Estimation Lambda Compensation PSNR Estimation Raw Image Data Estimate Q-Table PSNR Via Lambda Estimation (2) • Flow diagram for estimating PSNR for a jpeg image • The quantization matrix must be known or estimated to enable Lambda estimation • The Lambda estimation is a 8x8 matrix with a unique Lambda value for each DCT frequency
JPEG Stream Extract Q-Table Lambda Estimation Lambda Compensation PSNR Estimation Raw Image Data Estimate Q-Table Lambda Estimation (1) • Calculation of Lambda Using the Maximum-Likelihood Method • D = Quantization step size • N = Number of coefficient Values • N1 = Number of non-zero coefficient values • N0 = Number of zero-valued coefficients • S1 = Sum of the absolute values of the coefficients
Lambda Estimation (2) • Note that as the quantization step size increases the number of zero-valued coefficients approaches the total number of coefficient values • High frequency Lambda estimates need to be adjusted • Practical limitations to the upper bound of lML are implemented to allow improved PSNR calculation
JPEG Stream Extract Q-Table Lambda Estimation Lambda Compensation PSNR Estimation Raw Image Data Estimate Q-Table Lambda Compensation • The Lambda compensation step scales the estimated lambda values to account for over estimation at low frequencies and under estimation at higher frequencies. Lc = S.*L • Scaling is performed across 6 groups of similar DCT frequencies • Scaling matrix S is determined by minimizing the PSNR error for a set of control images and the corresponding JPEGs
PSNR Estimation • PSNR is calculated from the mean squared error between the original value, Xk and the calculated value, xk. However the original values, Xk, is NOT known. • PSNR calculated via Lambda estimation in the DCT domain • fx(x) = PDF of the Laplacian distribution with Lambda (l) • Xk = Quantization level value • P(Xk) = Probability of the Xk from the PDF fx(x)
PSNR Results with Lambda Estimation (1) Test Image 1
PSNR Results with Lambda Estimation (2) Test Image 2
Quantization matrix Q – unknown Known to be a multiple of Standard JPEG matrix (W) Q = sW s – scaling factor (unknown) W = [JPEG Standard, Annex K] Q Matrix Estimation
Procedure Load .jpg image file Subtract mid-level (128) Perform 8x8 DCT Divide every 8x8 block by the Standard JPEG matrix Resulting values are all multiples of “s” (with some round-off errors) Plot histogram Distance between peaks represents the value of “s” Estimating “s” with a histogram
Get displacement value which corresponds to the peak closest to zero Make sure peak is greater than the mean of the autocorrelation function Extracting “s” from the histogram
Results Able to estimate “s” to within accuracy of 0.1 Able to differentiate JPEG quality within 5-uint increments Problems with approach Scale factor not really constant for every frequency coefficient Round-off errors Results and Problems Solution: Estimate Q directly without relying on JPEG standard matrix
Procedure Same as before, but do not divide every block by JPEG standard matrix Create a histogram for every frequency coefficient Estimate step size directly Problems In some frequency bands, all coefficients are quantized to zero Unable to extract step size from them Need JPEG matrix again, to estimate the rest of the entries est Q (quality 50) = 16 11 10 16 24 40 51 61 12 12 14 19 26 58 60 0 14 13 16 24 40 57 0 0 14 17 22 29 0 0 0 0 18 22 0 0 0 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 real Q (quality 50) = 16 11 10 16 24 40 51 61 12 12 14 19 26 58 60 55 14 13 16 24 40 57 69 56 14 17 22 29 51 87 80 62 18 22 37 56 68 109 103 77 24 35 55 64 81 104 113 92 49 64 78 87 103 121 120 101 72 92 95 98 112 100 103 99 Estimating Q without JPEG matrix
Higher quality means being able to estimate a greater amount of the step sizes of the frequency coefficients Even at very low quality, the upper left 3x3 block, corresponding to the lowest frequencies is always estimated correctly Can use the known step size coefficients to determine the unknown ones (from the JPEG standard matrix) Hybrid Q estimator Estimate directly the ones you can Extrapolate the unknown ones from the ones that are known and the JPEG standard matrix Quality = 90 3 2 2 3 5 8 10 12 2 2 3 4 5 12 12 11 3 3 3 5 8 11 14 11 3 3 4 6 10 17 16 12 4 4 7 11 14 0 0 0 5 7 11 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Quality = 20 40 28 25 40 60 100 128 0 30 30 35 48 65 0 0 0 35 33 40 60 0 0 0 0 35 43 55 0 0 0 0 0 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Effect of quality on Q estimation
J.240 Standard • A standard for remote monitoring of video quality • Image features are extracted and transmitted separately from the video stream • Image features from source video and received video are compared to estimate quality [ITU-T Rec. J.240]
J.240 Encoding • x(b) - block “b” of input signal x • SPN – A random (+1,-1) matrix • WHT – Walsh-Hadamard Transform (Orthogonal Transform) • R[b] - Select one coefficient to represent the block [ITU-T Rec. J.240]
J.240 Encoding Results • Estimating MSE using J.240 feature pixels • R[b] – original J.240 bitstream • R’[b] – JPEG J.240 bitstream • Very good PSNR estimation • J.240 bitstream required [Chono, K.]
Conclusions • AC coefficients of DCT follow a Laplacian Distribution (l) • Can achieve good (within 1-2dB) PSNR estimation using Laplacian pdf model with known (l) and quantization matrix Q • Can estimate (l) using a hybrid method of: • Maximum Likelihood Estimator • Lambda Compensation • If quantization matrix Q is unknown • Can estimate Q via a histogram method if it is a multiple of JPEG Standard Q = sW • Can estimate s to within 0.1 accuracy • Can estimate the lower frequencies exactly • Can use a hybrid approach to estimate higher frequencies • Can estimate PSNR very well (within < 1dB accuracy) if a J.240 bitstream is available