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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 12th September 2015, 14:18   #1  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
halobuster - high quality halo remover

the filter is very high quality and almost harmless to details
cuz, it picks NLMeans, an advanced denoising algorithm instead of stuff like, blurring, minblur, destructive anyways as the dehalo kernel
Code:
Function HaloBuster (clip input, bool "lsb", int "a", float "h", float "thr", float "elast")
{
lsb = Default(lsb, False)
a= Default (a, 32)
h = Default(h, 6.4)
thr = Default(thr, 1.0)
elast = Default(elast, 1.5)
gray = lsb ? input.converttoy8 () : input.converttoy8 ().Dither_convert_8_to_16()
gray = stackvertical (dither_get_msb (gray).padding (a, a, a, a),dither_get_lsb (gray).padding (a, a, a, a))
clean = knlmeanscl (gray, d=0, a=a, s=0, h=h, lsb_inout=True)
mask = TCannyMod (converttoyv12 (clean.ditherpost (mode=-1)), sigma=1.5, mode=1, gmmax=50)
mask = mask.converttoy8 ()
mask = mt_lut (mask, "x 255 / 0.24 - 3.2 * 0.0 max 1.0 min 255 *")
mask = mt_expand (mask)
mask = mt_inflate (mask)
merge  = dither_merge16_8 (gray, clean, mask)
limit = Dither_limit_dif16 (gray, merge, thr=thr, elast=elast)
crop = Dither_crop16 (limit, a, a, -a, -a)
luma = lsb ? crop : crop.ditherpost (mode=-1)
final = input.IsY8 () ? luma : ytouv (input.utoy8 (), input.vtoy8 (), luma)
return final
}

Function Padding (clip input, int "left", int "top", int "right", int "bottom")
{
w = input.width ()
h = input.height ()

output = input.PointResize (w+left+right, h+top+bottom, -left, -top, w+left+right, h+top+bottom)

return output
}
parameters:
lsb --- clip is stacked 16bits or not (8bits)
h --- filtering strength
thr --- threshold, 0-255 scale, return pixel from the source clip if the difference < thr, otherwise, return pixel from the processed clip
elast --- softness of the threshold

only luma will be processed, chroma will be copied from the source clip

demo:
before





after
Code:
HaloBuster ()




Last edited by feisty2; 14th September 2015 at 15:16.
feisty2 is offline   Reply With Quote
 

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 00:49.


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