MaskTools/EdgeMask

From Avisynth wiki
Revision as of 16:01, 9 May 2013 by Admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


EdgeMask (clip[, int "thY1"[, int "thY2"[, int "thC1"[, int "thC2"[, string "type"]]]]])

Plugin: MaskTools

This filter creates an edge mask of the picture. The edge-finding algorithm uses a convolution kernel, and the result of the convolution is then thresholded with thY1 and thY2 (luma) and thC1 and thC2 (chroma). The thresholding happens like that (r is the result of the convolution):

  • r <= th1 gives 0.
  • th1 < r <= th2 gives r.
  • th2 < r gives 255.

In order to create a binary mask, you just have to set th1=th2.

The choice of the convolution kernel is done by type:

type Kernel
"roberts"
2 -1
-1 0
"sobel"
0 -1 0
-1 0 1
0 1 0
"laplace"
-1/8 -1/8 -1/8
-1/8 1 -1/8
-1/8 -1/8 -1/8
"special"
-1/4 0 -1/4
0 1 0
-1/4 0 -1/4

Finally, there are also two other possible values for type ("cartoon" and "line"), which have behaviors which are not documented here.

Defaults are : thY1 = 0, thY2 = 20, thC1 = 0, thC2 = 20 and type = "sobel".


Back to MaskTools.

Personal tools