how can i get the PSNR for an multibanded image?

2 次查看(过去 30 天)
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

采纳的回答

Youssef  Khmou
Youssef Khmou 2013-4-9
编辑:Youssef Khmou 2013-4-9
hi,
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 个评论
Rawan hamdi
Rawan hamdi 2013-4-9
Thank u so much but does this work for an image of size [280,307,191]?
Youssef  Khmou
Youssef Khmou 2013-4-9
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 .

请先登录,再进行评论。

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by