View Full Version : Filtering using a 3x3 mask with custom coefficients


ramprasad85
8th October 2011, 21:46
I am new to AviSynth!
I want to apply a custom 3x3 filter/mask on the pixels in the Y component of a video.
For example I want to apply Sobel filter

1 2 1
0 0 0
-1 -2 -1


How to do this using AviSynth? Is this possible/easier in VirtualDub?

:thanks:

cretindesalpes
9th October 2011, 01:22
mt_edge ("1 2 1 0 0 0 -1 -2 -1 1", thY1=0, thY2=255, u=-128, v=-128)
mt_edge is available from the masktools v2 (http://manao4.free.fr/). You can omit the u and v parameters if you don't care about the chroma.

Guest
9th October 2011, 02:04
# Horizontal (Sobel) edge detection:
GeneralConvolution(0, "
1 2 1
0 0 0
-1 -2 -1 ", 8)

http://avisynth.org/mediawiki/GeneralConvolution