Log in

View Full Version : Question on restoring chroma to a heavily filtered video.


Chainmax
1st June 2006, 21:15
I am trying to make a miniDVD out of some digicam videoclips. Most of these clips were taken on low light conditions and the faces look extremely orange. A sigma of 12+ in FFT3DFilter helps alleviate that, but it causes some colored items to become almost grey. I tried using Tweak to counteract this, but it doesn't help much and the faces become unnaturaly orange again. Can I do anything about it?

communist
1st June 2006, 21:22
For low-light video you may want to take a look at HDRAGC - very good plugin :)
Followed by some light/heavy denoising, depends on how much noise is amplified.

Chainmax
1st June 2006, 21:39
I might try that, thanks for the tip.

Here's a comparison:

Before:
http://img458.imageshack.us/img458/7198/source5bp.png (http://imageshack.us)

After:
http://img458.imageshack.us/img458/3306/result4ps.png (http://imageshack.us)

krieger2005
1st June 2006, 23:01
i guess you let work the fft-filter on chroma... I could image, that such a high sigma-value would remove all small-chroma-parts.... So on these parts is no (or the colour of the neighbour-areas) colour any more after using fft...

Chainmax
1st June 2006, 23:40
I intend to keep the FFT3DFilter line, what I'd like to know is if there is any way to make scenes like the one in the screens I posted less grey without messing up good results like this one:



Source:
http://img381.imageshack.us/img381/1147/source6wu.png (http://imageshack.us)

Result:
http://img395.imageshack.us/img395/5425/result8yz.png (http://imageshack.us)

foxyshadis
2nd June 2006, 00:44
I think that script needs a posting, along with a sample. I suspect ColorYUV and Tweak to fix oversaturation and bleeding hues would be a better fix than hammering it with fft3d. But it's impossible to tell what can be done until there's a sample.

krieger2005
2nd June 2006, 01:08
Jep. Why Denoising? Maybe an RGBAdjust with more blue and green color. Somewhere here i saw a script, which lighten darker parts more than other... Something like this:
clip3=tweak(bright=20,cont=0.4,sat=1.5)
mask=Greyscale(invert(last)).tweak(bright=-180,cont=1.3)
overlay(clip3,mask=mask,opacity=.3,mode="add")
Tweak(cont=1.2, bright=0)

I think, you should try HDRAGC and then adjust the Color with RGBAdjust or something similar.

krieger2005
2nd June 2006, 01:16
ConvertToRGB32()RGBAdjust(.88,1.11,1.58,1).ConvertToYV12()
Tweak(bright=7, cont=1.06)
gave me this:
http://img485.imageshack.us/img485/5929/out8jn.th.png (http://img485.imageshack.us/img485/2082/out0sm.png)

Just the script above and get a good looking movie ;)

Chainmax
2nd June 2006, 02:33
foxyshadis, here's the current script:

HDRAGC()

FFT3DFilter(sigma=3,plane=3,bw=32,bh=32,bt=3,ow=16,oh=16)

ConvertToRGB32()RGBAdjust(.88,1.11,1.58,1).ConvertToYV12()
Tweak(bright=7, cont=1.06)

Crop(0,2,320,238,align=true)

a = last
b = a.DeGrainMedian(mode=0).VagueDenoiser(threshold=0.8, method=1, nsteps=6, chromaT=0.8)
SeeSaw(a,b, NRlimit=6, NRlimit2=7, Sstr=1.5, Slimit=5, Spower=5, SdampLo=6, Szp=16)

DeHalo_Alpha()

EEDI2().TurnRight().EEDI2().TurnLeft()

Spline16Resize(656,448)

LimitedSharpenFaster(SMode=4)

vf=last.mvanalyse(isb=false,blksize=4,pel=2,search=3,truemotion=true)
vb=last.mvanalyse(isb=true,blksize=4,pel=2,search=3,truemotion=true)
MVFlowFPS(last,vb,vf,num=30000,den=1001)

AddBorders(24,16,24,16)

As for posting a sample, I would have posted one in the OP but can't for two reasons: I'd have to ask each person in the clips if they allow me to post it on the net and there are about 8 clips, each shot on different situations.

krieger2005: thanks for the HDRAGC and RGBAdjust+Tweak suggestions, they work incredibly well :). As for why denoising: the source has some blocking, grain and rainbows.

