You are here : matlab → Image Processing → immse
# immse() - Image Processing

### Syntax

### Example

### Output / Return Value

### Limitations

### Alternatives / See Also

### Reference

err = immse(X,Y) calculates the mean-squared error (MSE) between the arrays X and Y. X and Y can be arrays of any dimension, but must be of the same size and class.Code Generation support: Yes.MATLAB Function Block support: Yes.

err = immse(X,Y) example

Calculate Mean-Squared Error in Noisy ImageOpen This Example Read image and display it.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); The mean-squared error is 353.7631