Next: fnorm Up: Reference Previous: fmean   Contents   Index

#### fmse

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

MRD = 100×

where fi(x, y) is the gray-level value of pixel (x, y) in image i, i = 1, 2.

The mean square error is defined by

MSE =

where dx and dy are respectively the number of columns and the number of lines in the images.

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 f1 is considered as an original image and f2 as an approximation to it. The signal to noise ratio and peak signal to noise ratio are defined as follows

SNR = 10×log10

PSNR = 10×log10

where is the empirical variance of the original image.

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):

PSNR = 10×log10

.

Version 1.03

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

Author

Jean-Pierre D'Ales, Jacques Froment

Next: fnorm Up: Reference Previous: fmean   Contents   Index
mw 2004-05-05