The colorful wolf

January 26, 2011

Text Detection in Images

Filed under: Tech — randy @ 16:39
Tags:

That’s the search term I’ve been using to find areas of an image in which text is present, with the idea of pushing it through an OCR library once I’ve identified the right areas. Unfortunately text detection is a seriously tough problem, and countless papers have been written on the topic. I read a bunch of them today, and they range from idiotically simple to well beyond my comprehension. I took one of the simple ideas and implemented it upon what I built earlier this week. Here’s the output.

The paper itself suggested a rather basic (read: stupid) approach to edge detection, which I quickly did away with in favor of the Canny edge detector of OpenCV. The basic approach is like this:

  • Massage the image to make it easy to detect edges
  • Detect vertical lines that have the most edges OR have a very large difference with its surrounding lines
  • Detect the first and last ‘high intensity’ horizontal lines to crop the area already obtained by vertically slicing the image

Given the simplicity of the algorithm it does surprisingly well. Given the complexity of the task and the desired result it does surprisingly shit.

I really want to avoid creating a home-grown solution for this problem, but it’s really hard to find a good starting point for doing text detection. I hope I can find some better papers to base my next approach on. More later.

 

 

Advertisements

1 Comment »

  1. Hmn… literature review. Joy.

    Comment by Xi — January 26, 2011 @ 23:54 | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: