TEdgeMask

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(TEdgeMask)
 
m (minor formatting)
Line 1: Line 1:
[[Category:Plugins]]
+
{{FilterCat4|External_filters|Plugins|Other_filters|Edge_detection}}
{{FilterCat|External_filters|Other_filters|Edge_Detection}}
+
 
 
{{Filter3
 
{{Filter3
 
| {{Author/tritical}}
 
| {{Author/tritical}}
Line 10: Line 10:
 
<br>
 
<br>
 
== Description ==
 
== Description ==
:<tt>TEdgeMask</tt> creates an edgemask based off gradient vector magnitude. It includes some useful options such as luma to chroma linking of the edge map and seperate thresholds for each plane. It can output a binary mask or a magnitude mask scaled to a 0-255 range.
+
<tt>TEdgeMask</tt> creates an edgemask based off gradient vector magnitude. It includes some useful options such as luma to chroma linking of the edge map and seperate thresholds for each plane. It can output a binary mask or a magnitude mask scaled to a 0-255 range.<br/>
 
<br>
 
<br>
  
 
== Requirements ==
 
== Requirements ==
:- AviSynth 2.5.8 or greater
+
* AviSynth 2.5.8 or greater
:- Supported color formats: [[YUY2]], [[YV12]]
+
* Supported color formats: [[YUY2]], [[YV12]]
 
<br>
 
<br>
 
== [[Script variables|Syntax and Parameters]] ==
 
== [[Script variables|Syntax and Parameters]] ==
Line 28: Line 28:
 
::{{Par2|V|int|1}}
 
::{{Par2|V|int|1}}
 
:::These control how each of the planes (Y, U, V) is processed.
 
:::These control how each of the planes (Y, U, V) is processed.
:::Set to 1 to process the plane, set to 0 to not process (as in don't even memset, it will just be garbage),  
+
:::Set to 1 to process the plane, set to 0 to not process (as in don't even memset, it will just be garbage), set to -x to have the plane be memset to abs(x) (must be in the range -1 to -255 and -256 = 0).
:::set to -x to have the plane be memset to abs(x) (must be in the range -1 to -255 and -256 = 0).
+
 
<br>
 
<br>
 
::{{Par2|threshY|float|8.0}}
 
::{{Par2|threshY|float|8.0}}
Line 53: Line 52:
 
::{{Par2|valOff|int|0}}
 
::{{Par2|valOff|int|0}}
 
:::Sets the values to use for the binary mask output.  valOn = value for edge pixels, {{Template:FuncDef3|valOff}} = value for non-edge pixels.   
 
:::Sets the values to use for the binary mask output.  valOn = value for edge pixels, {{Template:FuncDef3|valOff}} = value for non-edge pixels.   
:::Set {{Template:FuncDef3|valOn}} to a negative value and instead of creating a binary mask, <tt>TEdgeMask</tt> will output a mask with the actual  
+
:::Set {{Template:FuncDef3|valOn}} to a negative value and instead of creating a binary mask, <tt>TEdgeMask</tt> will output a mask with the actual edge magnitude values scaled onto a 0-255 range (with the max value 255 corresponding to a single edge gradient of 255).
:::edge magnitude values scaled onto a 0-255 range (with the max value 255 corresponding to a single edge gradient of 255).
+
 
<br>
 
<br>
 
::{{Par2|preblur|bool|false}}
 
::{{Par2|preblur|bool|false}}
Line 87: Line 85:
  
 
== External Links ==
 
== External Links ==
<br>
 
 
<br>
 
<br>
 
<br>
 
<br>
 
-----------------------------------------------
 
-----------------------------------------------
 
'''Back to [[External_filters#Edge_Detection|External Filters]] &larr;'''
 
'''Back to [[External_filters#Edge_Detection|External Filters]] &larr;'''

Revision as of 08:50, 21 September 2014


Abstract
Author tritical
Version v0.9
Download TEdgeMaskv09.zip
Category Edge Detection
License GPLv2
Discussion


Contents

Description

TEdgeMask creates an edgemask based off gradient vector magnitude. It includes some useful options such as luma to chroma linking of the edge map and seperate thresholds for each plane. It can output a binary mask or a magnitude mask scaled to a 0-255 range.

Requirements

  • AviSynth 2.5.8 or greater
  • Supported color formats: YUY2, YV12


Syntax and Parameters


TEdgeMask (clip, int "Y", int "U", int "V", float "threshY", float "threshU", float "threshV", int "link", int "type", int "valOn", int "valOff", bool "preBlur")


clip  c =
Input clip; only YUY2 and YV12 are supported.


int  Y = 1
int  U = 1
int  V = 1
These control how each of the planes (Y, U, V) is processed.
Set to 1 to process the plane, set to 0 to not process (as in don't even memset, it will just be garbage), set to -x to have the plane be memset to abs(x) (must be in the range -1 to -255 and -256 = 0).


float  threshY = 8.0
float  threshU = 8.0
float  threshV = 8.0
These set the magnitude thresholds for each plane... if over this value then a pixel will be considered an edge.


int  link = 1
Specifies whether luma to chroma linking, no linking, or linking of every plane to every other plane is used.
  • 0 : no linking
  • 1 : luma to chroma linking
  • 2 : every plane to every other plane


int  type = 2
Sets the type of first order partial derivative approximation that is used.
Possible values:
  • 1 : 2 pixel
  • 2 : 4 pixel


int  valOn = 255
int  valOff = 0
Sets the values to use for the binary mask output. valOn = value for edge pixels, valOff = value for non-edge pixels.
Set valOn to a negative value and instead of creating a binary mask, TEdgeMask will output a mask with the actual edge magnitude values scaled onto a 0-255 range (with the max value 255 corresponding to a single edge gradient of 255).


bool  preblur = false
Indicates whether to apply a 3x3 guassian blur to the input image prior to generating the edge map.


Examples

TEdgeMask with default settings (binary mask output):

AviSource("blah.avi")
TEdgeMask (Y=1, U=1, V=1, threshY=8.0, threshU=8.0, threshV=8.0, link=1, type=2, valOn=255, valOff=0, preblur=false)


Magnitude mask output:

AviSource("blah.avi")
TEdgeMask (valOn=-1)


Changelog

Version      Date            Changes
v0.9 01/20/2005 - Initial release


Archived Downloads

Version Download Mirror
v0.9 TEdgeMaskv09.zip TEdgeMaskv09.zip


External Links




Back to External Filters

Personal tools