Color correction method and device, equipment and medium
By obtaining the current color mode in the electronic device and determining the target display lookup table using the preset display lookup table and the display lookup table associated with the standard color mode, the problem of high color accuracy maintenance cost in the multi-color mode of electronic devices is solved, and the problem of high color accuracy maintenance costs in the multi-color mode is realized. The effect of reducing production time and maintenance costs.
Patent Information
- Application Number
- CN202411813053.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-12-10
AI Technical Summary
The cost of maintaining color accuracy of electronic devices in multi-color mode is high, and it takes a lot of time to produce and maintain display lookup tables in multiple color modes.
By obtaining the current color mode of the electronic device, obtaining the display lookup table associated with the preset display lookup table and the standard color mode, determining the color temperature conversion matrix of the current color mode, and determining the target display lookup table based on the matrix and the preset display lookup table. Updates the grayscale value of the three primary colors of the pixels in the display screen.
There is no need to calibrate the corresponding display lookup table for each color mode, which reduces the production time and maintenance costs of electronic equipment, improves production efficiency, and ensures color accuracy in multi-color mode.
Smart Images

Figure CN119418629A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of display technology, and specifically relates to a color correction method, device, equipment and medium. Background Art
[0002] With the continuous development of technology, electronic devices serve as the main tools for communication, taking pictures, watching movies, live broadcasting and work. As the main tools, electronic devices cannot do without a good display screen. One of the evaluation criteria for a good display screen is the high color accuracy of the display screen.
[0003] In the exemplary technology, a display lookup table in a standard color mode is stored in the electronic device. The display lookup table is used to map the native white color temperature and color gamut area of the display screen to the standard color temperature and standard color gamut area, thereby ensuring that the color accuracy of the display screen in the standard color mode reaches the optimal value.
[0004] However, electronic devices have multiple color modes, and it is necessary not only to calibrate the display lookup table in the standard color mode, but also to calibrate the display lookup tables in other color modes. This results in a lot of time spent on producing electronic devices, and the cost of maintaining the color accuracy of electronic devices in multiple color modes is high. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a color correction method, apparatus, device and medium to solve the problem of high cost of maintaining color accuracy of electronic devices in multi-color modes.
[0006] In a first aspect, an embodiment of the present application provides a color correction method, comprising:
[0007] Get the current color mode of the electronic device;
[0008] When the current color mode is not a standard color mode, obtaining a preset display lookup table and a first display lookup table associated with the standard color mode;
[0009] Determine a color temperature conversion matrix of the current color mode, and determine a second display lookup table according to the color temperature conversion matrix and the preset display lookup table;
[0010] A target display lookup table corresponding to the current color mode is determined according to the first display lookup table and the second display lookup table, and grayscale values of three primary colors of pixels in the display screen of the electronic device are updated according to the target display lookup table.
[0011] In a second aspect, an embodiment of the present application provides a color correction device, the device comprising:
[0012] A first acquisition module, used to acquire the current color mode of the electronic device;
[0013] A second acquisition module, configured to acquire a preset display lookup table and a first display lookup table associated with the standard color mode when the current color mode is not the standard color mode;
[0014] A first determination module, configured to determine a color temperature conversion matrix of the current color mode, and determine a second display lookup table according to the color temperature conversion matrix and the preset display lookup table;
[0015] The second determination module is used to determine the target display lookup table corresponding to the current color mode according to the first display lookup table and the second display lookup table, and update the grayscale values of the three primary colors of the pixel points in the display screen of the electronic device according to the target display lookup table.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0017] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0018] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0019] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0020] In an embodiment of the present application, when the current color mode of the electronic device is not the standard color mode, a second display lookup table is determined based on the color temperature conversion matrix of the current color mode and the preset display lookup table, and a target display lookup table of the current color mode is determined based on the second display lookup table and the first display lookup table in the standard color mode, and then the grayscale values of the three primary colors of the pixel points in the display screen are updated through the target display lookup table. In the present application, the display lookup table of other color modes in the electronic device can be determined through the preset display lookup table and the display lookup table in the standard color mode, and there is no need to calibrate the corresponding display lookup table for each color mode of the electronic device, which reduces the production time of the electronic device, improves the production efficiency of the electronic device, and reduces the cost of maintaining the color accuracy of the electronic device in multiple color modes. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a schematic diagram of a scene of a color correction method according to an exemplary embodiment;
[0022] Figure 2 is one of the flowchart diagrams of a color correction method according to an exemplary embodiment;
[0023] Figure 3 is a second flowchart of a color correction method according to an exemplary embodiment;
[0024] Figure 4 is a third flowchart of a color correction method according to an exemplary embodiment;
[0025] Figure 5 is one of the schematic flow charts of a color correction method according to an exemplary embodiment;
[0026] Figure 6 is a second schematic diagram of a brief flow chart of a color correction method according to an exemplary embodiment;
[0027] Figure 7 is a third schematic diagram of a brief flow chart of a color correction method according to an exemplary embodiment;
[0028] Figure 8 is a structural block diagram of a color correction device according to an exemplary embodiment;
[0029] Fig. 9 is a structural block diagram of an electronic device according to an exemplary embodiment;
[0030] Fig.10 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0032] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0033] With the continuous development of technology, electronic devices serve as the main tools for communication, taking pictures, watching movies, live broadcasting and work. As the main tools, electronic devices cannot do without a good display screen. One of the evaluation criteria for a good display screen is the high color accuracy of the display screen.
[0034] In the exemplary technology, a display lookup table in a standard color mode is stored in the electronic device. The display lookup table is used to map the native white color temperature and color gamut area of the display screen to the standard color temperature and standard color gamut area, thereby ensuring that the color accuracy of the display screen in the standard color mode reaches the optimal value.
[0035] However, electronic devices have multiple color modes, and it is necessary not only to calibrate the display lookup table in the standard color mode, but also to calibrate the display lookup tables in other color modes. This results in a lot of time spent on producing electronic devices, and the cost of maintaining the color accuracy of electronic devices in multiple color modes is high.
[0036] In view of the high cost of maintaining color accuracy of electronic devices in multi-color modes,
[0037] By presetting the display lookup table and the display lookup table under the standard color mode, the display lookup table of other color modes in the electronic device can be determined. There is no need to calibrate the corresponding display lookup table for each color mode of the electronic device, which reduces the production time of the electronic device, improves the production efficiency of the electronic device, and reduces the cost of maintaining the color accuracy of the electronic device in multiple color modes.
[0038] Reference Figure 1 , a schematic diagram of a scene of the color correction method provided by the present application is described. Figure 1 As shown, the current color mode of the display screen 110 of the electronic device 100 is not the standard color mode, and the preset display lookup table and the first display lookup table associated with the standard color mode are obtained. The electronic device 100 determines the color temperature conversion matrix in the current color mode, determines the second display lookup table through the color temperature conversion matrix and the preset display lookup table, and then obtains the target display lookup table in the current color mode through the first display lookup table and the second display lookup table, so as to update the grayscale values of the three primary colors of the pixel points in the display screen based on the target display lookup table, that is, to perform color correction on the display screen based on the target display lookup table.
[0039] The following combination includes Figure 1 With reference to the accompanying drawings, the color correction method, device, equipment and medium provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.
[0040] The color correction method provided in the embodiment of the present application can be applied to the application scenario of displaying images on a display screen.
[0041] Combine the following Figure 1 The color correction method provided in the embodiment of the present application is described in detail.
[0042] Reference Figure 2 , Figure 2 This is one of the flow charts of the color correction method provided by this application, such as Figure 2 As shown, the color correction method includes the following steps:
[0043] Step S201, obtaining the current color mode of the electronic device.
[0044] In this embodiment, the execution subject is an electronic device provided with a display screen, such as a mobile phone, a computer, a tablet, a television, etc. For ease of description, the execution subject is referred to as a device below.
[0045] The device is provided with a plurality of color modes, such as RGB color mode, HSB color mode, CMYK color mode, Lab color mode, bitmap mode, grayscale mode, indexed color mode, duotone mode and multi-channel mode.
[0046] RGB color mode: various colors are obtained by changing the three color channels of red, green, and blue and superimposing them. This standard includes almost all colors that can be perceived by human vision and is one of the most widely used color systems.
[0047] HSB color mode: Hue, Saturation, Brightness. It uses the three attributes of color for quantification, with hue and saturation expressed as percentages, and brightness expressed as percentages. This mode is based on human perception of color and describes the three basic characteristics of color.
[0048] CMYK color mode: used for printed products, and represents colors by superimposing four colors: cyan, magenta, yellow, and black. This mode is suitable for color separation printing. Lab color mode: a uniform color space based on human visual perception, where L represents brightness, and a and b represent the two dimensions of color. This mode can maintain color consistency between different devices.
[0049] Bitmap mode: Each pixel has only one color value, usually used for scanning and bitmap image processing.
[0050] Grayscale mode: There are only two color values, black and white, used for black and white image processing.
[0051] Indexed color mode: Uses colors in the palette to represent colors in an image, suitable for web design.
[0052] Duotone mode: Uses two or more types of ink or color to simulate more color variations, often used for special effects.
[0053] Multi-channel mode: Each channel can represent different information, such as a channel for transparency processing.
[0054] The standard color mode can be any color mode calibrated with a display lookup table as mentioned above. After the device is running, the device obtains the current color mode, which is defined as the current color mode.
[0055] Step S202: when the current color mode is not the standard color mode, obtaining a preset display lookup table and a first display lookup table associated with the standard color mode.
[0056] After obtaining the current color mode, the device determines whether the current color mode is the color mode set in the electronic device. The set color mode is calibrated with a display lookup table, and the set color mode is a standard color mode. If the current color mode is not the standard color mode, the electronic device does not contain a display lookup table in the current color mode, and the device needs to determine the display lookup table in the current color mode.
[0057] Specifically, the device obtains a preset display lookup table and a display lookup table associated with a standard color mode, and the display lookup table in the standard color mode is defined as a first display lookup table. The preset display lookup table can be a 17-cube display lookup table or an 18-cube display lookup table. The 17-cube display lookup table refers to dividing the color space into 17 cubes using a cube partitioning method, with the coordinate axis being RGB. Each edge is divided into 17 segments and 17 nodes, i.e., a 17×17×17 display lookup table.
[0058] If the current color mode is the standard color mode, the display lookup table of the standard color mode is directly used to update the three primary colors of the pixels in the display screen.
[0059] Step S203, determining a color temperature conversion matrix of the current color mode, and determining a second display lookup table according to the color temperature conversion matrix and a preset display lookup table.
[0060] The current color mode has a corresponding conversion matrix, which is a color temperature conversion matrix. The color temperature conversion matrix is, for example, a color temperature conversion matrix of a P3 color gamut or a color temperature conversion matrix of an sRGB color gamut. In one example, the device pre-stores a color temperature conversion matrix in the current color mode, and the device directly obtains the color temperature conversion matrix associated with the current color mode.
[0061] After determining the color temperature conversion matrix, the device determines a second display lookup table based on the color temperature conversion matrix and the preset display lookup table. Exemplarily, the preset display lookup table is first linearly processed, that is, the preset display lookup table is gamma-changed, and then the preset display lookup table after linear processing is multiplied by the color temperature conversion matrix to obtain the second display lookup table.
[0062] Step S204, determining a target display lookup table corresponding to the current color mode according to the first display lookup table and the second display lookup table, and updating grayscale values of three primary colors of pixels in the display screen of the electronic device according to the target display lookup table.
[0063] After obtaining the second display lookup table, the device determines the display lookup table corresponding to the current mode based on the first display lookup table and the second display lookup table, and the display lookup table is defined as the target display lookup table. Exemplarily, the first display lookup table and the second display lookup table are interpolated using trilinear interpolation to obtain the target display lookup table.
[0064] After testing, it is found that by using the color correction method provided in this embodiment, the color accuracy of the display image of the display screen can be guaranteed even when the device operates in any color mode other than the standard color mode.
[0065] In this embodiment, when the current color mode of the electronic device is not the standard color mode, a second display lookup table is determined based on the color temperature conversion matrix of the current color mode and the preset display lookup table, and a target display lookup table of the current color mode is determined based on the second display lookup table and the first display lookup table in the standard color mode, and then the grayscale values of the three primary colors of the pixel points in the display screen are updated through the target display lookup table. In this application, the display lookup tables of other color modes in the electronic device can be determined through the preset display lookup table and the display lookup table in the standard color mode, and there is no need to calibrate the corresponding display lookup table for each color mode of the electronic device, which reduces the production time of the electronic device, improves the production efficiency of the electronic device, and reduces the cost of maintaining the color accuracy of the electronic device in multiple color modes.
[0066] Reference Figure 3 , Figure 3 This is the second flow chart of the color correction method provided by this application, based on Figure 2 In the illustrated embodiment, step S203 includes:
[0067] Step S301, determining a target color gamut corresponding to a current color mode and a first white point corresponding to the target color gamut.
[0068] In this embodiment, the device determines the target color gamut corresponding to the current color mode, and the target color gamut is, for example, the P3 color gamut or the sRGB color gamut. The device sets a white point corresponding to the target color gamut, and the white point is defined as a first white point, and the first white point has corresponding coordinates, and the coordinates of the first white point are (Wx, Wy, Wz).
[0069] Step S302: determining first ratio parameters of three primary colors corresponding to the current color mode according to the coordinates corresponding to the first white point.
[0070] After determining the first white point, the device determines first ratio parameters of the three primary colors of the current color mode based on the coordinates corresponding to the first white point.
[0071] Exemplarily, when the target color gamut is the P3 color gamut, the first ratio parameters of the three primary colors are:
[0072]
[0073] Exemplarily, when the target color gamut is the sRGB color gamut, the first ratio parameters of the three primary colors are:
[0074]
[0075] Step S303: determining a color temperature conversion matrix of the current color mode according to the first ratio parameter and a matrix corresponding to the target color gamut.
[0076] After the first ratio parameter is obtained, the color temperature conversion matrix of the current color mode is determined based on the first ratio parameter and a matrix corresponding to the target color gamut.
[0077] Exemplarily, the target color gamut is the P3 color gamut, and the product of the first ratio parameter and the matrix of the target color gamut is the color temperature conversion matrix, which is:
[0078]
[0079] Exemplarily, the target color gamut is the sRGB color gamut, and the product of the first ratio parameter and the matrix of the target color gamut is the color temperature conversion matrix, which is:
[0080]
[0081] In this embodiment, the device determines the target color gamut and the corresponding first white point corresponding to the current color mode, and determines the first ratio parameter of the three primary colors of the current color mode based on the white point of the first white point, thereby determining the color temperature conversion matrix corresponding to the current color mode based on the first ratio parameter and the matrix of the target color gamut, that is, the device does not need to store the color temperature conversion matrices of each color mode, thereby saving storage space of the device.
[0082] Reference Figure 4 , Figure 4 This is the third flow chart of the color correction method provided by this application, based on Figure 2 or Figure 3 In the illustrated embodiment, step S202 includes:
[0083] Step S401, determining a set color gamut corresponding to a standard color mode and a second white point corresponding to the set color gamut.
[0084] In this embodiment, the device calibrates the display lookup table of the standard color mode to obtain the display lookup table in the standard color mode.
[0085] Exemplarily, the device first adjusts the color mode of the display screen to the standard color mode, and determines the set color gamut of the display screen. The set color gamut refers to the color gamut set by the display screen for calibration in the standard color mode. The device then obtains the white point corresponding to the set color gamut, which is defined as the second white point, and the second white point is set based on the set color gamut.
[0086] Specifically, by setting the color gamut, the coordinates of the three vertices of red, green, and blue in the hue gamut can be determined, and the vertex refers to the limit value. For example, the red vertex coordinate refers to the coordinate value corresponding to the limit value of red in the set color gamut. The red vertex coordinate is (TargetRx, TargetRy), the green vertex coordinate is (TargetGx, TargetGy), and the blue vertex coordinate is (TargetBx, TargetBy). The white point coordinate is (TargetWx, TargetWy), and the brightness value of the white point is TargetLw.
[0087] Step S402, determining the first color coordinates of each color point in the set color gamut according to the coordinates and brightness value of the second white point.
[0088] After determining the second white point, the device determines the color coordinates of each color point in the set color gamut based on the coordinates of the second white point and the brightness value, and the color coordinates of the color point are defined as the first color coordinates.
[0089] Exemplarily, the device determines the brightness values of the three primary colors of each color point in the set color gamut and the total brightness value of the color point based on the coordinates and brightness value of the second white point. Specifically, given the coordinates and brightness value of the white point, the brightness values LRn, LGn, LBn of the three primary colors of the color point and the total brightness value Lc of the color point can be calculated by the formula corresponding to the color matching equation. The three primary colors are red, green and blue, and the brightness value of red in the color point is LRn, the brightness value of green in the color point is LGn, and the brightness value of blue in the color point is LBn.
[0090] The device determines the first color coordinates of the color point through the brightness values of the three primary colors and the total brightness value of the color point. Exemplarily, a matrix is constructed through the brightness values LRn, LGn, LBn of the three primary colors and the total brightness value Lc of the color point, and the device then determines the tristimulus values [Xc, Yc, Zc] of the color point based on the matrix, the coordinates of the red vertex, the coordinates of the green vertex, the coordinates of the blue vertex, and the coordinates of the white point. The calculation method of the tristimulus values is as follows:
[0091]
[0092] After obtaining the tristimulus values of the color point, the device can obtain the first color coordinates corresponding to the color point based on the tristimulus values, as follows:
[0093]
[0094] Wherein, Cx and Cy constitute the first color coordinate.
[0095] In this embodiment, the brightness values of the three primary colors of each color point in the set color gamut and the total brightness value of the color point are determined by the coordinates and brightness value of the second white point, and then based on the brightness values of the three primary colors of the color point and the total brightness value, the first color coordinates of the color point can be accurately determined.
[0096] Step S403, obtaining the display screen, the second color coordinates of the red picture displayed based on the initial color gamut, the third color coordinates of the green picture displayed based on the initial color gamut, and the fourth color coordinates of the blue picture displayed based on the initial color gamut.
[0097] After obtaining the first color coordinates, the device obtains the second color coordinates of the red picture displayed on the display screen in the initial color gamut, the third color coordinates of the green picture displayed based on the initial color gamut, and the fourth color coordinates of the blue picture displayed based on the initial color gamut. The second color coordinates, the third color coordinates, and the fourth color coordinates are obtained by testing and stored in the device.
[0098] Specifically, the display screen first displays the picture in the original color gamut (initial color gamut), and the picture is used as the display picture, and then the display picture is switched to the red picture, and the color coordinates of the display screen displaying the red picture are measured to obtain the second color coordinates; after measuring the second color coordinates, the display screen switches the red picture back to the display picture, and switches the display picture to the green picture, and then the color coordinates of the display screen displaying the green picture are measured to obtain the third color coordinates; after measuring the third color coordinates, the display screen switches the red picture back to the display picture, and switches the display picture to the blue picture, and the color coordinates of the display screen displaying the blue picture are measured to obtain the fourth color coordinates. The second color coordinates are (NativeRx, NativeRy), the third color coordinates are (NativeGx, NativeGy), and the fourth color coordinates are (NativeBx, NativeBy). It should be noted that the original color gamut is a color gamut set by the user on the display screen.
[0099] Step S404, determining the grayscale values of the three primary colors of the color point according to the first color coordinate, the second color coordinate, the third color coordinate and the fourth color coordinate, and constructing a display lookup table associated with the standard color mode according to the grayscale values of the three primary colors of each color point.
[0100] After obtaining the second color coordinates, the third color coordinates, and the fourth color coordinates, the device determines the grayscale value of the color point based on the second color coordinates, the third color coordinates, the fourth color coordinates, and the first color coordinates of the color point.
[0101] Exemplarily, the device determines the ratio parameters of the three primary colors of the color point based on the first color coordinate, the second color coordinate, the third color coordinate, and the fourth color coordinate, and the ratio parameters are specifically:
[0102]
[0103] After obtaining the ratio parameter, the device can determine the brightness values of the three primary colors of the color point based on the total brightness value of the color point and the ratio parameter. The brightness values of the three primary colors are LRnr, LGnr, and LBnr. Specifically, the brightness values of the three primary colors can be calculated based on the mapping relationship between the brightness values of the three primary colors of the color point and the total brightness value of the color point.
[0104] After obtaining the brightness values of the three primary colors of the color point, the brightness values of the three primary colors can be converted into grayscale values of the three primary colors. Specifically, the conversion can be performed through the mapping relationship between the brightness value and the grayscale value. For example, the brightness value can be converted into the grayscale value through the gamma algorithm. It should be noted that the three primary colors refer to the red, green and blue colors of the pixel points on the display screen, and the three primary colors refer to the red, green and blue of the pixel points in theoretical calculations.
[0105] In this embodiment, the ratio parameters of the three primary colors of the color point are determined by the second color coordinate, the third color coordinate, the fourth color coordinate and the first color coordinate of the color point, so that the grayscale values of the three primary colors of the color point can be accurately determined based on the ratio parameters and the total brightness value of the color point.
[0106] The device can obtain the grayscale values of the three primary colors of each color point in the set color gamut in the above manner, and the three primary color grayscale values of each color point can be constructed into a display lookup table corresponding to the standard color mode.
[0107] based on Figure 3 as well as Figure 4 The embodiment shown, specifically refer to Figure 5 , briefly explain the calculation of the grayscale values of the three primary colors:
[0108] 501. The device first sets a target color gamut (set color gamut) and a target white point (second white point) in a standard color mode;
[0109] 502. Calculate the coordinate points and brightness of all target colors (each color point in the set color gamut);
[0110] 503. Obtain the primary color gamut of the screen;
[0111] 504. Calculate the ratios of three primary colors r, g, and b based on the primary color gamut vertices and the color coordinates of the target color;
[0112] 505. Calculate the brightness of the three primary colors according to the target brightness (total brightness of the target color) and the ratio of the three primary colors;
[0113] 506. Calculate the grayscale values of the three primary colors respectively based on the gamma calculation method.
[0114] In this embodiment, the device calibrates the color mode of the display screen based on the set color gamut corresponding to the display screen and the second white point corresponding to the set color gamut, thereby obtaining a display lookup table in the standard color mode with high accuracy.
[0115] In one embodiment, after the device determines the display lookup table of other color modes in the non-standard color mode each time, it associates and stores the other color modes with the corresponding display lookup table.
[0116] If the current color mode of the device is not the standard color mode, the device detects whether the current color mode is associated with a historical display lookup table. If the device does not store the historical display lookup table associated with the current color mode, the preset display lookup table and the first display lookup table associated with the standard color mode are obtained to determine the display lookup table of the current color mode. If the current color mode is associated with a historical display lookup table, the device uses the historical display lookup table as the target display lookup table, thereby updating the grayscale values of the three primary colors of the pixel points in the display screen based on the target display lookup table.
[0117] In this embodiment, the grayscale values of the three primary colors of the pixels in the display screen are quickly updated through the historical display lookup table associated with the current color mode, without calculating the display lookup table of the current color mode, thus saving computing resources of the device.
[0118] In one embodiment, a plurality of display lookup tables associated with target brightness values are stored in the device. In order to avoid the device using the display lookup table associated with the target brightness value, after obtaining the target display lookup table, the device stores the target display lookup table in the setting module, and then updates the grayscale value of the pixel point in the display screen based on the target display lookup table in the setting module. The setting module is, for example, a data processor in the device, and for another example, the setting module is a C3D module of a DPU (Data Processing Unit), where C3D refers to a virtual reality engine module.
[0119] Reference Figure 6 , the color correction method in this embodiment is briefly described:
[0120] 601. Before the device leaves the factory, the display screen of the device is switched to a standard mode (standard color mode);
[0121] 602. Perform production line calibration on the display screen;
[0122] 603. Generate a 3D Lut (display lookup table) corresponding to brightness (brightness in standard color mode);
[0123] 604. Send the 3D Lut to the mobile terminal, that is, store it in the device;
[0124] 605. When the device is used after leaving the factory, the CPU module in the device obtains data (3D Lut);
[0125] 606. Perform data processing based on different target modes of the device to generate corresponding 3D Lut, that is, generate 3D Lut corresponding to different color modes;
[0126] 607. Set the 3D Lut corresponding to different color modes in the C3D module of the DPU.
[0127] Furthermore, Figure 6 Refer to the detailed information of generating corresponding 3D Lut based on different target modes in the data processing. Figure 7 :
[0128] 701. Calculate the target 3D Lut (second display lookup table) based on the white point color temperature conversion principle. The target 3DLut is obtained by the color temperature conversion matrix and the 3D Lut after linear processing. The color temperature conversion matrix refers to 7011-7014. The processed 3DLut is obtained based on 7021 and 7022.
[0129] 7011. Set a target color gamut (set color gamut) and a target white point (second white point);
[0130] 7012. Calculate the ratios of three primary colors r, g, and b based on the target color gamut vertex and the white point color coordinates;
[0131] 7013. The ratios of the three primary colors r, g, and b are multiplied by the target color gamut (the matrix corresponding to the target color gamut) to obtain a matrix;
[0132] The matrix obtained in 7014 and 7013 is multiplied by the matrix of the calibration mode (the matrix corresponding to the standard color mode) to obtain a color temperature conversion matrix;
[0133] 7021. Get the original 3D LUT (display lookup table of 17 cube or 18 cube);
[0134] 7022, the original 3D LUT is processed linearly;
[0135] 702. Perform trilinear interpolation between the target 3D Lut and the 3D Lut calibrated by the production line (first display lookup table) to obtain a final color-corrected 3D Lut (target display lookup table);
[0136] 703. The final color corrected 3D LUT is set to the C3D module of the DPU.
[0137] In this embodiment, the display lookup table in the setting module is used to update the grayscale values of the three primary colors of the pixel points in the display screen, avoiding the device using the display lookup table associated with the target brightness value to update the grayscale values of the three primary colors of the pixel points, that is, to determine that the device can correct the color of the display screen with the correct display lookup table.
[0138] Based on the same inventive concept, the present application also provides a color correction device. Figure 8 The color correction device provided in the embodiment of the present application is described in detail.
[0139] Figure 8 The figure is a structural block diagram of a color correction device according to an exemplary embodiment.
[0140] like Figure 8 As shown, the color correction device 800 may be an electronic device having a display screen, and the color correction device 800 may include:
[0141] A first acquisition module 810 is used to acquire the current color mode of the electronic device;
[0142] A second acquisition module 820, configured to acquire a preset display lookup table and a first display lookup table associated with the standard color mode when the current color mode is not the standard color mode;
[0143] A first determination module 830, configured to determine a color temperature conversion matrix of a current color mode, and determine a second display lookup table according to the color temperature conversion matrix and a preset display lookup table;
[0144] The second determination module 840 is used to determine the target display lookup table corresponding to the current color mode according to the first display lookup table and the second display lookup table, and update the grayscale values of the three primary colors of the pixel points in the display screen of the electronic device according to the target display lookup table.
[0145] The color correction device 800 is described in detail below, as shown below:
[0146] In one embodiment, the first determining module 830 further includes:
[0147] A first determination unit, used to determine a target color gamut corresponding to a current color mode and a first white point corresponding to the target color gamut;
[0148] A second determining unit, configured to determine first ratio parameters of the three primary colors corresponding to the current color mode according to the coordinates corresponding to the first white point;
[0149] The third determining unit is used to determine the color temperature conversion matrix of the current color mode according to the first ratio parameter and the matrix corresponding to the target color gamut.
[0150] In one embodiment, the second acquisition module 840 further includes:
[0151] A fourth determining unit, used to determine a set color gamut corresponding to the standard color mode and a second white point corresponding to the set color gamut;
[0152] a fifth determining unit, configured to determine the first color coordinates of each color point in the set color gamut according to the coordinates of the second white point and the brightness value;
[0153] A first acquisition unit, used to acquire a second color coordinate of a red picture displayed on the display screen based on an initial color gamut, a third color coordinate of a green picture displayed based on the initial color gamut, and a fourth color coordinate of a blue picture displayed based on the initial color gamut;
[0154] A sixth determining unit, configured to determine grayscale values of three primary colors of a color point according to the first color coordinate, the second color coordinate, the third color coordinate, and the fourth color coordinate;
[0155] The construction unit is used to construct a first display lookup table associated with the standard color mode according to the grayscale values of the three primary colors of each color point.
[0156] In one embodiment, the fifth determining unit includes:
[0157] A first determination subunit, configured to determine the brightness values of the three primary colors of each color point in the set color gamut and the total brightness value of the color point according to the coordinates and brightness value of the second white point;
[0158] The second determination subunit is used to determine the first color coordinate of the color point according to the brightness values of the three primary colors and the total brightness value of the color point.
[0159] In one embodiment, the sixth determining unit includes:
[0160] A third determination subunit, configured to determine a second ratio parameter of the three primary colors of the color point according to the first color coordinate, the second color coordinate, the third color coordinate, and the fourth color coordinate;
[0161] A fourth determining subunit, configured to determine brightness values of three primary colors of the color point according to the total brightness value of the color point and the second ratio parameter;
[0162] The fifth determining subunit is used to determine the grayscale values of the three primary colors of the color point according to the brightness values of the three primary colors of the color point.
[0163] In one embodiment, the second acquisition module 840 includes:
[0164] A storage unit, used for storing the target display lookup table in the setting module;
[0165] The updating unit is used to update the grayscale values of the three primary colors of the pixel points in the display screen of the electronic device according to the target display lookup table in the setting module.
[0166] In one embodiment, the second acquisition module 840 includes:
[0167] The second acquisition unit is used to acquire a preset display lookup table and a first display lookup table associated with a standard color mode when the current color mode is not associated with a historical display lookup table.
[0168] The color correction device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0169] The color correction device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0170] The color correction device provided in the embodiment of the present application can achieve Figure 2-4 The various processes implemented in the method embodiment achieve the same technical effect and will not be described again here to avoid repetition.
[0171] In some embodiments, Fig. 9As shown, the embodiment of the present application further provides an electronic device 900, including a processor 901 and a memory 902, wherein the memory 902 stores a program or instruction that can be executed on the processor 901, and when the program or instruction is executed by the processor 901, each step of the above-mentioned color correction method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0172] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0173] Fig.10 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0174] The electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.
[0175] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.10 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0176] The processor 1010 is used to obtain the current color mode of the electronic device;
[0177] When the current color mode is not the standard color mode, obtaining a preset display lookup table and a first display lookup table associated with the standard color mode;
[0178] Determine a color temperature conversion matrix of the current color mode, and determine a second display lookup table according to the color temperature conversion matrix and a preset display lookup table;
[0179] A target display lookup table corresponding to the current color mode is determined according to the first display lookup table and the second display lookup table, and grayscale values of three primary colors of pixels in a display screen of the electronic device are updated according to the target display lookup table.
[0180] In some embodiments, the processor 1010 is further configured to determine a target color gamut corresponding to the current color mode and a first white point corresponding to the target color gamut;
[0181] Determine first ratio parameters of the three primary colors corresponding to the current color mode according to the coordinates corresponding to the first white point;
[0182] A color temperature conversion matrix of the current color mode is determined according to the first ratio parameter and a matrix corresponding to the target color gamut.
[0183] In some embodiments, the processor 1010 is further configured to determine a set color gamut corresponding to the standard color mode and a second white point corresponding to the set color gamut;
[0184] Determine the first color coordinates of each color point in the set color gamut according to the coordinates of the second white point and the brightness value;
[0185] Acquire a second color coordinate of a red picture displayed on the display screen based on the initial color gamut, a third color coordinate of a green picture displayed based on the initial color gamut, and a fourth color coordinate of a blue picture displayed based on the initial color gamut;
[0186] Determine the grayscale values of the three primary colors of the color point according to the first color coordinate, the second color coordinate, the third color coordinate, and the fourth color coordinate;
[0187] A first display lookup table associated with the standard color mode is constructed according to the grayscale values of the three primary colors of each color point.
[0188] In some embodiments, the processor 1010 is further configured to determine the brightness values of the three primary colors of each color point in the set color gamut and the total brightness value of the color point according to the coordinates and brightness value of the second white point;
[0189] The first color coordinate of the color point is determined according to the brightness values of the three primary colors of the color point and the total brightness value.
[0190] In some embodiments, the processor 1010 is further configured to determine a second ratio parameter of the three primary colors of the color point according to the first color coordinate, the second color coordinate, the third color coordinate, and the fourth color coordinate;
[0191] Determine the brightness values of the three primary colors of the color point according to the total brightness value of the color point and the second ratio parameter;
[0192] According to the brightness values of the three primary colors of the color point, the grayscale values of the three primary colors of the color point are determined.
[0193] In some embodiments, the processing unit 1010 is further configured to store the target display lookup table in the setting module;
[0194] According to the target display lookup table in the setting module, the grayscale values of the three primary colors of the pixel points in the display screen of the electronic device are updated.
[0195] In some embodiments, the processing unit 1010 is further configured to obtain a preset display lookup table and a first display lookup table associated with a standard color mode when the current color mode is not associated with a historical display lookup table.
[0196] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0197] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 10010 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0198] The processor 1010 may include one or more processing units; in some embodiments, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.
[0199] The embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned color correction method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0200] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory, a random access memory, a magnetic disk or an optical disk.
[0201] The embodiment of the present application further provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned color correction method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0202] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0203] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned color correction method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0204] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0205] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0206] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A color correction method, characterized in that: include: Get the current color mode of the electronic device; When the current color mode is not a standard color mode, obtaining a preset display lookup table and a first display lookup table associated with the standard color mode; Determine a color temperature conversion matrix of the current color mode, and determine a second display lookup table according to the color temperature conversion matrix and the preset display lookup table; A target display lookup table corresponding to the current color mode is determined according to the first display lookup table and the second display lookup table, and grayscale values of three primary colors of pixels in the display screen of the electronic device are updated according to the target display lookup table.
2. The method according to claim 1, characterized in that The step of determining a color temperature conversion matrix of the current color mode includes: Determine a target color gamut corresponding to the current color mode and a first white point corresponding to the target color gamut; Determine first ratio parameters of the three primary colors corresponding to the current color mode according to the coordinates corresponding to the first white point; A color temperature conversion matrix of the current color mode is determined according to the first ratio parameter and a matrix corresponding to the target color gamut.
3. The method according to claim 1, characterized in that The step of obtaining a first display lookup table associated with the standard color mode comprises: Determine a set color gamut corresponding to the standard color mode and a second white point corresponding to the set color gamut; Determining the first color coordinates of each color point in the set color gamut according to the coordinates and brightness value of the second white point; Acquire a second color coordinate of a red picture displayed on the display screen based on an initial color gamut, a third color coordinate of a green picture displayed based on the initial color gamut, and a fourth color coordinate of a blue picture displayed based on the initial color gamut; Determine grayscale values of three primary colors of the color point according to the first color coordinate, the second color coordinate, the third color coordinate, and the fourth color coordinate; A first display lookup table associated with the standard color mode is constructed according to the grayscale values of the three primary colors of each of the color points.
4. The method according to claim 3, characterized in that The step of determining the first color coordinates of each color point in the set color gamut according to the coordinates of the second white point and the brightness value includes: Determine the brightness values of the three primary colors of each color point in the set color gamut and the total brightness value of the color point according to the coordinates and the brightness value of the second white point; A first color coordinate of the color point is determined according to the brightness values of the three primary colors of the color point and the total brightness value.
5. The method according to claim 3, characterized in that: Determining the grayscale values of the three primary colors of the color point according to the first color coordinate, the second color coordinate, the third color coordinate, and the fourth color coordinate includes: Determine a second ratio parameter of the three primary colors of the color point according to the first color coordinate, the second color coordinate, the third color coordinate, and the fourth color coordinate; Determining brightness values of three primary colors of the color point according to the total brightness value of the color point and the second ratio parameter; The grayscale values of the three primary colors of the color point are determined according to the brightness values of the three primary colors of the color point.
6. The method according to any one of claims 1 to 5, characterized in that The updating of the grayscale values of the three primary colors of the pixel points in the display screen of the electronic device according to the target display lookup table includes: storing the target display lookup table in a setting module; The grayscale values of the three primary colors of the pixel points in the display screen of the electronic device are updated according to the target display lookup table in the setting module.
7. The method according to any one of claims 1 to 5, characterized in that The step of obtaining a preset display lookup table and a first display lookup table associated with the standard color mode includes: In the case that the historical display lookup table associated with the current color mode is not stored, a preset display lookup table and a first display lookup table associated with the standard color mode are acquired.
8. A color correction device, characterized in that: The device comprises: A first acquisition module, used to acquire the current color mode of the electronic device; A second acquisition module, configured to acquire a preset display lookup table and a first display lookup table associated with the standard color mode when the current color mode is not the standard color mode; A first determination module, configured to determine a color temperature conversion matrix of the current color mode, and determine a second display lookup table according to the color temperature conversion matrix and the preset display lookup table; The second determination module is used to determine the target display lookup table corresponding to the current color mode according to the first display lookup table and the second display lookup table, and update the grayscale values of the three primary colors of the pixel points in the display screen of the electronic device according to the target display lookup table.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the color correction method according to any one of claims 1 to 7 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the color correction method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method for modulating color temperature of LCD
CN101329846A
Lookup table generation method used in display color correction
CN102237025A
Method for correcting gray scale display curve of display device, electronic equipment and computer-readable storage medium
CN109448644A
Object display method and device and color lookup table generation method and device
CN115294945A
Control method of organic light-emitting display system
CN118334977A