HOW TO ADD MSE TO EXISTING TOOL (CODE)?

 Réponse acceptée

DGM
DGM le 25 Mai 2022
Use immse()
A = imread('peppers.png'); % some reference image
B = imnoise(A,'gaussian',0.001); % a modified copy
immse(A,B) % the MSE
ans = 584.7149

3 commentaires

rena m
rena m le 11 Juin 2022
usually mse value should be 0 to 1. so the 584.7149 is equal to 0.5847 ?
DGM
DGM le 11 Juin 2022
Modifié(e) : DGM le 11 Juin 2022
The MSE is the mean of the square of a difference. If both images have a nominal range of [0 k], then the MSE will have a nominal range of [0 k^2].
If you expect that the nominal range of MSE is [0 1], then that implies that you expect your images to both have the same nominal range of [0 1].
A = imread('peppers.png'); % some reference image
B = imnoise(A,'gaussian',0.001); % a modified copy
% these images are both in the range [0 255]
err1 = immse(A,B) % the MSE
err1 = 583.8506
% if the images were both in the range of [0 1]
% this is what you'd get:
err2 = immse(im2double(A),im2double(B))
err2 = 0.0090
% which is the same as
err1/(255^2)
ans = 0.0090
rena m
rena m le 11 Juin 2022
thank you so much

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Encryption / Cryptography dans Centre d'aide et File Exchange

Produits

Version

R2019a

Question posée :

le 25 Mai 2022

Modifié(e) :

DGM
le 11 Juin 2022

Community Treasure Hunt

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

Start Hunting!

Translated by