Calculating the RMSE value between two images
35 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Shourya
le 19 Sep 2022
Commenté : Image Analyst
le 20 Sep 2022
I calculated the RMSE value between two images of size 128 x 128 in .jpg format and I am getting the result above 1. I want the range to be between 0-1. I tried applying imadjust to normalize but it did not help. How can I normalize the image and get the required result between 0-1. I also tried to save the images in .mat file and normalize it but I am getting error as the image is being saved as type struct and not double. Please help.Thank you in advance.
I used the following line to calculate rmse:
rmse_val = sqrt(mean((ref(:)-a(:)).^2))
0 commentaires
Réponse acceptée
Image Analyst
le 19 Sep 2022
You forgot to attach your variables. I don't know if you can subtract structures like that so I think ref and (the badly-named) a are actually numerical arrays, not structures. If they are uint8 gray scale images, you should convert to double before subtracting, and use the rms function:
a = imread('cameraman.tif');
ref = a + 10;
% First method is to use rms on the difference array.
diffImage = double(ref) - double(a);
r = rms(diffImage(:))
% Alternate way is to use rmse
re = rmse(double(ref(:)), double(a(:)))
4 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!