tags:

views:

100

answers:

4

I want to cut up the image based on various text markers placed around within it. The font/size of the marker is up to me.

I know commercial OCR packages provide this in their APIs but I'm hoping I can code this up myself.

Ideally I wouldn't have to go pixel to pixel and compare against an image of the marker text.

I'm good with C++/C#, Java, PHP and an other language where a library like this exists...

A: 

If you want to do a really sufisticated solution, you could use the hough transform. It is often used for augumented reality stuff - there it is necessary to find a certain marker in an image. Ofc you would have to change your markers a bit, would this be possible? ;-) The hough will give you the position of your marker lines and thus the area which you want to cut out.

Here is a link about hough, but there are many others though.

Hough

Or this one

Wiki

InsertNickHere
+1  A: 

Ideally I wouldn't have to go pixel to pixel and compare against an image of the marker text.

Well, if you're trying to find the marker image, then that's exactly what you'd have to do.

Here's an idea... Set the marker text to a particular color, then process the background image to make sure that it doesn't have any pixels of that color. Finding the markers should become a lot easier at that point.

Mike Baranczak
+1  A: 

A barcode would be easier to detect than a text marker. You can always place them together, with the barcode being used for automatic position detection and the text for human user.

rwong
A: 

A fiduciary marker would be better than text. That's what they use for augmented reality and such.

If the text is always the same size, shape, and oriented in the same direction, you could use normalized cross-correlation.

"Ideally I wouldn't have to go pixel to pixel and compare against an image of the marker text."

Well how else are you going to do it? You're only going to search in part of the image?

endolith