Jaded-Encoding-Thaumaturgy / vs-denoise

VapourSynth denoising, regression, and motion compensation functions
MIT License
18 stars 6 forks source link

MVTools degrain + SMDE preset produces significant ghosting #95

Closed shssoichiro closed 1 year ago

shssoichiro commented 1 year ago

The exception is if you set thSAD to a low value like 75. Slowpics for comparison, you can see very visibly the ghosting on the back of his shirt in image 2, which goes away in image 3 which lowers thSAD to 75. The ghosting is also not present when using the dfttest denoiser on its own without MVTools.

Image 1: source

Image 2:

pre = vsdenoise.DFTTest(clip).denoise(sigma=0.5, tr=1)
mc = vsdenoise.MVTools(pre, **vsdenoise.MVToolsPresets.SMDE)
clip = mc.degrain(ref=clip)

Image 3:

pre = vsdenoise.DFTTest(clip).denoise(sigma=0.5, tr=1)
mc = vsdenoise.MVTools(pre, **vsdenoise.MVToolsPresets.SMDE)
clip = mc.degrain(ref=clip, thSAD=75)
Setsugennoao commented 1 year ago

Well, that preset doesn't have sane defaults, since SMDE didn't have 'em, and most things weren't configurable either.

This should be fixed, however, if havsfunc's SMDE does not have the same ghosting issue (which in my esperience, it had, even though not as bad as CMDE).

So, how does it compare to the original?

Also, 75-100 is a perfectly normal threshold. But maybe it seems odd to you since old functions scaled it weirdly.

shssoichiro commented 1 year ago

Interestingly havsfunc.SMDegrain even with the default thSAD of 300 doesn't produce any noticeable ghosting. Although it's possible this is due to a difference in scaling as you mentioned. If that is the case it probably makes sense to update the default to rescale the thSAD properly. Though I haven't verified if it is actually the high SAD threshold causing it or if the lower SAD threshold is covering it up.

For comparison Image 1 = dfttest alone Image 2 = dfttest+MVTools.degrain with SMDE defaults Image 3 = dfttest+MVTools.degrain with SMDE defaults+thSAD=75 Image 4 = havsfunc.SMDegrain (default settings)

Out of these only image 2 shows ghosting.