Linear Methods for Image Interpolation
Data Structures | Defines | Enumerations | Functions
imdiff.c File Reference

Image difference calculator program. More...

#include <math.h>
#include <string.h>
#include <ctype.h>
#include "imageio.h"
#include "conv.h"
Include dependency graph for imdiff.c:

Go to the source code of this file.

Data Structures

struct  programparams
 struct of program parameters More...

Defines

#define DISPLAY_SCALING   255
 Display metrics for intensities in the range [0,DISPLAY_SCALING].
#define MSSIM_K1   0.01
#define MSSIM_K2   0.03
#define MSSIM_C1   (MSSIM_K1*MSSIM_K1)
#define MSSIM_C2   (MSSIM_K2*MSSIM_K2)

Enumerations

enum  metric {
  DEFAULT_METRICS, MAX_METRIC, MSE_METRIC, RMSE_METRIC,
  PSNR_METRIC, MSSIM_METRIC
}
 enum of possible metrics More...

Functions

void MakeDifferenceImage (float *A, const float *B, int Width, int Height, int NumChannels, float D)
 Make a difference image, Diff = (A - B)/D + 0.5.
void BasicMetrics (float *Max, float *Mse, const float *A, const float *B, int Width, int Height, int NumChannels, int Pad)
 Compute the maximum absolute difference and the MSE.
float ComputeMssim (const float *A, const float *B, int Width, int Height, int NumChannels, int Pad)
 Compute the Mean Structural SIMilarity (MSSIM) index.
void PrintHelpMessage ()
 Print program usage help message.
int main (int argc, char *argv[])

Detailed Description

Image difference calculator program.

Author:
Pascal Getreuer <getreuer@gmail.com>

This file implements the imdiff program, a command line tool for comparing two images with various image quality metrics. The possible metrics are

The program can also create a difference image, computed as D_n = 255/20 (A_n - B_n) + 255/2 where values outside of the range [0,255] are saturated.

Image alpha channels are ignored. Also beware that although the program can read 16-bit PNG images (provided LIBPNG_SUPPORT is enabled), the image data is quantized internally to 8 bits.

Copyright (c) 2010-2011, Pascal Getreuer All rights reserved.

This program is free software: you can use, modify and/or redistribute it under the terms of the simplified BSD License. You should have received a copy of this license along this program. If not, see <http://www.opensource.org/licenses/bsd-license.html>.

Definition in file imdiff.c.


Define Documentation

#define DISPLAY_SCALING   255

Display metrics for intensities in the range [0,DISPLAY_SCALING].

Definition at line 42 of file imdiff.c.

#define MSSIM_C1   (MSSIM_K1*MSSIM_K1)

Definition at line 47 of file imdiff.c.

#define MSSIM_C2   (MSSIM_K2*MSSIM_K2)

Definition at line 48 of file imdiff.c.

#define MSSIM_K1   0.01

Definition at line 44 of file imdiff.c.

#define MSSIM_K2   0.03

Definition at line 45 of file imdiff.c.


Enumeration Type Documentation

enum metric

enum of possible metrics

Enumerator:
DEFAULT_METRICS 
MAX_METRIC 
MSE_METRIC 
RMSE_METRIC 
PSNR_METRIC 
MSSIM_METRIC 

Definition at line 52 of file imdiff.c.


Function Documentation

void BasicMetrics ( float *  Max,
float *  Mse,
const float *  A,
const float *  B,
int  Width,
int  Height,
int  NumChannels,
int  Pad 
)

Compute the maximum absolute difference and the MSE.

Definition at line 292 of file imdiff.c.

Here is the caller graph for this function:

float ComputeMssim ( const float *  A,
const float *  B,
int  Width,
int  Height,
int  NumChannels,
int  Pad 
)

Compute the Mean Structural SIMilarity (MSSIM) index.

Definition at line 319 of file imdiff.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)

Definition at line 120 of file imdiff.c.

Here is the call graph for this function:

void MakeDifferenceImage ( float *  A,
const float *  B,
int  Width,
int  Height,
int  NumChannels,
float  D 
)

Make a difference image, Diff = (A - B)/D + 0.5.

Definition at line 278 of file imdiff.c.

Here is the caller graph for this function:

void PrintHelpMessage ( )

Print program usage help message.

Definition at line 88 of file imdiff.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines