**Name**

**fmse** Computes the mean square difference between two fimages

**Command Synopsis**

**fmse** [-n] [-p] *Image1* *Image2* *.* *.* *.* *.*

-n : flag to normalize the images

-p : flag to compute PSNR with max_Image1 - min_Image1 = 255

Image1: input image #1

Image2: input image #2

. (screen output) : signal to noise ratio / `Image1` (SNR)

. (screen output) : peak signal to noise ratio / `Image1` (PSNR)

. (screen output) : mean square error between Image1 and Image2 (MSE)

. (screen output) : maximal relative difference (MRD)

**Function Summary**

void fmse (Img1 , Img2 , Norm , PsnrFlg , SNR , PSNR , MSE , MRD )

Fimage Img1 , Img2 ;

int *Norm ;

char *PsnrFlg ;

double *SNR ;

double *PSNR ;

double *MSE ;

double *MRD ;

**Description**

*fmse* computes the maximal relative difference, mean square error, signal to noise ratio, and peak signal to noise ratio between two digitized images whose gray-level values are stored in the files *Image1* and *Image2*.

The maximal relative difference is given by

The mean square error is defined by

In maximal relative difference and mean square difference the two images have symetric roles. This is no longer the case in (peak) signal to noise ratio.
These quantities can be calculated for any two images, but are more meaningful if *f*_{1} is considered as an original image and *f*_{2} as an approximation to it. The signal to noise ratio and peak signal to noise ratio are defined as follows

The `-n`

option specifies that the two images are normalized to 0.0 mean and 1.0 variance before the computation of the quantities listed above.

Using the `-p`

option, you select the following alternative form to compute
the peak signal to noise ratio (it should be selected for 8-bits images only):

**See Also**

**Version 1.03**

Last Modification date : Thu Nov 29 20:23:56 2001

**Author**

Jean-Pierre D'Ales, Jacques Froment