Log in

View Full Version : How would I remove grains from a video ?


Pages : 1 [2]

Sharc
2nd April 2021, 08:38
Obviously, when fields=AssumeTFF().SeparateFields(), deltas becomes evens .....

Maybe I am missing something, but shouldn't spatial-temporal filtering of interlaced video preferably be done on grouped even and odd fields individually, rather than just on the separated fields?

DTL
2nd April 2021, 08:48
Maybe I am missing something, but shouldn't spatial-temporal filtering of interlaced video preferably be done on grouped even and odd fields individually, rather than just on the separated fields?

It may help to not degrade vertical resolution but will doubles distance to next moving block in case of moving I think. Also at time of move block may also change its content so will fall outside thSAD more quickly and will be lost from processing.

With large enough tr values it is even become visible sometime how static areas become noise-free but moving areas still noisy. Though noise at moving areas is less visible.

For photon-shot noise each doubling number of processed images lowers noise to -3 dB I think. So for visible noise level lowering if is required to double or better quadruple tr param value. So degrain 2/3/4/5/6 is too limited in processing num of frames and can provide only about -6..8 dB (about 2 times in amplitude) less noise level.

Sharc
2nd April 2021, 22:44
It may help to not degrade vertical resolution but will doubles distance to next moving block in case of moving I think. Also at time of move block may also change its content so will fall outside thSAD more quickly and will be lost from processing.

With large enough tr values it is even become visible sometime how static areas become noise-free but moving areas still noisy. Though noise at moving areas is less visible.

For photon-shot noise each doubling number of processed images lowers noise to -3 dB I think. So for visible noise level lowering if is required to double or better quadruple tr param value. So degrain 2/3/4/5/6 is too limited in processing num of frames and can provide only about -6..8 dB (about 2 times in amplitude) less noise level.
SMDegrain has an interlaced mode: SMDegrain(....,interlaced=true) which seems to do the even/odd fields grouping and supports large tr. I didn't try it out much though.

hello_hello
7th April 2021, 18:53
I tried the following idea, just to see....

A = Last
B = A.Bob(0.0, 1.0)
C = B.SeparateFields()
D = C.SelectEvery(4, 0)
E = C.SelectEvery(4, 3)
F = Interleave(D, E).Weave()
return F
As best as I can tell, clips A & F above would be identical. So....


1. A low quality PAL source deinterlaced with Yadif and upscaled to 1080p for a look-see.
Yadif(Mode=1).CropResize(1920,1080, 20,0,-20,0, InDAR=20.0/11.0)

https://i.postimg.cc/NLkVBFjZ/1-Source.jpg (https://postimg.cc/NLkVBFjZ)

2. SMDegrain in interlaced mode, followed by the same de-interlacing and upscaling.
SMDegrain(Interlaced=true)
Yadif(Mode=1).CropResize(1920,1080, 20,0,-20,0, InDAR=20.0/11.0)

https://i.postimg.cc/WdCYXJ5q/2-SMDegrain-Interlaced-true.jpg (https://postimg.cc/WdCYXJ5q)

3. I was expecting this to look a fair bit better than SMDegrain in interlaced mode, but there wasn't a lot in it.
It's followed by Yadif de-interlacing and then it's upscaled again.
A = Last
B = A.Bob(0.0, 1.0).SMDegrain().ComplementParity()
C = B.SeparateFields()
D = C.SelectEvery(4, 0)
E = C.SelectEvery(4, 3)
Out = Interleave(D, E).Weave()
return Out.Yadif(Mode=1).CropResize(1920,1080, 20,0,-20,0, InDAR=20.0/11.0)

https://i.postimg.cc/64tdM9sv/3-Bob-SMDegrain-Reinterlace.jpg (https://postimg.cc/64tdM9sv)

Maybe not for every frame, but I think #3 usually had a very slight edge over #2, although it doesn't seem worthwhile. I might find something more grainy later and try again.
I didn't try for perfect denoising, or even good denoising. I just wanted to see if bobbing first might make a difference.


4. While I was at it... just for fun.... bobbing with QTGMC, then re-interlacing.
A = Last
B = A.QTGMC(EzDenoise=1.5)
C = B.SeparateFields()
D = C.SelectEvery(4, 0)
E = C.SelectEvery(4, 3)
Out = Interleave(D, E).Weave()
return Out.Yadif(Mode=1).CropResize(1920,1080, 20,0,-20,0, InDAR=20.0/11.0)

https://i.postimg.cc/06SW324W/4-QTGMC-Ez-Denoise-1-5-Reinterlace.jpg (https://postimg.cc/06SW324W)

5. And just because.... a progressive output from QTGMC. No need for Yadif on playback this time.
QTGMC(EzDenoise=1.5)
CropResize(1920,1080, 20,0,-20,0, InDAR=20.0/11.0)

https://i.postimg.cc/LnmTTVRb/5-QTGMC-Ez-Denoise-1-5.jpg (https://postimg.cc/LnmTTVRb)

lollo2
8th April 2021, 11:23
For my scripts I follow the recommendation given here https://forum.doom9.org/showthread.php?t=86394 and experimented that the best result when applying spatio-temporal or motion compensated filters to interlaced materials is obtained after double rate deinterlacing (I reinterlace back at the end).
This example uses RemoveDirtMC, MVDegrainMulti and sharpen as filtering; since then I moved to TemporalDegrain2 and LSFmod (and lossless nnedi3(field=-2) deinterlacing), but it shoud also give an idea (over-sharpened to highlight the difference)

original s-vhs capture
https://forum.doom9.org/attachment.php?attachmentid=17723&d=1617876847

mode A: just filtering without deinterlacing
https://forum.doom9.org/attachment.php?attachmentid=17724&d=1617877002

mode B: SeparateFields() / SelectEven().<filtering> / SelectOdd().<filtering> / Interleave() / Weave()
https://forum.doom9.org/attachment.php?attachmentid=17725&d=1617877091

mode C: <Bobbing deinterlacer> / <filtering> / SeparateFields() / SelectEvery(4,0,3) / Weave()

Bob version
https://forum.doom9.org/attachment.php?attachmentid=17726&d=1617877195

QTGMC version
https://forum.doom9.org/attachment.php?attachmentid=17727&d=1617877254

kedautinh12
8th April 2021, 11:31
Can't access your link

lollo2
8th April 2021, 17:03
Thanks for your interest. I suspect that the images are waiting admin approval, or that I did some mistake. I will wait a little bit and eventually repost...

kedautinh12
20th July 2021, 13:33
theoretical quality compare of some common video denoise filters
BM4D > NLMeans > Motion Compensate > Frequency Filters (FFT/DFT..) > Bilateral > Median Filter > simple linear filters (Gaussian Filter, Wiener Filter...)

How about KNLMeanCL??? Where i get BM4D??