DeSpot

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(redirect for convenient searching)
 
(DeSpot: add documentation (mostly finished))
Line 1: Line 1:
#REDIRECT [[External_filters#Film_Damage_correction]]
+
{{FilterCat4|External_filters|Plugins|Restoration_filters|Film_Damage}}
{{FilterCat|External_filters|Restoration_filters|Film_Damage}}
+
{{Filter3
 +
| {{Author/Fizick}}
 +
| 3.6.1.0
 +
| [http://avisynth.org.ru/despot/despot3610.zip despot3610.zip]
 +
| Film Restoration
 +
|5=[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
 +
|6=[https://forum.doom9.org/showthread.php?t=59388 Doom9 Forum]}}
 +
<br>
 +
== Description ==
 +
This filter is designed to remove temporal noise in the form of dots (spots) and streaks found in some videos. The filter is also useful for restoration (cleaning) of old telecined 8mm (and other) films from spots (from dust) and some stripes (scratches).
 +
 
 +
*See official documentation: http://avisynth.org.ru/despot/despot.html
 +
<br>
 +
== Requirements ==
 +
* [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.5.8 or greater]
 +
*Supported color formats: [[YUY2]], [[YV12]]
 +
<br>
 +
 
 +
== [[Script variables|Syntax and Parameters]] ==
 +
 
 +
:{{Template:FuncDef|DeSpot (clip, int "mthres", int "mwidth", int "mheight", int "merode", bool "interlaced", bool "median", int "p1", int "p2", int "pwidth", int "pheight", bool "ranked", int "sign", int "maxpts", int "p1percent", int "dilate", bool "fitluma", int "blur", int "tsmooth", int "show", int "mark_v", bool "show_chroma", bool "motpn", int "seg", bool "color", int "mscene", int "minpts", clip "extmask", bool "planar") }}
 +
<br>
 +
::{{Par2| |clip| }}
 +
:::Input clip.
 +
<br>
 +
::{{Par2|mthres|int|16}}
 +
:::A pixel needs to be different from the another frame by at least 'MTHRES' in order to be considered moving. This number should be larger than 'P2' in order to prevent noise from being identified as motion.
 +
<br>
 +
::{{Par2|mwidth|int|7}}
 +
::{{Par2|mheight|int|5}}
 +
:::These define the width and height of block for motion map denoising algorithm (erode and dilate stages).
 +
<br>
 +
::{{Par2|merode|int|33}}
 +
::: These define a threshold value of percent of motion pixels in the block at erode stage.
 +
<br>
 +
::{{Par2|interlaced|bool|false}}
 +
:::Whether to treat the video as interlaced or not (progressive). The default is false (progressive) for DeSpot since version 1.3. (In older versions, the Field based video was processed as interlaced by default - it was a bug).
 +
<br>
 +
::{{Par2|median|bool|}}
 +
:::True or false.
 +
<br>
 +
::{{Par2|p1|int|24}}
 +
::{{Par2|p2|int|12}}
 +
:::A pixel needs to be at different from its neighbors by at least 'P1' in order for it to be considered noise. The surrounding pixels must be different by at lease 'P2' in order for the pixel to be considered part of the same spot.
 +
<br>
 +
::{{Par2|pwidth|int|6}}
 +
::{{Par2|pheight|int|5}}
 +
:::A spot can be no larger than pwidth x pheight.
 +
<br>
 +
::{{Par2|ranked|bool|true}}
 +
:::Enables ranked ordered difference spot detector with 6 points instead of 2.
 +
<br>
 +
::{{Par2|sign|int|0}}
 +
:::Set mode for removing of only black or white spots or both:
 +
:::*sign = 0 - any spots and outliers (default)
 +
:::*sign = 1 - only black (dark) spots and outliers
 +
:::*sign = -1 - only white (light) spots and outliers
 +
:::*sign = 2 - only black (dark) spots, any outliers
 +
:::*sign = -2 - only white (light) spots, any outliers
 +
<br>
 +
::{{Par2|maxpts|int|0}}
 +
:::Set upper limit of points (pixels) per every spot.
 +
:::Range: from 0 to 10000000, default=0 - no limit
 +
<br>
 +
::{{Par2|p1percent|int|10}}
 +
::: Set lower limit of relative fracture of high-contrasted (by criterion P1) pixels per spot (in percent).
 +
:::Range: from 0 to 100
 +
<br>
 +
::{{Par2|dilate|int|1}}
 +
:::Set range of morphological dilate (growing) of removed spots (in pixel units).
 +
:::Range: from 0 to 255
 +
<br>
 +
::{{Par2|fitluma|bool|true}}
 +
:::Enables some frame luminosity correction in places of deleted spots.
 +
<br>
 +
::{{Par2|blur|int|1}}
 +
::: Value (length) of local spatial blur near borders of deleted spots
 +
:::Range: from 0 to 4, default 1
 +
<br>
 +
::{{Par2|tsmooth|int|0}}
 +
:::Control temporal smoothing in static areas (except spots and motion).
 +
:::Set approximate threshold of pixel luma variance in 3 frames,
 +
:::The more variance exceed this threshold, the less temporal smoothing.
 +
:::0 - no temporal smoothing.
 +
:::Range: from 0 to 127
 +
<br>
 +
::{{Par2|show|int|0}}
 +
:::To instead spots removing, show a motion map and noise that would of been eliminated, use parameter:
 +
:::*0 - not show,
 +
:::*1 - to highlight the noise instead of removing it
 +
:::*2 - show a motion map and noise
 +
<br>
 +
::{{Par2|mark_v|int|255}}
 +
:::Where mark_v is the luma value to highlight the noise with.
 +
:::The color (pink, green or grey) of noise spot now is depend from parity of mark_v.
 +
:::Motion map is also shown.
 +
:::Range: from 0 to 255
 +
<br>
 +
::{{Par2|show_chroma|bool|false}}
 +
:::Use to show clip color data on motion map.
 +
<br>
 +
::{{Par2|motpn|int|true}}
 +
:::Define motion detecting method.
 +
:::*false - detect motion from previous to current and from current to next frame (old method used in all versions before 3.0)
 +
:::*true - detect motion from previous to next frame (new method since version 3.0)
 +
<br>
 +
::{{Par2|seg|int|2}}
 +
:::Control spots segments removing method.
 +
:::*0 - remove only spots pixels which has no overlap with motion zones (old method used in all versions before 3.0, most strong removing);
 +
:::*1 - remove only spots line segments which has no any overlap with motion zones;
 +
:::*2 - remove only whole spots which has no any overlap with motion zones (most safe).
 +
<br>
 +
::{{Par2|color|bool|false}}
 +
:::Control color correction at place of removed spots .
 +
:::*true - change color of pixels at places of removed spots to mean value previous, current and next frames,
 +
:::*false - not change color of pixels at places of detected spots.
 +
<br>
 +
::{{Par2|mscene|int|40}}
 +
:::Set percent of pixels in motion for scenechange detection and disabling of frame spot removal.
 +
:::Range: from 0 to 100
 +
<br>
 +
::{{Par2|minpts|int|0}}
 +
:::Set lower limit of points (pixels) per every spot.
 +
:::Range: from 0 to 10000000, default=0 - no limit
 +
<br>
 +
::{{Par2|extmask|clip|none}}
 +
:::Optional external mask clip. It will be binarized with threshold 127 and logically added (by "OR" operation) to internal motion mask. It can be used for additional protection of good objects (if you have some reliable mask).
 +
<br>
 +
::{{Par2|planar|bool|False}}
 +
:::Old hack, do not use. Read included docs if you are curious.
 +
<br>
 +
== Examples ==
 +
DeSpotwith default settings:
 +
[[AviSource]]("Blah.avi")
 +
DeSpot()
 +
<br>
 +
== Archived Downloads ==
 +
{| class="wikitable" border="1"; width="400px"
 +
|-
 +
!!width="100px"| Version
 +
!!width="150px"| Download
 +
!!width="150px"| Mirror
 +
|-
 +
!v3.6.1.0
 +
|[http://avisynth.org.ru/despot/despot3610.zip despot3610.zip]
 +
|[https://web.archive.org/web/20160327122653if_/http://avisynth.org.ru/despot/despot3610.zip despot3610.zip]
 +
|}
 +
 
 +
<br>
 +
== External Links ==
 +
<br>
 +
<br>
 +
-----------------------------------------------
 +
'''Back to [[External_filters#Film_Damage_correction|External Filters]] &larr;'''
 +
-----------------------------------------------

Revision as of 18:04, 1 June 2020

Abstract
Author Fizick
Version 3.6.1.0
Download despot3610.zip
Category Film Restoration
License GPLv2
Discussion Doom9 Forum


Contents

Description

This filter is designed to remove temporal noise in the form of dots (spots) and streaks found in some videos. The filter is also useful for restoration (cleaning) of old telecined 8mm (and other) films from spots (from dust) and some stripes (scratches).


Requirements


Syntax and Parameters

DeSpot (clip, int "mthres", int "mwidth", int "mheight", int "merode", bool "interlaced", bool "median", int "p1", int "p2", int "pwidth", int "pheight", bool "ranked", int "sign", int "maxpts", int "p1percent", int "dilate", bool "fitluma", int "blur", int "tsmooth", int "show", int "mark_v", bool "show_chroma", bool "motpn", int "seg", bool "color", int "mscene", int "minpts", clip "extmask", bool "planar")


clip   =
Input clip.


int  mthres = 16
A pixel needs to be different from the another frame by at least 'MTHRES' in order to be considered moving. This number should be larger than 'P2' in order to prevent noise from being identified as motion.


int  mwidth = 7
int  mheight = 5
These define the width and height of block for motion map denoising algorithm (erode and dilate stages).


int  merode = 33
These define a threshold value of percent of motion pixels in the block at erode stage.


bool  interlaced = false
Whether to treat the video as interlaced or not (progressive). The default is false (progressive) for DeSpot since version 1.3. (In older versions, the Field based video was processed as interlaced by default - it was a bug).


bool  median =
True or false.


int  p1 = 24
int  p2 = 12
A pixel needs to be at different from its neighbors by at least 'P1' in order for it to be considered noise. The surrounding pixels must be different by at lease 'P2' in order for the pixel to be considered part of the same spot.


int  pwidth = 6
int  pheight = 5
A spot can be no larger than pwidth x pheight.


bool  ranked = true
Enables ranked ordered difference spot detector with 6 points instead of 2.


int  sign = 0
Set mode for removing of only black or white spots or both:
  • sign = 0 - any spots and outliers (default)
  • sign = 1 - only black (dark) spots and outliers
  • sign = -1 - only white (light) spots and outliers
  • sign = 2 - only black (dark) spots, any outliers
  • sign = -2 - only white (light) spots, any outliers


int  maxpts = 0
Set upper limit of points (pixels) per every spot.
Range: from 0 to 10000000, default=0 - no limit


int  p1percent = 10
Set lower limit of relative fracture of high-contrasted (by criterion P1) pixels per spot (in percent).
Range: from 0 to 100


int  dilate = 1
Set range of morphological dilate (growing) of removed spots (in pixel units).
Range: from 0 to 255


bool  fitluma = true
Enables some frame luminosity correction in places of deleted spots.


int  blur = 1
Value (length) of local spatial blur near borders of deleted spots
Range: from 0 to 4, default 1


int  tsmooth = 0
Control temporal smoothing in static areas (except spots and motion).
Set approximate threshold of pixel luma variance in 3 frames,
The more variance exceed this threshold, the less temporal smoothing.
0 - no temporal smoothing.
Range: from 0 to 127


int  show = 0
To instead spots removing, show a motion map and noise that would of been eliminated, use parameter:
  • 0 - not show,
  • 1 - to highlight the noise instead of removing it
  • 2 - show a motion map and noise


int  mark_v = 255
Where mark_v is the luma value to highlight the noise with.
The color (pink, green or grey) of noise spot now is depend from parity of mark_v.
Motion map is also shown.
Range: from 0 to 255


bool  show_chroma = false
Use to show clip color data on motion map.


int  motpn = true
Define motion detecting method.
  • false - detect motion from previous to current and from current to next frame (old method used in all versions before 3.0)
  • true - detect motion from previous to next frame (new method since version 3.0)


int  seg = 2
Control spots segments removing method.
  • 0 - remove only spots pixels which has no overlap with motion zones (old method used in all versions before 3.0, most strong removing);
  • 1 - remove only spots line segments which has no any overlap with motion zones;
  • 2 - remove only whole spots which has no any overlap with motion zones (most safe).


bool  color = false
Control color correction at place of removed spots .
  • true - change color of pixels at places of removed spots to mean value previous, current and next frames,
  • false - not change color of pixels at places of detected spots.


int  mscene = 40
Set percent of pixels in motion for scenechange detection and disabling of frame spot removal.
Range: from 0 to 100


int  minpts = 0
Set lower limit of points (pixels) per every spot.
Range: from 0 to 10000000, default=0 - no limit


clip  extmask = none
Optional external mask clip. It will be binarized with threshold 127 and logically added (by "OR" operation) to internal motion mask. It can be used for additional protection of good objects (if you have some reliable mask).


bool  planar = False
Old hack, do not use. Read included docs if you are curious.


Examples

DeSpotwith default settings:

AviSource("Blah.avi")
DeSpot()


Archived Downloads

Version Download Mirror
v3.6.1.0 despot3610.zip despot3610.zip


External Links




Back to External Filters


Personal tools