Calculate length of spaces image of text

时间:2019-04-08 13:45:48

标签: math

I am currently extracting letters from an image to write a letter recognizer using a convolutional neural network. The information I get from the image of text is the position of each letter on the image itself. What I am trying to do is determine where a word ends so I can insert a space when I am printing my result. A line break is quite easy since the distance from the current letter to the next letter is negative and that's how I determine a line break. Now to determine if there is a space between 2 letters doesn't seem that easy.

Things I have tried:

  1. Set a threshold (30 pixels)

    • Worked for very specific texts
  2. Calculate a mean of all distances excluding negative ones

    • Worked only for specific texts as well

Is anyone aware of a standardized way to determine if there is a space between 2 letters on an image of text? (This should be independent of font and such)

0 个答案:

没有答案