Image Quality Assessment (IQA) 1.1.2
A fast, accurate, and reliable C library for measuring image quality.
Data Structures | Defines | Typedefs | Functions | Variables
include/ssim.h File Reference
#include "convolve.h"

Go to the source code of this file.

Data Structures

struct  _ssim_int
struct  _map_reduce

Defines

#define GAUSSIAN_LEN   11
#define SQUARE_LEN   8

Typedefs

typedef int(* _map )(const struct _ssim_int *, void *)
typedef float(* _reduce )(int, int, void *)

Functions

float _iqa_ssim (float *ref, float *cmp, int w, int h, const struct _kernel *k, const struct _map_reduce *mr, const struct iqa_ssim_args *args)

Variables

static const float g_gaussian_window [GAUSSIAN_LEN][GAUSSIAN_LEN]
static const float g_square_window [SQUARE_LEN][SQUARE_LEN]

Define Documentation

#define GAUSSIAN_LEN   11

Definition at line 44 of file ssim.h.

#define SQUARE_LEN   8

Definition at line 63 of file ssim.h.


Typedef Documentation

typedef int(* _map)(const struct _ssim_int *, void *)

Definition at line 83 of file ssim.h.

typedef float(* _reduce)(int, int, void *)

Definition at line 84 of file ssim.h.


Function Documentation

float _iqa_ssim ( float *  ref,
float *  cmp,
int  w,
int  h,
const struct _kernel k,
const struct _map_reduce mr,
const struct iqa_ssim_args args 
)

Private method that calculates the SSIM value on a pre-processed image.

The input images must have stride==width. This method does not scale.

Note:
Image buffers are modified.

Map-reduce is used for doing the final SSIM calculation. The map function is called for every pixel, and the reduce is called at the end. The context is caller-defined and *not* modified by this method.

Parameters:
refOriginal reference image
cmpDistorted image
wWidth of the images
hHeight of the images
kThe kernel used as the window function
mrOptional map-reduce functions to use to calculate SSIM. Required if 'args' is not null. Ignored if 'args' is null.
argsOptional SSIM arguments for fine control of the algorithm. 0 for defaults. Defaults are a=b=g=1.0, L=255, K1=0.01, K2=0.03
Returns:
The mean SSIM over the entire image (MSSIM), or NAN if error.

Definition at line 142 of file ssim.c.


Variable Documentation

const float g_gaussian_window[GAUSSIAN_LEN][GAUSSIAN_LEN] [static]
Initial value:
 {
    {0.000001f, 0.000008f, 0.000037f, 0.000112f, 0.000219f, 0.000274f, 0.000219f, 0.000112f, 0.000037f, 0.000008f, 0.000001f},
    {0.000008f, 0.000058f, 0.000274f, 0.000831f, 0.001619f, 0.002021f, 0.001619f, 0.000831f, 0.000274f, 0.000058f, 0.000008f},
    {0.000037f, 0.000274f, 0.001296f, 0.003937f, 0.007668f, 0.009577f, 0.007668f, 0.003937f, 0.001296f, 0.000274f, 0.000037f},
    {0.000112f, 0.000831f, 0.003937f, 0.011960f, 0.023294f, 0.029091f, 0.023294f, 0.011960f, 0.003937f, 0.000831f, 0.000112f},
    {0.000219f, 0.001619f, 0.007668f, 0.023294f, 0.045371f, 0.056662f, 0.045371f, 0.023294f, 0.007668f, 0.001619f, 0.000219f},
    {0.000274f, 0.002021f, 0.009577f, 0.029091f, 0.056662f, 0.070762f, 0.056662f, 0.029091f, 0.009577f, 0.002021f, 0.000274f},
    {0.000219f, 0.001619f, 0.007668f, 0.023294f, 0.045371f, 0.056662f, 0.045371f, 0.023294f, 0.007668f, 0.001619f, 0.000219f},
    {0.000112f, 0.000831f, 0.003937f, 0.011960f, 0.023294f, 0.029091f, 0.023294f, 0.011960f, 0.003937f, 0.000831f, 0.000112f},
    {0.000037f, 0.000274f, 0.001296f, 0.003937f, 0.007668f, 0.009577f, 0.007668f, 0.003937f, 0.001296f, 0.000274f, 0.000037f},
    {0.000008f, 0.000058f, 0.000274f, 0.000831f, 0.001619f, 0.002021f, 0.001619f, 0.000831f, 0.000274f, 0.000058f, 0.000008f},
    {0.000001f, 0.000008f, 0.000037f, 0.000112f, 0.000219f, 0.000274f, 0.000219f, 0.000112f, 0.000037f, 0.000008f, 0.000001f},
}

Definition at line 45 of file ssim.h.

const float g_square_window[SQUARE_LEN][SQUARE_LEN] [static]
Initial value:
 {
    {0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f},
    {0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f},
    {0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f},
    {0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f},
    {0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f},
    {0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f},
    {0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f},
    {0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f, 0.015625f},
}

Definition at line 64 of file ssim.h.

 All Data Structures Files Functions Variables Typedefs Defines


Copyright (c) 2011 by Tom Distler