Log in

View Full Version : Help with syntaxis/struct using masks


Overdrive80
20th February 2012, 13:59
Hi again, actually i am learning to use masktools but dude if i am doing properly or correctly. My script is

DGDecode_mpeg2source...
* * * * * * * * * * * * * * * *
original=last

prefiltered= dfttest(tbsize=1)

mask=prefiltered.mt_edge(mode="sobel",U=1,V=1).mt_deflate(U=1,V=1)

#return mask

super=Msuper(prefiltered)

backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)

MDegrain2(super,backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)

contrasharpening(last, original)

mt_merge(last, original, mask)


I am trying keep original edges with little noise reduction while filter rest areas.
The result no is bad but exist areas with grain.

Thanks in advance.

Didée
20th February 2012, 14:36
Basically, the script correctly implements the strategy you want to go.

Fishy points:

- "sobel" edge followed by deflate() could make the edgemask too thin / too dim, you need to check if the mask comes out properly.

- you're using the "prefiltered" superclip for Mdegrain. This (basically) means that the noisy original frame has 20% weight, and gets averaged with 4 pre-denoised wing frames (having a total of 80% weight.) (Short of SAD weightening.)
If this is intended, then it's okay. The "clinical schoolcase" would be to use an original_superclip for MDegrain.

Without knowing the source (and its "level" of grain), it's impossible to tell why you have left-over grain. Maybe the prefilter is not strong enough, maybe the standard blocksize 8x8 is too small, maybe the edgemask did respond to some of the grain. Chances are that it's a combination of all these points. :)

Overdrive80
20th February 2012, 20:15
Basically, the script correctly implements the strategy you want to go.

Fishy points:

- "sobel" edge followed by deflate() could make the edgemask too thin / too dim, you need to check if the mask comes out properly.

- you're using the "prefiltered" superclip for Mdegrain. This (basically) means that the noisy original frame has 20% weight, and gets averaged with 4 pre-denoised wing frames (having a total of 80% weight.) (Short of SAD weightening.)
If this is intended, then it's okay. The "clinical schoolcase" would be to use an original_superclip for MDegrain.

Without knowing the source (and its "level" of grain), it's impossible to tell why you have left-over grain. Maybe the prefilter is not strong enough, maybe the standard blocksize 8x8 is too small, maybe the edgemask did respond to some of the grain. Chances are that it's a combination of all these points. :)

Thanks Didée for your answer. I have inserted a control command to see the mask, for now this point is clear. ^^

About the second point, my intention isn´t do that you are explaining, I understand that i is doing it wrong. What happens is that when using the prefiltered clip for super, the result was cleaner and so I used.

With respect blocksize i havent idea. I have uploaded a part of video: http://www.mediafire.com/?bbg47izeruy8b94. I would be grateful If I could continue helping me understand.