KNLMeansCL
From Avisynth wiki
(Difference between revisions)
Raffriff42 (Talk | contribs) m (added category) |
(KNLMeansCL: add documentation) |
||
Line 1: | Line 1: | ||
− | + | {{FilterCat6|External_filters|Plugins|Plugins_x64|Denoisers|Spatial-Temporal Denoisers|Deep_color_tools}} | |
− | {{ | + | {{Filter3 |
+ | |[https://github.com/Khanattila Khanattila] | ||
+ | |v1.1.1 | ||
+ | | | ||
+ | 3=[https://github.com/Khanattila/KNLMeansCL/releases KNLMeansCL-v1.1.1.zip] | ||
+ | |4=Spatial-Temporal Denoisers | ||
+ | |5=[http://www.gnu.org/licenses/gpl-3.0.txt GPLv3] | ||
+ | |6=[http://forum.doom9.org/showthread.php?t=171379 Doom9 Thread] | ||
+ | }} | ||
+ | |||
+ | <br> | ||
+ | == Description == | ||
+ | KNLMeansCL is an optimized OpenCL implementation of the Non-local means de-noising algorithm. The NLMeans filter, originally proposed by Buades et al., is a very popular filter for the removal of white Gaussian noise, due to its simplicity and excellent performance. The strength of this algorithm is to exploit the repetitive character of the image in order to de-noise the image unlike conventional de-noising algorithms, which typically operate in a local neighbourhood. | ||
+ | |||
+ | <br> | ||
+ | |||
+ | == Requirements == | ||
+ | * [x86]: [[AviSynth+]] or [http://sourceforge.net/projects/avisynth2/ AviSynth 2.6] | ||
+ | * [x64]: [[AviSynth+]] | ||
+ | * Supported color formats: [[RGB32]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]] | ||
+ | ** AviSynth+: all planar YUV formats 8/10/12/16bit and float are supported. Also [[RGB64]] is supported | ||
+ | <br> | ||
+ | * Microsoft VisualC++ Redistributable Package 2015 | ||
+ | * Compatible CPU or GPU, see requirements here: https://github.com/Khanattila/KNLMeansCL/wiki/Requirements | ||
+ | |||
+ | <br> | ||
+ | == [[Script variables|Syntax and Parameters]] == | ||
+ | :{{Template:FuncDef|KNLMeansCL (clip, int "d", int "a", int "s", float "h", string "channels", int "wmode", float "wref", clip "rclip", string "device_type", int "device_id", int "ocl_x", int "ocl_y", int "ocl_r", bool "stacked", bool "info")}} | ||
+ | <br> | ||
+ | ::{{Par2| |clip| }} | ||
+ | :::Input clip; 8192x8192 is the highest resolution supported. | ||
+ | <br> | ||
+ | ::{{Par2|d|int|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). | ||
+ | <br> | ||
+ | ::{{Par2|a|int|2}} | ||
+ | :::Set the radius of the search window. a=0 uses 1 pixel, while a=1 uses 9 pixels and so 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. | ||
+ | <br> | ||
+ | ::{{Par2|s|int|4}} | ||
+ | :::Set the radius of the similarity neighbourhood window. The impact on performance is low, therefore it depends on the nature of the noise. Similarity neighborhood size = (2 * s + 1)^2. | ||
+ | <br> | ||
+ | ::{{Par2|h|float|1.2}} | ||
+ | :::Controls the strength of the filtering. Larger values will remove more noise. | ||
+ | <br> | ||
+ | ::{{Par2|channels|string|"auto"}} | ||
+ | :::Set the colour channels to be denoised. Possible values are <code>"YUV", "Y", "UV" or "RGB"</code>, depending on the source colour format. By default, "Y" is denoised if colour space is YUV, otherwise "RGB". | ||
+ | <br> | ||
+ | ====Advanced==== | ||
+ | ::{{Par2|wmode|int|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 neighbourhoods (the weight is 0 as soon as a given threshold is exceeded). | ||
+ | :::*3 : Modified Bisquare weighting function to be even more robust. | ||
+ | <br> | ||
+ | ::{{Par2|wref|float|1.0}} | ||
+ | :::Amount of original pixel to contribute to the filter output, relative to the weight of the most similar pixel found. | ||
+ | <br> | ||
+ | ::{{Par2|rclip|clip| }} | ||
+ | :::Extra reference clip option to do weighting calculation. | ||
+ | <br> | ||
+ | ====OpenCL==== | ||
+ | ::{{Par2|device_type|string|"auto"}} | ||
+ | :::*<code>"accelerator"</code> : Dedicated OpenCL accelerators. | ||
+ | :::*<code>"cpu"</code> : An OpenCL device that is the host processor. | ||
+ | :::*<code>"gpu"</code> : An OpenCL device that is a GPU. | ||
+ | :::*<code>"auto"</code> : "accelerator" -> "gpu" -> "cpu". | ||
+ | <br> | ||
+ | ::{{Par2|device_id|int|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. | ||
+ | <br> | ||
+ | ::{{Par2|ocl_x|int|0}} | ||
+ | ::{{Par2|ocl_y|int|0}} | ||
+ | ::{{Par2|ocl_r|int|0}} | ||
+ | :::They should not be changed, unless you know what you are doing. | ||
+ | :::*'ocl_x' and 'olc_y' are the local work group size of the separable convolution kernel. | ||
+ | :::*'olc_r' is the number of processed pixel for work-item. | ||
+ | <br> | ||
+ | ====Miscellaneous==== | ||
+ | ::{{Par2|stacked|bool|false}} | ||
+ | :::AviSynth hack. Set 16-bit stacked input and output clip. See [[Stack16]] for more info. | ||
+ | :::AviSynth+ supports native high bit depth; this hack is only for AviSynth 2.6. | ||
+ | <br> | ||
+ | ::{{Par2|info|bool|false}} | ||
+ | :::Display info on the screen. It requires YUV colour space. | ||
+ | <br> | ||
+ | == Examples == | ||
+ | KNLMeansCL with all default settings: | ||
+ | [[AviSource]]("Blah.avi") | ||
+ | KNLMeansCL() | ||
+ | |||
+ | <br> | ||
+ | == Changelog == | ||
+ | See https://github.com/Khanattila/KNLMeansCL/blob/master/CHANGELOG | ||
+ | |||
+ | <br> | ||
+ | == External Links == | ||
+ | *[https://github.com/Khanattila/KNLMeansCL GitHub] - Source code repository. | ||
+ | <br> | ||
+ | <br> | ||
+ | ----------------------------------------------- | ||
+ | '''Back to [[External_filters#Denoisers|External Filters]] ←''' |
Revision as of 17:51, 11 April 2020
Abstract | |
---|---|
Author | Khanattila |
Version | v1.1.1 |
Download | KNLMeansCL-v1.1.1.zip |
Category | Spatial-Temporal Denoisers |
License | GPLv3 |
Discussion | Doom9 Thread |
Contents |
Description
KNLMeansCL is an optimized OpenCL implementation of the Non-local means de-noising algorithm. The NLMeans filter, originally proposed by Buades et al., is a very popular filter for the removal of white Gaussian noise, due to its simplicity and excellent performance. The strength of this algorithm is to exploit the repetitive character of the image in order to de-noise the image unlike conventional de-noising algorithms, which typically operate in a local neighbourhood.
Requirements
- [x86]: AviSynth+ or AviSynth 2.6
- [x64]: AviSynth+
- Supported color formats: RGB32, Y8, YV12, YV16, YV24, YV411
- AviSynth+: all planar YUV formats 8/10/12/16bit and float are supported. Also RGB64 is supported
- Microsoft VisualC++ Redistributable Package 2015
- Compatible CPU or GPU, see requirements here: https://github.com/Khanattila/KNLMeansCL/wiki/Requirements
Syntax and Parameters
- KNLMeansCL (clip, int "d", int "a", int "s", float "h", string "channels", int "wmode", float "wref", clip "rclip", string "device_type", int "device_id", int "ocl_x", int "ocl_y", int "ocl_r", bool "stacked", bool "info")
- clip =
- Input clip; 8192x8192 is the highest resolution supported.
- clip =
- int d = 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 d = 1
- int a = 2
- Set the radius of the search window. a=0 uses 1 pixel, while a=1 uses 9 pixels and so on. Usually, larger it the better the result of the denoising. Spatial size = (2 * a + 1)^2.
- int a = 2
- Tip: total search window size = temporal size * spatial size.
- int s = 4
- Set the radius of the similarity neighbourhood window. The impact on performance is low, therefore it depends on the nature of the noise. Similarity neighborhood size = (2 * s + 1)^2.
- int s = 4
- float h = 1.2
- Controls the strength of the filtering. Larger values will remove more noise.
- float h = 1.2
- string channels = "auto"
- Set the colour channels to be denoised. Possible values are
"YUV", "Y", "UV" or "RGB"
, depending on the source colour format. By default, "Y" is denoised if colour space is YUV, otherwise "RGB".
- Set the colour channels to be denoised. Possible values are
- string channels = "auto"
Advanced
- int wmode = 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 neighbourhoods (the weight is 0 as soon as a given threshold is exceeded).
- 3 : Modified Bisquare weighting function to be even more robust.
- int wmode = 0
- float wref = 1.0
- Amount of original pixel to contribute to the filter output, relative to the weight of the most similar pixel found.
- float wref = 1.0
- clip rclip =
- Extra reference clip option to do weighting calculation.
- clip rclip =
OpenCL
- string device_type = "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".
- string device_type = "auto"
- int device_id = 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.
- int device_id = 0
- int ocl_x = 0
- int ocl_y = 0
- int ocl_r = 0
- They should not be changed, unless you know what you are doing.
- 'ocl_x' and 'olc_y' are the local work group size of the separable convolution kernel.
- 'olc_r' is the number of processed pixel for work-item.
- They should not be changed, unless you know what you are doing.
- int ocl_x = 0
Miscellaneous
- bool stacked = false
- AviSynth hack. Set 16-bit stacked input and output clip. See Stack16 for more info.
- AviSynth+ supports native high bit depth; this hack is only for AviSynth 2.6.
- bool stacked = false
- bool info = false
- Display info on the screen. It requires YUV colour space.
- bool info = false
Examples
KNLMeansCL with all default settings:
AviSource("Blah.avi") KNLMeansCL()
Changelog
See https://github.com/Khanattila/KNLMeansCL/blob/master/CHANGELOG
External Links
- GitHub - Source code repository.
Back to External Filters ←