So here's the scoop: I have a short clip, with two different levels of noise: The moving foreground image is dark with black details and the still background image has some mid-tones and bright areas. The moving image is cleaned gorgeously with MCTemporalDenoise, while preserving all of my details.
The still background does not clean so nicely with MC. However, TTempSmooth (or even MC at high levels) does a nicer job for what I need.
But this would blur details in my moving image, so I cannot use the same filter for the entire clip. This is where overlay works wonders. So my question is as follows:
for the overlay clip, is it possible to create a mask that would make the background transparent (so that my base clip, with the properly filtered background can show), but the moving foreground image on my overlay clip to show instead?
Thanks.
+ Reply to Thread
Results 1 to 14 of 14
-
-
Since the foreground is dark, but the background has bright areas & midtones, you might be able to achieve separation with a luma mask .
-
Can you show me a sample script? I'm at work and can't post the clip.
Appreciated, thanks. -
Download this masks pack . Read the instructions and look at the example syntax. (There are saturation mask, luma mask , box mask and flat mask variations)
http://doom10.org/index.php?topic=2195.0
For luma mask, b and w limit the black and white levels defining the mask . Use show=true to visualize the mask . You can use upper=true to invert the mask (black becomes white) (as you're probably already aware, "white" in the mask for overlay() are areas that are "transparent" or show through). You can use other filters like various blurs to "feather" the mask (so you don't get sharp edges) -
Ok, I've been playing with flatmask. The clip that I'm working on is attached here, along with an image cap of my mask.
My goal is to mask the lady, smooth the background and surrounding areas with TTempSmooth, and then smooth the lady with McTemporalDenoise.
The mask was accomplished with this script:
Code:MPEG2Source("blah blah.d2v") AssumeTFF() TFM(d2v="blah blah.d2v") TDecimate(mode=1) raw=last TTempSmooth(maxr=7,lthresh=30,cthresh=5, strength=5, interlaced=false) ##Ttempsmooth used for the background## flatmask (raw, str=100, luma=true, lth=40, upper=true, show=true) ###to mask the lady## McTemporalDenoise(settings="high", sigma=4, twopass=true, useTTmpSm=true, chroma=true, protect=true, AA=true, edgeclean=true, stabilize=true, TTstr=8, enhance=true, AGstr=1.0, maxr=7) ##MCTemporal went on the entire image as a whole. It won't negatively affect the stable background, as long as the lady was not filtered with TTempsmooth, and only with MCTemporal###
-
I think this is what you're trying to do:
Code:Mpeg2Source("sample1.demuxed.d2v") TFM(d2v="sample1.demuxed.d2v") TDecimate() mask=flatmask(last, str=100, luma=true, lth=40, upper=true, show=true) ###to mask the lady## tts=TTempSmooth(maxr=7,lthresh=30,cthresh=5, strength=5, interlaced=false) mt_merge(tts, last, mask) McTemporalDenoise(settings="high", sigma=4, twopass=true, useTTmpSm=true, chroma=true, protect=true, AA=true, edgeclean=true, stabilize=true, TTstr=8, enhance=true, AGstr=1.0, maxr=7)
-
You're not supposed to see it. It's used to determine which parts of the image are taken from the two videos when merging.
If you really want to see the mask add "return(mask)" right after creating it.Last edited by jagabo; 14th Jul 2012 at 23:02.
-
Ah, I see. It worked. This is actually a great tool for what I need to accomplish, thanks alot Jag.
Two quick questions, and then I'm on my way:
1. I updated my script (below) and the results look the same as in your script...actually my background appears more stable with the script below. It does not have mt_merge like your script, only that line 4 in my script was changed to filtered(last). Is there a difference in the way this script functions when you don't use mt_merge? I ask because the mask is still protecting the parts of the clip that I don't want touched by TTEmpSmooth, but I want to make sure I'm not missing something.
Code:MPEG2Source("sample1.demuxed.d2v") TFM(d2v=("sample1.demuxed.d2v") TDecimate(mode=1) filtered=last TTempSmooth(maxr=7,lthresh=20,cthresh=5, strength=5, interlaced=false) flatmask(filtered, str=100, r=10, luma=true, lth=32, upper=true, show=false) McTemporalDenoise(settings="high")
Thanks again. -
Yes, you can let flatmask to the merging for you. I'm not familiar with the maskpack.
-
If you look at the last line of the flatmask() script you'll see that it either returns the mask or calls mt_merge() for you.
Similar Threads
-
overlay my logo question
By bearmon2010 in forum EditingReplies: 6Last Post: 13th Dec 2011, 07:44 -
Overlay/Mask/Layer Question
By legocrazy1 in forum EditingReplies: 3Last Post: 16th Jul 2010, 04:00 -
Capture twice and overlay
By sphinx99 in forum RestorationReplies: 11Last Post: 15th Mar 2010, 05:02 -
H.264 video is dim with overlay / x264vfw question
By serexl in forum Newbie / General discussionsReplies: 16Last Post: 9th Mar 2010, 20:07 -
Help with Avisynth overlay
By WAKA in forum Newbie / General discussionsReplies: 12Last Post: 14th Jul 2009, 12:37