资源简介
图像质量评价matlab代码,在此分享
图像质量评价matlab代码,在此分享
图像质量评价matlab代码,在此分享
代码片段和文件信息
function [absdiff snr psnr imfid msediffentropy] = compare(originalimg restoredimg)
%Function to compare the original image with the
%restored image using some predefined methods
%Inputs: originalimg restoredimg
%Returns: absdiff snr psnr imfid mse
%
%originalimg: It is the original unblurred image
%restoredimg: It is the restored image
%absdiff: Average Absolute Difference
%snr: Signal to Noise Ratio (dB)
%psnr: Peak Signal to Noise Ratio (dB)
%imfid: Image Fidelity(逼真度)
%mse: Mean Square Error
%diffentropy: The difference between restoredimg entroy and originalimg
% entroy
%
%Example:
% [absdiff snr psnr imfid mse] = compare(originalimg restoredimg);
% This call takes original image and the restored image and returns
% the comparison of both the images using some predefined methods.
%Average absolute difference
%
md = originalimg - restoredimg;
mdsize = size(md);
summation = 0;
for i = 1:mdsize(1)
for j = 1:mdsize(2)
summation = summation + abs(md(ij));
end
end
absdiff = summation/(mdsize(1)*mdsize(2));
%}
%Signal to Noise Ratio (SNR)
%
md = (originalimg - restoredimg).^2;
mdsize = size(md);
summation = 0;
sumsq=0;
for i = 1:mdsize(1)
for j = 1:mdsize(2)
summation = summation + md(ij);
sumsq = sumsq + (originalimg(ij)^2);
end
end
snr = sumsq/summation;
snr = 10 * log10(snr);
%}
%Peak Signal to Noise Ratio (PSNR)
md = (originalimg - restoredimg).^2;
mdsize = size(md);
summation = 0;
for i = 1:mdsize(1)
for j = 1:mdsize(2)
summation = summation + abs(md(ij));
end
end
psnr = size(originalimg 1) * size(originalimg 2) * max(max(originalimg.^2))/summation;
psnr = 10 * log10(psnr);
%}
%Image Fidelity
md = (originalimg - restoredimg).^2;
mdsize = size(md);
summation = 0;
sumsq = 0;
for i = 1:mdsize(1)
for j = 1:mdsize(2)
summation = summation + abs(md(ij));
sumsq = sumsq + (originalimg(ij)^2);
end
end
imfid = (1-summation)/sumsq;
%}
%Mean Square Error
%
diff = originalimg - restoredimg;
diff1 = diff.^2;
mse = mean(mean(diff1));
%}
%Entropy
%
diffentropy = entropy(restoredimg) - entropy(originalimg);
%}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2244 2009-10-15 11:40 图像质量评价MatlAB程序\Compare.asv
文件 2328 2009-10-15 11:42 图像质量评价MatlAB程序\Compare.m
目录 0 2009-10-16 21:27 图像质量评价MatlAB程序
----------- --------- ---------- ----- ----
4572 3
- 上一篇:直驱永磁同步风机最大风能追踪
- 下一篇:轨迹跟踪---船舶航迹控制matlab程序
相关资源
- 轨迹跟踪---船舶航迹控制matlab程序
- LFM信号模糊函数Matlab代码
- MATLAB GUI 多界面图像处理
- 小波图像融合matlab实现源代码
- 单轮abs控制 matlab仿真实现
- NSGA-II的matlab 仿真程序
- 感兴趣区域提取(ROI)matlab实现
- TDOA_AOA定位的扩展卡尔曼滤波算法MA
- 频域整形法构造1/f噪声
- 大时滞系统的模糊控制MATLAB仿真\\大时
- 能量检测matlab代码
- 将二进小波变换用于图像增强的MATL
- matlab基于遗传算法实现的高效排课系
- matlab中ICP点云匹配算法
- 贝叶斯辨识的matlab程序
- 直接序列扩频的MATLAB仿真,以及对应
- 《数字信号处理matlab版》代码
- matlab车牌图像分割
- 多相滤波数字信道化MATLAB源码
-
用GUI实时更改simuli
nk仿真参数 - 基于RBF神经网络的PID控制仿真代码
- RBF插值算法Matlab代码
- DCT基函数图像_MATLAB版本
- Matlab实现M/M/1排队模型
- A率PCM编码MATLAB程序
- matlab三相桥式整流电路仿真模型
- 偏微分图像处理MATLAB程序
- 图像预处理MATLAB代码包括图像去孔洞
- 信号包络提取
- matlab编写的有关图像识别分类方法的
评论
共有 条评论