function [ StrSim ] = SSIM(a,b)
%SSIM Implementation of the similarity comparision in SSIM
%--------------------------------------------------------------------------
% Input: intensity image a and b; patch size w.
% Output: struction similarity StrSim.
%--------------------------------------------------------------------------
% Details can be found in the authors' original paper:
% Z.Wang, A.Bovik, H.Sheikh and E.Simoncelli, "Image quality assessment:
% From error visibility to structural similarity," IEEE Transactions on
% Image Processing, vol. 13, no. 4, pp. 600-612, Apr. 2004.
%--------------------------------------------------------------------------
c = 2e-4; %small constant
w = 8; %patch size
h =fspecial('average',[w,w]);
h = h/sum(sum(h));
mu1 = filter2(h, a, 'valid');
mu2 = filter2(h, b, 'valid');
mu1_sq = mu1.*mu1;
mu2_sq = mu2.*mu2;
mu1_mu2 = mu1.*mu2;
sigma1_sq = filter2(h, a.*a, 'valid') - mu1_sq;
sigma2_sq = filter2(h, b.*b, 'valid') - mu2_sq;
sigma12 = filter2(h, a.*b, 'valid') - mu1_mu2;
StrSim = (sigma12 + c)./(sqrt(sigma1_sq.*sigma2_sq)+c);
MATLAB实现图像质量评估标准SSIM 程序源码.zip
版权申诉
5星 · 超过95%的资源 174 浏览量
2022-03-27
19:56:32
上传
评论 6
收藏 13KB ZIP 举报
阿里matlab建模师
- 粉丝: 3212
- 资源: 2782
最新资源
- Screenshot_20240427_031602.jpg
- 网页PDF_2024年04月26日 23-46-14_QQ浏览器网页保存_QQ浏览器转格式(6).docx
- 直接插入排序,冒泡排序,直接选择排序.zip
- 在排序2的基础上,再次对快排进行优化,其次增加快排非递归,归并排序,归并排序非递归版.zip
- 实现了7种排序算法.三种复杂度排序.三种nlogn复杂度排序(堆排序,归并排序,快速排序)一种线性复杂度的排序.zip
- 冒泡排序 直接选择排序 直接插入排序 随机快速排序 归并排序 堆排序.zip
- 课设-内部排序算法比较 包括冒泡排序、直接插入排序、简单选择排序、快速排序、希尔排序、归并排序和堆排序.zip
- Python排序算法.zip
- C语言实现直接插入排序、希尔排序、选择排序、冒泡排序、堆排序、快速排序、归并排序、计数排序,并带图详解.zip
- 常用工具集参考用于图像等数据处理
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
- 3
- 4
- 5
前往页