DeNoise

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with " {{FilterCat4|External_filters|Plugins|<!-- category -->TODO|<!-- category -->TODO}} {{Filter3 |1=<!-- author -->[http://www.avisynth.nl/users/vcmohan/ V.C.Mohan] |2=<!-- ver...")
 
m (Description)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
+
{{FilterCat|External_filters|Plugins|Denoisers}}
{{FilterCat4|External_filters|Plugins|<!-- category -->TODO|<!-- category -->TODO}}
+
 
+
 
{{Filter3
 
{{Filter3
|1=<!-- author -->[http://www.avisynth.nl/users/vcmohan/ V.C.Mohan]
+
|1={{Author/vcmohan}}
|2=<!-- version -->1.0.0.0.0
+
|2=22 Nov 2015
|3=<!-- download 2.5.8 version URL -->2.5.8 version[http://www.avisynth.nl/users/vcmohan/DeNoise/DeNoise.zip DeNoise] 2.6.0 alpha5 version URL -->[http://www.avisynth.nl/users/vcmohan/DeNoise/DeNoise_2_6.zip DeNoise]
+
|3= [http://www.avisynth.nl/users/vcmohan/DeNoise/DeNoise_2_6.zip DeNoise_2_6.zip]
|4=<!-- category -->External filters
+
|4=External filters
|5=<!-- license -->[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
+
|5=<!-- license -->[https://www.gnu.org/licenses/gpl-3.0.en.html GPLv3]
|6=<!-- discussion URL -->[http://forum.doom9.org/showthread.php?p=712586#post712586 announced DeNoise plugin]}}
+
|6=[https://forum.doom9.org/showthread.php?p=712586#post712586 Doom9 Forum]}}
  
 
<br>
 
<br>
 
== Description ==
 
== Description ==
<!-- a one-sentence description -->
+
This is an adaptive local noise reduction filter. It uses global variance of the noise, local mean and local variance in a moving grid of specified size. It tries to preserve edges as closely as possible.
Using Variance of a given window, minimizes noise and tries to preserve edges and a full description is at  [http://www.avisynth.nl/users/vcmohan/DeNoise/DeNoise.html click me].
+
 
<br>
+
 
 +
*Official documentation: http://www.avisynth.nl/users/vcmohan/DeNoise/DeNoise.html
 +
*For AviSynth+ see [[modPlus]], includes high bit depth colorspace support and 64-bit.
 
<br>
 
<br>
 +
 
== Requirements ==
 
== Requirements ==
* <!-- Avisynth version -->AviSynth 2.5.8 or [http://sourceforge.net/projects/avisynth2/files/AviSynth_Alpha_Releases/ 2.6.0 Alpha 5 or greater]
+
* [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6]
* <!-- source video: progressive
+
* Supported color formats: [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]]
* <!-- color formats -->Supported color formats: [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]], <span style="color:red">*</span>[[YV16]], <span style="color:red">*</span>[[YV24]], <span style="color:red">*</span>[[YV411]], <span style="color:red">*</span>[[Y8]]
+
: <span style="color:red">*</span> Not available in AviSynth 2.5.8.
+
* <!-- CPU/GPU -->
+
* <!-- binaries -->
+
* <!-- dependent plugins -->
+
 
<br>
 
<br>
"c[sf]i[ef]i[xgrid]i[ygrid]i[getvar]b[clip]b[lx]i[ty]i[rx]i[by]i[elx]i[ety]i[erx]i[eby]i[var]i[evar]i[uv]b[usey]b[show]b"
+
 
 
== [[Script variables|Syntax and Parameters]] ==
 
== [[Script variables|Syntax and Parameters]] ==
:{{Template:FuncDef|<!-- function name -->DeNoise (''clip'', ''<!-- par 1 type -->int'' "<!-- par 1 name -->sf", ''<!-- par 2 type -->int'' "<!-- par 2 name -->ef", ''<!-- par 3 type -->int'' "<!-- par 3 name -->xgrid", ''<!-- par 4 type -->int'' "<!-- par 4 name -->ygrid", ''<!-- par 5 type -->bool'' "<!-- par 5 name -->getvar", ''<!-- par 6 type -->bool'' "<!-- par 6 name -->clip", ''<!-- par 7 type -->int'' "<!-- par 7 name -->lx", ''<!-- par 8 type -->int'' "<!-- par 8 name -->ty",, ''<!-- par 9 type -->int'' "<!-- par 9 name -->rx", ''<!-- par 10 type -->int'' "<!-- par 10 name -->by", ''<!-- par 11 type -->int'' "<!-- par 11 name -->elx",''<!-- par 12 type -->int'' "<!-- par 12 name -->ety",''<!-- par 13 type -->int'' "<!-- par 13 name -->erx",''<!-- par 14 type -->int'' "<!-- par 14 name -->eby",''<!-- par 15 type -->int'' "<!-- par 15 name -->var",''<!-- par 16 type -->int'' "<!-- par 16 name -->evar", ''<!-- par 17 type -->bool'' "<!-- par 17 name -->uv", ''<!-- par 18 type -->bool'' "<!-- par 18 name -->usey", ''<!-- par 19 type -->bool'' "<!-- par 19 name -->show")}}
+
:{{Template:FuncDef| DeNoise (clip, int "sf", int "ef", int "xgrid", int "ygrid", bool "getvar", bool "clip", int "lx", int "ty", int "rx", int "by", int "elx", int "ety", int "erx", int "eby", int "var", int "evar", bool "uv", bool "usey", bool "show")}}
 +
 
 
<br>
 
<br>
 
::{{Par2| |clip| }}
 
::{{Par2| |clip| }}
:::Input clip.      
+
::: Input clip.
 
<br>
 
<br>
::{{Par2|<!-- par 1 type -->int|<!-- par 1 name -->sf|<!-- par 1 default value -->0}}
+
::{{Par2|sf|int|0}}
:::<!-- par 1 description -->process starts on frame .
+
:::Starting frame number to process.
 
<br>
 
<br>
::{{Par2|<!-- par 2 type -->int|<!-- par 2 name -->ef|<!-- par 2 default value -->last frame}}
+
::{{Par2|ef|int| }}
:::<!-- par 2 description -->process ends on frame .
+
:::End frame number to process, default is the last frame.
 
<br>
 
<br>
::{{Par2|<!-- par 3 type -->int|<!-- par 3 name -->xgrid|<!-- par 3 default value -->5}}
+
::{{Par2|xgrid|int|5}}
:::<!-- par 3 description -->local grid size in x direction .
+
::: Number of pixels along x axis in moving grid.
 
+
:::* Between 3 to 9
 
<br>
 
<br>
::{{Par2|<!-- par 4 type -->int|<!-- par 4 name -->ygrid|<!-- par 4 default value -->xgrid}}
+
::{{Par2|ygrid|int|xgrid}}
:::<!-- par 4 description -->local grid size along y.  
+
::: Number of pixels along y axis in moving grid.
 +
:::* Between 3 to 9
 
<br>
 
<br>
::{{Par2|<!-- par 5 type -->bool|<!-- par 5 name -->getvar|<!-- par 5 default value -->true}}
+
::{{Par2|getvar|bool|true}}
:::<!-- par 5 description -->Is variance to be determined from a window?
+
::: Is Global variance to be computed?
 +
:::* True for yes, false for is specified.
 
<br>
 
<br>
::{{Par2|<!-- par 6 type -->bool|<!-- par 6 name -->clip|<!-- par 6 default value -->a}}
+
::{{Par2|clip|bool|true}}
:::<!-- par 6 description -->Is variance from first frame window is valid for entire clip? true. If false to be determined frame by frame.  
+
::: Is variance valid for all clip or only frame?
 +
:::* True for yes, false for for frame.
 
<br>
 
<br>
::{{Par2|<!-- par 7 type -->int|<!-- par 7 name -->lx|<!-- par 7 default value -->must be specified if getvar is true}}
+
::{{Par2|lx|int|None. Must be specified}}
:::<!-- par 7 description -->left x coord of window on 1st frame.
+
::: Window left x at start frame for computing global variance.
 +
:::* Within clip, less than <code>rx</code>.
 
<br>
 
<br>
::{{Par2|<!-- par 8 type -->int|<!-- par 8 name -->ty|<!-- par 8 default value -->must be specified if getvar is true}}
+
::{{Par2|ty|int|None. Must be specified}}
:::<!-- par 8 description -->top y coordinate of window on 1st frame.
+
::: Window top y at start frame for computing global variance.
 +
:::* Within clip, less than <code>by</code>.
 
<br>
 
<br>
::{{Par2|<!-- par 9 type -->int|<!-- par 9 name -->rx|<!-- par 7 default value -->must be specified if getvar is true}}
+
::{{Par2|rx|int|None. Must be specified}}
:::<!-- par 9 description -->right x coord of window on 1st frame.
+
::: Window right x at start frame for computing global variance.
 +
:::* Within clip, more than <code>lx</code>.
 
<br>
 
<br>
::{{Par2|<!-- par 10 type -->int|<!-- par 10 name -->by|<!-- par 10 default value -->must be specified if getvar is true}}
+
::{{Par2|by|int|None. Must be specified}}
:::<!-- par 10 description -->bottom y coordinate of window on 1st frame.
+
::: Window bottom y at start frame for computing global varianc.
 +
:::* Within clip, more than <code>ty</code>.
 +
::{{Par2|elx|int|None. Must be specified}}
 +
::: Window left x at end frame for computing global variance.
 +
:::* Within clip, less than <code>erx</code>.
 
<br>
 
<br>
::{{Par2|<!-- par 11 type -->int|<!-- par 11 name -->elx|<!-- par 11 default value -->lx}}
+
::{{Par2|ety|int|None. Must be specified}}
:::<!-- par 11 description -->left x coord of window on last frame.
+
::: Window top y at end frame for computing global variance.
 +
:::* Within clip, less than <code>eby</code>.
 
<br>
 
<br>
::{{Par2|<!-- par 12 type -->int|<!-- par 12 name -->ety|<!-- par 12 default value -->ty}}
+
::{{Par2|erx|int|None. Must be specified}}
:::<!-- par 12 description -->top y coordinate of window on last frame.
+
::: Window right x at end frame for computing global variance.
 +
:::* Within clip, more than <code>elx</code>.
 
<br>
 
<br>
::{{Par2|<!-- par 13 type -->int|<!-- par 13 name -->erx|<!-- par 13 default value -->rx}}
+
::{{Par2|eby|int|None. Must be specified}}
:::<!-- par 13 description -->right x coord of window on last frame.
+
::: Window bottom y at end frame for computing global variance.
 +
:::* Within clip, more than <code>ety</code>.
 
<br>
 
<br>
::{{Par2|<!-- par 14 type -->int|<!-- par 14 name -->eby|<!-- par 14 default value -->by}}
+
::{{Par2|var|int|100}}
:::<!-- par 14 description -->bottom y coordinate of window on last frame.
+
:::Variance specified at start frame.
 +
:::*Range: greater than 0
 
<br>
 
<br>
::{{Par2|<!-- par 15 type -->int|<!-- par 15 name -->var|<!-- par 15 default value -->100}}
+
::{{Par2|evar|int|<code>var</code>}}
:::<!-- par 15 description -->value to be used as global variance. Will be used if getvar is false.
+
:::Variance at end frame.
 +
:::*Range: greater than 0
 
<br>
 
<br>
::{{Par2|<!-- par 16 type -->int|<!-- par 16 name -->evar|<!-- par 16 default value -->var}}
+
::{{Par2|uv|bool|true}}
:::<!-- par 10 description -->variance on last frame. In between linear interpolation.
+
::: Whether U and V of YUY2 and YUV formats to be processed.
 +
:::* true = uv process
 +
:::* false = do not process uv
 
<br>
 
<br>
::{{Par2|<!-- par 17 type -->bool|<!-- par 17 name -->uv|<!-- par 17 default value -->true}}
+
::{{Par2|usey|bool|false}}
:::<!-- par 17 description -->Whether u v planes to be processed(for planar and yuy2 input)?.
+
::: Whether variance of Y to be used for u and v also.
<br>
+
:::* true = yes
::{{Par2|<!-- par 18 type -->bool|<!-- par 18 name -->usey|<!-- par 18 default value -->false}}
+
:::* false = no
:::<!-- par 18 description -->can variance of y plane can be used for u v planes?
+
 
+
<br>
+
::{{Par2|<!-- par 19 type -->bool|<!-- par 19 name -->show|<!-- par 19 default value -->false}}
+
:::<!-- par 19 description -->if true an error message showing variance values determined will appear)
+
<br>
+
 
+
 
<br>
 
<br>
 +
::{{Par2|show|bool|false}}
 +
::: Whether variance values are to be displayed as an error message.
 +
:::* true = yes
 +
:::* false = no
 
<br>
 
<br>
  
 
== Examples ==
 
== Examples ==
 
<!-- example code block: 1st char in each line = space -->
 
<!-- example code block: 1st char in each line = space -->
## This is some example code to remove noise from an image.
+
*DeNoise with default values:
  imagereader("C:\avi_plugins\varianslim\theoin.jpg", end = 10)
+
  AviSource("blah.avi")
  converttoyv16()
+
  DeNoise()
  DeNoise(clip=false,lx=220,rx=245,ty=322,by=402, uv = true, show = false)
+
 
 +
 
 +
*Process all frames (sf and ef parameters are omitted):
 +
  DeNoise(getvar=false, var=120, evar=160, xgrid=5, ygrid=7)
 +
 
 +
 
 +
*Process only frames 35-55:
 +
DeNoise(sf=35, ef=55, clip=false, lx=220, rx=245, ty=322, by=402)  
  
 
<br>
 
<br>
 
<br>
 
<br>
 
-----------------------------------------------
 
-----------------------------------------------
'''Back to [[External_filters|External Filters]] &larr;'''
+
'''Back to [[External_filters#Denoisers|External Filters]] &larr;'''

Latest revision as of 03:44, 10 June 2020

Abstract
Author V. C. Mohan
Version 22 Nov 2015
Download DeNoise_2_6.zip
Category External filters
License GPLv3
Discussion Doom9 Forum


Contents

[edit] Description

This is an adaptive local noise reduction filter. It uses global variance of the noise, local mean and local variance in a moving grid of specified size. It tries to preserve edges as closely as possible.



[edit] Requirements


[edit] Syntax and Parameters

DeNoise (clip, int "sf", int "ef", int "xgrid", int "ygrid", bool "getvar", bool "clip", int "lx", int "ty", int "rx", int "by", int "elx", int "ety", int "erx", int "eby", int "var", int "evar", bool "uv", bool "usey", bool "show")


clip   =
Input clip.


int  sf = 0
Starting frame number to process.


int  ef =
End frame number to process, default is the last frame.


int  xgrid = 5
Number of pixels along x axis in moving grid.
  • Between 3 to 9


int  ygrid = xgrid
Number of pixels along y axis in moving grid.
  • Between 3 to 9


bool  getvar = true
Is Global variance to be computed?
  • True for yes, false for is specified.


bool  clip = true
Is variance valid for all clip or only frame?
  • True for yes, false for for frame.


int  lx = None. Must be specified
Window left x at start frame for computing global variance.
  • Within clip, less than rx.


int  ty = None. Must be specified
Window top y at start frame for computing global variance.
  • Within clip, less than by.


int  rx = None. Must be specified
Window right x at start frame for computing global variance.
  • Within clip, more than lx.


int  by = None. Must be specified
Window bottom y at start frame for computing global varianc.
  • Within clip, more than ty.
int  elx = None. Must be specified
Window left x at end frame for computing global variance.
  • Within clip, less than erx.


int  ety = None. Must be specified
Window top y at end frame for computing global variance.
  • Within clip, less than eby.


int  erx = None. Must be specified
Window right x at end frame for computing global variance.
  • Within clip, more than elx.


int  eby = None. Must be specified
Window bottom y at end frame for computing global variance.
  • Within clip, more than ety.


int  var = 100
Variance specified at start frame.
  • Range: greater than 0


int  evar = var
Variance at end frame.
  • Range: greater than 0


bool  uv = true
Whether U and V of YUY2 and YUV formats to be processed.
  • true = uv process
  • false = do not process uv


bool  usey = false
Whether variance of Y to be used for u and v also.
  • true = yes
  • false = no


bool  show = false
Whether variance values are to be displayed as an error message.
  • true = yes
  • false = no


[edit] Examples

  • DeNoise with default values:
AviSource("blah.avi")
DeNoise()


  • Process all frames (sf and ef parameters are omitted):
DeNoise(getvar=false, var=120, evar=160, xgrid=5, ygrid=7) 


  • Process only frames 35-55:
DeNoise(sf=35, ef=55, clip=false, lx=220, rx=245, ty=322, by=402) 




Back to External Filters

Personal tools