![]() |
Image Quality Assessment (IQA) 1.1.2
A fast, accurate, and reliable C library for measuring image quality.
|
#include "iqa.h"#include "ssim.h"#include "decimate.h"#include <math.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | _context |
Defines | |
| #define | SCALES 5 |
| #define | LPF_LEN 9 |
Functions | |
| int | _ms_ssim_map (const struct _ssim_int *si, void *ctx) |
| float | _ms_ssim_reduce (int w, int h, void *ctx) |
| void | _free_buffers (float **buf, int scales) |
| int | _alloc_buffers (float **buf, int w, int h, int scales) |
| float | iqa_ms_ssim (const unsigned char *ref, const unsigned char *cmp, int w, int h, int stride, const struct iqa_ms_ssim_args *args) |
Variables | |
| static const float | g_lpf [LPF_LEN][LPF_LEN] |
| static float | g_alphas [] = { 0.0000f, 0.0000f, 0.0000f, 0.0000f, 0.1333f } |
| static float | g_betas [] = { 0.0448f, 0.2856f, 0.3001f, 0.2363f, 0.1333f } |
| static float | g_gammas [] = { 0.0448f, 0.2856f, 0.3001f, 0.2363f, 0.1333f } |
| int _alloc_buffers | ( | float ** | buf, |
| int | w, | ||
| int | h, | ||
| int | scales | ||
| ) |
| int _ms_ssim_map | ( | const struct _ssim_int * | si, |
| void * | ctx | ||
| ) |
| float iqa_ms_ssim | ( | const unsigned char * | ref, |
| const unsigned char * | cmp, | ||
| int | w, | ||
| int | h, | ||
| int | stride, | ||
| const struct iqa_ms_ssim_args * | args | ||
| ) |
Calculates the Multi-Scale Structural SIMilarity between 2 equal-sized 8-bit images. The default algorithm is MS-SSIM* proposed by Rouse/Hemami 2008.
See https://ece.uwaterloo.ca/~z70wang/publications/msssim.pdf and http://foulard.ece.cornell.edu/publications/dmr_hvei2008_paper.pdf
| ref | Original reference image |
| cmp | Distorted image |
| w | Width of the images. |
| h | Height of the images. |
| stride | The length (in bytes) of each horizontal line in the image. This may be different from the image width. |
| args | Optional MS-SSIM arguments for fine control of the algorithm. 0 for defaults. Defaults are wang=0, scales=5, gaussian=1. |
float g_alphas[] = { 0.0000f, 0.0000f, 0.0000f, 0.0000f, 0.1333f } [static] |
float g_betas[] = { 0.0448f, 0.2856f, 0.3001f, 0.2363f, 0.1333f } [static] |
float g_gammas[] = { 0.0448f, 0.2856f, 0.3001f, 0.2363f, 0.1333f } [static] |
const float g_lpf[LPF_LEN][LPF_LEN] [static] |
{
{ 0.000714f,-0.000450f,-0.002090f, 0.007132f, 0.016114f, 0.007132f,-0.002090f,-0.000450f, 0.000714f},
{-0.000450f, 0.000283f, 0.001316f,-0.004490f,-0.010146f,-0.004490f, 0.001316f, 0.000283f,-0.000450f},
{-0.002090f, 0.001316f, 0.006115f,-0.020867f,-0.047149f,-0.020867f, 0.006115f, 0.001316f,-0.002090f},
{ 0.007132f,-0.004490f,-0.020867f, 0.071207f, 0.160885f, 0.071207f,-0.020867f,-0.004490f, 0.007132f},
{ 0.016114f,-0.010146f,-0.047149f, 0.160885f, 0.363505f, 0.160885f,-0.047149f,-0.010146f, 0.016114f},
{ 0.007132f,-0.004490f,-0.020867f, 0.071207f, 0.160885f, 0.071207f,-0.020867f,-0.004490f, 0.007132f},
{-0.002090f, 0.001316f, 0.006115f,-0.020867f,-0.047149f,-0.020867f, 0.006115f, 0.001316f,-0.002090f},
{-0.000450f, 0.000283f, 0.001316f,-0.004490f,-0.010146f,-0.004490f, 0.001316f, 0.000283f,-0.000450f},
{ 0.000714f,-0.000450f,-0.002090f, 0.007132f, 0.016114f, 0.007132f,-0.002090f,-0.000450f, 0.000714f},
}