Skip to content
Edoardo Brunetti edited this page Dec 14, 2016 · 32 revisions

Syntax

KNLMeansCL(clip, int d, int a, int s, float h, string channels, int wmode, float wref, clip rclip, string device_type, int device_id, bool lsb_inout, bool info)

knlm.KNLMeansCL(clip clip, int d, int a, int s, float h, string channels, int wmode, float wref, clip rclip, string device_type, int device_id, bool info)

Basic

clip clip
Video source.

int d [default: 1]
Set the number of past and future frame that the filter uses for denoising the current frame. d=0 uses 1 frame, while d=1 uses 3 frames and so on. Usually, larger it the better the result of the denoising. Temporal size = (2 * d + 1).

int a [default: 2]
Set the radius of the search window. a=0 uses 1 pixel, while a=1 uses 9 pixels and son on. Usually, larger it the better the result of the denoising. Spatial size = (2 * a + 1)^2.

Tip: total search window size = temporal size * spatial size.

int s [default: 4]
Set the radius of the similarity neighborhood window. The impact on performance is low, therefore it depends on the nature of the noise. Similarity neighborhood size = (2 * s + 1)^2.

float h [default: 1.2]
Controls the strength of the filtering. Larger values will remove more noise.

bool cmode [default: false]
Use color distance instead of grey intensities. Normally KNLMeansCL processes only Luma and copy Chroma if present. If cmode is true KNLMeansCL processes Luma and Chroma together. If color space is RGB, cmode is always true.

string channels [default: "auto"]
Set the color channels to be denoised. Possible values are "YUV", "Y", "UV" or "RGB", depending on the source color format. By default, "Y" is denoised if color space is YUV, otherwise "RGB".

Advanced

int wmode [default: 1]
0 := Cauchy weighting function has a very slow decay. It assigns larger weights to dissimilar blocks than the Leclerc robust function, which will eventually lead to over-smoothing.
1 := Welsch weighting function has a faster decay, but still assigns positive weights to dissimilar blocks. Original Non-local means denoising weighting function.
2 := Bisquare weighting function use a soft threshold to compare neighborhoods (the weight is 0 as soon as a given threshold is exceeded).

int wmode [default: 0]
0 := Welsch weighting function has a faster decay, but still assigns positive weights to dissimilar blocks. Original Non-local means denoising weighting function.
1 := Modified Bisquare weighting function to be less robust.
2 := Bisquare weighting function use a soft threshold to compare neighborhoods (the weight is 0 as soon as a given threshold is exceeded).
3 := Modified Bisquare weighting function to be even more robust.

float wref [default: 1.0]
Amount of original pixel to contribute to the filter output, relative to the weight of the most similar pixel found.

clip rclip [default: not set]
Extra reference clip option to do weighting calculation.

OpenCL

string device_type [default: "auto"]
"accelerator" := Dedicated OpenCL accelerators.
"cpu" := An OpenCL device that is the host processor.
"gpu" := An OpenCL device that is a GPU.
"auto" := "accelerator" -> "gpu" -> "cpu".

int device_id [default: 0]
The 'device_id'+1º device of type 'device_type' in the system. Example: [device_type = "GPU", device_id = 1] return the second GPU in the system.

Miscellaneous

bool lsb_inout [default: false]
AviSynth hack. Set 16-bit input and output clip.

bool info [default: false]
Display info on screen. It requires YUV color space.

Clone this wiki locally