How do I compute RMSE for Color Image ??
4 次查看(过去 30 天)
显示 更早的评论
I wish to compute RMSE for color images and I applied the code below was to compute RMSE for grayscale image.
Please will this same code be applicable to (RGB) color image ??
% RMSE for Grayscale Images
data = imread('woman_GT[1-Original].bmp'); % Read real data
estimate = imread('woman_GT[8-Our Method].bmp'); % Read predicted data
rmseResults=RMSE(data,estimate); % Compute RMSE
% Alert user of the answer.
message = sprintf('The Root mean square error is %.3f.', rmseResults);
msgbox(message);
Thanks
0 个评论
采纳的回答
Rik
2018-11-17
If the function you are using is from this FEX submission, then yes, it will work. The interpretation of the RMSE might be more difficult, or it might not even make sense.
The root mean square error is just that: sqrt(mean(err^2)), so as long as you modify that to support vectors or matrices, it should work.
3 个评论
Image Analyst
2018-11-19
Which would mean adding a dot before the caret
r = sqrt(mean(err .^ 2))
Or you could use the built-in functions immse() and psnr().
Rik
2018-11-19
I agree with the use of built-in functions whenever you have access to them, you never know where Mathworks engineers were able to put some tricks to increase performance (now or in a future release).
However, the code here will only yield the expected result for vector input, because mean will return an array with one dimension less than the input, so a 2D input will become a vector. (of course for a scalar input, the output will not be 0 dimensions)
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!