View Full Version : White and black halos removing


Great Dragon
5th November 2010, 15:18
Hi guys.

I'm trying to deal with some halos and especially black borders near the edges.
So I've searched through forum for any good solutions.
No surprise but all halos removers (that I've found) done by our guru Didee.

And here is a result of my searching.

mpeg2source("e:\_alf\101\VTS_01_1.d2v")
QTGMC(Preset="very slow", lossless=1)
selecteven()

o = last

mb1 = o.minblurX(1,1)
mb2 = mb1.minblurX(2,1)
mb12 = mb1.mt_lutxy(mb2,"x 3 + y < x 2 + x 3 - y > x 2 - y ? ?",U=2,V=2)

e = mb1.mt_edge("prewitt",0,255,0,255)
e3 = e.mt_expand().mt_expand().mt_expand().removegrain(11,-1).mt_expand()

h = o.repair(mb12.removegrain(11,-1),17)
hD = mt_makediff(h,o)
h1 = h.minblurX(1,1)
hsD = mt_makediff(h1.minblurX(2,1),h1).mt_lut("x 128 - 8 * 128 +")
DD = mt_lutxy(hsD,hD,"x 128 - y 128 - * 0 < y 128 - 4 / 0 1 - * 128 + x 128 - abs y 128 - abs < x y ? ?").removegrain(5)
h = h.mt_makediff(DD,U=2,V=2)
x1 = o.mt_merge(h,e3,U=2,V=2) .mt_merge(o,e,U=2,V=2)
x1

src= last
BDH3 = src.BlindDeHalo3(rx=2.0,ry=2.5)
BDH3_med = BDH3.repair(BDH3.MedianBlur(2,-333,-333),1) # using radius 2
BDH3_diff = mt_makediff(src,BDH3)
BDH3_med_diff = mt_makediff(BDH3,BDH3_med)
DD = mt_lutxy(BDH3_diff,BDH3_med_diff,"x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?")

BDH3.mt_adddiff(DD,U=2,V=2) # the result

mergechroma(awarpsharp2(type=1))

MCTemporalDenoise(settings="low", sigma=4, twopass=true, stabilize=false, gpu=false, enhance=true, edgeclean=true, truemotion=true, AGstr=0.0, GFthr=1.0, \
SHmode=3, Tovershoot=2, deblock=false, chroma=true, ECrad=3, ECthr=32, ECmode="dfttest().dehalo_alpha()")


Resulting picture is quite fine but there is still some dark borders left.
Source | Filtered
http://d.imagehost.org/t/0803/00.jpg (http://d.imagehost.org/view/0803/00) | http://d.imagehost.org/t/0759/07_05_mc-l_t2.jpg (http://d.imagehost.org/view/0759/07_05_mc-l_t2)
Sample (http://rapidshare.com/files/429043200/alf_sample_201.demuxed.m2v)

But there are places where this script isn't so good.
Source | Encode
http://b.imagehost.org/t/0693/00_source_deint.jpg (http://b.imagehost.org/view/0693/00_source_deint) | http://b.imagehost.org/t/0488/01_enc.jpg (http://b.imagehost.org/view/0488/01_enc)
Sample (http://rapidshare.com/files/429042959/alf_sample_101.demuxed.m2v)

Can someone take a look and suggest any improvements to my script?

I've also tried dehalo_alpha() but it makes live action video looks unnatural, like oil painted.