Log in

View Full Version : New halo removers discussion


Pages : 1 2 [3]

flebber
27th April 2010, 03:15
No advice whatsoever?
Please?...

your photos are pending approval, upload to flickr or whatever and post photo's in so people can instantly view.

the_provider
27th April 2010, 11:29
your photos are pending approval, upload to flickr or whatever and post photo's in so people can instantly view.

I can see them so I guess everybody else can see them, too.
I have them on flickr now but for some reason I couldn't make the appear here(I used the Insert photo button with no visible result), here is an example: http://www.flickr.com/photos/49747562@N08/4557549414/

Thank you in advance.
Best regards.

flebber
27th April 2010, 15:39
Well definitely try dehalo_alpha.

Maybe

FFT3dGPU(sigma=3.0, plane=4, bt=0,sharpen=1, bw=32, bh=32)
DeHalo_alpha()
LSFmod(defaults="slow")

You could always try fft3dfilter instead of the GPU version, dfftest does a good job but can be a little slow for me.

Or even

MCTemporalDenoise(edgeclean=true, ecrad=4, stabilize=true, maxr=2)
DeHalo_alpha()
LSFmod(defaults="slow")

Lyris
27th April 2010, 15:45
The first image appears to be an optical halo. I've seen this on a lot of older flying spot scanner transfers, the white areas "glow".
I don't think dehalo filters will work for that.

The second image looks like it's been camcorded from a TV set? It has optical glowing AND an electronic halo (smaller darker line). The halo remover would likely get rid of the thick black line, but not the white light spilling over the boundary.

The third one is entirely electronic, but it looks like all of the detail in this image is confined to the middle frequencies. Removing the halos is likely to be of limited success.

the_provider
27th April 2010, 22:45
First I would like to thank everybody who take the time to reply.

Well definitely try dehalo_alpha.

I would like to do that, too but I keep getting the same error:
Error reading source frame 0: Avisynth read error: CAVIStreamSynth: System exception - Acces violation...
I use the following script:
LoadPlugin("C:\Software\GORDIA~1\DGMPGDec\DGDecode.dll")
LoadPlugin("C:\Downloads\BitComet\VirtualDub-1.9.9\plugins\Repair.dll")
LoadPlugin("C:\Downloads\BitComet\VirtualDub-1.9.9\plugins\RemoveGrain.dll")
LoadPlugin("C:\Downloads\BitComet\VirtualDub-1.9.9\plugins\mt_masktools-25.dll")
Import("C:\Documents and Settings\Catalin\My Documents\Video_related\BlindDeHalo3_mt2.avs")

LoadPlugin("C:\Software\GORDIA~1\AviSynthPlugins\UnDot.dll")


# SOURCE
mpeg2source("C:\BitComet_Download\BurebistaDVD\VIDEO_TS\Burebista1.d2v")

#Version()
ConvertToYV12()

BlindDeHalo3()

# CROPPING
crop(2,20,716,536)

# RESIZING
LanczosResize(720,368)

