What does a low RMSE value of an image determine?

7 ビュー (過去 30 日間)
soni
soni 2015 年 4 月 12 日
コメント済み: Image Analyst 2015 年 4 月 12 日
Hi,
I am comparing two images and wanted to calculate the error.
Does a lower RMSE value show a small error?
Thanks

回答 (1 件)

Image Analyst
Image Analyst 2015 年 4 月 12 日
It means that the "test" image is close to the "reference" image on a pixel-by-pixel basis, if that's the RMSE method you used.
  1 件のコメント
Image Analyst
Image Analyst 2015 年 4 月 12 日
I assume b and N are images, then it's almost correct. You need to square the (a-b) before you take the mean. You can use mean2() instead of mean(mean()) if they are gray scale images. See this snippet from my attached demo
%------ PSNR CALCULATION ---------------------
% Now we have our two images and we can calculate the PSNR.
% First, calculate the "square error" image.
% Make sure they're cast to floating point so that we can get negative differences.
% Otherwise two uint8's that should subtract to give a negative number
% would get clipped to zero and not be negative.
squaredErrorImage = (double(grayImage) - double(noisyImage)) .^ 2;
% Display the squared error image.
subplot(2, 2, 3);
imshow(squaredErrorImage, []);
title('Squared Error Image', 'FontSize', fontSize);
% Sum the Squared Image and divide by the number of elements
% to get the Mean Squared Error. It will be a scalar (a single number).
mse = sum(squaredErrorImage(:)) / (rows * columns);
% Calculate PSNR (Peak Signal to Noise Ratio) from the MSE according to the formula.
PSNR = 10 * log10( 256^2 / mse);
% Alert user of the answer.
message = sprintf('The mean square error is %.2f.\nThe PSNR = %.2f', mse, PSNR);
msgbox(message);
Note that there are now built in functions for mse called immse() and PSNR caleld psnr().

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by