Log in

View Full Version : Chroma problem(swap?) near edge on anime...


LaTo
12th September 2008, 19:45
Hi!

To be short, here is the sample:
SAMPLE (200ko) (http://latoninf.free.fr/div/sample.avi)

I have tried to solve this problem, but my solution is slow...

Here it is:

directshowsource("OP.mkv",fps=23.976)

luma = last
Uchr = luma.UtoY()
Vchr = luma.VtoY()

### DENOISING CHROMA USING LUMA VECTORS (remove most of the problem)
VECS = luma.pointresize(width/2,height/2).MVanalyseMulti(refframes=6,chroma=false)
uC = Uchr.MVDegrainMulti(VECS,refframes=6,thSAD=600)
vC = Vchr.MVDegrainMulti(VECS,refframes=6,thSAD=600)

### MAKE MASK & AJUSTING THRESHOLD (preserve the other part of the picture)
thr = string(8)
uD = mt_makediff(uC,Uchr).mt_lut("x 128 "+thr+" - < 255 x 128 "+thr+" + > 255 0 ? ?",U=1,V=1)
vD = mt_makediff(vC,Vchr).mt_lut("x 128 "+thr+" - < 255 x 128 "+thr+" + > 255 0 ? ?",U=1,V=1)

### LIMIT CHROMA SATURATION & AJUSTING STRENGTH (try to solve the problem without strong denoising)
str = string(0.5)
uL = Uchr.mt_lut("x 128 - "+str+" * 128 +",U=1,V=1)
vL = Vchr.mt_lut("x 128 - "+str+" * 128 +",U=1,V=1)

### SWAP UV + INVERT -OR- UL/VL -OR- MVDEGRAINED CLIP ???
uFIX = mt_merge(Uchr,Vchr.Invert(),uD)
#uFIX = mt_merge(Uchr,uL,uD)
#uFIX = mt_merge(Uchr,uC,uD)

vFIX = mt_merge(Vchr,Uchr.Invert(),vD)
#vFIX = mt_merge(Vchr,vL,vD)
#vFIX = mt_merge(Vchr,vC,vD)

YToUV(uFIX, vFIX, luma)

Maybe some people can help, with good ideas it's surely possible to make a better script :script:

Thanks.

LaTo
13th September 2008, 14:53
Nobody?

Screenshot:
http://latoninf.free.fr/div/screenshot.png

Near the eye...

thetoof
13th September 2008, 15:45
What about fft3dfilter on plane=3 with high sigmas? Playing with sigma/2/3/4 could also be good... or some derainbow filter (Tcomb and cie)

martino
14th September 2008, 09:51
My fav: http://forum.doom9.org/showthread.php?p=1172924#post1172924

LaTo
14th September 2008, 15:15
These don't solve the problem :-/

45tripp
16th September 2008, 02:48
well it does if you go high enough
and don't mind a slight bleaching.
fft3dgpu(plane=3,sigma=45)


working off your script,
i found this reasonable:

AVISource("sample.avi")
luma = last
Uchr = luma.UtoY()
Vchr = luma.VtoY()

### DENOISING CHROMA USING LUMA VECTORS (remove most of the problem)
VECS = luma.pointresize(width/2,height/2).MVanalyseMulti(refframes=4,chroma=false)
uC = Uchr.MVDegrainMulti(VECS,refframes=4,thSAD=999)
vC = Vchr.MVDegrainMulti(VECS,refframes=4,thSAD=999)
### MAKE MASK & AJUSTING THRESHOLD (preserve the other part of the picture)
thr = string(4)
uD = mt_makediff(uC,Uchr).mt_lut("x 128 "+thr+" - < 255 x 128 "+thr+" + > 255 0 ? ?",U=1,V=1)
vD = mt_makediff(vC,Vchr).mt_lut("x 128 "+thr+" - < 255 x 128 "+thr+" + > 255 0 ? ?",U=1,V=1)

uFIX = mt_merge(Uchr,uc.fft3dgpu(sigma=50),uD)
vFIX = mt_merge(Vchr,vc.fft3dgpu(sigma=50),vD)

YToUV(uFIX, vFIX, luma)
fft3dgpu(plane=3,sigma=6)

pandy
16th September 2008, 11:29
if this is analog capture try to use S-VIDEO (ie separate chroma and luma at hardware level)