mikewando
14th January 2012, 13:36
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.
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.