# DENOISING: choose one combination (or none)
Undot()
where BlindDeHalo3_mt2.avs(I have a core 2 duo processor) contains:
function BlindDeHalo3( clip clp, float "rx", float "ry", int "strength",
\ float "lodamp", float "hidamp", float "sharpness", float "tweaker",
\ int "PPmode", int "PPlimit", bool "interlaced")
{
rx = default( rx, 3.0 )
ry = default( ry, 3.0 )
strength = default( strength, 125 )
lodamp = default( lodamp, 0.0 )
hidamp = default( hidamp, 0.0 )
sharpness = default( sharpness, 0.0 )
tweaker = default( tweaker, 0.0 )
PPmode = default( PPmode, 0 )
PPlimit = default( PPlimit, (abs(PPmode)==3) ? 4 : 0 )
interlaced = default( interlaced, false )

sharpness = (sharpness>1.58) ? 1.58 : sharpness
tweaker = (tweaker > 1.00) ? 1.00 : tweaker
strength = float(strength)*(1.0+sharpness*0.25)
RR = string((rx+ry)/2.0)
ST = string(float(strength)/100.0)
LD = string(lodamp)
HD = string(pow(hidamp,2))
TWK0 = "x y - 12 "+ST+" / "+RR+" / /"
TWK = "x y - 12 "+ST+" / "+RR+" / / abs"
TWK_HLIGHT = "x y - abs 1 < 128 "+TWK+" 128 "+TWK+" - "+TWK+" 128 / * + "+TWK0+" "+TWK+" "+LD+" + / * "
\ + "128 "+TWK+" - 20 / 2 ^ 128 "+TWK+" - 20 / 2 ^ "+HD+" + / * 128 + ?"

i = (interlaced==false) ? clp : clp.separatefields()
oxi = i.width
oyi = i.height
sm = i.bicubicresize(m4(oxi/rx),m4(oyi/ry))
mm = mt_lutxy(sm.mt_expand(),sm.mt_inpand(),"x y - 4 *").mt_expand().mt_deflate().blur(1.58).mt_inflate().bicubicresize(oxi,oyi,1.0,.0).mt_inflate()
sm = sm.bicubicresize(oxi,oyi,1.0,.0)
smd = mt_lutxy(i.sharpen(tweaker),sm,TWK_HLIGHT)
smd = (sharpness==0.0) ? smd : smd.blur(sharpness)
clean = mt_lutxy(i,smd,yexpr="x y 128 - -").mergechroma(i)
clean = mt_merge(i,clean,mm)

LL = string(PPlimit)
LIM = "x "+LL+" + y < x "+LL+" + x "+LL+" - y > x "+LL+" - y ? ?"

base = (PPmode<0) ? i : clean
small = base .bicubicresize(m4(oxi/sqrt(rx*1.5)),m4(oyi/sqrt(ry*1.5)))
ex1 = small.mt_expand().blur(.5)
in1 = small.mt_inpand().blur(.5)
hull = mt_logic( mt_lutxy( ex1.mt_expand().RemoveGrain(12,-1), ex1, "x y - 1 1 / * 1.0 ^ 1 - 5 *" )
\ ,mt_lutxy( in1, in1.mt_inpand().RemoveGrain(12,-1), "x y - 1 1 / * 1.0 ^ 1 - 5 *" )
\ ,"max", U=-128, V=-128)
\ .bicubicresize(oxi,oyi,1.0,.0)

postclean = (abs(PPmode)== 1) ? mt_merge(base,small.bicubicresize(oxi,oyi,1.0,.0),hull,Y=3,U=2,V=2)
\ : (abs(PPmode)== 2) ? mt_merge(base,base.RemoveGrain(19,-1),hull,Y=3,U=2,V=2)
\ : (abs(PPmode)== 3) ? mt_merge(base,base.RemoveGrain(4,-1),hull,Y=3,U=2,V=2)
\ : clean

postclean = (PPlimit==0) ? postclean
\ : mt_lutxy(base,postclean,yexpr=LIM,U=2,V=2)

(PPmode==0) ? clean : postclean
interlaced ? weave() : last

return( last )
}
#---------------------------------------------------------
function m4(float x) {return(x<16?16:int(round(x/4.0))*4)}


