i can't calculate psnr for below code......

2 ビュー (過去 30 日間)
Nivetha m
Nivetha m 2016 年 4 月 4 日
clc; clear all; close all; fontSize = 20; a=imread('C:\Users\shankar\Documents\MATLAB\measurement\ship.jpg'); subplot(2,2,1),imshow(a),title('original image', 'FontSize', fontSize), b=rgb2gray(a); subplot(2,2,2),imshow(b),title('GRAY image', 'FontSize', fontSize), [m n]=size(b); H=fspecial('laplacian'); b2=imfilter(a,H); subplot(2,2,3),imshow(b2),title('FILTER image', 'FontSize', fontSize),
squaredErrorImage = (double(b) - double(b2)) .^ 2; mse = sum(sum(squaredErrorImage)) / (m * n); RMSE = sqrt(mse); PSNR = 10 * log10( 256^2 / mse); mad = mean2(abs(double(b)-double(b2))); message = sprintf('The mean square error is %.2f.\nThe PSNR = %.2f.\n THE RMSE=%.2f.\n THE mad=%.2f',mse, PSNR,RMSE,mad); msgbox(message);

回答 (0 件)

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by