[MPlayer-dev-eng] [CFTWWI] VF logodetect/logoremove
Ivo
ivop at euronet.nl
Thu Aug 11 02:44:42 CEST 2005
Hi,
A while ago, several logo removal video filters where posted. By that time,
I wrote a detection filter and an improved alpha-deblend filter. It was
never really finished and I completely lost interest. In fact, I find
deblended or blurred logo's even more annoying than the original logo's.
For a decent deblend, the logo has to be transparent enough (which most of
them aren't), otherwise you get a lot of noise in the non-dark/light
scenes. And all blur algorithms I have seen so far make the logo look like
it's behind a +10 dioptre lens.
So, why do I post this code here? Well, I got bugged to release it several
times (you know who you are :) ) and maybe others have use for it. In no
case will I commit this code (or lobby for it) and maintain it, but if
others want to, go ahead.
* logodetect can take two suboption, thres and (no)output. The latter speaks
for itself and thres defines a lower threshold. All pixels that never reach
a value below thres are considered to make up the logo.
TODO (if anyone wants to): support for totally opaque logo's. those are
better detected by determining which pixels hardly change color at all
(+-10 or something). As a bonus, it'll also detect (partly) black logo's.
If output is specified (default), it writes a logo and alpha pnm file to
disk when you abort MPlayer by control-c. Be sure to keep it running for
long enough to detect all the pixels that make up the logo (thousands of
frames, depending on the content) and be sure the logo is always visible in
every frame you feed it (be aware of pre-commercial break fading of the
logo, like for exaple The WB does). Also, experiment with the threshold.
They might vary between files you try it on (even if it's the same show
from the same ripper or network sometimes) and it takes some time to find
the best value. For example, if the correct value is 30 and you use 32, see
what happend when you deblend/remove it :) Offcourse, this filter works
best on clean signals (DVB feeds, etc.)
* logoremove reads the pnm files and applies a deblend or plain remove
filter to the video it's playing. suboptions are logo=<file>, alpha=<file>
and (no)deblend.
TODO: implement nodeblend (read: remove/blur). The framework is there, just
right now it paints all logo pixels black.
I was thinking of an algorithm that computes the weighted average (weight
based on distance) of surrounding non-logo pixels for every logo-pixel.
To compile, copy both files to libmpcodecs/. , add hooks in vf.c and
Makefile there, run make and have fun :)
CFTWWI, Code For Those Who Want It :)
--Ivo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vf_logodetect.c
Type: text/x-csrc
Size: 11366 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050811/d789f773/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vf_logoremove.c
Type: text/x-csrc
Size: 11556 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050811/d789f773/attachment-0001.c>
More information about the MPlayer-dev-eng
mailing list