IP Library › Granted Patent US 12,249,168
Granted Patent B2
US 12,249,168 · App. 17/649,406 · Granted Mar 11, 2025

Text detection algorithm for separating words detected as one text bounding box

Inventors: Ophir Azulai (Tivon, IL); Udi Barzelay (Haifa, IL); Oshri Pesah Naparstek (Karmiel, IL)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06V30/153G06T3/4046G06T11/60G06V30/414
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,249,168
App. No.
17/649,406
Granted
Mar 11, 2025
Kind
B2
Abstract

A method, computer system, and a computer program product for text detection is provided. The present invention may include training a text detection model. The present invention may include performing text detection on an inputted image using the trained text detection model. The present invention may include determining whether at least one of a plurality of bounding boxes generated using the inputted image has an aspect ratio above a threshold. The present invention may include based upon determining that at least one of the plurality of bounding boxes generated using the inputted image has the aspect ratio above the threshold, upscaling any text within the at least one bounding box and performing text detection on a new image using the trained text detection model. The present invention may include outputting an output image.

Claims (57)

1. A method for text detection, the method comprising:

training a text detection model, wherein the training comprises generating text using a generator created to generate random text with variability in size, font, and/or background, injected with additional noise;

performing text detection on an inputted image using the trained text detection model;

determining whether at least one of a plurality of bounding boxes generated using the inputted image has an aspect ratio above a threshold;

based upon determining that at least one of the plurality of bounding boxes generated using the inputted image has the aspect ratio above the threshold, upscaling any text within the at least one bounding box;

copying the at least one of the plurality of generated bounding boxes having the aspect ratio above the threshold to a new image file having a same file format as the inputted image;

performing text detection on a new image using the trained text detection model;

combining both the plurality of bounding boxes generated using the inputted image and the new image file, wherein upon determining that at least one of the plurality of bounding boxes generated using the inputted image contains more than one word, replacing any corresponding portions of the inputted image with the at least one bounding box generated using the new image; and

outputting an output image, wherein the output image is comprised of at least one bounding box generated using the inputted image and at least one bounding box generated using the new image.

2. The method of claim 1 , wherein the trained text detection model is a neural network which predicts a word or a line of text by labeling each pixel in the inputted image as text or not text and placing one of the plurality of bounding boxes generated using the inputted image around a group of concurrent pixels labeled as text using a connected components algorithm, and wherein a Gaussian distribution is calculated based on the group of concurrent pixels labeled as text within the bounding box.

3. The method of claim 1 , wherein the threshold is two times a height of a bounding box divided by a width of a bounding box, calculated for a longest word in a dictionary and multiplied by two.

4. The method of claim 1 , wherein upscaling the text within the at least one bounding box further comprises:

copying the upscaled text to the new image, wherein the new image is at a constant resolution.

5. A computer system for text detection, comprising:

one or more processors, one or more computer-readable memories, one or more computer-readable tangible storage medium, and program instructions stored on at least one of the one or more tangible storage medium for execution by at least one of the one or more processors via at least one of the one or more memories, wherein the computer system is capable of performing a method comprising:

training a text detection model, wherein the training comprises generating text using a generator created to generate random text with variability in size, font, and/or background, injected with additional noise;

performing text detection on an inputted image using the trained text detection model;

determining whether at least one of a plurality of bounding boxes generated using the inputted image has an aspect ratio above a threshold;

based upon determining that at least one of the plurality of bounding boxes generated using the inputted image has the aspect ratio above the threshold, upscaling any text within the at least one bounding box;

copying the at least one of the plurality of generated bounding boxes having the aspect ratio above the threshold to a new image file having a same file format as the inputted image;

performing text detection on a new image using the trained text detection model;

combining both the plurality of bounding boxes generated using the inputted image and the new image file, wherein upon determining that at least one of the plurality of bounding boxes generated using the inputted image contains more than one word, replacing any corresponding portions of the inputted image with the at least one bounding box generated using the new image; and

outputting an output image, wherein the output image is comprised of at least one bounding box generated using the inputted image and at least one bounding box generated using the new image.

6. The computer system of claim 5 , wherein the trained text detection model is a neural network which predicts a word or a line of text by labeling each pixel in the inputted image as text or not text and placing one of the plurality of bounding boxes generated using the inputted image around a group of concurrent pixels labeled as text using a connected components algorithm, and wherein a Gaussian distribution is calculated based on the group of concurrent pixels labeled as text within the bounding box.

7. The computer system of claim 5 , wherein the threshold is two times a height of a bounding box divided by a width of a bounding box, calculated for a longest word in a dictionary and multiplied by two.

8. The computer system of claim 5 , wherein upscaling the text within the at least one bounding box further comprises:

copying the upscaled text to the new image, wherein the new image is at a constant resolution.

9. A computer program product for text detection, comprising:

one or more non-transitory computer-readable storage media and program instructions stored on at least one of the one or more tangible storage media, the program instructions executable by a processor to cause the processor to perform a method comprising:

training a text detection model, wherein the training comprises generating text using a generator created to generate random text with variability in size, font, and/or background, injected with additional noise;

performing text detection on an inputted image using the trained text detection model;

determining whether at least one of a plurality of bounding boxes generated using the inputted image has an aspect ratio above a threshold;

based upon determining that at least one of the plurality of bounding boxes generated using the inputted image has the aspect ratio above the threshold, upscaling any text within the at least one bounding box;

copying the at least one of the plurality of generated bounding boxes having the aspect ratio above the threshold to a new image file having a same file format as the inputted image;

performing text detection on a new image using the trained text detection model;

combining both the plurality of bounding boxes generated using the inputted image and the new image file, wherein upon determining that at least one of the plurality of bounding boxes generated using the inputted image contains more than one word, replacing any corresponding portions of the inputted image with the at least one bounding box generated using the new image; and

outputting an output image, wherein the output image is comprised of at least one bounding box generated using the inputted image and at least one bounding box generated using the new image.

10. The computer program product of claim 9 , wherein the trained text detection model is a neural network which predicts a word or a line of text by labeling each pixel in the inputted image as text or not text and placing one of the plurality of bounding boxes generated using the inputted image around a group of concurrent pixels labeled as text using a connected components algorithm, and wherein a Gaussian distribution is calculated based on the group of concurrent pixels labeled as text within the bounding box.

11. The computer program product of claim 9 , wherein the threshold is two times a height of a bounding box divided by a width of a bounding box, calculated for a longest word in a dictionary and multiplied by two.

12. The computer program product of claim 9 , wherein upscaling the text within the at least one bounding box further comprises:

copying the upscaled text to the new image, wherein the new image is at a constant resolution.

13. The method of claim 1 , further comprising:

filtering out at least one of the plurality of plurality of bounding boxes generated using the new image file based on the at least of the plurality of bounding boxes no longer being recognized as text by the trained detection model.

14. The method of claim 1 , wherein the training of the text detection model further comprises:

outputting each pixel of the inputted image within the plurality of bounding boxes with a label of 1 and every other pixel in the inputted image not in the plurality of bounding boxes with a label of 0.

15. The method of claim 1 , wherein the performing of the text detection on the inputted image further comprises:

replacing each pixel of the inputted image with a particular color based on a determination of whether a word is present.

16. The method of claim 15 , further comprising:

combining each pixel with the particular color into the plurality of bounding boxes using a connected components algorithm.

17. The computer system of claim 5 , further comprising:

filtering out at least one of the plurality of plurality of bounding boxes generated using the new image file based on the at least of the plurality of bounding boxes no longer being recognized as text by the trained detection model.

18. The computer system of claim 5 , wherein the training of the text detection model further comprises:

outputting each pixel of the inputted image within the plurality of bounding boxes with a label of 1 and every other pixel in the inputted image not in the plurality of bounding boxes with a label of 0.

19. The computer system of claim 5 , wherein the performing of the text detection on the inputted image further comprises:

replacing each pixel of the inputted image with a particular color based on a determination of whether a word is present.

20. The computer system of claim 19 , further comprising:

filtering out at least one of the plurality of plurality of bounding boxes generated using the new image file based on the at least of the plurality of bounding boxes no longer being recognized as text by the trained detection model.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 31, 2022
From: AZULAI, OPHIR; BARZELAY, UDI; NAPARSTEK, OSHRI PESAH
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 058828/0548 →
Continuity (1)
Related Publication 20230245481A1 · Aug 3, 2023
References Cited (15)
US 10127673B1 · Ben Khalifa · 2018 [cited by examiner]
US 10679085B2 · Li · 2020 [cited by applicant]
US 20150234812A1 · Vukosavljevic · 2015 [cited by examiner]
US 20200226400A1 · Corring · 2020 [cited by examiner]
US 20210110189A1 · Huang · 2021 [cited by examiner]
US 20210192201A1 · Nguyen · 2021 [cited by examiner]
US 20210201064A1 · Chen · 2021 [cited by examiner]
Li, Hui, Peng Wang, and Chunhua Shen. “Towards end-to-end text spotting with convolutional recurrent neural networks.” Proceedings of the IEEE international conference on computer vision. 2017. (Year: 2017). [cited by examiner]
Liu, Juhua, et al. “ASTS: A unified framework for arbitrary shape text spotting.” IEEE Transactions on Image Processing 29 (2020): 5924-5936. (Year: 2020). [cited by examiner]
Liao, “TextBoxes++: A Single-Shot Oriented Scene Text Detector,” arXiv:1801.02765v3 [cs.CV], Apr. 27, 2018, 15 pgs. [cited by applicant]
Mahto, “Scene Text Detection And Recognition Using EAST And Tesseract,” Towards Data Science, [accessed Sep. 29, 2021], 32 pgs., Retrieved from the Internet: <https://towardsdatascience.com/scene-text-detection-and-reco… [cited by applicant]
Mell et al., “The NIST Definition of Cloud Computing”, National Institute of Standards and Technology, Special Publication 800-145, Sep. 2011, pp. 1-7. [cited by applicant]
Richardson, “It's All About The Scale—Efficient Text Detection Using Adaptive Scaling,” 2020 IEEE, pp. 1833-1842. [cited by applicant]
Shashidhara, et al., “Word Segmentation for Document Images by Successively Merging Adjacent Character Bounding Boxes by Iterative Dilation,” LJCSET, Feb. 2012, pp. 873-876. [cited by applicant]
Wang, et al., “R-YOLO: A Real-Time Text Detector for Natural Scenes with Arbitrary Rotation,” Sensors 2021 MDPI, Jan. 28, 2021, 20 pgs. [cited by applicant]
Cited By (2)
US 12,561,950 US 12,738,085