OR
DeHalo_alpha, of course with the proper change in the Import command in my script:
function DeHalo_alpha(clip clp, float "rx", float "ry", float "darkstr", float "brightstr", float "lowsens", float "highsens", float "ss")
{
rx = default( rx, 2.0 )
ry = default( ry, 2.0 )
darkstr = default( darkstr, 1.0 )
brightstr = default( brightstr, 1.0 )
lowsens = default( lowsens, 50 )
highsens = default( highsens, 50 )
ss = default( ss, 1.5 )

LOS = string(lowsens)
HIS = string(highsens/100.0)
DRK = string(darkstr)
BRT = string(brightstr)
ox = clp.width()
oy = clp.height()
uv = 1
uv2 = (uv==3) ? 3 : 2

halos = clp.bicubicresize(m4(ox/rx),m4(oy/ry)).bicubicresize(ox,oy,1,0)
are = mt_lutxy(clp.mt_expand(U=uv,V=uv),clp.mt_inpand(U=uv,V=uv),"x y -","x y -","x y -",U=uv,V=uv)
ugly = mt_lutxy(halos.mt_expand(U=uv,V=uv),halos.mt_inpand(U=uv,V=uv),"x y -","x y -","x y -",U=uv,V=uv)
so = mt_lutxy( ugly, are, "y x - y 0.001 + / 255 * "+LOS+" - y 256 + 512 / "+HIS+" + *" )
lets = mt_merge(halos,clp,so,U=uv,V=uv)
remove = (ss==1.0) ? clp.repair(lets,1,0)
\ : clp.lanczosresize(m4(ox*ss),m4(oy*ss))
\ .mt_logic(lets.mt_expand(U=uv,V=uv).bicubicresize(m4(ox*ss),m4(oy*ss)),"min",U=uv2,V=uv2)
\ .mt_logic(lets.mt_inpand(U=uv,V=uv).bicubicresize(m4(ox*ss),m4(oy*ss)),"max",U=uv2,V=uv2)
\ .lanczosresize(ox,oy)
them = mt_lutxy(clp,remove,"x y < x x y - "+DRK+" * - x x y - "+BRT+" * - ?",U=2,V=2)

return( them )
}

function m4(float x) {return(x<16?16:int(round(x/4.0)*4))}

Any other way of using DeHalo?
I am using Avisynth 2.6

Thank you in advance.

Gavino
27th April 2010, 22:53
LoadPlugin("C:\Downloads\BitComet\VirtualDub-1.9.9\plugins\mt_masktools-25.dll")
...
I am using Avisynth 2.6
Then you should be using mt_masktools-26.dll

the_provider
29th April 2010, 08:51
Then you should be using mt_masktools-26.dll

Thank you for the tip, the script works now.

I will see if it helps with restoring my video, too, and get back with results.

Best regards.

byme
4th May 2010, 00:10
I wonder if with BlindDeHalo can keep dark areas, as with the DeHalo_alpha acting on darkstr=0.0

add a VMToon not convinced me

:thanks:

Akai-Shuichi
6th December 2012, 05:11
I posted this in a separate thread, but thought I'd post it here as well. I'm not very familiar with dehaloing in general so I was wondering what filter/settings could fix this?


http://oi45.tinypic.com/r1zbia.jpg

Guest
6th December 2012, 15:05
I posted this in a separate thread, but thought I'd post it here as well. Not allowed per forum rule 8: no cross-posting. Please don't do it again.

x265
8th April 2013, 07:16
I posted this in a separate thread, but thought I'd post it here as well. I'm not very familiar with dehaloing in general so I was wondering what filter/settings could fix this?


http://oi45.tinypic.com/r1zbia.jpg

I have these dvd's and calling the dehalo_alpha() once fixed the problem.

lansing
21st November 2013, 19:08
I'm trying to use the abcxyz function, I already have the masktools2 2.0a48 installed, but it still give me the error message "there is no function named yv12lutxy", what else am I missing?

EDIT:

I found out what's the problem. I was confused by the wiki page, where it said there's an updated version with masktools2, but the link was linking to the masktools version.

http://avisynth.nl/index.php/Abcxyz

Reel.Deel
22nd November 2013, 04:40
I found out what's the problem. I was confused by the wiki page, where it said there's an updated version with masktools2, but the link was linking to the masktools version.

Sorry about that, that's my fault. Before I uploaded anything blindly, I wanted to make sure that the output of abcxyz with MaskTools2 was identical to the original. Indeed it is. Somehow I forgot to update it. :o
It's fixed (http://avisynth.nl/index.php/Abcxyz) now.