Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
Nivetha m
Nivetha m el 4 de Abr. de 2016
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);

Respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by