![]() |
Image Quality Assessment (IQA) 1.1.2
A fast, accurate, and reliable C library for measuring image quality.
|
#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] |
| 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.
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.
| ref | Original reference image |
| cmp | Distorted image |
| w | Width of the images |
| h | Height of the images |
| k | The kernel used as the window function |
| mr | Optional map-reduce functions to use to calculate SSIM. Required if 'args' is not null. Ignored if 'args' is null. |
| args | Optional 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 |
const float g_gaussian_window[GAUSSIAN_LEN][GAUSSIAN_LEN] [static] |
{
{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},
}
const float g_square_window[SQUARE_LEN][SQUARE_LEN] [static] |
{
{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},
}