Filter löschen
Filter löschen

how can i get the PSNR for an multibanded image?

3 Ansichten (letzte 30 Tage)
Rawan hamdi
Rawan hamdi am 9 Apr. 2013
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

Akzeptierte Antwort

Youssef  Khmou
Youssef Khmou am 9 Apr. 2013
Bearbeitet: Youssef Khmou am 9 Apr. 2013
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 Kommentare
Rawan hamdi
Rawan hamdi am 9 Apr. 2013
Thank u so much but does this work for an image of size [280,307,191]?
Youssef  Khmou
Youssef Khmou am 9 Apr. 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 .

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by