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 > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th August 2015, 06:07   #221  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
@jackoneill
Did some more tests, your 16x16 SATD works at uint8_t but fails at uint16_t
feisty2 is offline   Reply With Quote
Old 30th August 2015, 15:01   #222  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Code:
import vapoursynth as vs
core = vs.get_core()
clp = xxx
clp = core.std.ShufflePlanes(clp, planes=0, colorfamily=vs.GRAY)
clp = core.fmtc.bitdepth(clp, fulls=False, fulld=True, bits=8)
sup = core.mv.Super(clp)
bv1 = core.mv.Analyse(sup,isb=True,blksize=8,overlap=4,delta=1,search=3,truemotion=True,dct=1)
fv1 = core.mv.Analyse(sup,isb=False,blksize=8,overlap=4,delta=1,search=3,truemotion=True,dct=1)
bv2 = core.mv.Analyse(sup,isb=True,blksize=8,overlap=4,delta=2,search=3,truemotion=True,dct=1)
fv2 = core.mv.Analyse(sup,isb=False,blksize=8,overlap=4,delta=2,search=3,truemotion=True,dct=1)
bv3 = core.mv.Analyse(sup,isb=True,blksize=8,overlap=4,delta=3,search=3,truemotion=True,dct=1)
fv3 = core.mv.Analyse(sup,isb=False,blksize=8,overlap=4,delta=3,search=3,truemotion=True,dct=1)
clp = core.mv.Degrain3(clp, sup, bv1, fv1, bv2, fv2, bv3, fv3, thsad=1200, thscd1=10000)
clp.set_output ()


Code:
import vapoursynth as vs
core = vs.get_core()
clp = core.d2v.Source ("D:/CIMW/VID.d2v")
clp = core.std.ShufflePlanes(clp, planes=0, colorfamily=vs.GRAY)
clp = core.fmtc.bitdepth(clp, fulls=False, fulld=True, bits=16)
sup = core.mv.Super(clp)
bv1 = core.mv.Analyse(sup,isb=True,blksize=8,overlap=4,delta=1,search=3,truemotion=True,dct=1)
fv1 = core.mv.Analyse(sup,isb=False,blksize=8,overlap=4,delta=1,search=3,truemotion=True,dct=1)
bv2 = core.mv.Analyse(sup,isb=True,blksize=8,overlap=4,delta=2,search=3,truemotion=True,dct=1)
fv2 = core.mv.Analyse(sup,isb=False,blksize=8,overlap=4,delta=2,search=3,truemotion=True,dct=1)
bv3 = core.mv.Analyse(sup,isb=True,blksize=8,overlap=4,delta=3,search=3,truemotion=True,dct=1)
fv3 = core.mv.Analyse(sup,isb=False,blksize=8,overlap=4,delta=3,search=3,truemotion=True,dct=1)
clp = core.mv.Degrain3(clp, sup, bv1, fv1, bv2, fv2, bv3, fv3, thsad=1200, thscd1=10000)
clp.set_output ()


don't wanna be an asshole here, but...
dct=1-4 for uint16_t are broken as well...
and I pulled a request on GitHub that should have fixed dct=5-10 for uint16_t by the way
but I got no idea how to fix this... so good luck with it
feisty2 is offline   Reply With Quote
Old 30th August 2015, 15:20   #223  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by feisty2 View Post
Code:
import vapoursynth as vs
core = vs.get_core()
clp = xxx
clp = core.std.ShufflePlanes(clp, planes=0, colorfamily=vs.GRAY)
clp = core.fmtc.bitdepth(clp, fulls=False, fulld=True, bits=8)
sup = core.mv.Super(clp)
bv1 = core.mv.Analyse(sup,isb=True,blksize=8,overlap=4,delta=1,search=3,truemotion=True,dct=1)
fv1 = core.mv.Analyse(sup,isb=False,blksize=8,overlap=4,delta=1,search=3,truemotion=True,dct=1)
bv2 = core.mv.Analyse(sup,isb=True,blksize=8,overlap=4,delta=2,search=3,truemotion=True,dct=1)
fv2 = core.mv.Analyse(sup,isb=False,blksize=8,overlap=4,delta=2,search=3,truemotion=True,dct=1)
bv3 = core.mv.Analyse(sup,isb=True,blksize=8,overlap=4,delta=3,search=3,truemotion=True,dct=1)
fv3 = core.mv.Analyse(sup,isb=False,blksize=8,overlap=4,delta=3,search=3,truemotion=True,dct=1)
clp = core.mv.Degrain3(clp, sup, bv1, fv1, bv2, fv2, bv3, fv3, thsad=1200, thscd1=10000)
clp.set_output ()


