Error using psnr function
이전 댓글 표시
I used [peaksnr, snr] = psnr(B, A) wherein A is a binary image and B, the same image but a weiner2 function applied to it.
An error then is outputted
Error using psnr
Expected input number 1, A, to be one of these types:
uint8, uint16, int16, single, double
Instead its type was logical.
Error in psnr>checkImages (line 71)
validateattributes(A,validImageTypes,{'nonsparse'},mfilename,'A',1);
Error in psnr (line 39)
checkImages(A,ref);
답변 (1개)
Image Analyst
2017년 9월 21일
So? Just cast it to one of those data types like it suggested.
[peaksnr, snr] = psnr(double(B), double(A))
댓글 수: 2
Jemela Llanes
2017년 9월 22일
편집: Jemela Llanes
2017년 9월 22일
Image Analyst
2017년 9월 22일
I think PSNR is usually used to measure compression/decompression accuracy but I suppose you could use it. I think immse() or computing MAD (mean absolute difference) would be better.
카테고리
도움말 센터 및 File Exchange에서 Image Quality에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!