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 14th January 2012, 13:36   #1  |  Link
Registered User
Join Date: Nov 2010
Posts: 11
Dehalo on text

There are several instances of pretty blatant halos around text (mostly credits, but some text creeps up throughout the episodes too) in this source (there is some haloing on other parts of the source, but nothing as blatant, nor would I suspect as easy to fix, so for now I'm just focusing on the text):
Halo: http://i.imgur.com/PZwer.png
Blurred: http://i.imgur.com/Mm6oL.png

The second image is a simple blur(1.2) which does a better job at hiding the halos than any of the various dehalo filters I found lying around, but of course it destroys a lot of detail in more complicated scenes, and even on some of the kanji themselves. I tried preventing the more detailed parts of scenes, and scenes without text from being affected by throwing together a quick mask, but I don't really (obviously) have much experience trying to mask things off:
halod = last
dhalod = halod.blur(1.2)
mask = halod.mt_edge(mode="laplace", thY1=30, thY2=30).averageblur(radY=5).mt_binarize(0)
mt_merge(halod, dhalod, mask)
The result of this is pretty good for my purposes. The idea is that this will find the places with really high luma differences (white text on dark background), expand the area to include the halos, and replace that portion with the blurred portion.

Besides blurring the kanji (since I couldn't really think of a good way to expand just the edges of the mask) it doesn't take into account changes to the mask over time so sometimes as the background moves behind the text, portions of the text will flicker between halo'd and blurred.

So I was wondering if anyone could think of some ways to improve on this idea. Basically better ways to detect the white text, expand the edges of the mask so it covers just the halos, and prevent the mask from popping in and out.

Last edited by mikewando; 14th January 2012 at 13:43.
mikewando is offline   Reply With Quote

dehalo, masks, text

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 04:55.

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