| CPC H04N 23/88 (2023.01) [H04N 23/631 (2023.01); H04N 23/71 (2023.01)] | 20 Claims |

|
1. An image processing method, comprising:
starting a camera of an electronic device in response to a first operation;
acquiring a first image under a first ambient light source in response to a second operation, wherein the first image is an image in a first color space, and the first ambient light source is at least one ambient light source for acquisition of the first image;
adjusting the first image based on a formula
![]() to obtain an adjusted first image, wherein
![]() are RGB values of an i-th pixel of the first image,
![]() are RGB values of an i-th pixel of the adjusted first image, Rgain=G/R, Bgain=G/B, and R, G, and B are RGB values, respectively, of the first ambient light source in the first color space;
adjusting the adjusted first image based on a formula
![]() to obtain a second image in a second color space, wherein CCM is a color correction matrix obtained based on a first parameter of the first ambient light source, and
![]() are RGB values of the i-th pixel of the second image in the second color space, wherein the second color space is different from the first color space;
obtaining a second parameter based on the first parameter, wherein the second parameter is a parameter related to a third color space, the first parameter comprises an x1 value and a y1 value of the first ambient light source in an xy chromaticity diagram, the second parameter has a correspondence with the first parameter, the second parameter identifies light source information of the first ambient light source in the third color space, the third color space is different from the first color space, and the third color space is different from the second color space;
performing second image processing on the second image based on the second parameter to obtain a target image; and
storing the target image.
|