AVIL
2nd June 2006, 06:07
You can change also parameters for FFT3Dfilter:


FFT3DFilter(sigma=6,sigma2=4,sigma3=3,sigma4=2,plane=3,bw=32,bh=32,bt=3,ow=16,oh=16)

with this multi-sigma parameter you give more filtering to high frequencies (litle artefacts) and is more conservative with low-frequencies (big masses of color).

Good luck

Chainmax
2nd June 2006, 12:48
Is there a VirtualDub and Avisynth filter I can use to fix this oversaturation?

Wilbert
2nd June 2006, 13:29
Did you try Tweak(sat=blabla), but you are not satisfied with it?

http://www.avisynth.org/mediawiki/Tweak

It even includes example pics.

G_M_C
2nd June 2006, 13:38
The source in this post: http://forum.doom9.org/showthread.php?p=835530#post835530 looks interleaced to me. Have u tried some form of de-interlacing (or simple separatefields () & weave () ) or the "interlaced=true" option in FFT3Dfilter ?

I'd clean the video firstwith FFT3D, before using HDRAGC because it prevents enhancing the noise in the HDRAGC stage. You can always clean a bit more, with a low sigma afterwards.

for ex:

Separatefields()
FFT3DFilter(sigma=3,plane=3,bw=32,bh=32,bt=3,ow=16,oh=16)
HDRAGC(max_gain=4,min_gain=1,corrector=0.8)
weave()


For saturation and other color corrections HDRAGC has some other options, like min_sat. See also: http://strony.aster.pl/paviko/hdragc.htm

Also i recommend using FFT3DGPU if yoyr system is able to (new enough GPU); It's the version of FFT3D wich runs on the GPU, and it runs quite a bit faster !

krieger2005
2nd June 2006, 14:24
I think FFT should be used for every field, not simply after separatefields, so
interleave(SelectOdd.FFT...(), SelectEven.FFT...())

BTW: I saw somewhere here a Avisynth-FIlter, which manipulate only some parts of the chroma and could change for example only "orange faces".... But i don't know the name of it for now.

G_M_C
2nd June 2006, 14:32
Don't know krieger2005, but if so the exampkle i gave could also be changed to (i think):


FFT3DFilter(sigma=3,plane=3,bw=32,bh=32,bt=3,ow=16,oh=16,interlaced=true)
Separatefields()
HDRAGC(max_gain=4,min_gain=1,corrector=0.8)
weave()


The problem still being that the clip is interlaced, and many plugins/filters dont work as intended on interlaced clips :p

So in my opinion it is better to de-interlace it first before doing any filtering/changing (if the clip is interlaced in the first place that is ;) )

Chainmax
2nd June 2006, 14:34
I'll try to toy with HRDAGC's settings to see if I can make it not amplify the chroma problem.

Wilbert: I did try Tweak (read the OP) but it didn't do much good since it nullifies any attempt to make something out of the orange/reddish faces.

G_M_C: the source is not interlaced, the screenshot looks like it because it was blown up from 320x240 to 640x480 with PointResize. I'll put the FFT3DFilter line before the HDRAGC one, thanks for the suggestion.

krieger2005: that filter you mention sounds like just what I need. If you remember the name, please post it here.

krieger2005
2nd June 2006, 14:44
I will post the name when i find it on my HD :). But i remember now for a modified version of Tweak (i don't know what is the original and what the modified name, there are TweakColor and Tweak), where you can change the saturation of a specific area (given in degrees). I don't like it, because it also include much false Color-Areas (because of noise) but you can try it, maybe it works for you... You should find it at warpenterprises

Wilbert
2nd June 2006, 14:44
krieger2005: that filter you mention sounds like just what I need. If you remember the name, please post it here.
You need v2.60 pre-alpha (see feedback page avisynth.org), and you need to read the documentation of Tweak once more (edit: it has the same funtionality as TweakColor which krieger2005 is referring to). Btw, it's pre-alpha so you it at your own risk.

If you send me a short clip, i will look at it.

G_M_C
2nd June 2006, 14:46
I'll try to toy with HRDAGC's settings to see if I can make it not amplify the chroma problem.

Wilbert: I did try Tweak (read the OP) but it didn't do much good since it nullifies any attempt to make something out of the orange/reddish faces.

G_M_C: the source is not interlaced, the screenshot looks like it because it was blown up from 320x240 to 640x480 with PointResize. I'll put the FFT3DFilter line before the HDRAGC one, thanks for the suggestion.

krieger2005: that filter you mention sounsd like just what I need. If you remember the name, please post it here.

Too ban you cant put a small sample up somewhere, so more of us can toy with it :)

