IP Library › Granted Patent US 11,568,631
Granted Patent B2
US 11,568,631 · App. 17/204,472 · Granted Jan 31, 2023

Method, system, and non-transitory computer readable record medium for extracting and providing text color and background color in image

Inventor: Seunghoon Baek (Seongnam-si, KR)
Assignee: LINE Plus Corporation
G06V10/56G06K9/6223G06T7/90G06V10/50G06V20/62G06V30/153G06V30/10
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 11,568,631
App. No.
17/204,472
Granted
Jan 31, 2023
Kind
B2
Abstract

A method for extracting and providing a text color and background color in an image, includes detecting a first area that includes a text in a given image; extracting, from the first area, a representative text color that represents the text and a representative background color that represents a background of the first area; and overlaying a second area that includes a translation result of the text on the given image and applying the representative text color and the representative background color to a text color and a background color of the second area.

Claims (67)

1. A method implemented by a computer system comprising at least one processor, the method comprising:

detecting a first area that comprises a text in a given image;

extracting, from the first area, a representative text color that represents the text and a representative background color that represents a background of the first area;

overlaying, on the given image, a second area that comprises a translation result of the text; and

applying the representative text color and the representative background color to a text color and a background color of the second area,

wherein the extracting the representative text color comprises:

extracting a histogram for a plurality of pixels of the first area;

extracting a text base color based on a color distribution of the first area; and

selecting the representative text color based on a first distance value between the histogram for the plurality of pixels of the first area and the text base color.

2. The method of claim 1 , wherein the detecting comprises detecting the first area using an optical character reader (OCR).

3. The method of claim 1 , wherein the extracting the representative background color comprises:

extracting a background base color based on the color distribution of the first area; and

selecting the representative background color based on a second distance value between the histogram for the plurality of pixels of the first area and the background base color.

4. The method of claim 3 , wherein the extracting the representative text color and the representative background color further comprises transforming the first area to a preset form through an image perspective transform algorithm.

5. The method of claim 3 , wherein the extracting the representative text color and the representative background color further comprises sorting the histogram by size.

6. The method of claim 3 , wherein the extracting the histogram comprises extracting a three-dimensional (3D) histogram according to a color channel combination for the plurality of pixels of the first area.

7. The method of claim 3 , wherein the extracting the histogram comprises quantizing all of pixel values of the first area based on multiples having a same base number.

8. The method of claim 3 , wherein the extracting the text base color and the background base color comprises:

clustering the color distribution of the first area using a first color and a second color through a K-mean algorithm;

summing a first number of pixels for the first color and a second number of pixels for the second color with respect to a border area of the first area; and

in response to the first number of pixels being greater than the second number of pixels, selecting the first color as the background base color and selecting the second color as the text base color.

9. The method of claim 3 , wherein the selecting the representative text color comprises:

selecting a first pixel color of which the first distance value is less than or equal to a threshold as the representative text color; and

wherein the selecting the representative background color comprises:

selecting a second pixel color of which the second distance value is less than or equal to the threshold as the representative background color.

10. The method of claim 9 , further comprising: increasing the threshold in response to absence of a pixel less than or equal to the threshold.

11. The method of claim 1 , further comprising:

extracting a representative object color of an image object; and

applying the representative object color as a color that constitutes a user interface (UI) associated with the image object.

12. The method of claim 1 , further comprising:

extracting a representative icon color of an icon and applying the representative icon color as a background theme color.

13. The method of claim 1 , further comprising:

extracting a representative previous frame color and a representative current frame color from a previous frame and a current frame of a video, respectively; and

detecting a scene change based on a difference between the representative previous frame color and the representative current frame color.

14. A computer system comprising:

at least one processor configured to execute computer-readable instructions stored in a memory, to:

detect a first area that comprises a text in a given image;

extract, from the first area, a representative text color that represents the text and a representative background color that represents a background of the first area;

overlay a second area that comprises a translation result of the text on the given image; and

apply the representative text color and the representative background color to a text color and a background color of the second area,

wherein the at least one processor is configured to execute the computer-readable instructions to extract the representative text color by:

extracting a histogram for a plurality of pixels of the first area;

extracting a text base color based on a color distribution of the first area; and

selecting the representative text color based on a first distance value between the histogram for the plurality of pixels of the first area and the text base color.

15. The computer system of claim 14 , wherein the at least one processor is further configured to execute computer-readable instructions to:

extract a background base color based on the color distribution of the first area, and

select the representative background color based on a second distance value between the histogram for the plurality of pixels of the first area and the background base color.

16. The computer system of claim 15 , wherein the at least one processor is further configured to execute computer-readable instructions to:

extract a three-dimensional (3D) histogram according to a color channel combination for the plurality of pixels of the first area.

17. The computer system of claim 15 , wherein the at least one processor is further configured to execute computer-readable instructions to:

quantize all of pixel values of the first area based on multiples having a same base number.

18. The computer system of claim 15 , wherein the at least one processor is further configured to execute computer-readable instructions to:

cluster the color distribution of the first area using a first color and a second color through a K-mean algorithm,

sum a first number of pixels for each of the first color and a second number of pixels for the second color with respect to a border area of the first area, and

in response to the first number of pixels being greater than the second number of pixels, select the first color as the background base color and select the second color as the text base color.

19. The computer system of claim 15 , wherein the at least one processor is further configured to execute computer-readable instructions to:

select a first pixel color of which the first distance value is less than or equal to a threshold as the representative text color, and

select a second pixel color of which the second distance value is less than or equal to the threshold as the representative background color.

20. A method implemented by a computer system comprising at least one processor, the method comprising:

detecting a first area that comprises a text in a given image;

extracting, from the first area, a representative text color that represents the text and a representative background color that represents a background of the first area;

overlaying, on the given image, a second area that comprises a translation result of the text; and

applying the representative text color and the representative background color to a text color and a background color of the second area,

wherein extracting the representative background color comprises:

extracting a histogram for a plurality of pixels of the first area;

extracting a background base color based on a color distribution of the first area; and

selecting the representative background color based on a first distance value between the histogram for the plurality of pixels of the first area and the background base color.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 17, 2021
From: BAEK, SEUNGHOON
To: LINE PLUS CORPORATION
Reel/Frame 055628/0153 →
Priority Claims (1)
KR 10-2020-0038295 · Mar 30, 2020 · national
Continuity (1)
Related Publication 20210303905A1 · Sep 30, 2021