oo

So, this time I properly sorted my training data, did some magic on it and tried again.

No, this is not good. The detected text areas are flickering all over the place. It took me a couple of seconds to get this barely decent detection result pop up, and getting this image was about 100% luck, 0% skill. It's not actually detecting text areas, it's still detecting random areas of... something. Anyway, it's mis-trained. Again.

Fortunately I anticipated this, so I'm also running a bunch of other haar training methods in parallel, which should be done tomorrow or so. I still haven't figured out how to properly test the accuracy of my attempts, and because the results have been shit so far I haven't really needed to look into it.

OpenCV/JavaCV notes: I love it. Accessing a webcam in Java in a couple lines of code, and getting better resolution than the Java Media Framework. It's a properly nice library. If only I could get my hands on Intel's Threading Building Blocks, but their site's been down for days. Very annoying.

 

Posted in Tech | Tagged ,

Text Detection in Images

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.

 

 

Posted in Tech | Tagged