CN-117237200-B - White balance correction method and device, electronic equipment and storage medium
Abstract
The embodiment of the invention discloses a white balance correction method, a device, electronic equipment and a storage medium, wherein the method comprises the steps of obtaining target color coordinates corresponding to a display mode to be corrected, carrying out initial correction on each pixel point to obtain a first RGB gain value corresponding to each pixel point, confirming the position of a target color coordinate mapped in a correction matrix, constructing the correction matrix based on CIE 1931 color space by taking the first RGB gain value as an origin, correspondingly configuring RGB gain compensation values taking the origin as a reference in each matrix unit in the correction matrix, and carrying out secondary correction on the first RGB gain value according to the RGB gain compensation values of the matrix unit in which the target color coordinate is located to obtain corrected color coordinates corresponding to the display mode to be corrected, thereby solving the technical problems of inaccurate correction and large color temperature error range after correction in the prior art.
Inventors
- Wen Randi
- TAO BINGJUN
- DAI YALI
- LI YONGSHENG
Assignees
- 广州视源电子科技股份有限公司
- 广州视睿电子科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20220606
Claims (9)
- 1. A white balance correction method, comprising: Obtaining target color coordinates corresponding to a display mode to be corrected, wherein the display mode to be corrected comprises a darkness mode, an eye protection mode, a monochrome mode and a color mode; Carrying out initial correction on each pixel point to obtain a first RGB gain value corresponding to each pixel point, wherein the deviation between a first color coordinate corresponding to the first RGB gain value and the target color coordinate is within a preset error range; Confirming the position of the target color coordinate mapping in a correction matrix, wherein the correction matrix is constructed based on CIE 1931 color space by taking the first RGB gain value as an origin point, and each matrix unit in the correction matrix is correspondingly configured with an RGB gain compensation value taking the origin point as a reference; Performing secondary correction on the first RGB gain value according to the RGB gain compensation value of the matrix unit where the target color coordinate is located to obtain a corrected color coordinate corresponding to the display mode to be corrected; Wherein said confirming the location of said target color coordinate map in the correction matrix comprises: mapping the target color coordinates to a CIE 1931 color space to obtain an initial RGB gain value; Confirming a matrix unit in which the correction matrix is located according to the initial RGB gain value; the second correction is performed on the first RGB gain value according to the RGB gain compensation value of the matrix unit where the target color coordinate is located, to obtain a corrected color coordinate corresponding to the display mode to be corrected, including: Correcting the first RGB gain value according to the RGB gain compensation value of the matrix unit where the target color coordinate is located in the correction matrix to obtain a second RGB gain value; And mapping the second RGB gain value to a CIE 1931 color space to obtain a second color coordinate serving as a correction color coordinate corresponding to the display mode to be corrected.
- 2. The method of claim 1, wherein the correction matrix covers a partial area in the CIE 1931 color space.
- 3. The white balance correction method according to claim 2, wherein the correction matrix is a matrix of 3 rows and 5 columns.
- 4. The white balance correction method according to claim 1, wherein the column width of the matrix unit is 0.001 and the row height is 0.002.
- 5. The method of claim 1, wherein the RGB gain compensation value is within ±1.
- 6. The white balance correction method according to claim 1, characterized in that the white balance correction method further comprises: and when the correction of all the display modes to be corrected is finished, generating a bin file according to all the corrected color coordinates.
- 7. A white balance correction device, comprising: the display device comprises an acquisition unit, a correction unit and a display unit, wherein the acquisition unit is used for acquiring target color coordinates corresponding to a display mode to be corrected, and the display mode to be corrected comprises a dark mode, an eye protection mode, a single-color mode and a color mode; The initial correction unit is used for carrying out initial correction on each pixel point to obtain a first RGB gain value corresponding to each pixel point, and the deviation between a first color coordinate corresponding to the first RGB gain value and the target color coordinate is within a preset error range; the confirming unit is used for confirming the position of the target color coordinate mapping in a correction matrix, the correction matrix is constructed based on CIE 1931 color space by taking the first RGB gain value as an origin point, and each matrix unit in the correction matrix is correspondingly configured with an RGB gain compensation value taking the origin point as a reference; The secondary correction unit is used for carrying out secondary correction on the first RGB gain value according to the RGB gain compensation value of the matrix unit where the target color coordinate is located, so as to obtain a corrected color coordinate corresponding to the display mode to be corrected; Wherein the confirmation unit includes: the first mapping module is used for mapping the target color coordinates to a CIE 1931 color space to obtain an initial RGB gain value; a first confirming module, configured to confirm a matrix unit in which the correction matrix is located according to the initial RGB gain value; A secondary correction unit comprising: the correction module is used for correcting the first RGB gain value according to the RGB gain compensation value of the matrix unit where the target color coordinate is located in the correction matrix to obtain a second RGB gain value; and the second mapping module is used for mapping the second RGB gain value to the CIE 1931 color space to obtain a second color coordinate serving as a correction color coordinate corresponding to the display mode to be corrected.
- 8. An electronic device, comprising: One or more processors; A memory for storing one or more computer programs; When executed by the one or more processors, causes the electronic device to implement the white balance correction method of any of claims 1-6.
- 9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the white balance correction method according to any one of claims 1-6.
Description
White balance correction method and device, electronic equipment and storage medium Technical Field The embodiment of the invention relates to the technical field of image processing, in particular to a white balance correction method, a white balance correction device, electronic equipment and a storage medium. Background With the development of image technology, the image color is processed by adjusting white balance in the image processing process, so that the desired picture effect can be achieved. White balance is an index for describing white generated by mixing of three primary colors of red, green and blue in a display device, and can restore a white object to white under any light source, so that different image colors are restored, and an image displayed by the display device is more real. The existing correction method mainly corrects the X coordinate and the Y coordinate in the color coordinates, and the correction is ended when the X coordinate and the Y coordinate in the corrected color coordinates are within the allowable error range of the X coordinate and the Y coordinate in the target color coordinates. The inventors found that by correcting the color of an image by the prior art, the error of the obtained corrected color coordinates and the target color coordinates is generally relatively large, resulting in a relatively large color temperature error range, and therefore, the difference between the color of the image displayed in the display device and the true color is significant. Disclosure of Invention The invention provides a white balance correction method, a white balance correction device, electronic equipment and a storage medium, which are used for solving the technical problems that the correction in the prior art is inaccurate and the corrected color temperature error range is large. In a first aspect, an embodiment of the present invention provides a white balance correction method, including: obtaining a target color coordinate corresponding to a display mode to be corrected; Carrying out initial correction on each pixel point to obtain a first RGB gain value corresponding to each pixel point, wherein the deviation between a first color coordinate corresponding to the first RGB gain value and a target color coordinate is within a preset error range; Confirming the position of the target color coordinate mapping in a correction matrix, wherein the correction matrix is constructed based on CIE 1931 color space by taking a first RGB gain value as an origin point, and each matrix unit in the correction matrix is correspondingly configured with an RGB gain compensation value taking the origin point as a reference; And carrying out secondary correction on the first RGB gain value according to the RGB gain compensation value of the matrix unit where the target color coordinate is located, and obtaining the corrected color coordinate corresponding to the display mode to be corrected. In a second aspect, an embodiment of the present invention provides a white balance correction apparatus, including: the acquisition unit is used for acquiring the target color coordinates corresponding to the display mode to be corrected; the initial correction unit is used for carrying out initial correction on each pixel point to obtain a first RGB gain value corresponding to each pixel point, and the deviation between a first color coordinate corresponding to the first RGB gain value and a target color coordinate is in a preset error range; the confirming unit is used for confirming the position of the target color coordinate mapping in the correction matrix, the correction matrix is constructed based on CIE 1931 color space by taking the first RGB gain value as the origin point, and each matrix unit in the correction matrix is correspondingly configured with the RGB gain compensation value taking the origin point as a reference; and the secondary correction unit is used for carrying out secondary correction on the first RGB gain value according to the RGB gain compensation value of the matrix unit where the target color coordinate is located, so as to obtain the corrected color coordinate corresponding to the display mode to be corrected. In a third aspect, an embodiment of the present invention provides an electronic device, including: One or more processors; A memory for storing one or more computer programs; when executed by one or more processors, causes the electronic device to implement the white balance correction method as in the first aspect. In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the white balance correction method as in the first aspect. The white balance correction method, the device, the electronic equipment and the storage medium comprise the steps of obtaining target color coordinates corresponding to a display mode to be corrected,