IP Library Patent Application 18596829
Patent Application
App. No. 18/596,829

IMAGE PROCESSING METHOD AND APPARATUS

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 None
App. No.
18/596,829
Abstract

Embodiments of this application disclose an image processing method and an apparatus. The method includes: obtaining an image, where the image includes a detection object; performing region division on the image based on the detection object to obtain image regions, where the obtained image regions include a first region and a second region, and the first region includes the detection object, and the second region does not include the detection object; and performing white balance correction on the image based on a color temperature value of the first region and a color temperature value of the second region. According to this solution, a white balance processing effect of an image can be improved, and display quality of the image can be improved.

Claims (72)

1 . An image processing method, comprising:

obtaining an image, wherein the image comprises a detection object;

performing region division on the image based on the detection object to obtain image regions, wherein the obtained image regions comprise a first region and a second region, the first region comprises the detection object, and the second region does not comprise the detection object; and

performing white balance correction on the image based on a color temperature value of the first region and a color temperature value of the second region.

2 . The method according to claim 1 , wherein the performing the white balance correction on the image based on a color temperature value of the first region and a color temperature value of the second region comprises:

if a difference between the color temperature value of the first region and the color temperature value of the second region is greater than a preset threshold, determining, based on the color temperature value of the first region, a first white balance gain coefficient corresponding to the first region, and determining, based on the color temperature value of the second region, a second white balance gain coefficient corresponding to the second region; and

performing the white balance correction on the image based on the first white balance gain coefficient and the second white balance gain coefficient.

3 . The method according to claim 2 , wherein the method further comprises:

if the difference between the color temperature value of the first region and the color temperature value of the second region is not greater than the preset threshold, determining a color temperature value of the image based on the color temperature value of the first region and the color temperature value of the second region;

determining a third white balance gain coefficient corresponding to the color temperature value of the image; and

performing the white balance correction on the image based on the third white balance gain coefficient.

4 . The method according to claim 3 , wherein the determining a color temperature value of the image based on the color temperature value of the first region and the color temperature value of the second region comprises:

determining a first weight based on an area proportion of the first region in the image, and determining a second weight based on an area proportion of the second region in the image; and

determining the color temperature value of the image based on the color temperature value of the first region, the color temperature value of the second region, the first weight, and the second weight.

5 . The method according to claim 1 , wherein the performing white balance correction on the image based on a color temperature value of the first region and a color temperature value of the second region comprises:

determining, based on the color temperature value of the first region, a first white balance gain coefficient corresponding to the first region, and determining, based on the color temperature value of the second region, a second white balance gain coefficient corresponding to the second region; and

if a difference between the color temperature value of the first region and the color temperature value of the second region is greater than a preset threshold, performing the white balance correction on the image based on the first white balance gain coefficient and the second white balance gain coefficient; or

if a difference between the color temperature value of the first region and the color temperature value of the second region is not greater than a preset threshold, determining a fourth white balance gain coefficient based on the first white balance gain coefficient and the second white balance gain coefficient; and performing the white balance correction on the image based on the fourth white balance gain coefficient.

6 . The method according to claim 5 , wherein the determining the fourth white balance gain coefficient based on the first white balance gain coefficient and the second white balance gain coefficient comprises:

determining a first weight based on an area proportion of the first region in the image, and determining a second weight based on an area proportion of the second region in the image; and

determining the fourth white balance gain coefficient based on the first white balance gain coefficient, the second white balance gain coefficient, the first weight, and the second weight.

7 . The method according to claim 1 , wherein the performing the region division on the image based on the detection object comprises:

performing the region division on the image based on a contour line of the detection object.

8 . The method according to claim 7 , wherein the obtained image regions further comprise a critical region, and the critical region comprises the contour line; and

the performing white balance correction on the image based on a color temperature value of the first region and a color temperature value of the second region comprises:

if a difference between the color temperature value of the first region and the color temperature value of the second region is greater than a preset threshold, determining, based on the color temperature value of the first region, a first white balance gain coefficient corresponding to the first region, and determining, based on the color temperature value of the second region, a second white balance gain coefficient corresponding to the second region;

determining a fifth white balance gain coefficient based on the first white balance gain coefficient and the second white balance gain coefficient, wherein the fifth white balance gain coefficient is used to correct the critical region; and

performing the white balance correction on the image based on the first white balance gain coefficient, the second white balance gain coefficient, and the fifth white balance gain coefficient.

9 . The method according to claim 7 , wherein the performing the region division on the image based on the contour line of the detection object comprises:

generating a first bounding box of the detection object;

determining, in an image region comprised in a second bounding box, a region contour line that comprises a largest image area as the contour line of the detection object, wherein the second bounding box is obtained by extending the first bounding box outwards; and

performing the region division on the image based on the contour line of the detection object, wherein the first region is an image region comprised in the contour line, and the second region is an image region outside the contour line.

10 . The method according to claim 1 , wherein before the performing the region division on the image based on the detection object, the method comprises:

determining that a current location is close to a preset location.

11 . A image processing apparatus, comprising:

a memory configured to store program code; and

a processor configured to invoke the program code in the memory to perform an image processing method, wherein the method comprises:

obtaining an image, wherein the image comprises a detection object;

performing region division on the image based on the detection object to obtain image regions, wherein the obtained image regions comprise a first region and a second region, the first region comprises the detection object, and the second region does not comprise the detection object; and

performing white balance correction on the image based on a color temperature value of the first region and a color temperature value of the second region.

12 . The apparatus according to claim 11 , wherein the performing white balance correction on the image based on a color temperature value of the first region and a color temperature value of the second region comprises:

if a difference between the color temperature value of the first region and the color temperature value of the second region is greater than a preset threshold, determining, based on the color temperature value of the first region, a first white balance gain coefficient corresponding to the first region, and determining, based on the color temperature value of the second region, a second white balance gain coefficient corresponding to the second region; and

performing the white balance correction on the image based on the first white balance gain coefficient and the second white balance gain coefficient.

13 . The apparatus according to claim 12 , wherein the method further comprises:

if the difference between the color temperature value of the first region and the color temperature value of the second region is not greater than the preset threshold, determining a color temperature value of the image based on the color temperature value of the first region and the color temperature value of the second region;

determining a third white balance gain coefficient corresponding to the color temperature value of the image; and

performing the white balance correction on the image based on the third white balance gain coefficient.

14 . The apparatus according to claim 13 , wherein the determining a color temperature value of the image based on the color temperature value of the first region and the color temperature value of the second region comprises:

determining a first weight based on an area proportion of the first region in the image, and determining a second weight based on an area proportion of the second region in the image; and

determining the color temperature value of the image based on the color temperature value of the first region, the color temperature value of the second region, the first weight, and the second weight.

15 . The apparatus according to claim 11 , wherein the performing white balance correction on the image based on a color temperature value of the first region and a color temperature value of the second region comprises:

determining, based on the color temperature value of the first region, a first white balance gain coefficient corresponding to the first region, and determining, based on the color temperature value of the second region, a second white balance gain coefficient corresponding to the second region; and

if a difference between the color temperature value of the first region and the color temperature value of the second region is greater than a preset threshold, performing the white balance correction on the image based on the first white balance gain coefficient and the second white balance gain coefficient; or

if a difference between the color temperature value of the first region and the color temperature value of the second region is not greater than a preset threshold, determining a fourth white balance gain coefficient based on the first white balance gain coefficient and the second white balance gain coefficient; and performing the white balance correction on the image based on the fourth white balance gain coefficient.

16 . The apparatus according to claim 15 , wherein the determining the fourth white balance gain coefficient based on the first white balance gain coefficient and the second white balance gain coefficient comprises:

determining a first weight based on an area proportion of the first region in the image, and determining a second weight based on an area proportion of the second region in the image; and

determining the fourth white balance gain coefficient based on the first white balance gain coefficient, the second white balance gain coefficient, the first weight, and the second weight.

17 . The apparatus according to claim 11 , wherein the performing the region division on the image based on the detection object comprises:

performing the region division on the image based on a contour line of the detection object.

18 . The apparatus according to claim 17 , wherein the obtained image regions further comprise a critical region, and the critical region comprises the contour line; and

the performing white balance correction on the image based on a color temperature value of the first region and a color temperature value of the second region comprises:

if a difference between the color temperature value of the first region and the color temperature value of the second region is greater than a preset threshold, determining, based on the color temperature value of the first region, a first white balance gain coefficient corresponding to the first region, and determining, based on the color temperature value of the second region, a second white balance gain coefficient corresponding to the second region;

determining a fifth white balance gain coefficient based on the first white balance gain coefficient and the second white balance gain coefficient, wherein the fifth white balance gain coefficient is used to correct the critical region; and

performing the white balance correction on the image based on the first white balance gain coefficient, the second white balance gain coefficient, and the fifth white balance gain coefficient.

19 . The apparatus according to claim 17 , wherein the performing the region division on the image based on the contour line of the detection object comprises:

generating a first bounding box of the detection object;

determining, in an image region comprised in a second bounding box, a region contour line that comprises a largest image area as the contour line of the detection object, wherein the second bounding box is obtained by extending the first bounding box outwards; and

performing the region division on the image based on the contour line of the detection object, wherein the first region is an image region comprised in the contour line, and the second region is an image region outside the contour line.

20 . A computer-readable storage medium, wherein the computer-readable storage medium is configured to store instructions; and when the instructions are executed by a processor, cause the processor to:

obtain an image, wherein the image comprises a detection object;

perform region division on the image based on the detection object to obtain image regions, wherein the obtained image regions comprise a first region and a second region, the first region comprises the detection object, and the second region does not comprise the detection object; and

perform white balance correction on the image based on a color temperature value of the first region and a color temperature value of the second region.

Assignments (3)
CHANGE OF NAME Recorded Apr 28, 2026
From: SHENZHEN YINWANG INTELLIGENT TECHNOLOGIES CO., LTD.
To: YINWANG INTELLIGENT TECHNOLOGIES CO., LTD.
Reel/Frame 075485/0524 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 12, 2024
From: HUAWEI TECHNOLOGIES CO., LTD.
To: SHENZHEN YINWANG INTELLIGENT TECHNOLOGIES CO., LTD.
Reel/Frame 069336/0125 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 25, 2024
From: CHEN, KANG
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 069023/0421 →