Chainmax
2nd June 2006, 15:13
New try:

http://img391.imageshack.us/img391/5498/nskript0en.png (http://imageshack.us)


Relevant script portion:

FFT3DFilter(sigma=3,plane=4,bw=32,bh=32,bt=3,ow=16,oh=16)

HDRAGC()

Tweak(hue=-15,sat=0.9)

Chainmax
2nd June 2006, 21:17
You can download a small sample from [link deleted].

Chainmax
7th June 2006, 00:52
Has anyone tried the sample clip?

videoFred
7th June 2006, 07:21
OK,

I tried this: MVDenoise + HDR ACG + LimitedsharpenFaster.
HDR ACG settings: coef_gain=1.2, max_sat=0.7, shift_u=5, shift_v=-15, shift=-5
http://users.pandora.be/ho-slotcars/HDR/HDR_Doom_010.jpg

http://users.pandora.be/ho-slotcars/HDR/HDR_Doom_011.jpg

I think the result is pretty good.
You can play with the shift_u and shift_v parameters to change color balance.

Fred.

Chainmax
8th June 2006, 13:28
Those results are awesome, but I can't reproduce them with the HDR AGC settings you posted, what I get is not nearly as bright or colorful as the "after" pics you posted. Here's the script:

ConvertToYV12()

DeHalo_Alpha()

HDRAGC(coef_gain=1.2, max_sat=0.7, shift_u=5, shift_v=-15, shift=-5)

Crop(0,2,320,238,align=true)

a = last
b = a.DeGrainMedian().VagueDenoiser(threshold=0.8, method=1, nsteps=6, chromaT=0.8)
SeeSaw(a,b, NRlimit=6, NRlimit2=7, Sstr=1.5, Slimit=5, Spower=5, SdampLo=6, Szp=16)

EEDI2().TurnRight().EEDI2().TurnLeft()

Spline16Resize(656,448)

LimitedSharpenFaster(SMode=4,Strength=150)

vf=last.mvanalyse(isb=false,blksize=4,pel=2,search=3,truemotion=true)
vb=last.mvanalyse(isb=true,blksize=4,pel=2,search=3,truemotion=true)
MVFlowFPS(last,vb,vf,num=30000,den=1001)

AddGrain(10,0,0)

AddBorders(24,16,24,16)

ConvertToRGB()

videoFred
8th June 2006, 13:53
Sorry to hear this...
Have you tried HDR ACG on his own?
This difference must be caused by something..

Oh, yes, I also used max_gain=16, min_gain=1.5

Fred.

Chainmax
8th June 2006, 18:56
Are you sure those are the settings you used? Even with this script:

ConvertToYV12()

VagueDenoiser(threshold=0.8, method=1, nsteps=6, chromaT=0.8)

HDRAGC(max_gain=16,min_gain=1.5,coef_gain=1.2,max_sat=0.7,shift_u=5,shift_v=-15,shift=-5)

Crop(0,2,320,238,align=true)

LimitedSharpenFaster(SMode=4,Strength=150)

vf=last.mvanalyse(isb=false,blksize=4,pel=2,search=3,truemotion=true)
vb=last.mvanalyse(isb=true,blksize=4,pel=2,search=3,truemotion=true)
MVFlowFPS(last,vb,vf,num=30000,den=1001)

I don't get anything close to your results :confused:.

videoFred
9th June 2006, 06:53
Chainmax,

I made a mistake:scared:

It's not max_sat=0.7
but coef_sat=0.7

I hope you have the same results, now.

*EDIT* I tried max_sat=0.7 and yes, it takes all the colors away.


Sorry,
Fred.

Chainmax
9th June 2006, 19:32
Wonderful, now it looks great after changing that and upping the reducer switch. Thanks for all your help, I really appreciate it :).