0

When I read an image with text, Google Vision inserts line breaks in the middle of the sentence. How can I do to avoid this. Here's an example of the image text and Google Vision return:

Text in the image:

01 600149 CHICKEN M PR 1 UN X 3.500 (0.11)
02 600019 POTATO M PR 1 UN X 7.50 (0.24)
03 31820 COCA ZERO M PR 1 UN X 10.90 (0.00)

Google Vision Return:

01 600149 CHICKEN M PR
02 600019 POTATO M PR
03 31820 COCA ZERO M PR
1 UN X 3,500 0.11)
1 UN X 7.50 (0.24)
1 UN X 10.90 (0.00)

Thank you,

Malakai
  • 3,011
  • 9
  • 35
  • 49
Sergio
  • 1
  • 2

1 Answers1

0

You can't really control how Google detects the text boxes. They're not one the same line because their text detector detected different text boxes separately (for a better OCR quality maybe)

What you can do is check the y position of each text box (it's given in the result of OCR) and put the text togther if the y is close. Of course you should order by ascending x so that you have the text in the good order.