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?
3 views (last 30 days)
Show older comments
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
0 Comments
Answers (1)
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)
% 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))
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.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!