Code:
import vapoursynth as vs
core = vs.get_core()
clp = core.d2v.Source ("D:/CIMW/VID.d2v")
clp = core.std.ShufflePlanes(clp, planes=0, colorfamily=vs.GRAY)
clp = core.fmtc.bitdepth(clp, fulls=False, fulld=True, bits=16)
sup = core.mv.Super(clp)
bv1 = core.mv.Analyse(sup,isb=True,blksize=8,overlap=4,delta=1,search=3,truemotion=True,dct=1)
fv1 = core.mv.Analyse(sup,isb=False,blksize=8,overlap=4,delta=1,search=3,truemotion=True,dct=1)
bv2 = core.mv.Analyse(sup,isb=True,blksize=8,overlap=4,delta=2,search=3,truemotion=True,dct=1)
fv2 = core.mv.Analyse(sup,isb=False,blksize=8,overlap=4,delta=2,search=3,truemotion=True,dct=1)
bv3 = core.mv.Analyse(sup,isb=True,blksize=8,overlap=4,delta=3,search=3,truemotion=True,dct=1)
fv3 = core.mv.Analyse(sup,isb=False,blksize=8,overlap=4,delta=3,search=3,truemotion=True,dct=1)
clp = core.mv.Degrain3(clp, sup, bv1, fv1, bv2, fv2, bv3, fv3, thsad=1200, thscd1=10000)
clp.set_output ()


don't wanna be an asshole here, but...
dct=1-4 for uint16_t are broken as well...
and I pulled a request on GitHub that should have fixed dct=5-10 for uint16_t by the way
but I got no idea how to fix this... so good luck with it
Can you also post the same frame without any filtering?
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 30th August 2015, 15:34   #224  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Code:
import vapoursynth as vs
core = vs.get_core()
clp = xxx
clp = core.std.ShufflePlanes(clp, planes=0, colorfamily=vs.GRAY)
clp.set_output ()
feisty2 is offline   Reply With Quote
Old 3rd September 2015, 00:26   #225  |  Link
YAFU
Registered User
 
Join Date: Aug 2015
Posts: 40
noise reduction in Blender 3D cycles engine

