www.gusucode.com > images 案例代码 matlab源码程序 > images/CalculateMeanSquaredErrorInNoisyImageExample.m
%% Calculate Mean-Squared Error in Noisy Image % %% % Read image and display it. % Copyright 2015 The MathWorks, Inc. ref = imread('pout.tif'); imshow(ref) %% % Create another image by adding noise to a copy of the reference image. A = imnoise(ref,'salt & pepper', 0.02); imshow(A) %% % Calculate mean-squared error between the two images. err = immse(A, ref); fprintf('\n The mean-squared error is %0.4f\n', err);