MaskTools2/Mt motion

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''Back to MaskTools2''' <br> <br> == Description == :Creates motion masks. <br> == Syntax and Parameters == :{{Template:FuncDef|mt_motion (clip, int "thY1", int "thY2", i...")
 
m
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Back to [[MaskTools2]]'''
+
{{FilterCat4|External_filters|Plugin_functions|Other_filters|Support_filters}}
 +
Creates motion masks.
 +
 
 
<br>
 
<br>
 +
== [[Script variables|Syntax and Parameters]] ==
 +
:{{Template:FuncDef|mt_motion (clip, int "thY1", int "thY2", int "thC1", int "thC2", int "thT", int "sc_value", int "Y", int "U", int"V", string "chroma", int "offX", int "offY", int "w" int "h")}}
 
<br>
 
<br>
== Description ==
+
::{{Par2| |clip| }}
:Creates motion masks.
+
:::Input clip.
 
<br>
 
<br>
== Syntax and Parameters ==
+
::{{Par2|thY1|int|10}}
:{{Template:FuncDef|mt_motion (clip, int "thY1", int "thY2", int "thC1", int "thC2", int "thT", int "sc_value", int "Y", int "U", int"V", string "chroma", int "offX", int "offY", int "w" int "h")}}
+
::{{Par2|thY2|int|10}}
 +
:::Luma thresholds; {{Template:FuncDef3|thY1}} is the low threshold and thY2 the high threshold. Under {{Template:FuncDef3|thY1}}, the pixel is set to zero, over {{Template:FuncDef3|thY2}}, to 255, and in between, left untouched.
 +
:::Range: 0 to 255
 +
<br>
 +
::{{Par2|thC1|int|10}}
 +
::{{Par2|thC2|int|10}}
 +
 
 +
:::Chroma thresholds; {{Template:FuncDef3|thC1}} is the low threshold and {{Template:FuncDef3|thC2}} the high threshold. Under {{Template:FuncDef3|thC1}}, the pixel is set to zero, over {{Template:FuncDef3|thC2}}, to 255, and in between, left untouched.
 +
:::Range: 0 to 255
 
<br>
 
<br>
::{{Par|thY1|int|10}}
+
::{{Par2|thT|int|10}}
::{{Par|thY2|int|10}}
+
:::{{Template:FuncDef3|thT}} decides whether the frame is a scene change or not. The mask is made blank if a scene change is detected, else, the mask is computed.
:::Range: 0 - 255
+
:::Range: 0 to 255
::::Luma thresholds.
+
:::::thY1 is the low threshold and thY2 the high threshold. Under thY1, the pixel is set to zero, over thY2, to 255, and in between, left untouched.
+
 
<br>
 
<br>
::{{Par|thC1|int|10}}
+
::{{Par2|sc_value|int|0}}
::{{Par|thC2|int|10}}
+
:::
:::Range: 0 - 255
+
:::Range: 0 to 255
::::Chroma thresholds.
+
:::::thC1 is the low threshold and thC2 the high threshold. Under thC1, the pixel is set to zero, over thC2, to 255, and in between, left untouched.
+
 
<br>
 
<br>
::{{Par|thT|int|10}}
+
::{{Par2|Y|int|3}}
:::Range: 0 - 255
+
::{{Par2|U|int|1}}
::::thT decides whether the frame is a scene change or not. The mask is made blank if a scene change is detected, else, the mask is computed.
+
::{{Par2|V|int|1}}
 +
:::These three values describe the actual processing mode that is to be used on each plane / channel. Here is how the modes are coded :
 +
::::*x = -255...0 : all the pixels of the plane will be set to -x.
 +
::::*x = 1 : the plane will not be processed. That means the content of the plane after the filter is pure garbage.
 +
::::*x = 2 : the plane of the first input clip will be copied.
 +
::::*x = 3 : the plane will be processed with the processing the filter is designed to do.
 
<br>
 
<br>
::{{Par|sc_value|int|0}}
+
::{{Par2|chroma|string|""}}
:::Range: 0 - 255
+
:::When defined, the value contained in this string will overwrite the {{Template:FuncDef3|U}} and {{Template:FuncDef3|V}} processing modes.
::::
+
:::This is a nice addition proposed by mg262 that makes the filter more user friendly. Allowed values for chroma are:
 +
::::*"process" : set u = v = 3.
 +
::::*"copy" or "copy first" : set u = v = 2.
 +
::::*"xxx", where xxx is a number : set u = v = -xxx.
 
<br>
 