Hello.
I post in this thread because I think my problem is related to mv tools (I've seen something like this script is used on page 8).
The user "brothermechanic" from blenderartists forum has published a script to reduce noise from videos made with Blender 3D renderings (Cycles engine):
http://www.blenderartists.org/forum/...th-VapourSynth

I'm using VapourSynth under Linux. Noise reduction is good, but there are problems with color banding. In some cases the banding is very noticeable. Here I share a set of images. In the video you can see the banding in the red walls and spheres:
https://www.dropbox.com/s/6miemtkv9a...Synth.zip?dl=0

I am not a programmer, I have no idea of scripting, so I'm a bit stuck here. So I would appreciate if you can take a look at the script and images, and if you can recommend me how to prevent the banding is so visible. Maybe we are doing something wrong with this script?

I know there are filters to debanding, but apparently they add noise to the image, and our main goal here is to remove the noise. So it would be great if you could recommend a better option to solve that problem.

I am making the video with this from terminal:
Quote:
vspipe --y4m script.vpy - | ffmpeg -i pipe: -vcodec libx264 -crf 10 encoded.mkv
PS: I guess that people with little knowledge of the issues discussed in this forum (like me) are not very welcome, because the random questions are very difficult...

Last edited by YAFU; 3rd September 2015 at 00:40.
YAFU is offline   Reply With Quote
Old 3rd September 2015, 01:53   #226  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
You're welcome here

Sorry for the rushed reply but it's 2am and i'm from my phone

www.pasteall.org/60924/python

Banding when using a denoising script is caused by processing thr image at a bitdepth too low, i modified the paste so that it use a 16bit pipeline [hoping that FT3dfilter support it].
I've also lowered the number of reference for motion estimation cause i've find degrain3 to strong.

Thsad of 400 is pretty high, try to use a lower value, something like 200,

Also i think you save your original blender render in jpg, don't do that, save it in png, even better if on png48, i've never used blender so i can't help you here.

Last tip, if the video you save is a temporary one to be reprocessed you can use a 10bit build of x264 on lossless mode [crf=0] and outputting a 4:4:4 video [--output-csp i444], or save it in png48 using imwri.write()
If it is the final render then let me know and wait utc 12:00 and i'll expand my explaination

Let me know if you have questions
MonoS is offline   Reply With Quote
Old 3rd September 2015, 02:18   #227  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Fft3d supports 8bits only
feisty2 is offline   Reply With Quote
Old 3rd September 2015, 04:24   #228  |  Link
YAFU
Registered User
 
Join Date: Aug 2015
Posts: 40
@MonoS, thank you for answer in those late hours of the night!

When using "png" the same banding is also generated. Blender supports many output formats and also 16 bits. So, is there some "Fft3d" alternative with 16 bits support (for vapoursynth)? I have seen that there is "Fft3dgpu"? Is that filter for vapoursynth and with 16-bit support? Generally Blender/Cycles users have high end GPU's.
YAFU is offline   Reply With Quote
Old 3rd September 2015, 04:29   #229  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
dfttest (category wise, both are frequency denoisers)
but these 2 are pretty destructive to high frequencies, you got some better options actually, like KNLMeansCL
and it even works at 32bits precision (floating point)
feisty2 is offline   Reply With Quote
Old 3rd September 2015, 05:18   #230  |  Link
YAFU
Registered User
 
Join Date: Aug 2015
Posts: 40
Thank you. I compiled and installed "KNLMeansCL" in linux (need to install "opencl-headers", but I'm not sure if it will work because I use "nvidia" proprietary driver ).
But I have no idea how to implement or adapt the script. Where could I find any examples on how to use it?
YAFU is offline   Reply With Quote
Old 3rd September 2015, 05:20   #231  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
http://forum.doom9.org/showthread.php?t=171379
feisty2 is offline   Reply With Quote
Old 3rd September 2015, 05:48   #232  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
example
Code:
import vapoursynth as vs
core = vs.get_core()

clp = core.imwri.Read('png-50/%04d.png', firstnum=1, alpha=False)
clp = core.fmtc.bitdepth (clp, bits=32, fulls=True, fulld=True, flt=True)
clp = core.fmtc.matrix (clp, mat="601", fulls=True, fulld=True)

def getvectors (src, pelclip, tr=6, pel=4, dct=0, thsad=400):
    core        = vs.get_core ()
    src16       = core.fmtc.bitdepth (src, fulls=True, fulld=True, bits=16, flt=False)
    supersoft   = core.mv.Super (src16, pel=pel, chroma=False, hpad=32, vpad=32, pelclip=pelclip, sharp=2, rfilter=4, levels=0)
    supersharp  = core.mv.Super (src16, pel=pel, chroma=False, hpad=32, vpad=32, pelclip=pelclip, sharp=2, rfilter=2, levels=0)
    def search (isb, delta):
        vectors = core.mv.Analyse (supersoft, isb=isb, overlap=16, blksize=32, search=3, chroma=False, truemotion=True, delta=delta, trymany=True, searchparam=16, pelsearch=16, dct=dct, levels=0, divide=2, badrange=-24)
        vectors = core.mv.Recalculate (supersoft, vectors, overlap=8, blksize=16, thsad=thsad//2, chroma=False, truemotion=True, search=3, searchparam=16, dct=dct, smooth=1, divide=2)
        vectors = core.mv.Recalculate (supersharp, vectors, overlap=4, blksize=8, thsad=thsad//2, chroma=False, truemotion=True, search=3, searchparam=16, dct=dct, smooth=1, divide=2)
        vectors = core.mv.Recalculate (supersharp, vectors, overlap=2, blksize=4, thsad=thsad//2, chroma=False, truemotion=True, search=3, searchparam=16, dct=dct, smooth=1, divide=0)
        return vectors
    bv          = [search (True, i) for i in range (tr, 0, -1)]
    fv          = [search (False, i) for i in range (1, tr+1)]
    vmulti      = bv + fv
    vmulti      = core.std.Interleave (vmulti)
    return vmulti

def degrainn (src, comp, pelclip, vmulti, tr=6, pel=4, thsad=400, thscd1=10000, thscd2=255):
    core        = vs.get_core ()
    comp16      = core.fmtc.bitdepth (comp, fulls=True, fulld=True, bits=16, flt=False)
    src16       = core.fmtc.bitdepth (src, fulls=True, fulld=True, bits=16, flt=False)
    superclip   = core.mv.Super (comp16, pel=pel, chroma=False, hpad=32, vpad=32, pelclip=pelclip, sharp=2, rfilter=2, levels=0)
    def MDG1 (a):
        bv      = core.std.SelectEvery (vmulti, tr*2, tr-1-a)
        fv      = core.std.SelectEvery (vmulti, tr*2, tr+a)
        MDG     = core.mv.Degrain1 (src16, superclip, bv, fv, thsad=thsad, thscd1=thscd1, thscd2=thscd2, plane=0, limit=65535)
        MDG     = core.fmtc.bitdepth (MDG, fulls=True, fulld=True, bits=32, flt=True)
        return MDG
    MDGMulti    = [MDG1 (i) for i in range (0, tr)]
    MDGMulti    = core.std.Interleave (MDGMulti)
    def MDGMerge (start=None, a=2):
        start   = core.std.Merge (core.std.SelectEvery (MDGMulti, tr, 0), core.std.SelectEvery (MDGMulti, tr, 1), 0.5) if start is None else start
        merge   = core.std.Merge (start, core.std.SelectEvery (MDGMulti, tr, a), 1/(a+1))
        a       = a+1
        clip    = merge if a == tr else MDGMerge (start=merge, a=a)
        return clip
    return MDGMerge ()

def nrfinal (spatial, dif, peldif, vmulti, pel=4, tr=6, thsad=4800, thscd1=10000, thscd2=255):
    core    = vs.get_core ()
    blankd  = core.std.Expr ([dif], "0.5")
    comp    = degrainn (blankd, dif, peldif, vmulti, tr=tr, pel=pel, thsad=thsad, thscd1=thscd1, thscd2=thscd2)
    NR      = core.std.MergeDiff (spatial, comp)
    return NR

def padding (src, left=0, right=0, top=0, bottom=0):
    core   = vs.get_core ()
    w      = src.width
    h      = src.height
    clip   = core.fmtc.resample (src, w+left+right, h+top+bottom, -left, -top, w+left+right, h+top+bottom, kernel="point", fulls=True, fulld=True)
    return clip

spt = core.std.CropRel (core.knlm.KNLMeansCL(padding(clp,24,24,24,24), 0, 24, 4, h=3.2),24,24,24,24)
dif = core.std.MakeDiff(clp,spt)
vec = getvectors (spt, None)
clp = nrfinal (spt, dif, None, vec)
clp.set_output ()

Last edited by feisty2; 3rd September 2015 at 14:37.
feisty2 is offline   Reply With Quote
Old 3rd September 2015, 11:24   #233  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Can't you simply make Blender generate your images without that noise in them, or with less noise?
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 3rd September 2015, 13:42   #234  |  Link
YAFU
Registered User
 
Join Date: Aug 2015
Posts: 40
@feisty2, thanks. "vsedit" shows me the following error:
Code:
Failed to evaluate the script:
Python exception: matrix: output bitdepth not supported.
Traceback (most recent call last):
  File "vapoursynth.pyx", line 1469, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:23703)
  File "/media/TEMPORAL/scrypt.vpy", line 5, in <module>
    clp = core.fmtc.matrix (clp, mat="601", col_fam=vs.YUV, bits=32, fulls=True, fulld=True)
  File "vapoursynth.pyx", line 1368, in vapoursynth.Function.__call__ (src/cython/vapoursynth.c:22272)
vapoursynth.Error: matrix: output bitdepth not supported.
And if I change that line 32 by 16, now I get the following error:
Code:
Failed to evaluate the script:
Python exception: knlm.KNLMeansCL: VapourSynthCreate error (clBuildProgram)!
Traceback (most recent call last):
  File "vapoursynth.pyx", line 1469, in vapoursynth.vpy_evaluateScript (src/cython/vapoursynth.c:23703)
  File "/media/TEMPORAL/scrypt.vpy", line 59, in <module>
    spt = core.std.CropRel (core.knlm.KNLMeansCL(padding(clp,24,24,24,24), 0, 24, 4, h=3.2),24,24,24,24)
  File "vapoursynth.pyx", line 1368, in vapoursynth.Function.__call__ (src/cython/vapoursynth.c:22272)
vapoursynth.Error: knlm.KNLMeansCL: VapourSynthCreate error (clBuildProgram)!
I'll try to find a simple script that makes use of "KNLMeansCL" to determine whether it is working properly on my installation.

@jackoneill. Yes, I could render with less noise increasing the render samples. But it means much greater render time by frame. You can spend hours/days rendering a few seconds of animation. That's why we are interested in reducing noise to save time with less samples. So, if by using images with more color depth I can avoid banding, that would be great.
YAFU is offline   Reply With Quote
Old 3rd September 2015, 13:59   #235  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Quote:
Originally Posted by YAFU View Post
@jackoneill. Yes, I could render with less noise increasing the render samples. But it means much greater render time by frame. You can spend hours/days rendering a few seconds of animation. That's why we are interested in reducing noise to save time with less samples. So, if by using images with more color depth I can avoid banding, that would be great.
As i expected, you are using a ray tracer, right??

If i remember right the "noise" you get it's not noise but lack of enough rays to build a proper pixel, so, if my understanding of the problem and the nature of the noise is right, you can substitute the first call to ft3dfilter with a gaussian blur [this will level out this lack of photons and make a better image for motion estimation], for the second call i don't know if it will be very useful, a lot of non static noise are already been removed by Degrain2
So, try removing the second call to ft3dfilter and substituting the first call with core.std.GBlur(ret, sigma=1.0) [IIRC GBlur don't work well with 16bit frames, you should try]

For png is to be expected some banding if you still use an 8bit pipeline, the use of png is needed to avoid jpeg compression artifact and chroma subsampling [you can turn off subsampling and use 100% quality, but you'll still get some little artifact and probably a bigger size than png].

Start saving your render in 16bit PNG then build up from this, now i'll take some look using your package.

EDIT: my apologies, the second call to ft3dfilter is required to remove quite a bit of remaining noise, i emulated it using dfttest but it cut out a lot of details as feisty2 said.

Also i made some errors in the script i sent you this morning, imwri read subsampled jpeg as RGB24 even if they in some sense are not, i'll post here the updated test script
Code:
input = core.fmtc.bitdepth(src, flt=True).fmtc.matrix(mat="601", col_fam=vs.YUV).fmtc.bitdepth(bits=16)

superF1 = core.generic.GBlur(input, 1.0)
superF2 = core.mv.Super(superF1, pel=2, sharp=1)
super = core.mv.Super(input)
#mvbw3 = core.mv.Analyse(superF2, isb=True, delta=3, overlap=4)
mvbw2 = core.mv.Analyse(superF2, isb=True, delta=2, overlap=4)
mvbw = core.mv.Analyse(superF2, isb=True, delta=1, overlap=4)
mvfw = core.mv.Analyse(superF2, isb=False, delta=1, overlap=4)
mvfw2 = core.mv.Analyse(superF2, isb=False, delta=2, overlap=4)
#mvfw3 = core.mv.Analyse(superF2, isb=False, delta=3, overlap=4)
 
ret = core.mv.Degrain2(clip=input, super=super, mvbw=mvbw, mvfw=mvfw, mvbw2=mvbw2, mvfw2=mvfw2, thsad=400)
 
ret = core.dfttest.DFTTest(ret, sigma=2.5).fmtc.bitdepth(bits=8, dmode=7)
ret.set_output()
this produced quite some nice [and washed out] result, here some screen
Frame 35: http://abload.de/img/nuovovapoursynthpytho77oeb.png
Frame 96: http://abload.de/img/nuovovapoursynthpytho4bqxt.png

last thing: there's already some banding in your original jpeg, you can't see it but if you apply some amplification you'll see it
frame 34: http://abload.de/img/nuovovapoursynthpythoqjodx.png

Last edited by MonoS; 3rd September 2015 at 14:27.
MonoS is offline   Reply With Quote
Old 3rd September 2015, 14:38   #236  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
@YAFU
corrected

edit:.. just @ed the wrong guy... that's embarrassing

Last edited by feisty2; 3rd September 2015 at 14:44.
feisty2 is offline   Reply With Quote
Old 3rd September 2015, 14:45   #237  |  Link
YAFU
Registered User
 
Join Date: Aug 2015
Posts: 40
@MonoS, That's right, Cycles is a ray tracing renderer:
https://www.blender.org/manual/rende...ght_paths.html

You can configure static noise pattern or random noise pattern. With static noise the noise reduction with the script does not work. The images I uploaded have random noise pattern.

I will analyze what you say and do some tests, it is a bit complicated to understand for me.

I'll upload a png sequence of 20 images at 16 bits for you can analyze if you want. But it will take some time because my bandwidth to upload is not good.
Thanks.
YAFU is offline   Reply With Quote
Old 3rd September 2015, 15:01   #238  |  Link
MonoS
Registered User
 
Join Date: Aug 2012
Posts: 203
Quote:
Originally Posted by YAFU View Post
@MonoS, That's right, Cycles is a ray tracing renderer:
https://www.blender.org/manual/rende...ght_paths.html

You can configure static noise pattern or random noise pattern. With static noise the noise reduction with the script does not work. The images I uploaded have random noise pattern.

I will analyze what you say and do some tests, it is a bit complicated to understand for me.

I'll upload a png sequence of 20 images at 16 bits for you can analyze if you want. But it will take some time because my bandwidth to upload is not good.
Thanks.
if you don't understand something don't be ashamed to ask, i've build up this knowledge across many years of experience across different subject [in which videogame and relative development are a crucial part ].

The reason why with the static noise the script doesn't work is because the script try to distinguish between detail and noise using the movement of the camera and the object and applying denoising only on what is changed between frames [in the case of my example script, 2 previous, the current and 2 successive frames], with static noise, as the name says, the noise don't move so for the script the noise become detail.

Maybe someone more expert than me can come up with an intelligent idea on how to remove the static noise using the fact that it's static and so a mask can be created to modify only the affected pixels, who know
MonoS is offline   Reply With Quote
Old 3rd September 2015, 16:07   #239  |  Link
YAFU
Registered User
 
Join Date: Aug 2015
Posts: 40
@MonoS, Thanks. Your tests look promising. I'll be doing some tests, perhaps this weekend.
Here I uploaded a sequence of png images at 16 bits. I have also included the blender scene in case any of you want to play with it
https://www.dropbox.com/s/xfndrsx5gw...scene.zip?dl=0

Download Blender (OpenSource, Free). Open the scene with Blender. The scene is set to use nvidia GPU (CUDA). If you do not have a good graphics card, in the right panel under "Render" in "Device" choose "CPU". Then on that panel a little below under "Performance" in "Tiles" you put a value of 32 in X and Y (32 is not related to bits, this is only frame size of each thread processor). To render the scene, in above menu in "Render" > "Render Animation". The images are saved by default in your "tmp" folder. Esc aborts rendering. If you want to play with the scene, the right mouse button selects objects. For navigate the 3D view (orbit) press the middle mouse button. You can play animation in the viewport (not rendered) by clicking the play button below in the timeline. What I say just if you want to spend a little fun time with Blender 3D . This scene is very simple just for testing and renders it relatively quickly.

Regarding noise reduction, I think random noise patterns is the right way to proceed, especially if the image has no quick/fast changes between frame and frame. Without knowing much about this, I think it would be relative easy to detect noise with static noise pattern, but then some algorithm should reconstruct the image below the noise considering neighbors pixels, and that would be quite difficult and maybe without good result.

@feisty2, do you know some very simple script where I can test whether "KNLMeansCL" is working well? I think OpenCL headres I installed to compile it only work with opensource drivers (I'm using "nvidia" driver), but I do not know.
YAFU is offline   Reply With Quote
Old 3rd September 2015, 16:16   #240  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Code:
##Load Vaporsynth
import vapoursynth as vs
core = vs.get_core()
##Load The Source Clip
clp = core.imwri.Read('png-50/%04d.png', firstnum=1, alpha=False)
clp = core.fmtc.bitdepth (clp, bits=32, fulls=True, fulld=True, flt=True)
clp = core.fmtc.matrix (clp, mat="601", fulls=True, fulld=True)
##The Actual KNLMeansCL
clp = core.knlm.KNLMeansCL(clp, d=0, a=24, s=4, h=3.2)
##Output
clp.set_output ()
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 09:41.


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