MaskTools v2

Abstract

Authors : Kurosu, Manao, mg262
Version : 2.0 alpha 27
Download : http://manao4.free.fr/
Category : Misc Plugins
Requirements : YV12 Colorspace

Table of contents

I) Introduction

Masktool's dll contains a set of filters designed to create, manipulate and use masks. Masks, in video processing, are a way to give a relative importance to each pixels. You can, for example, create a mask that select only the green parts of the video, and then replace these parts with another video.

To give the most control over the handling of masks, the filters will use the fact that each luma and chroma planes can be uncorrelated. That mean that a single video will always be considered by the filters as 3 independant planes. That applies for masks as well, which means that a mask clip will in fact contain 3 masks, one for each planes.

The filters have a set of common parameters, that mainly concerns what processing to do on each planes. They all work only in YV12 ( though with Avisynth 2.6, support for all planar format will be available ).

II) Common parameters

As said previously, all the filters - except the helpers - share a common set of parameters. These parameters are used to tell what processing to do on each plane / channel, and what area of the video to process.

III) Filters list

Here is an exhaustive list of the filters contained in this dll :

IV) Filters description

mt_edge

mt_edge : string mode("sobel"), int thY1(10), int thY2(10), int thC1(10), int thC2(10)

mt_motion

mt_motion : int thY1(10), int thY2(10), int thC1(10), int thC2(10), int thT(10)

mt_expand, mt_inpand

mt_xxpand : int thY(255), int thC(255), string mode("square")

mt_inflate, mt_deflate

mt_xxflate : int thY(255), int thC(255)

mt_merge

mt_merge : clip clip1, clip clip2, clip mask, bool "luma"(false)

mt_lut

mt_lut : string expr("x"), string yexpr("x"), string uexpr("x"), string vexpr("x")

mt_lutxy

mt_lutxy : clip clip1, clip clip2, string expr("x"), string yexpr("x"), string uexpr("x"), string vexpr("x")

mt_lutf

mt_lutf : clip clip1, clip clip2, string mode("avg"), string expr("y"), string yexpr("y", string uexpr("y"), string vexpr("y")

mt_luts

mt_luts : clip clip1, clip clip2, string mode("avg"), string pixels(""), string expr("x"), string yexpr("x"), string uexpr("x"), string vexpr("x")

mt_average

mt_average : clip clip1, clip clip2

mt_makediff

mt_makediff : clip clip1, clip clip2

mt_adddiff

mt_adddiff : clip clip1, clip clip2

mt_clamp

mt_clamp : clip c, clip bright_limit, clip dark_limit, int overshoot(0), int undershoot(0)

mt_invert

mt_invert : clip c

mt_binarize

mt_binarize : clip c, int threshold(128), bool upper(false)

mt_logic

mt_logic : clip clip1, clip clip2, string mode("and")

mt_hysteresis

mt_hysteresis : clip small_mask, clip big_mask

mt_convolution

mt_convolution : clip c, string horizontal("1 1 1"), string vertical("1 1 1"), bool saturate(true), float total(1.0f)

mt_mappedblur

mt_mappedblur : clip c, clip map, string kernel("1 1 1 1 1 1 1 1 1"), string mode("replace")

mt_square, mt_circle, mt_diamond

mt_square : int radius(1), bool zero(true)
mt_circle : int radius(1), bool zero(true)
mt_diamond : int radius(1), bool zero(true)

mt_rectangle, mt_ellipse, mt_losange

mt_rectangle : int hor_radius(1), int ver_radius(1), bool zero(true)
mt_ellipse : int hor_radius(1), int ver_radius(1), bool zero(true)
mt_losange : int hor_radius(1), int ver_radius(1), bool zero(true)

mt_polish

mt_polish : string expr("x")

V) Reverse polish notation.

A lot of filters accept custom functions defined by an expression written in reverse polish notation. You may not be accustomed to this notation, so here are a few pointers :

VI) Changelog

Alpha 27 :

Alpha 26 :

Alpha 25 :

Alpha 24 :

Alpha 23 :

Alpha 22 :

Alpha 21 :

Alpha 20 :

Alpha 19 :

Alpha 18 :

Alpha 17 :

Alpha 16 :

Alpha 15 :

Alpha 14 :

Alpha 13 :

Alpha 12 :

Alpha 11 :

Alpha 10 :

Alpha 9 :

Alpha 8 :

Alpha 7 :

Alpha 6 :

Alpha 5 :

Alpha 4 :

Alpha 3 :

Alpha 2 :

Alpha 1 :