TMaskCleaner

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(redirect for convenient searching)
 
m (Syntax and Parameters: typo)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
#REDIRECT [[External_filters#Averaging.2FLayering.2FMasking]]
+
{{FilterCat5|External_filters|Plugins|Plugins_x64|Adjustment_filters|Masking}}
{{FilterCat|External_filters|Adjustment_filters|Masking}}
+
{{Filter3
 +
| {{Author/tp7}}
 +
| v0.91
 +
|[https://github.com/tp7/tmaskcleaner/releases tmaskcleaner-x86.zip // tmaskcleaner-x64.zip]
 +
| Masking
 +
| [http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
 +
|6=}}
 +
 
 +
== Description ==
 +
A really simple mask cleaning plugin for AviSynth based on mt_hysteresis. It discards all areas of less than length pixels with values bigger or equal to thresh.
 +
<br>
 +
<br>
 +
 
 +
== Requirements ==
 +
* [x86]: [[AviSynth+]] or [http://sourceforge.net/projects/avisynth2/ AviSynth 2.6]
 +
* [x64]: [[AviSynth+]]
 +
* Supported color formats: [[Y8]], [[YV12]], [[YV16]], [[YV24]]
 +
* Microsoft Visual C++ 2012 Redistributable Packages
 +
<br>
 +
 
 +
== [[Script variables|Syntax and Parameters]] ==
 +
:{{Template:FuncDef|TMaskCleaner (clip, int "length", int "thresh", int "fade")}}
 +
<br>
 +
::{{Par2| |clip| }}
 +
:::Input clip.
 +
<br>
 +
::{{Par2|length|int|5}}
 +
::{{Par2|thresh|int|235}}
 +
:::It discards all areas of less than <code>length</code> pixels with values bigger or equal to <code>thresh</code>.
 +
<br>
 +
::{{Par2|fade|int|0}}
 +
:::Usage: <code>TMaskCleaner(length=100, fade=200)</code> will zero areas below length, assign 0..255 to areas in [length,length+fade] range, and 255 to areas above length+fade.
 +
:::This allows adaptive processing of area ranges for example by transforming the mask from linear 0..255 distribution denoted here as / to:
 +
:::*/\ with <code>mt_lut("x 128 > 255 x - x ?")</code>
 +
:::*|| to grab some arbitrary range with <code>mt_lut("x 118 > x 138 < & 255 0 ?")</code>
 +
:::*non-linear _/_ mask by smoothly amplifying the middle with <code>mt_lut("x 128 > 255 x - x ? 100 - 28 / 0.5 ^ 256 *")</code>
 +
<br>
 +
 
 +
== Examples ==
 +
TMaskCleaner with default values:
 +
AviSource("bah.avi")
 +
TMaskCleaner(length=5, fade=235, fade=0)
 +
<br>
 +
== Changelog ==
 +
Version      Date            Changes<br>
 +
v0.91        2013/12/24      - 'Fade' parameter added
 +
v0.9        2013/11/30      - Initial release
 +
<br>
 +
== External Links ==
 +
*[https://github.com/tp7/tmaskcleaner GitHub] - Source code repository.
 +
<br>
 +
<br>
 +
-----------------------------------------------
 +
'''Back to [[External_filters#Averaging.2FLayering.2FMasking|External Filters]] &larr;'''

Latest revision as of 03:07, 28 March 2020

Abstract
Author tp7
Version v0.91
Download tmaskcleaner-x86.zip // tmaskcleaner-x64.zip
Category Masking
License GPLv2
Discussion

Contents

[edit] Description

A really simple mask cleaning plugin for AviSynth based on mt_hysteresis. It discards all areas of less than length pixels with values bigger or equal to thresh.

[edit] Requirements


[edit] Syntax and Parameters

TMaskCleaner (clip, int "length", int "thresh", int "fade")


clip   =
Input clip.


int  length = 5
int  thresh = 235
It discards all areas of less than length pixels with values bigger or equal to thresh.


int  fade = 0
Usage: TMaskCleaner(length=100, fade=200) will zero areas below length, assign 0..255 to areas in [length,length+fade] range, and 255 to areas above length+fade.
This allows adaptive processing of area ranges for example by transforming the mask from linear 0..255 distribution denoted here as / to:
  • /\ with mt_lut("x 128 > 255 x - x ?")
  • || to grab some arbitrary range with mt_lut("x 118 > x 138 < & 255 0 ?")
  • non-linear _/_ mask by smoothly amplifying the middle with mt_lut("x 128 > 255 x - x ? 100 - 28 / 0.5 ^ 256 *")


[edit] Examples

TMaskCleaner with default values:

AviSource("bah.avi")
TMaskCleaner(length=5, fade=235, fade=0)


[edit] Changelog

Version      Date            Changes
v0.91 2013/12/24 - 'Fade' parameter added v0.9 2013/11/30 - Initial release


[edit] External Links

  • GitHub - Source code repository.




Back to External Filters

Personal tools