[MPlayer-dev-eng] patch: video filter to OCR subtitles for mplayer

D Richard Felker III dalias at aerifal.cx
Fri Nov 28 05:50:17 CET 2003


On Tue, Nov 25, 2003 at 08:33:03PM +0200, Tuukka Toivonen wrote:
> threshold
> ---------
> This filter takes in BGR32 image and binarizes it, setting
> subtitles to full white and everything else to black. It

Use YUV! There's absolutely no use in doing BRG32; it just makes it
much slower and clumsier.

> performs multiple complex image processing tasks for recognizing
> subtitles and discarding everything else. Here is the main operations:
> 1. Edges in each frame are enhanced using Roberts masks.
>    A new image is created based on absolute values of edge strengths.
> 2. Difference image is created by subtracting the previous image
>    from the newest frame and taking absolute value.
> 3. The image is thresholded: all colors with distance larger than DIST
>    from the specified color (RED,GREEN,BLUE) are set to black,
>    other pixels are set to white.
> 4. The image is labeled, e.g. connected white regions are numbered

...

IMO a filter that does all this should not just be named threshold...
As a user, I would expect vf_threshold to be a basic threshold filter
(i.e. all pixels darker than the threshold go to black, all lighter go
to white).

> - Better way to get frame numbers than count them?

Using frame numbers is incorrect, but there's no correct way to do it
with G1 architecture. With MPlayer G2, you should use the timestamps.

Rich



More information about the MPlayer-dev-eng mailing list