<br>
::{{Par|Y|int|3}}
+
::{{Par2|offX|int|0}}
::{{Par|U|int|1}}
+
::{{Par2|offY|int|0}}
::{{Par|V|int|1}}
+
:::{{Template:FuncDef3|offX}} and {{Template:FuncDef3|offY}} are the top left coordinates of the box where the actual processing shall occur. Everything outside that box will be garbage.
::::These three values describe the actual processing mode that is to be used on each plane / channel. Here is how the modes are coded :
+
:::::*x = -255...0 : all the pixels of the plane will be set to -x.
+
:::::*x = 1 : the plane will not be processed. That means the content of the plane after the filter is pure garbage.
+
:::::*x = 2 : the plane of the first input clip will be copied.
+
:::::*x = 3 : the plane will be processed with the processing the filter is designed to do.
+
:::::*x = 4 (when applicable) : the plane of the second input clip will be copied.
+
:::::*x = 5 (when applicable) : the plane of the third input clip will be copied.
+
 
<br>
 
<br>
::{{Par|chroma|string|""}}
+
::{{Par2|w|int|-1}}
::::When defined, the value contained in this string will overwrite the u & v processing modes.
+
::{{Par2|h|int|-1}}
::::This is a nice addition proposed by mg262 that makes the filter more user friendly. Allowed values for chroma are:
+
:::{{Template:FuncDef3|w}} and {{Template:FuncDef3|h}} are the width and height of the processed box. -1 means that the box extends to the lower right corner of the video. That also means that default settings are meant to process the whole picture.
:::::*"process" : set u = v = 3.
+
 
:::::*"copy" or "copy first" : set u = v = 2.
+
:::::*"copy second" : set u = v = 4.
+
:::::*"copy third" : set u = v = 5.
+
:::::*"xxx", where xxx is a number : set u = v = -xxx.
+
 
<br>
 
<br>
::{{Par|offX|int|0}}
+
== Examples ==
::{{Par|offY|int|0}}
+
mt_motion with default settings:
::::"offx" and offy are the top left coordinates of the box where the actual processing shall occur. Everything outside that box will be garbage.
+
[[AviSource]]("blah.avi")
 +
mt_motion(thY1=10, thY2=10, thC1=10, thC2=10, thT=10, sc_value=0, Y=3, U=1, V=1, chroma="", offX=0, offY=0, w=-1, h=-1)
 +
 
 
<br>
 
<br>
'''Back to [[MaskTools2]]'''
+
-----------------------------------------------
 +
'''Back to [[MaskTools2#Filters|MaskTools2]] &larr;'''
 +
-----------------------------------------------

Latest revision as of 00:06, 25 June 2018

Creates motion masks.


[edit] Syntax and Parameters

mt_motion (clip, int "thY1", int "thY2", int "thC1", int "thC2", int "thT", int "sc_value", int "Y", int "U", int"V", string "chroma", int "offX", int "offY", int "w" int "h")


clip   =
Input clip.


int  thY1 = 10
int  thY2 = 10
Luma thresholds; thY1 is the low threshold and thY2 the high threshold. Under thY1, the pixel is set to zero, over thY2, to 255, and in between, left untouched.
Range: 0 to 255


int  thC1 = 10
int  thC2 = 10
Chroma thresholds; thC1 is the low threshold and thC2 the high threshold. Under thC1, the pixel is set to zero, over thC2, to 255, and in between, left untouched.
Range: 0 to 255


int  thT = 10
thT decides whether the frame is a scene change or not. The mask is made blank if a scene change is detected, else, the mask is computed.
Range: 0 to 255


int  sc_value = 0
Range: 0 to 255


int  Y = 3
int  U = 1
int  V = 1
These three values describe the actual processing mode that is to be used on each plane / channel. Here is how the modes are coded :
  • x = -255...0 : all the pixels of the plane will be set to -x.
  • x = 1 : the plane will not be processed. That means the content of the plane after the filter is pure garbage.
  • x = 2 : the plane of the first input clip will be copied.
  • x = 3 : the plane will be processed with the processing the filter is designed to do.


string  chroma = ""
When defined, the value contained in this string will overwrite the U and V processing modes.
This is a nice addition proposed by mg262 that makes the filter more user friendly. Allowed values for chroma are:
  • "process" : set u = v = 3.
  • "copy" or "copy first" : set u = v = 2.
  • "xxx", where xxx is a number : set u = v = -xxx.


int  offX = 0
int  offY = 0
offX and offY are the top left coordinates of the box where the actual processing shall occur. Everything outside that box will be garbage.


int  w = -1
int  h = -1
w and h are the width and height of the processed box. -1 means that the box extends to the lower right corner of the video. That also means that default settings are meant to process the whole picture.


[edit] Examples

mt_motion with default settings:

AviSource("blah.avi")
mt_motion(thY1=10, thY2=10, thC1=10, thC2=10, thT=10, sc_value=0, Y=3, U=1, V=1, chroma="", offX=0, offY=0, w=-1, h=-1)



Back to MaskTools2


Personal tools