Kiyamou / VapourSynth-DehazingCE

Dehazing Plugin Based on Contrast Enhancement for VapourSynth
Other
11 stars 1 forks source link
dehaze

VapourSynth-DehazingCE

Build Status

DehazingCE is a dehazing plugin for VapourSynth, based on contrast enhancement.

Original paper: Optimized contrast enhancement for real-time image and video dehazing

Still in development, support 8-16 bit RGB.

Usage

core.dhce.Dehazing(clip src[, clip ref, float trans, float gamma, int air_size, int trans_size, int guide_size, bool post, float lamda])

Usage

Recommended to set small size ref clip.

src = ...
ref = core.resize.Spline36(src, 320, 240)
res = core.dhce.DehazingCE(src, ref, trans=..., gamma=..., ...)

Example

Before dehazing After dehazing

The first image is from original paper. (Dehazing parameters: ref size: 320 * 240, trans=0.35, gamma=1/0.65)

The second image is from Wikipedia. (Dehazing parameters: ref size: same with input, trans=0.3, gamma=1/0.7)

Build

Windows

Default VapourSynth include path is C:/Program Files/VapourSynth/sdk/include, if not, set with -DVAPOURSYNTH_INCLUDE_DIR.

mkdir build && cd build
cmake -G "NMake Makefiles" ..
cmake --build .

Linux

Default VapourSynth include path is /usr/local/include, if not, set with -DVAPOURSYNTH_INCLUDE_DIR.

mkdir build && cd build
cmake ..
cmake --build .

Windows and Linux using Github Actions

1.Fork this repository.

2.Enable Github Actions on your fork: Settings tab -> Actions -> General -> Allow all actions and reusable workflows -> Save button.

3.Edit (if necessary) the file .github/workflows/CI.yml on your fork modifying the environment variable VapourSynth version:

env:
  VAPOURSYNTH_VERSION: <SET_YOUR_VERSION>

4.Go to the GitHub Actions tab on your fork, select CI workflow and press the Run workflow button (if you modified the .github/workflows/CI.yml file, a workflow will be already running and no need to run a new one).

When the workflow is completed you will be able to download the artifacts generated (Windows and Linux versions) from the run.

Download Nightly Builds

GitHub Actions Artifacts ONLY can be downloaded by GitHub logged users.

Nightly builds are built automatically by GitHub Actions (GitHub's integrated CI/CD tool) every time a new commit is pushed to the master branch or a pull request is created.

To download the latest nightly build, go to the GitHub Actions tab, enter the last run of workflow CI, and download the artifacts generated (Windows and Linux versions) from the run.

License

License is from original source code.