Log in

View Full Version : Removing DV chroma noise


Boulder
4th July 2011, 11:18
Is there a good way to remove the chroma noise that is apparent in low-light conditions but not visible in daylight shots? It is possible to dampen it by using insanely high sigma3 and sigma4 for the chroma planes in FFT3DFilter, but it naturally affects also frames which should not be touched at all.

Here's a sample, the ugly noise can be seen in the background wall as bluish and yellowish spots.

http://www.mediafire.com/?m2027v2f9daa325

Didée
4th July 2011, 14:04
The old dreadful problem, still without any brilliant solution. (AFAIK. Perhaps I missed something?)

Three variants: 1) plain FFT3D, 2) ttempsmooth using FFT3D as 'pfclip', 3) "Least-pixel-change" combination of them both.

No better ideas for the moment.

AviSource("dv_sample.avi")
o = last
fft = o.fft3dfilter(sigma=1,sigma2=2,sigma3=8,sigma4=12,bw=64,bh=64,ow=32,oh=32,bt=3,interlaced=true,plane=1)
tts = o.ttempsmooth(5,12,12,6,6,strength=4,pfclip=fft).mt_lutxy(o,Y=4,U=2,V=4)

D1 = mt_makediff(o,fft,Y=1,U=3,V=1)
D2 = mt_makediff(o,tts,Y=1,U=3,V=1)
DD = mt_lutxy(D1,D2,"x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?",Y=1,U=3,V=1)

the_least = o.mt_makediff(DD,Y=2,U=3,V=2)

# fft # fft3dfilter on U-plane
# tts # ttempsmooth on U-plane, with pfclip=FFT3D
the_least # from fft and tts, use (per-pixel) whichever did *less* change to the original pixel

return(last)

Reasoning: as long as there's only little motion, ttempsmooth can smooth out chroma almost as good as FFT3D, while doing less desaturation (see the blue present parcel).
Not quite sure if those ttempsmooth thresholds are good, or too aggressive, or not aggressive enough ... however it should be reasonably safe to use aggressive thresholds with ttemsmooth, as it's limited to never do more than what FFT3D did.

Boulder
4th July 2011, 15:37
Thanks, Didée. Would it be optimal to create a motion compensated clip to feed to the chain? I could plug that chroma denoising process inside my current denoising method which includes using MAnalyse/MCompensate.

Didée
4th July 2011, 15:46
Maybe yes, maybe no. That's left over to be tried out. The possible danger is that with motion compensation things start to "snap in" again, resulting in less blotch removal. (Like in general denoising, where in non-motion areas a plain TemporalSoften is always more effective than MDegrain).

johnmeyer
4th July 2011, 16:31
fft3d is probably a better tool, but one I used with great success for VHS chroma noise was CNR, a VirtualDub plugin. This was ported to AVISynth many years ago as CNR2. This is a typical call for VHS noise:

Cnr2("oxx",8,14,191,75,255,20,255,false)

henryho_hk
5th July 2011, 00:27
But isn't it CCD/CMOS noise?

johnmeyer
5th July 2011, 00:34
But isn't it CCD/CMOS noise?Well, the OP said chroma noise. I was responding to that.

Boulder
5th July 2011, 09:29
It's the standard CCD chroma noise which affects low-quality cells if I remember correctly. My DV camera dates from 2005 so it's definitely not current tech ;)

CNR2 gets rid of some of the noise but leaves some artefacts to certain areas so it's not usable for my materials. Didée's function seems to work quite well, I just need to encode a longer clip and see how it looks upon playback.

Tempter57
5th July 2011, 09:45
Boulder
variant with filter ccd_sse2.vdf (http://acobw.narod.ru/file/ccd.zip) by S.Stolyarevsky :

LoadVirtualDubPlugin("C:\Program Files\AviSynth\plugins 2.5\ccd_sse2.vdf", "CamCD", 0)
ConvertToRGB32().CamCD(30,2).converttoyv12()
Temporalsoften(3,3,15,15,2)

Didée
5th July 2011, 10:04
LoadVirtualDubPlugin("C:\Program Files\AviSynth\plugins 2.5\ccd_sse2.vdf", "CamCD", 0)
ConvertToRGB32().CamCD(30,2).converttoyv12()
Temporalsoften(3,3,15,15,2)
Thus destroying the interlaced field structure. :eek:
(On chroma, at least. Not sure if 'ccd' is merely temporal, or spatial/spatio-temporal?)

Even if the filter is interlacing compliant, you absolutely need the "interlaced=true" parameter in the ConvertToXX filters.

Tempter57
5th July 2011, 10:20
Thus destroying the interlaced field structure. :eek:
(On chroma, at least. Not sure if 'ccd' is merely temporal, or spatial/spatio-temporal?)

Even if the filter is interlacing compliant, you absolutely need the "interlaced=true" parameter in the ConvertToXX filters.

SetMTMode(2)
setmemorymax(640)
ConvertToRGB32(interlaced=true).CamCD(30,1) . ConvertToYV12(interlaced=true)
chroma = last
MDegrain2i2(chroma,8,4,5)
ConverttoYUY2(interlaced=true)

Boulder
5th July 2011, 11:25
My source will be QTGMC-bobbed to 50fps so fortunately I don't have to deal with interlacing. I'll test that filter as well, I had to convert to RGB for Deshaker anyway so I can plug it there without bothering Avisynth.