Skip to content

Commit

Permalink
improve README
Browse files Browse the repository at this point in the history
  • Loading branch information
FreezyLemon committed Oct 16, 2022
1 parent a0be633 commit ffe40d3
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# denoiseMC - Motion-compensated denoising, based on MVTools

This script requires [MVTools](https://github.com/dubhater/vapoursynth-mvtools).

```python
def denoiseMC(clip, denoise_fn, radius: int = 2, search: int = 3, blksize: int = 16):
```

`denoise_fn` takes only one parameter, the input video clip. If `blksize` is 8 or higher, the motion vectors are recalculated at half `blksize` after the initial analysis.
## Parameters

`denoise_fn` is a function accepting one parameter (the video clip to denoise). Check the examples to understand how to use this parameter.

`radius` sets the temporal radius for motion compensation.

`blksize` sets the block size for MVTools' `Analyse` function. If blksize is 8 or larger, the motion vectors will be recalculated with `blksize/2` to get finer results.

`search` sets the search mode for MVTools' `Analyse` and `Recalculate` functions.

## Examples

Expand All @@ -16,6 +26,7 @@ from denoiseMC import denoiseMC
def denoise(clip):
return core.ttmpsm.TTempSmooth(clip, maxr=4)

# Make sure to set radius=4 so TTempSmooth can use maxr=4
denoised = denoiseMC(clip, radius=4, denoise_fn=denoise)
```

Expand All @@ -26,3 +37,7 @@ from denoiseMC import denoiseMC

denoised = denoiseMC(clip, lambda c: core.ttmpsm.TTempSmooth(c))
```

## How it works

This script creates a sequence of motion-compensated frames around each source frame, and then runs your denoising function on this sequence of frames. The motion-compensated frames are then discarded and only the (now denoised) source frame is returned.

0 comments on commit ffe40d3

Please sign in to comment.