VideoHelp Forum




+ Reply to Thread
Results 1 to 14 of 14
  1. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    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.
    Quote Quote  
  2. Since the foreground is dark, but the background has bright areas & midtones, you might be able to achieve separation with a luma mask .
    Quote Quote  
  3. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    Can you show me a sample script? I'm at work and can't post the clip.

    Appreciated, thanks.
    Quote Quote  
  4. 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)
    Quote Quote  
  5. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    Will try it.

    Thanks.
    Quote Quote  
  6. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    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###
    Image Attached Thumbnails Click image for larger version

Name:	maskedsample.jpg
Views:	256
Size:	19.2 KB
ID:	13099  

    Image Attached Files
    Quote Quote  
  7. 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)
    Quote Quote  
  8. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    Thanks. Mask is set to true, but I can't see it.
    Quote Quote  
  9. 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.
    Quote Quote  
  10. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    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")
    2. Is there another mask in the MasksPack that can do the same job better and easier, or is this the best tool for the job?

    Thanks again.
    Quote Quote  
  11. Yes, you can let flatmask to the merging for you. I'm not familiar with the maskpack.
    Quote Quote  
  12. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    Great.

    Thanks.
    Quote Quote  
  13. 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.
    Quote Quote  
  14. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    I admit it. I'm very impressed.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!