UT Arlington EE 5351 - Metric Structural Similarity

Unformatted text preview:

EE-5356 DIGITAL IMAGE PROCESSINGMetric Structural Similarity (SSIM) Ajaykumar SharmaA perceptual image quality assessment metric-structural similarity (SSIM)This project is related to structural similarity index (SSIM) which represents perceptual image quality based on the structural information. SSIM is an objective image quality metric and is superior to traditional quantitative measures such as MSE and PSNR. This project demonstrates the SSIM based image quality assessment and illustrates its validity in terms of human visual perception. It will be very helpful to understand SSIM and its applications by reviewing the paper listed below.(a) A general form of SSIM is )],([)],([)],([),( yxsyxcyxlyxSSIM ,[Note that >0, β>0 and γ >0 are parameters used to adjust the relative importance of the three components].where yx, are image patches and 12212),(CCyxlyxyx, 22222),(CCyxcyxyx, 33),(CCyxsyxxy andl(x,y) is luminance comparison (eq. 6), c(x,y) is contrast comparison (eq. 9), and s(x,y) is structural comparison (eq. 10). 321,, CCC are constants. x, y, x, y, xy are defined in Eqs.14, 15, 16 in the reference paper. Gaussian weighting function has the form( )2 21 21 22, exp2n nw n ns� �+= -� �� �, 1 2, 1,2, ,11n n = L For more information, students are referred to the paper, Z. Wang et al. "Image quality assessment: From error visibility to structural similarity," IEEE Trans. ImageProcessing, vol. 13, no. 4, pp. 600-612, Apr. 2004, which can be downloaded fromhttp://www.cns.nyu.edu/~lcv/ssim/ (Also from IEEE Xplore).Write a Matlab function as my_ssim whose the inputs are two images and,,,321,, CCC, the outputs are SSIM_metric and SSIM_map between the two images. The SSIM_metric isthe mean value of SSIM_map which is computed by a local moving window (11x11 pixels). You can download the Matlab implementation of the SSIM at http://www.cns.nyu.edu/~lcv/ssim/ as a reference.(b) Set ,,,321,, CCC as in the paper and apply your function to the different distortedLena images (512x512) with the same mean square error (MSE). The test images can bedownloaded at the link “Universal image quality index” athttp://www.cns.nyu.edu/~zwang/. Compute the SSIM_metric and show the SSIM_map.You will find that the SSIM_metric is more correlated to human perception of qualitycompared with MSE.(c) Fix 321,, CCC as in (b) and set  as 1. Choose any 5 pairs of ,, for example [2,1 ] , [3,1 ],[4,1 ],[1,2 ],[1,3 ] and apply yourfunction to the distorted Lena images (You can use all or parts of the images). Then find the, to produce the SSIM_metric most correlated with your perception of the quality. Thereis no right answer, which is totally dependent on your own opinion of the quality.SSIM was introduced in JVT Hannover (Germany) meeting April 2008. Document isreferred to JVT-AB31 (W.S.Kim, Z. Li, P. Pahalawatta, and A.M. Tourapis from Dolby Lab,Burbank CA) Matlab Code:%%Project Part aclear all;close all;clc;%% Reading Imagesimg1=imread('Image1.gif');img2=imread('Image3.gif');figure(1);subplot(2,2,1);imshow(img1);title('Orginal Lena Image');subplot(2,2,2);imshow(img2);title('Distorted Lena Image which has noise');[x,y]=size(img1);img1 = double(img1);img2 = double(img2);%% Defining the alpha and beta images which are as defined in the paperalpha=2;beta=2;gamma=2;L=length(x);K1=0.01;K2=0.03; %% Defining the window with guassian filterwindow = fspecial('gaussian', 11, 2); %C1 = (K1*L)^2;C2 = (K2*L)^2;C3=C2/2;window = window/sum(sum(window));%% Obtaining the 2-D filtermu_x = filter2(window, img1, 'valid');mu_y = filter2(window, img2, 'valid');%% Calculating the mux and muy valuesmu1_sq = mu_x.*mu_x;mu2_sq = mu_y.*mu_y;mu1_mu2 = mu_x.*mu_y;%% Calculating the variance of the filtervar_x_sq = filter2(window, img1.*img1, 'valid') - mu1_sq;var_y_sq = filter2(window, img2.*img2, 'valid') - mu2_sq;var_x=sqrt(var_x_sq);var_y=sqrt(var_y_sq);var_xy = filter2(window, img1.*img2, 'valid') - mu1_mu2;%% Equations I,c,sI=(((2.*(mu_x)).*(mu_y))+C1)./(mu_x.^2+mu_y.^2+C1);c=((2.*var_x_sq.*var_y_sq)+C2)./(var_x_sq.^2+var_y_sq.^2+C2);s=((var_xy+C3)./((var_x.*var_y+C3)));%% Calculating the Structural Similarity index valuessim_map =(I.^alpha).*(c.^beta).*(s.^gamma);mssim = mean2(ssim_map)figure(1);subplot(2,2,3);imshow(max(0, ssim_map).^4);title('SSIM-MAP output');Output:Orginal Lena Image Distorted Lena Image which has noiseSSIM-MAP outputOrginal Lena Image Distorted Lena Image which has noiseSSIM-MAP outputOrginal Lena Image Distorted Lena Image which has noiseSSIM-MAP outputOrginal Lena Image Distorted Lena Image which has noiseSSIM-MAP outputOrginal Lena Image Distorted Lena Image which has noiseSSIM-MAP outputOrginal Lena Image Distorted Lena Image which has noiseSSIM-MAP outputOrginal Lena Image Distorted Lena Image which has noiseSSIM-MAP outputOBSERVATIONS:The compression ratios for the images are:Lena image= 4.8574goldhill image= 2.2445 Type of distortion SSIM Values MSE valuesSalt and Pepper 0.4598 225.36Additive Gaussian noise 0.1884 225.18Multiplicative speckle noise 0.2580 224.14Mean shift algorithm 0.9788 224.99Contrast Stretching 0.7115 225.09Blurred image 0.1392 224.13Jpeg compressed image 0.1537 214.11For goldhill image:Orginal Goldhill Image Distorted Goldhill Image which has noiseSSIM-MAP outputOrginal Goldhill Image Distorted Goldhill Image which has noiseSSIM-MAP outputOrginal Goldhill Image Distorted Goldhill Image which has noiseSSIM-MAP outputOrginal Goldhill Image Distorted Goldhill Image which has noiseSSIM-MAP outputOrginal Goldhill Image Distorted Goldhill Image which has noiseSSIM-MAP outputOrginal Goldhill Image Distorted Goldhill Image which has noiseSSIM-MAP outputOrginal Goldhill Image Distorted Goldhill Image which has noiseSSIM-MAP output Type of distortion SSIM Values MSE valuesSalt and Pepper 0.7085 120.21Additive Gaussian noise 0.3481 121.12Multiplicative speckle noise 0.4443 121.42Mean shift algorithm 0.9857 121.00Contrast Stretching 0.8093 120.90Blurred image 0.1721 121.93Jpeg compressed image 0.2998 117.47Project Part


View Full Document

UT Arlington EE 5351 - Metric Structural Similarity

Download Metric Structural Similarity
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Metric Structural Similarity and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Metric Structural Similarity 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?