IP Library Granted Patent US 10,909,724
Granted Patent B2
US 10,909,724 · App. 16/233,863 · Granted Feb 2, 2021

Method, apparatus, and computer readable medium for adjusting color annotation of an image

Inventors: Xiong Duan (Beijing, CN); Xianpeng Lang (Beijing, CN); Wang Zhou (Beijing, CN); Miao Yan (Beijing, CN); Yifei Zhan (Beijing, CN); Changjie Ma (Beijing, CN); Yonggang Jin (Beijing, CN)
Assignee: Baidu Online Network Technology (Beijing) Co., Ltd.
G06T7/90G06K9/342G06K9/4652G06T3/40G06T5/30G06T7/12G06T7/149G06T11/001H04N1/393H04N1/3935G06K9/726G06T2207/10024G06T2207/20021G06T2207/20081G06T2207/20192G06T2207/30252
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 10,909,724
App. No.
16/233,863
Granted
Feb 2, 2021
Kind
B2
Abstract

Embodiments of the present disclosure provide a method, apparatus, and computer readable storage medium for processing an image. The method described herein includes determining a to-be-processed first region and a to-be-processed second region in an input image, the first region is at least partially filled with a first color, the second region is at least partially filled with a second color, and the first region and the second region are adjacent regions sharing a common boundary region. The method further includes shrinking the first region and the second region, to enable neither of the shrunken first region and the shrunken second region to include the boundary region. The method further comprises expanding the shrunken first region and the shrunken second region, to enable the boundary region to be filled with at least one color of the first color or the second color.

Claims (60)

1. A method for processing an image, the method comprising:

determining a to-be-processed first region and a to-be-processed second region in an input image, the first region at least partially filled with a first color, the second region at least partially filled with a second color, the first region and the second region being adjacent regions sharing a common boundary region, wherein the determining comprises:

acquiring a color dictionary, the color dictionary indicating a plurality of valid colors filled in regions in the input image; and

determining the first region and the second region adjacent to each other, in response to determining that the first color and the second color are included in the plurality of valid colors;

shrinking the first region and the second region, to enable neither of the shrunken first region and the shrunken second region to include the boundary region; and

expanding the shrunken first region and the shrunken second region, to enable the boundary region to be filled with at least one color of the first color or the second color,

wherein the color dictionary further indicates the first color being associated with a first priority level and the second color being associated with a second priority level, and the expanding the shrunken first region and the shrunken second region comprises:

executing image dilation on the shrunken first region, to add a plurality of pixels having the first color near a first boundary of the shrunken first region;

executing image dilation on the shrunken second region, to add a plurality of pixels having the second color near a second boundary of the shrunken second region; and

executing image superposition on the dilated shrunken first region and the dilated shrunken second region obtained after the image dilation based on the first priority level and the second priority level.

2. The method according to claim 1 , wherein the shrinking the first region and the second region comprises:

removing the boundary region from the first region and the second region.

3. The method according to claim 1 , wherein the shrinking the first region and the second region comprises:

executing image erosion on the first region, to remove a plurality of pixels near a first boundary of the first region in the first region; and

executing image erosion on the second region, to remove a plurality of pixels near a second boundary of the second region in the second region.

4. The method according to claim 1 , wherein the executing image superposition on the dilated shrunken first region and the dilated shrunken second region obtained after the image dilation comprises:

enabling the dilated shrunken first region obtained after the image dilation to at least partially cover the dilated shrunken second region obtained after the image dilation, in response to the first priority level being higher than the second priority level.

5. The method according to claim 1 , wherein the input image comprises a third region, the third region is filled with a third color excluded in the plurality of valid colors, and the method further comprises:

selecting a fourth color best matching the third color from the plurality of valid colors; and

filling the third region with the fourth color to replace the third color.

6. The method according to claim 5 , wherein the selecting the fourth color comprises:

determining respective distances between the third color and the plurality of valid colors, the distances indicating corresponding differences between the third color and the plurality of valid colors; and

selecting a valid color having a smallest distance between the valid color and the third color from the plurality of valid colors as the fourth color.

7. The method according to claim 6 , wherein the third color is represented by a first vector, the fourth color is represented by a second vector, and the distance between the third color and the fourth color is a Euclidean distance between the first vector and the second vector.

8. An apparatus for processing an image, comprising:

at least one processor; and

a memory storing instructions, the instructions when executed by the at least one processor, cause the at least one processor to perform operations, the operations comprising:

determining a to-be-processed first region and a to-be-processed second region in an input image, the first region at least partially filled with a first color, the second region at least partially filled with a second color, the first region and the second region being adjacent regions sharing a common boundary region, wherein the determining comprises:

acquiring a color dictionary, the color dictionary indicating a plurality of valid colors filled in regions in the input image; and

