function [mssim, ssim_map,siga_sq,sigb_sq] = SSIM(ima, imb)
% ========================================================================
%ssim的算法主要参考如下论文:
%Z. Wang, A. C. Bovik, H. R. Sheikh, and E. P. Simoncelli, "Image
% quality assessment: From error visibility to structural similarity,"
% IEEE Transactios on Image Processing, vol. 13, no. 4, pp. 600-612,
% Apr. 2004.
% 首先对图像加窗处理,w=fspecial('gaussian', 11, 1.5);
% (2*ua*ub+C1)*(2*sigmaa*sigmab+C2)
% SSIM(A,B)=————————————————————————
% (ua*ua+ub*ub+C1)(sigmaa*sigmaa+si