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)?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 9 of 9
Thread
-
-
-
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)
-
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. -
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. -
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.
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)
-
LumaMask(SMDegrain(tr=2,thSAD=300,contrasharp=true ,str=2.0,refinemotion=true,lsb=false),last,b=16, w=64, upper=false)