i have been given to find out the psnr value of a hyperspectral image / data. its is of size 690*110*300. how can i proceed to do that?

1 view (last 30 days)
JYOTIRMAYEE PATI
JYOTIRMAYEE PATI on 14 Jun 2022
Answered: DGM on 14 Jun 2022
when i am trying to solve the code by using the code provided in mathworks website the psnr values are coming in negative even for standard hsi images.can u help me with the codes

Answers (1)

DGM
DGM on 14 Jun 2022
Consider the example:
A = rand(10,10,10);
B = A + randn(10,10,10)*1E-6;
% using IPT psnr()
R0 = psnr(B,A)
R0 = 119.9760
% using basic tools
% the white value of the data
wv = 1; % for floating-point classes
% the error
err = double(A)-double(B);
% the PSNR
R = 10*log10(wv^2/mean(err(:).^2))
R = 119.9760
My guess is that you're not accounting for the data class, the classes differ, or that that one or both arrays are scaled improperly for their class. The above example does everything in floating-point. If this doesn't help clarify, then you'll have to reveal the class/scale of your data and the code you tried to use.

Community Treasure Hunt

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

Start Hunting!