2

I'm interested in finding text boundaries in an image (not character recognition, just locating the text):

Given some JPEG image with graphics and text,
if the user clicks over the text the application will automatically zoom it,
But for that I need to find the text boundaries...
Any ideas?

pradyunsg
  • 18,287
  • 11
  • 43
  • 96
JJj
  • 23
  • 2
  • Do you create the images? Can you store the text boxes as meta data during the creation process? It is also always helpful to show pictures, if possible. – bjoernz Jun 09 '11 at 13:08
  • No, I don't create the images myself! I can't show them yet, but their just pictures of birds with some text. I want to zoom the text if the user clicks over it. – JJj Jun 09 '11 at 13:55

2 Answers2

2

Without seeing the images, it is difficult to think of a robust way, that will work in most cases. Here is my suggestion (I assume that you know the colour(s) of the text and that the text colour(s) is rare in the image):

  1. filter the image: calculate the Euclidean distance in RGB or HSV space
  2. cluster the peaks: look at the peaks, if they are close together, they probably belong to the same text.
  3. calculate the bounding box around the clusters.

I hope this gets you started.

bjoernz
  • 3,852
  • 18
  • 30
1

If text is known font and its size is same, you could cross correlate with the test text you have. If the correlation is high, then text is found. If text size is known, which I assumed, you already have the window size of the correlation window.

Hephaestus
  • 120
  • 1
  • 7