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 > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 4th July 2011, 11:18   #1  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Removing DV chroma noise

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
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 4th July 2011, 14:04   #2  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
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.

Code:
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.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)

Last edited by Didée; 4th July 2011 at 14:11.
Didée is offline   Reply With Quote
Old 4th July 2011, 15:37   #3  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
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.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 4th July 2011, 15:46   #4  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
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).
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 4th July 2011, 16:31   #5  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
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)
johnmeyer is offline   Reply With Quote
Old 5th July 2011, 00:27   #6  |  Link
henryho_hk
Registered User
 
Join Date: Mar 2004
Posts: 889
But isn't it CCD/CMOS noise?
henryho_hk is offline   Reply With Quote
Old 5th July 2011, 00:34   #7  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
Quote:
Originally Posted by henryho_hk View Post
But isn't it CCD/CMOS noise?
Well, the OP said chroma noise. I was responding to that.
johnmeyer is offline   Reply With Quote
Old 5th July 2011, 09:29   #8  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
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.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 5th July 2011, 09:45   #9  |  Link
Tempter57
Registered User
 
Join Date: Jan 2011
Location: Donetsk
Posts: 58
Boulder
variant with filter ccd_sse2.vdf 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)

Last edited by Tempter57; 5th July 2011 at 11:45.
Tempter57 is offline   Reply With Quote
Old 5th July 2011, 10:04   #10  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
Quote:
Originally Posted by Tempter57 View Post
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.
(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.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 5th July 2011, 10:20   #11  |  Link
Tempter57
Registered User
 
Join Date: Jan 2011
Location: Donetsk
Posts: 58
Quote:
Originally Posted by Didée View Post
Thus destroying the interlaced field structure.
(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)
Tempter57 is offline   Reply With Quote
Old 5th July 2011, 11:25   #12  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
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.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder 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 17:37.


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