What was problem saving this question?

function [Ps]=psnr(originalImage,embeddedImage)
I=double(originalImage);
B=double(embeddedImage);
MSE=mean(mean((I-B).^2));
MAXI=255; %MAXI is the maximum possible pixel value of the image.
%When the pixels are represented using 8 bits per sample, this is 255.
Ps=10*log10(MAXI^2/MSE);
end
here call function in embedd
Ps=psnr(originalImage,embeddedImage);
disp(Ps);
This error
Error in psnr (line 4)
MSE=mean(mean((I-B).^2));
Error in Embed (line 141)
Ps=psnr(originalImage,embeddedImage);

답변 (2개)

Walter Roberson
Walter Roberson 2015년 5월 8일

0 개 추천

You did not show us what the error message was.
I suspect that your originalImage and your embeddedImage are not the same size()
Reem Al Shehri
Reem Al Shehri 2015년 5월 8일

0 개 추천

The error MSE=mean(mean((I-B).^2));

댓글 수: 1

That tells us where the error was, but not what the error was. For example just before that did it say,
"Error in license manager, -97"
or did it say
"Matrix dimensions must agree"
?

댓글을 달려면 로그인하십시오.

태그

아직 태그를 입력하지 않았습니다.

질문:

2015년 5월 8일

댓글:

2015년 5월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by