VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Member
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    I've been working on some cartoons with Mdegrain lately. Works great but some fast motion dark scenes slightly suffer with blurring/ghosting.

    So I thought about this crazy idea: Using Histogram("luma"), which removes all the chroma from the picture while maintaining all details, THEN applying mdegrain. I think this would give me a better motion vector and an overall, more accurate cleanup job.

    Two questions: Will this work and can someone assist me with a script on how to do it (if it's possible)?
    Quote Quote  
  2. Originally Posted by unclescoob View Post
    I've been working on some cartoons with Mdegrain lately. Works great but some fast motion dark scenes slightly suffer with blurring/ghosting.

    So I thought about this crazy idea: Using Histogram("luma"), which removes all the chroma from the picture while maintaining all details, THEN applying mdegrain. I think this would give me a better motion vector and an overall, more accurate cleanup job.

    Two questions: Will this work and can someone assist me with a script on how to do it (if it's possible)?
    You don't want to use histogram("luma"), not even for a mask, or prefilter, or to take vectors from - because it's a distorted, enhanced view. It enhances amplifies noise, flaws and all the defects on purpose. It's more of a visualization aid to see defects
    Quote Quote  
  3. I mostly agree with poisondeathray. But there might be some circumstances where you could use a variation of histogram("luma") in the motion vector analysis. But histogram("luma") alone will increase noise. You have to decrease the noise before the histogram. Use a script like the following to visualize motion vectors found by mvtools2:

    Code:
    WhateverSource("filename.ext")
    src = last
    
    # show motion vectors of original video
    super = MSuper()
    vectors = MAnalyse(super, isb = false)
    full = MShow(super, vectors) # implicit last works properly
    
    # show motion vectors of histogram video
    last = src
    ColorYUV(gain_y=-224) # divide luma by 8 to reduce noise, try different strengths
    Histogram("luma")
    ColorYUV(gain_y=-128, off_y=32) # darken the histogram so we can see motion vectors better
    super = MSuper()
    vectors = MAnalyse(super, isb = false)
    hist = MShow(super, vectors) # implicit last works properly
    
    # show them side by side
    StackHorizontal(full, hist)
    When I ran this on a few test videos there wasn't much difference in the motion vectors.
    Quote Quote  
  4. Member
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    Thanks guys. PDR I'll give it a shot.
    Quote Quote  
  5. Use a mask for using lower settings on dark areas or simply to disable denoising there. You can also brighten the clip that gets the motion vectors, while denoising the actual clip.

    Things like plane based motion vectors or prefiltering, etc are things implemented in smdegrain for simplicity reasons.
    Quote Quote  
  6. Member
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    Jagabo, I used your script but I really don't know what to do with this. I see one side color with alot of dots and lines, and the other side in b&w with the same dots and lines (I assume those are motion vectors?)

    Ok, so I see it. Is the purpose of the script just to see the motion vectors? Can I incorporate my clean-up job in this script?

    I'm confused.

    Please explain this to me like I'm an idiot.
    Quote Quote  
  7. Member
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    Dogway, can I get a sample script?
    Quote Quote  
  8. Originally Posted by unclescoob View Post
    Jagabo, I used your script but I really don't know what to do with this. I see one side color with alot of dots and lines, and the other side in b&w with the same dots and lines (I assume those are motion vectors?)

    Ok, so I see it. Is the purpose of the script just to see the motion vectors?
    Yes, the purpose was to visualize the motion vectors so you can compare between the regular video and the histogram("luma") video. In the handful of video I tried it with there was very little difference.

    Originally Posted by unclescoob View Post
    Can I incorporate my clean-up job in this script?
    I haven't used MDegrain. I don't know if it supports the use of a separate video for motion vector analysis.

    Regarding protecting dark areas from over filtering:

    Code:
    weakfiltered = yadayada()
    strongfiltered = yadayadayada()
    lumamask = Greyscale().ColorYUV(cont_y=100) # tune mask to suit
    Overlay(weakfiltered, strongfiltered, mask=lumamask)
    Quote Quote  
  9. LumaMask(SMDegrain(tr=2,thSAD=300,contrasharp=true ,str=2.0,refinemotion=true,lsb=false),last,b=16, w=64, upper=false)
    Quote Quote