PDA

View Full Version : weighted convolution filter?


AnnaFan777
11th December 2008, 16:51
weighted convolution filter?

Any chance of developing a weighted convolution (with thresholds) filter ?
it could be very useful for things like noise removal ,edge detection, and
other interesting stuff...

*.mp4 guy
11th December 2008, 23:19
What would be more interesting and more feature complete would be a non-linear convolution filter, in which you can describe any defined algabraic relation between all pixels.

IE
matrix of pixels:
ABC
DEF
GHI

E could be defined as a 1/8 of d, f, b, and h, plus 1/16 of a, c, g, and i, plus 1/4 E. then you could define a as being equal to the median of its three closest neighbors excluding e if the absolute value of a minus e was greater then 25. You could apply metrics such as this to all of the constituent pixels of a matrix, you could theoretically describe any possible mathematical relationship between the pixels in a given matrix in this way.

Manao
12th December 2008, 06:05
Try mt_mappedblur in masktools v2.

hanfrunz
12th December 2008, 11:47
http://avisynth.org/mediawiki/GeneralConvolution
http://avisynth.org/mediawiki/MaskTools2 -> Mt_convolution
http://forum.doom9.org/showthread.php?s=&threadid=38281 ->Convolution3D YV12&SMP for Avisynth 2.5

AnnaFan777
12th December 2008, 22:32
MaskTools2 -> Mt_convolution
Does not really do weighted calculation

with a convolution with a weighting system and thresholds
one could easily create some neat functions
like:
limited sharpen (without shapening the edges, noises or vice-versa)
smart blur (without blur out fine edges)
De-moire (without destroying edges)

Imagine with a 3D convolution with thresholds (or non-linear weighting)
you can create a temporal smoother which, instead of averaging pixels,
it discards the noisy pixels, or suppress noises more effectively.

I suppose that it's not very complicated to write this in "filter factory" (VirtualDub's built-in filter writer)
and it may even give more freedom more flexibility for users to define any
weighting system (even non-linear) .

If only someone could write a sample in "filter factory".
then all you need is some basic programming skill to modify it.

sadly, there are really not many filter factory tutorial out there.

Manao
13th December 2008, 06:53
AnnaFan777 : you need to get your vocabulary straight: mt_convolution does a weighted convolution, but without thresholds. mt_mappedblur does a weighted convolution with thresholds, and you give it an additionnal map containing the local thresholds.

All you are describing can be done with the masktools. They are the filter factory you want.