Skip to content

Commit

Permalink
add badge and example codes to README
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnychen94 committed Jun 3, 2019
1 parent ff04cca commit 576283b
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,43 @@
# ImageQualityIndexes

[![Build Status](https://travis-ci.org/JuliaImages/ImageQualityIndexes.jl.svg?branch=master)](https://travis-ci.org/JuliaImages/ImageQualityIndexes.jl)
[![Codecov](https://codecov.io/gh/JuliaImages/ImageQualityIndexes.jl/badge.svg?branch=master)](https://codecov.io/gh/JuliaImages/ImageQualityIndexes.jl)

ImageQualityIndexes provides the basic image quality assessment methods.

## Supported indexes

* `PSNR` -- Peak signal-to-noise ratio
* `SSIM` -- Structural similarity
### Full reference indexes

* `PSNR`/`psnr` -- Peak signal-to-noise ratio
* `SSIM`/`ssim` -- Structural similarity


## Basic usage

In this package, each index corresponds to a `ImageQualityIndex` type, there are three ways to assess the image quality:
The root type is `ImageQualityIndex`, each concrete index is supposed to be one of `FullReferenceIQI`, `ReducedReferenceIQI` and `NoReferenceIQI`.

There are three ways to assess the image quality:

* use the general protocol, e.g., `assess(PSNR(), x, ref)`. This reads as "**assess** the image quality of **x** using method **PSNR** with information **ref**"
* each index instance is itself a function, e.g., `PSNR()(x, ref)`
* for well-known indexes, there are also convenient name for it, e.g., `psnr(x, ref)`
* for well-known indexes, there are also convenient name for it for benchmark purpose.

For detailed usage of particular index, please check the docstring (e.g., `?PSNR`)

## Examples

```julia
using Images, TestImages
using ImageQualityIndexes

img = testimage("lena_gray_256") .|> float64
noisy_img = img .+ 0.1 .* randn(size(img))
ssim(noisy_img, img) # 0.3577
psnr(noisy_img, img) # 19.9941

kernel = ones(3, 3)./9 # mean filter
denoised_img = imfilter(noisy_img, kernel)
ssim(denoised_img, img) # 0.6529
psnr(denoised_img, img) # 26.0350
```

2 comments on commit 576283b

@johnnychen94
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/1158

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 576283b7634b1f38eecded5148d2684aa27f094c
git push origin v0.1.0

Please sign in to comment.