how can i get the PSNR for an multibanded image?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I have an image which is [307,280,191] and i added some noise to it and i want to get the PSNR between the 2 images (original and noisy)
Thanks
0 comentarios
Respuesta aceptada
Youssef Khmou
el 9 de Abr. de 2013
Editada: Youssef Khmou
el 9 de Abr. de 2013
hi,
Take a look at my submission : http://www.mathworks.com/matlabcentral/fileexchange/37691-psnr-for-rgb-images
In the PDF file "PSNR_RGB.pdf" you will find how to implement the PSNR for 3D array .
function y=PSNR_RGB(X,Y)
% Y= PSNR_RGB(X,Y)
% Computes the Peak Signal to Noise Ratio for two RGB images
% Class input : double [0,1] ,
% july ,25, 2012
% KHMOU Youssef
if size(X)~=size(Y)
error('The images must have the same size');
end
%if ~isa(X,'double')
% X=double(X)./255.00;
%end
%if ~isa(Y,'double')
% Y=double(Y)./255.00;
%end
% begin
d1=max(X(:));
d2=max(Y(:));
d=max(d1,d2);
sigma=mean2((X-Y).^2);
y=10*log((d.^2)./sigma);
Start testing with this function... BUT i think that this function works well , example :
I=randn(100,100,100);
J=I*0.9;
PSNR_RGB(I,J); % 76 Decibels
J=imnoise(I,'Gaussian',0,0.6);
PSNR_RGB(I,J); % 30 Decibels
2 comentarios
Youssef Khmou
el 9 de Abr. de 2013
look at the example above, i think it works, otherwise try as i said to download the submission, the psnr for multidimensional array is explained .
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!