Why does ISWT2 (R2017a) fail for coefficients in single precision?
Ältere Kommentare anzeigen
ISWT2 (R2017a) seems not to work properly for coefficients in single precision. The code below fails only for the single precision case.
nLevels = 1;
%%For image in double
X = im2double(imread('cameraman.tif'));
C = swt2(X,nLevels,'haar');
Y = iswt2(C,'haar');
psnr(Y,X)
%%For image in single
X = im2single(imread('cameraman.tif'));
C = swt2(X,nLevels,'haar');
Y = iswt2(C,'haar'); % <- error
psnr(Y,X)
Why does this phenomenon happen?
Akzeptierte Antwort
Weitere Antworten (1)
Ankit Bhatnagar
am 16 Mai 2017
0 Stimmen
Hi,
The ISWT2 works only with double precision as it uses functionality which expects the value to be double. Kindly use the double precision for this function.
1 Kommentar
Walter Roberson
am 16 Mai 2017
No, it's just a bug. Have a look at my Answer.
Kategorien
Mehr zu イメージ解析 finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!