Log in

View Full Version : Mask for relatively noiseless regions?


maxhondur
13th November 2005, 10:48
Hi,

I'm not very good at using avisynth, and I hope something like this hasn't been asked before(if so, I'm pretty bad at searching too)

Is there a filter that can highlight the 'noiseless' areas of a video clip?

Appreciate the help.. though as you can imagine it's more about my curiosity regarding avisynth rather than a real need to backup my stuffs :) Thanks!

Manao
13th November 2005, 14:20
Let's say your favorite denoiser is called 'denoise'. To create a mask of the noiseless region, you'd do something like this : denoised = source.denoise()
diff = mt_lutxy(source, denoised, "x y - abs", y=3, u=3, v=3)That creates a mask saying where the video has been denoised. The mask is mainly dark green, because 'source' is relatively close to 'denoised'. So we want it reversed, and the contrast must be enhanced.renormeddiff = diff.mt_lut("x 48 *", y=3, u=3, v=3)
invdiff = renormeddiff.mt_lut("255 x -", y=3, u=3, v=3)Now, the mask shows the noiseless areas. You might find the mask 'noisy' by itself, so you can make it more homogenous by doinginvdiff2 = invdiff.mt_expand(y=3,u=3,v=3).mt_inpand(y=3,u=3,v=3)you can repeat that last step as much as needed. All the filters used come in the masktools v2 package ( in my sig ).

Finally, the first three steps can be merged in a single one : mask = mt_lutxy(source, source.denoise(), "255 x y - abs 48 * -", y=3, u=3, v=3)

maxhondur
15th November 2005, 23:23
Manao,

Thanks for the input! It seems that every time I read something about masktools there's always another function that I seem to have missed out on. In my spare time, I sometimes go on these mask tool frenzies, playing around with such-and-such effect, but they usually go down the drain(I also get these migraines, either from mental exhaustion or desk-head impact) :p Thanks again!