Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st November 2015, 16:07   #1  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
denoising casual chat


so I was thinking like, is it possible to get even better quality than BM3D (Block Matching) or NLMeans (Pixel Matching)
maybe just do a combo of both
like, NLMeans filters in time domain, and sure it treats high frequencies well cuz they are kinda sparse in time domain, and it's super destructive to low frequencies
and BM3D, does good stuff to low frequencies and kills high frequencies on the contrary, as it block matches in time domain BUT, filters in frequency domain, low frequencies are sparse in frequency domain so they are filtered right and well, and high frequencies are not that lucky...

so maybe, maybe combine the high frequencies from NLMeans and low frequencies from BM3D and it would be,
even better

demo:
source image


NLMeans
Code:
import vapoursynth as vs
core = vs.get_core()
clp =  whatever..
clp = core.knlm.KNLMeansCL(clp, 0, 32, 4, h=2.4)
clp.set_output ()

low frequencies are screwed, see places boxed out with red rectangles

BM3D
Code:
import vapoursynth as vs
core = vs.get_core()
clp =  whatever
ref = core.bm3d.Basic(clp, sigma=8, block_size=8, block_step=1, group_size=32, bm_range=24, bm_step=1)
clp = core.bm3d.Final(clp, ref, sigma=8, block_size=8, block_step=1, group_size=32, bm_range=24, bm_step=1)
clp.set_output ()

high frequencies are fucked, also boxed out with red rectangles

NLMeans BM3D Combo
Code:
import vapoursynth as vs
core = vs.get_core()
clp =  whatever

def gauss (src, p=30):
    core   = vs.get_core ()
    upsmp  = core.fmtc.resample (src, src.width * 2, src.height * 2, kernel="gauss", a1=100, fulls=True, fulld=True)
    clip   = core.fmtc.resample (upsmp, src.width, src.height, kernel="gauss", a1=p, fulls=True, fulld=True)
    return clip

nlm = core.knlm.KNLMeansCL(clp, 0, 32, 4, h=2.4)
ref = core.bm3d.Basic(clp, sigma=8, block_size=8, block_step=1, group_size=32, bm_range=24, bm_step=1)
bm3 = core.bm3d.Final(clp, ref, sigma=8, block_size=8, block_step=1, group_size=32, bm_range=24, bm_step=1)
clp = core.std.MergeDiff (gauss (bm3, 16), core.std.MakeDiff(nlm,gauss (nlm,16)))
clp.set_output ()

now you are practically enjoying advantages from both sides, (and suffering from computing complexity from both sides too..)
feisty2 is offline   Reply With Quote
Old 1st November 2015, 20:13   #2  |  Link
Bloax
The speed of stupid
 
Bloax's Avatar
 
Join Date: Sep 2011
Posts: 317
It would seem like you're demonstrating with far too aggressive settings; the source image looks far better than the result thanks to the filters blurring out all details.
Bloax is offline   Reply With Quote
Old 1st November 2015, 23:19   #3  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by Bloax View Post
It would seem like you're demonstrating with far too aggressive settings; the source image looks far better than the result thanks to the filters blurring out all details.
Exactly, that's why it's called demo, not real case
I was just using that to show the difference
feisty2 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:42.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.