determining the first region and the second region adjacent to each other, in response to determining that the first color and the second color are included in the plurality of valid colors;

shrinking the first region and the second region, to enable neither of the shrunken first region and the shrunken second region to include the boundary region; and

expanding the shrunken first region and the shrunken second region, to enable the boundary region to be filled with at least one color of the first color or the second color,

wherein the color dictionary further indicates the first color being associated with a first priority level, and the second color being associated with a second priority level, and the expanding the shrunken first region and the shrunken second region comprises:

executing image dilation on the shrunken first region, to add a plurality of pixels having the first color near a first boundary of the shrunken first region;

executing image dilation on the shrunken second region, to add a plurality of pixels having the second color near a second boundary of the shrunken second region; and

executing image superposition on the dilated shrunken first region and the dilated shrunken second region obtained after the image dilation based on the first priority level and the second priority level.

9. The apparatus according to claim 8 , wherein the shrinking the first region and the second region comprises:

removing the boundary region from the first region and the second region.

10. The apparatus according to claim 8 , wherein the shrinking the first region and the second region comprises:

executing image erosion on the first region, to remove a plurality of pixels near a first boundary of the first region in the first region; and

executing image erosion on the second region, to remove a plurality of pixels near a second boundary of the second region in the second region.

11. The apparatus according to claim 8 , wherein the executing image superposition on the dilated shrunken first region and the dilated shrunken second region obtained after the image dilation comprises:

enabling the dilated shrunken first region obtained after the image dilation to at least partially cover dilated shrunken the second region obtained after the image dilation, in response to the first priority level being higher than the second priority level.

12. The apparatus according to claim 8 , wherein the input image comprises a third region, the third region is filled with a third color excluded in the plurality of valid colors, and the operations further comprises:

selecting a fourth color best matching the third color from the plurality of valid colors; and

filling the third region with the fourth color to replace the third color.

13. The apparatus according to claim 12 , wherein the selecting the fourth color comprises:

determining respective distances between the third color and the plurality of valid colors, the distances indicating corresponding differences between the third color and the plurality of valid colors; and

selecting a valid color having a smallest distance between the valid color and the third color from the plurality of valid colors as the fourth color.

14. The apparatus according to claim 13 , wherein the third color is represented by a first vector, the fourth color is represented by a second vector, and the distance between the third color and the fourth color is a Euclidean distance between the first vector and the second vector.

15. A non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor, cause the processor to perform operations, the operations comprising:

determining a to-be-processed first region and a to-be-processed second region in an input image, the first region at least partially filled with a first color, the second region at least partially filled with a second color, the first region and the second region being adjacent regions sharing a common boundary region, wherein the determining comprises:

acquiring a color dictionary, the color dictionary indicating a plurality of valid colors filled in regions in the input image; and

determining the first region and the second region adjacent to each other, in response to determining that the first color and the second color are included in the plurality of valid colors;

shrinking the first region and the second region, to enable neither of the shrunken first region and the shrunken second region to include the boundary region; and

expanding the shrunken first region and the shrunken second region, to enable the boundary region to be filled with at least one color of the first color or the second color,

wherein the color dictionary further indicates the first color being associated with a first priority level and the second color being associated with a second priority level, and the expanding the shrunken first region and the shrunken second region comprises:

executing image dilation on the shrunken first region, to add a plurality of pixels having the first color near a first boundary of the shrunken first region;

executing image dilation on the shrunken second region, to add a plurality of pixels having the second color near a second boundary of the shrunken second region; and

executing image superposition on the dilated shrunken first region and the dilated shrunken second region obtained after the image dilation based on the first priority level and the second priority level.

Assignments (3)
CORRECTIVE ASSIGNMENT TO CORRECT THE APPLICANT NAME PREVIOUSLY RECORDED AT REEL: 057933 FRAME: 0812. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Dec 28, 2021
From: BAIDU ONLINE NETWORK TECHNOLOGY (BEIJING) CO., LTD.
To: APOLLO INTELLIGENT DRIVING TECHNOLOGY (BEIJING) CO., LTD.
Reel/Frame 058594/0836 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 13, 2021
From: BAIDU ONLINE NETWORK TECHNOLOGY (BEIJING) CO., LTD.
To: APOLLO INTELLIGENT DRIVING (BEIJING) TECHNOLOGY CO., LTD.
Reel/Frame 057933/0812 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 29, 2020
From: ZHOU, WANG; YAN, MIAO; MA, CHANGJIE
To: BAIDU ONLINE NETWORK TECHNOLOGY (BEIJING) CO., LTD.
Reel/Frame 054763/0846 →
Priority Claims (1)
CN 2017 1 1486200 · Dec 29, 2017 · national
Continuity (1)
Related Publication 20190206088A1 · Jul 4, 2019