VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. I'm working on a cartoon source (already did the IVTC previously). In my restoration, I am using the binarize mask to protect my dark/black pixels while I only denoise my light pixels. However, I need to protect my edges, so I incorporated a sharpening filter into the mt_binarize mask to accomplish this(as you can see). However, I feel that it may not be enough to protect fine details. I figured it would be a good idea to add mt_edge into my script, which I did. Now when I did this, I then ONLY got the edgemask output and not the binarize output. Is it possible to combine both masks so that I can get both, my binarize and edge mask outputs in my clip? Here is a sample of what my script currently looks like. Please advise and thank you all for your time.

    [avisource(blah.avi)
    a=last
    b=mctemporaldenoise(settings="high")
    mask=mt_binarize(threshold=67, lsfmod(). lsfmod())
    Overlay(a,b, mask=mask)]
    Last edited by Betelman; 25th Jan 2020 at 23:57.
    Quote Quote  
  2. Use Overlay() to combine masks. Assuming hard masks (all values either 0 or 255)

    Overlay(mask1, mask2, mode="Multiply") # logical AND
    Overlay(mask1, mask2, mode="Add") # logical OR
    Quote Quote  
  3. I received the following error message: Invalid arguments to function "Overlay".

    Here's my updated script, based on your suggestion:

    AVISource("blah.avi")
    a=last
    b=McTemporalDenoise(settings="high")
    mask1 = mt_binarize(threshold=66, toonlite(). toonlite(). LSFmod())
    mask2=mt_edge("prewitt")
    Overlay(a,b,mask1, mask2, mode="add")
    Quote Quote  
  4. Create a combined mask with Overlay(), then use that combined mask to overlay your filtered video over the unfiltered video.
    Quote Quote  
  5. I don't mean to be a bother, but I'm a bit confused. Can you please re-arrange my script and post so that I can see what you mean?
    Quote Quote  
  6. I'm not sure exactly what you're trying to accomplish with the two masks (protect edges and dark areas? protect only edges in dark areas? filter bright areas and dark edges?) but here's how you combine them and then apply them:

    AVISource("blah.avi")
    a=last
    b=McTemporalDenoise(settings="high")
    mask1 = mt_binarize(threshold=66, toonlite(). toonlite(). LSFmod())
    mask2=mt_edge("prewitt")
    combined_mask = Overlay(mask1, mask2, mode="add")
    Overlay(a,b,mask=combined_mask)
    Quote Quote  
  7. I'm trying to protect edges, AND dark areas. Filter everything else mercilessly
    Last edited by Betelman; 26th Jan 2020 at 09:56.
    Quote Quote  
  8. Originally Posted by Betelman View Post
    I'm trying to protect edges, AND dark areas. Filter everything else mercilessly

    Code:
    AVISource("blah.avi")
    a=last
    b=McTemporalDenoise(settings="high")
    mask1 = mt_binarize(threshold=66, upper=true, toonlite(). toonlite(). LSFmod())
    mask2=mt_edge("prewitt")
    combined_mask = Overlay(mask1, mask2, mode="add")
    Overlay(b,a,mask=combined_mask)
    Quote Quote  
  9. Hey, not bad! Thanks dude!
    Quote Quote  



Similar Threads