Skip to content

Commit

Permalink
0.2.7: ssim and vifp1
Browse files Browse the repository at this point in the history
  • Loading branch information
zvezdochiot committed Jan 8, 2023
1 parent c01cad3 commit 4447402
Show file tree
Hide file tree
Showing 10 changed files with 472 additions and 39 deletions.
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Includes metrics:

- MSE / MAX^2, MAX = 255
- PSNR
- [SSIM](https://github.com/rolinh/VQMT)
- [VIFP1](https://github.com/rolinh/VQMT)
- [SMALLFRY](https://github.com/dwbuiten/smallfry)
- [SHARPENBAD](https://github.com/ImageProcessing-ElectronicPublications/libsmallfry)
- [Correlation](https://github.com/ImageProcessing-ElectronicPublications/libsmallfry)
Expand All @@ -15,13 +17,15 @@ Includes metrics:

The value of MSE metrics is from 0.0 (minimum difference) to 1.0 (maximum difference).

The value of PSNR metrics is from 1.0 (maximum difference) to inf.
The value of PSNR metrics is from 0.0 (maximum difference) to inf.

The value of SHARPENBAD metrics is from 1.0 (minimum difference) to -1.0 (maximum difference).
The value of [SSIM](https://github.com/rolinh/VQMT) and [VIFP1](https://github.com/rolinh/VQMT) metrics is from 1.0 (minimum difference) to 0.0 (maximum difference).

The value of Correlation metrics is from 1.0 (minimum difference) to 0.0 (maximum difference).
The value of [SHARPENBAD](https://github.com/ImageProcessing-ElectronicPublications/libsmallfry) metrics is from 1.0 (minimum difference) to -1.0 (maximum difference).

The value of NHW metrics is from 0.0 (minimum difference) to 1.0 (maximum difference) ([origin project code](https://github.com/rcanut/NHW_Neatness_Metrics/issues/1)).
The value of [Correlation](https://github.com/ImageProcessing-ElectronicPublications/libsmallfry) metrics is from 1.0 (minimum difference) to 0.0 (maximum difference).

The value of [NHW metrics](https://github.com/rcanut/NHW_Neatness_Metrics/issues/1) is from 0.0 (minimum difference) to 1.0 (maximum difference).

## build

Expand Down Expand Up @@ -69,6 +73,7 @@ stbnhwmetrics ${IMAGE_ORIG_PATH} ${IMAGE_COMPARE_PATH} [metric.out.png]
- `metricspsnr.h` - metrics PSNR and MSE
- `metricsum.h` - ["Universal Scale" of metrics (UM)](https://github.com/ImageProcessing-ElectronicPublications/jpeg-recompress)
- `smallfry.h` - metrics [SMALLFRY, SHARPENBAD and Correlation](https://github.com/ImageProcessing-ElectronicPublications/libsmallfry)
- `ssim.h` - metrics [SSIM and VIFP1](https://github.com/rolinh/VQMT)
- `stb/` - [stb](https://github.com/nothings/stb.git)
- `stbimmetrics.c` - CLI program.
- `ycbcr.h` - [YCbCr color space](https://en.wikipedia.org/wiki/YCbCr).
Expand Down Expand Up @@ -128,14 +133,16 @@ Save png: lena.quant444.psnr.png

```

* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.mse.png) MSE: 0.013604, UM: -1.218735
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.psnr.png) PSNR: 18.663233, UM: -1.317894
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.smallfry.png) SMALLFRY: 83.753342, UM -0.653625
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.shbad.png) SHARPENBAD: -0.213132, UM: -0.575435
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.cor.png) Corelation: 0.953666, UM: -0.644979
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.nhw-n.png) NHW-N: 0.072673, UM: 0.144120
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.nhw-c.png) NHW-C: 0.145290, UM: -0.042954
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.nhw-r.png) NHW-R: 0.116387, UM: -0.109872
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.mse.png) MSE: 0.013604
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.psnr.png) PSNR: 18.663233
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.ssim.png) SSIM: 0.618509, UM: -0.239359
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.vifp1.png) VIFP1: 0.806863, UM: -
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.smallfry.png) SMALLFRY: 83.753342
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.shbad.png) SHARPENBAD: -0.213132
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.cor.png) Corelation: 0.953666
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.nhw-n.png) NHW-N: 0.072673
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.nhw-c.png) NHW-C: 0.145290
* ![metric](https://raw.githubusercontent.com/ImageProcessing-ElectronicPublications/stb-image-metrics-demo/main/images/lena.quant444.nhw-r.png) NHW-R: 0.116387

---

Expand Down
10 changes: 8 additions & 2 deletions man/man1/stbimmetrics.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "StbImMetrics" 1 0.2.5 "8 Jan 2023" "User Manual"
.TH "StbImMetrics" 1 0.2.7 "9 Jan 2023" "User Manual"

.SH NAME
stbimmetrics
Expand All @@ -9,6 +9,8 @@ This utility compares two graphics files based on metrics.
Includes metrics:
- MSE / MAX^2, MAX = 255
- PSNR
- SSIM
- VIFP1
- SMALLFRY
- SHARPENBAD
- correlation
Expand All @@ -18,7 +20,9 @@ Includes metrics:

The value of MSE metrics is from 0.0 (minimum difference) to 1.0 (maximum difference).

The value of PSNR metrics is from 1.0 (maximum difference) to inf.
The value of PSNR metrics is from 0.0 (maximum difference) to inf.

The value of SSIM and VIPF1 metrics is from 1.0 (minimum difference) to 0.0 (maximum difference).

The value of SHARPENBAD metrics is from 1.0 (minimum difference) to -1.0 (maximum difference).

Expand All @@ -35,6 +39,8 @@ stbimmetrics [options] ${IMAGE_ORIG_PATH} ${IMAGE_COMPARE_PATH} [metric.out.png]
metric (default psnr):
mse - MSE / MAX^2, MAX = 255
psnr - PSNR
ssim - SSIM
vifp1 - VIFP 1 layer
smallfry - SMALLFRY
shbad - SHARPENBAD
cor - correlation
Expand Down
6 changes: 4 additions & 2 deletions src/dependencies.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
#define METRICS_UM_IMPLEMENTATION
#define YCBCR_IMPLEMENTATION
#define METRICS_PSNR_IMPLEMENTATION
#define METRICS_NHW_IMPLEMENTATION
#define METRICS_SSIM_IMPLEMENTATION
#define METRICS_SMALLFRY_IMPLEMENTATION
#define METRICS_NHW_IMPLEMENTATION
#include "stb/stb_image.h"
#include "stb/stb_image_write.h"
#include "metricsum.h"
#include "ycbcr.h"
#include "metricspsnr.h"
#include "metricsnhw.h"
#include "ssim.h"
#include "smallfry.h"
#include "metricsnhw.h"
4 changes: 2 additions & 2 deletions src/metricsnhw.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
****************************************************************************
* Metrics NHW *
* file: metricsnhw.h *
* version: 0.2.6 *
* version: 0.2.7 *
* *
****************************************************************************
***************************************************************************/
Expand All @@ -18,7 +18,7 @@
#ifndef __METRICS_NHW__H
#define __METRICS_NHW__H

#define METRICSNHW_VERSION "0.2.6"
#define METRICSNHW_VERSION "0.2.7"

#ifdef METRICS_STATIC
#define METRICSAPI static
Expand Down
4 changes: 2 additions & 2 deletions src/metricspsnr.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
****************************************************************************
* Metrics PSNR *
* file: metricspsnr.h *
* version: 0.2.6 *
* version: 0.2.7 *
* *
****************************************************************************
***************************************************************************/
Expand All @@ -14,7 +14,7 @@
#ifndef __METRICS_PSNR__H
#define __METRICS_PSNR__H

#define METRICS_PSNR_VERSION "0.2.6"
#define METRICS_PSNR_VERSION "0.2.7"

#ifdef METRICS_STATIC
#define METRICSAPI static
Expand Down
4 changes: 2 additions & 2 deletions src/metricsum.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
****************************************************************************
* Metrics UM *
* file: metricsum.h *
* version: 0.2.6 *
* version: 0.2.7 *
* *
****************************************************************************
***************************************************************************/
Expand All @@ -15,7 +15,7 @@
#ifndef __METRICS_UM__H
#define __METRICS_UM__H

#define METRICS_VERSION "0.2.6"
#define METRICS_VERSION "0.2.7"

#ifdef METRICS_STATIC
#define METRICSAPI static
Expand Down
4 changes: 2 additions & 2 deletions src/smallfry.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
****************************************************************************
* Metrics PSNR *
* file: metricspsnr.h *
* version: 0.2.6 *
* version: 0.2.7 *
* *
****************************************************************************
***************************************************************************/
Expand All @@ -31,7 +31,7 @@
#ifndef __METRICS_SMALLFRY__H
#define __METRICS_SMALLFRY__H

#define METRICS_SMALLFRY_VERSION "0.2.6"
#define METRICS_SMALLFRY_VERSION "0.2.7"

#ifdef METRICS_STATIC
#define METRICSAPI static
Expand Down
Loading

0 comments on commit 4447402

Please sign in to comment.