# How should I go about cleaning up this kind of images? (algos)

I want to extract text from some images with messy backgrounds.

First step was switching to gray scale, applying an edge detection algorithm, and then cleaning up a little bit.

Here's an example of the result:

I want to use the tesseract OCR to extract the text from it, but it's not good enough to find it, as the background is quite messed up still. (I tried with a cleaner version and it's doing ok).

So, could anyone recommend an algorithm, or a type of algo, that would help me clean up this image and just get the text? (it will always have this font).

One idea I had was to try to remove all the clumps that are "larger" than the font, which is pretty thin.

ps: hopefully it's the right stackexchange site.

Turns out, the trick to solve this was just to realize that from frame to frame the background was changing, but the text was staying constant. So by doing an | operation on the pixel values of a few consecutive frames, it was crazy simple to get only the text.