VideoHelp Forum
+ Reply to Thread
Results 1 to 17 of 17
Thread
  1. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    Hi folks. First let me state that I do not know of any denoising script better than MDegrain (3 to be specific). Results are gorgeous except for one small thing: frame blending in dark scene changes. As you'll notice in the slammed door (frame 147) in my POST Filter sample. If you look closely, you'll notice some details from the following frame. this is not going to fly with what I'm doing, so I thought of one solution:

    I know that lowering thSAD1 and thSAD2 does it, but of course, this leads to poor denoising results. My solution at this time is using trim() by ONLY lowering the SAD in the affected frames (such as frame 147) and then returning the original script for the rest of the scene, until I run into a similiar scene. But I don't know. Somehow I feel that there's a much "cleaner" way to do this. In any event, attached are 3 files: The prefiltered, the post-filtered, and an image of the actual damaged frame caused by the filtering.

    Let me know if you have any suggestions, please.

    Thanks
    Image Attached Thumbnails Click image for larger version

Name:	frame 147.jpg
Views:	734
Size:	53.3 KB
ID:	17396  

    Image Attached Files
    Quote Quote  
  2. maybe something more along the lines of FFT3DGPU(sigma=4) also have you tried to combine a spatial only filter, followed by a not so aggressive motion compensated one,...
    Quote Quote  
  3. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Or, try to force a scene change simply by splitting the clip at the scene change and processing the two separately, or spatially denoising only the frame at the scene change (matching the strength of your temporal denoising) and replacing the original with that, etc.?

    Cheers,
    Francois
    Quote Quote  
  4. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    FFT3Dsigma4 works fine ONLY with McTemporalDenoise. Alone, it looks like shit. It blurs and compiles the dirt into globs. Unless I'm missing something? But then again, this has always been my experience with any spatial filter used alone.
    Quote Quote  
  5. You can adjust the scene change detection thresholds; e.g. lower thscd1, e.g try something like thscd1=200 to start with, then check other areas for false positives. Then fine tune thscd1 and thscd2
    Quote Quote  
  6. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    PDR, this worked significantly. I actually remember tweaking these settings in the past, but forgot. So I lowered thscd1 from it's default 400 to 200. I then lowered thscd2 from default 130 to 90. I kept the thSAD at 400, and it looks good--eeeeeeeEXCEPT for one little thing: The door slams but for a second or two, you can see the guy's uniform details behind the door. As if the door is transparent. MvAnalyse is definitely not registering these frames well, and I think it's because that scene is very fast. This is an issue that needs to be addressed with this filter, because otherwise it is perfect and does an almost excellent job at removing junk without blocking, clumping, or eliminating fine detail.
    Quote Quote  
  7. I see what you're saying....you mean before the door is shut... But it's like that even without changing the scene detection settings (default values) . Changing those values fixes the frames before the scenechange, but not the ones before the door is shut

    I'll take a closer look but It might be difficult trying to get medegrain / related functions to work in this scene . Part of the reason is the dark outlines are obscured in the dark scene
    Last edited by poisondeathray; 19th Apr 2013 at 22:10.
    Quote Quote  
  8. Since the (lack of) contrast in the lines compared to the dark shades all around is likely causing the problem, you can use a filtered preclip with darkened higher contrast lines, as input into smdegrain (basically a wrapper function for mdegrain 1/2/3 plus a few other frills)

    note: I added hdragc just for tweaking purposes to brighten the scene so you can visualize the lines more clearly and adjust the settings; you can comment that out or adjust as you see fit. As usual, adjust the strengths to your tastes - smdegrain has the same settings as mdegrain 1/2/3 . If you intend to brighten the clip you will probably have to increase the denoise strength. The point of this example was just to demonstrate how you might enhance line preservation with medgrain/mvtools2 related filters

    Code:
    .
    .
    .
    orig=last
    
    
    ##### make enhanced dark lines for prefilter clip
    orig
    hdragc(shift=5,max_gain=2, coef_sat=0.5)
    dfttest
    toon(1).toon(1).toon(1).toon(1)
    darkline=last
    
    ##### feed prefiltered clip into smdegrain, with modified scene detection settings
    orig
    smdegrain(prefilter=darkline,thscd1=200, thscd2=130)
    hdragc(shift=5,max_gain=2, coef_sat=0.5)
    filtered=last
    
    filtered
    Last edited by poisondeathray; 19th Apr 2013 at 22:40.
    Quote Quote  
  9. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    Unable to load libfftw3f-3.dll! EXCEPT I have it in my SYS program. What gives???
    Quote Quote  
  10. For FFT3DFilter and dfttest you also need the FFTW3 library . On Windows the file needed for both is libfftw3f-3.dll. However for FFT3DFilter, it needs to be called FFTW3.dll, so you will need two copies and rename one. On Windows put the files in your System32 or SysWow64 folder (for 32bit vs. 64bit, respectively)


    http://www.fftw.org/install/windows.html
    Last edited by poisondeathray; 20th Apr 2013 at 10:20.
    Quote Quote  
  11. btw. alternatively one could use LoadDll and load the other two through it,..
    Code:
    LoadPlugin("G:\avisynthPlugins\LoadDll.dll")
    LoadDll("G:\avisynthPlugins\libfftw3f-3.dll")
    LoadDll("G:\avisynthPlugins\fftw3.dll")
    Quote Quote  
  12. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    I have these dll's in my SYSWOW64 folder. I've renamed it with the .dll extension. Nothing. This whole thing is starting to become alot of useless shit.
    Quote Quote  
  13. Banned
    Join Date
    Dec 2010
    Location
    New York
    Search Comp PM
    Quote Quote  
  14. Originally Posted by unclescoob View Post
    I've renamed it with the .dll extension.
    If it didn't already have a .dll extension you don't have the right file.
    Quote Quote  
  15. If you can't get it to work, replace dfttest with something else like blur(1) or some other spatial denoiser

    It's not a perfect treatment either way, there are still some artifacts, just improved over using default mdegrain .

    Some prefilter denoiser is required for this approach, otherwise the linedarkeners will overemphasize the grain and darken the grain

    Or you might try a completely different approach, instead of mvtools2 / mdegrain1/2/3
    Quote Quote  
  16. Maybe another approach is to preserve the lines is use a darkline mask for prefilter input, either overlay or darkline protection mask

    mdegrain destroys the lines here even on non scene changes, because there is no separation (everything is too dark, it cannot distinguish between line edges effectively) .

    I don't have any bright scenes, so I don't know if these values will work for all parts, you might have to adjust, or apply to different sections; or you might think the prefilter is too strong (MCTD in this example, maybe something else is better) . Also these have been brightened to visualize the lines, remove those or adjust as you see fit

    This is an example of a darkline overlay for the prefiltered clip . You can find the lumamask function and a short explanation in the link below. Note: it's being used slightly differently here as the mask for an overlay, because "multiply" is the desired transfer mode
    https://forum.videohelp.com/threads/355377-Interlacing-problem?p=2235692&viewfull=1#post2235692


    Code:
    .
    .
    .
    hdragc(shift=5,max_gain=2, coef_sat=0.5)
    mctemporaldenoise(settings="medium", strength=0)
    
    dmask=lumamask(orig, b=22, w=36, upper=true, show=true)
    overlay(orig, orig, mask=dmask, mode="multiply")
    darkline=last
    
    
    orig
    smdegrain(tr=1, prefilter=darkline,thscd1=200, thscd2=130)
    Some comparisons :

    smdegrain (smdegrain default setting is almost the same thing as mdegrain3)

    Click image for larger version

Name:	154 smdegrain.png
Views:	513
Size:	408.0 KB
ID:	17469


    darkline multiplied mask overlay as prefiltered clip into smdegrain(reduced settings)

    Click image for larger version

Name:	154 darkline_multiply.png
Views:	524
Size:	337.7 KB
ID:	17471
    Quote Quote  
  17. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Wow
    Quote Quote  



Similar Threads

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