Color correction method, device, equipment and medium
By generating a target display lookup table to update the color mode of electronic devices, the problem of high cost in maintaining color accuracy in multi-color modes is solved, thereby improving production efficiency and reducing costs.
Patent Information
- Application Number
- CN202411813053.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-12-10
AI Technical Summary
Maintaining color accuracy in multiple color modes for electronic devices is costly and requires a lot of time to calibrate multiple display lookup tables.
By obtaining the preset display lookup table and the display lookup table under the standard color mode, the color temperature conversion matrix of the current color mode is determined, the target display lookup table is generated, and the grayscale values of the three primary colors of the pixels in the display screen are updated.
There is no need to display a lookup table for each color mode, which reduces production time, improves production efficiency, and reduces the cost of maintaining color accuracy in multiple color modes.
Smart Images

Figure CN119418629B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of display, and particularly relates to a color correction method and device, equipment and medium. BACKGROUND
[0002] With the continuous development of technology, electronic devices serve as main tools for communication, photographing, movie watching, live streaming and work. Electronic devices as main tools cannot do without a good display screen. One of the evaluation standards of a good display screen is that the color accuracy of the display screen is high.
[0003] In the example technology, a display lookup table under a standard color mode is stored in an electronic device. The display lookup table is used to map the native white color temperature and color gamut area of a display screen to a standard color temperature and a standard color gamut area, so as to ensure that the color accuracy of the display screen under the standard color mode reaches an optimal value.
[0004] However, the electronic device has multiple color modes. Not only the display lookup table under the standard color mode needs to be calibrated, but also the display lookup tables under other color modes need to be calibrated, which leads to a large amount of time spent in producing the electronic device and a high cost of maintaining the color accuracy of the electronic device under multiple color modes. SUMMARY
[0005] The purpose of the embodiments of the application is to provide a color correction method, device, equipment and medium, so as to solve the problem of high cost of maintaining the color accuracy of the electronic device under multiple color modes.
[0006] In a first aspect, the embodiments of the application provide a color correction method, comprising:
[0007] obtaining a current color mode of an electronic device;
[0008] in a case where 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] 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 the preset display lookup table;
[0010] 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 the gray scale values of three primary colors of a pixel point in a display screen of the electronic device according to the target display lookup table.
[0011] In a second aspect, the embodiments of the application provide a color correction device, which comprises:
[0012] The first obtaining module is configured to obtain a current color mode of the electronic device.
[0013] The second obtaining module is configured to, in a case where the current color mode is not a standard color mode, obtain a preset display lookup table and a first display lookup table associated with the standard color mode.
[0014] The first determining module is 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 determining module is configured to determine 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 update a gray scale value of a three-primary color of a pixel point in a display screen of the electronic device according to the target display lookup table.
[0016] In a third aspect, an electronic device is provided, which includes a processor and a memory. The memory stores programs or instructions executable on the processor. When the programs or instructions are executed by the processor, the steps of the method according to the first aspect are implemented.
[0017] In a fourth aspect, a readable storage medium is provided. The readable storage medium stores programs or instructions. When the programs or instructions are executed by a processor, the steps of the method according to the first aspect are implemented.
[0018] In a fifth aspect, a chip is provided. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is configured to run programs or instructions to implement the method according to the first aspect.
[0019] In a sixth aspect, a computer program product is provided. The program product is stored in a storage medium. When the program product is executed by at least one processor, the method according to the first aspect is implemented.
[0020] In the embodiment of the present application, when the current color mode of the electronic device is not the standard color mode, the 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 the 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 gray scale 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, without calibrating the corresponding display lookup table for each color mode of the electronic device, thereby reducing the production time of the electronic device, improving the production efficiency of the electronic device, and reducing the maintenance cost of the color accuracy of the electronic device in multiple color modes. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 is a scene schematic diagram of a color correction method according to an exemplary embodiment;
[0022] Figure 2 is one of flow schematic diagrams of a color correction method according to an exemplary embodiment;
[0023] Figure 3 is another of flow schematic diagrams of a color correction method according to an exemplary embodiment;
[0024] Figure 4 is a third of flow schematic diagrams of a color correction method according to an exemplary embodiment;
[0025] Figure 5 is one of brief flow schematic diagrams of a color correction method according to an exemplary embodiment;
[0026] Figure 6 is another of brief flow schematic diagrams of a color correction method according to an exemplary embodiment;
[0027] Figure 7 is a third of brief flow schematic diagrams 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] Figure 9 is a structural block diagram of an electronic device according to an exemplary embodiment;
[0030] Figure 10 is a hardware structural schematic diagram of an electronic device for implementing the embodiment of the present application. DETAILED DESCRIPTION
[0031] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art are within the scope of protection of the present application.
[0032] The terms "first", "second", and the like 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 interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of a kind and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally represents an "or" relationship between the front and rear associated objects.
[0033] With the continuous development of technology, electronic devices serve as major tools for communication, photography, viewing, live streaming, and work. Electronic devices as major tools cannot be separated from a good display screen. One of the evaluation criteria for a good display screen is that the color accuracy of the display screen is high.
[0034] In an example technology, a display lookup table under a standard color mode is stored in an electronic device, and the display lookup table is used to map the native white color temperature and the color gamut area of the display screen to a standard color temperature and a standard color gamut area, so as to ensure that the color accuracy of the display screen under the standard color mode reaches an optimal value.
[0035] However, there are multiple color modes for electronic devices, and not only the display lookup table under the standard color mode needs to be calibrated, but also the display lookup tables under other color modes need to be calibrated, which leads to a large amount of time spent in producing electronic devices, and a high cost of maintaining the color accuracy of electronic devices under multiple color modes.
[0036] In view of the problem of high cost of maintaining the color accuracy of electronic devices under multiple 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, without calibrating the corresponding display lookup table for each color mode of the electronic device, thereby reducing the production time of the electronic device, improving the production efficiency of the electronic device, and reducing the cost of maintaining the color accuracy of the electronic device under multiple color modes.
[0038] Reference Figure 1 The scene schematic diagram of the color correction method provided by the present application is described. As shown inFigure 1 As shown in FIG. 1, 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 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 gray scale 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 color correction method, device, equipment and medium provided by the embodiments of the present application will be described in detail in combination with the accompanying drawings including Figure 1 .
[0040] The color correction method provided by the embodiments of the present application can be applied to the application scenario of displaying a picture on a display screen.
[0041] The color correction method provided by the embodiments of the present application will be described in detail in combination with the accompanying drawings including Figure 1 .
[0042] Referring to Figure 2 , Figure 2 is one of the flowcharts of the color correction method provided by the present application, as shown in FIG. 1, the color correction method comprises the following steps: Figure 2
[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 computer, a television set, etc. For ease of description, the following uses the device to represent the execution subject.
[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, two-tone mode and multi-channel mode, etc.
[0046] RGB color mode: various colors are obtained through the change and superposition of red (Red), green (Green) and blue (Blue) three color channels. This standard almost includes all the 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 quantifies the three attributes of color, hue and saturation are expressed in percentage values, and brightness is expressed in percentage values. This mode is based on human perception of color and describes the three basic characteristics of color.
[0048] CMYK color mode: used for printing, colors are represented by the superposition of four colors: cyan, magenta, yellow, and black. This mode is suitable for color separation printing.
[0049] Bitmap mode: each pixel has only one color value, usually used for scanning and bitmap image processing.
[0050] Grayscale mode: only two color values, black and white, used for black and white image processing.
[0051] Indexed color mode: uses colors in a palette to represent colors in an image, suitable for web design.
[0052] Dual-tone mode: uses two or more types of ink or color to simulate more color changes, often used for special effects.
[0053] Multi-channel mode: each channel can represent different information, such as a certain channel for transparency processing.
[0054] The standard color mode can be any of the above color modes with a display lookup table. After the device is running, the device obtains the current color mode, which is defined as the current color mode.
[0055] Step S202, if the current color mode is not a standard color mode, obtain the preset display lookup table and the 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 a color mode with a display lookup table, and the set color mode is a standard color mode. If the current color mode is not a standard color mode, the electronic device does not contain a display lookup table under the current color mode, and the device needs to determine the display lookup table under the current color mode.
[0057] Specifically, the device acquires 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 a method of dividing a color space into 17 cubes by using a cube partitioning method, and the coordinate axes are RGB. Each edge is divided into 17 segments with 17 nodes, i.e., a 17x17x17 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 pixel points in the display screen.
[0059] In step S203, a color temperature conversion matrix of the current color mode is determined, and a second display lookup table is determined according to the color temperature conversion matrix and the preset display lookup table.
[0060] The current color mode has a corresponding conversion matrix, which is the 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 an example, the device has pre-stored a color temperature conversion matrix in the current color mode, and the device directly acquires the color temperature conversion matrix associated with the current color mode.
[0061] After the color temperature conversion matrix is determined, the device determines a second display lookup table based on the color temperature conversion matrix and the preset display lookup table. For example, the preset display lookup table is first linearly processed, i.e., gamma variation is performed on the preset display lookup table, and then the linearly processed preset display lookup table is multiplied by the color temperature conversion matrix, so as to obtain the second display lookup table.
[0062] In step S204, 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 the gray scale 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.
[0063] After the device obtains the second display lookup table, the device determines a 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 a target display lookup table. For example, the first display lookup table and the second display lookup table are interpolated by using trilinear interpolation, so as to obtain the target display lookup table.
[0064] It has been tested that, by using the color correction method provided in the embodiment, the device running any color mode other than the standard color mode can also ensure the color accuracy of the display screen.
[0065] In the embodiment, when the current color mode of the electronic device is not the standard color mode, the 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 the 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 the gray scale values of the three primary colors of the pixel points in the display screen are updated through the target display lookup table. In the 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, without calibrating the corresponding display lookup table for each color mode of the electronic device, thereby reducing the production time of the electronic device, improving the production efficiency of the electronic device, and reducing the maintenance cost of the color accuracy of the electronic device in the multi-color mode.
[0066] Referring to Figure 3 , Figure 3 is a flowchart of the color correction method provided by the application, based on Figure 2 , step S203 includes:
[0067] Step S301, determining the target color gamut corresponding to the current color mode and the first white point corresponding to the target color gamut.
[0068] In the embodiment, the device determines the target color gamut corresponding to the current color mode, and the target color gamut is, for example, P3 color gamut or sRGB color gamut. The device sets the white point corresponding to the target color gamut, and the white point is defined as the 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 the first proportion parameter of the 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 the first proportion parameter of the three primary colors of the current color mode based on the coordinates corresponding to the first white point.
[0071] For example, when the target color gamut is P3 color gamut, the first proportion parameter of the three primary colors is:
[0072]
[0073] For example, when the target color gamut is sRGB color gamut, the first proportion parameter of the three primary colors is:
[0074]
[0075] Step S303, determining the color temperature conversion matrix of the current color mode according to the first proportion parameter and the matrix corresponding to the target color gamut.
[0076] After obtaining the first proportion parameter, a color temperature conversion matrix of the current color mode is determined based on the first proportion parameter and a matrix corresponding to the target color gamut.
[0077] For example, the target color gamut is P3 color gamut, the product of the first proportion parameter and the matrix of the target color gamut is the color temperature conversion matrix, and the color temperature conversion matrix is:
[0078]
[0079] For example, the target color gamut is sRGB color gamut, the product of the first proportion parameter and the matrix of the target color gamut is the color temperature conversion matrix, and the color temperature conversion matrix is:
[0080]
[0081] In this embodiment, the device determines the target color gamut corresponding to the current color mode and the corresponding first white point, determines the first proportion parameter of the three primary colors of the current color mode based on the white point of the first white point, and thus determines the color temperature conversion matrix corresponding to the current color mode based on the first proportion parameter and the matrix of the target color gamut, that is, the device does not need to store the color temperature conversion matrix of each color mode, thereby saving the storage space of the device.
[0082] Referring to Figure 4 , Figure 4 is a third flowchart of the color correction method provided in the present application, based on Figure 2 or Figure 3 , step S202 comprises:
[0083] In step S401, a set color gamut corresponding to a standard color mode and a second white point corresponding to the set color gamut are determined.
[0084] In this embodiment, the device calibrates the display lookup table of the standard color mode to obtain the display lookup table under the standard color mode.
[0085] For example, 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 calibration of the display screen under the standard color mode. Then, the device 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, the coordinates of the red, green and blue three vertices in the hue color gamut can be determined by setting the color gamut, and the vertices refer to the limit values. For example, the red vertex coordinate refers to the limit value of the red in the set color gamut corresponding to the coordinate value. 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] In step S402, the first color coordinates of each color point in the set color gamut are determined according to the coordinates and the 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 and the brightness value of the second white point, and the color coordinates of the color point are defined as the first color coordinates.
[0089] For example, 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 the brightness value of the second white point. Specifically, the coordinates and the brightness value of the white point are known, and the brightness values LRn, LGn and 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 corresponding formula of the color matching equation. The three primary colors are red, green and blue, and the brightness value of the red in the color point is LRn, the brightness value of the green in the color point is LGn, and the brightness value of the blue in the color point is LBn.
[0090] The device determines the first color coordinates of the color point by the brightness values of the three primary colors of the color point and the total brightness value. For example, a matrix is constructed by the brightness values LRn, LGn and LBn of the three primary colors and the total brightness value Lc of the color point, and the device determines the three stimulus 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 white point coordinates. The calculation method of the three stimulus values is as follows:
[0091]
[0092] After obtaining the three stimulus values of the color point, the device can obtain the first color coordinates corresponding to the color point based on the three stimulus values, as follows:
[0093]
[0094] Wherein, Cx and Cy constitute the first color coordinates.
[0095] In this embodiment, the luminance values of the three primary colors of each color point in the set color gamut and the total luminance value of the color point are determined through the coordinates and luminance values of the second white point, and the first color coordinates of the color point can be accurately determined based on the luminance values of the three primary colors and the total luminance value of the color point.
[0096] In step S403, 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 are obtained.
[0097] After obtaining the first color coordinates, the device obtains 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. 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 a picture in the original color gamut (initial color gamut), which is used as a display picture, then the display picture is switched to a 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 the display picture is switched to a green picture, and 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 the display picture is switched to a 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] In step S404, the gray scale values of the three primary colors of the color point are determined according to the first color coordinates, the second color coordinates, the third color coordinates, and the fourth color coordinates, and the display lookup table associated with the standard color mode is constructed according to the gray scale 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 gray scale values of the color points based on the second color coordinates, the third color coordinates, the fourth color coordinates, and the first color coordinates of the color points.
[0101] For example, the device determines the proportion parameters of the three primary colors of the color point based on the first color coordinates, the second color coordinates, the third color coordinates, and the fourth color coordinates, and the proportion parameters are specifically:
[0102]
[0103] After obtaining the proportion parameter, the device can determine the luminance values of the three primary colors of the color point based on the total luminance value of the color point and the proportion parameter, and the luminance values of the three primary colors are LRnr, LGnr, and LBnr. Specifically, the luminance values of the three primary colors can be calculated based on the mapping relationship between the luminance values of the three primary colors of the color point and the total luminance value of the color point.
[0104] After obtaining the luminance values of the three primary colors of the color point, the luminance values of the three primary colors can be converted into gray scale values of the three primary colors. Specifically, the conversion can be performed through the mapping relationship between the luminance values and the gray scale values, for example, the luminance values can be converted into the gray scale values through a gamma algorithm. It should be noted that the three primary colors refer to the red, green, and blue colors of the pixel points in the display screen, and the three primary colors refer to the red, green, and blue in theoretical calculation.
[0105] In this embodiment, the proportion parameter of the three primary colors of the color point is determined through the second color coordinate, the third color coordinate, the fourth color coordinate, and the first color coordinate of the color point, so that the gray scale values of the three primary colors of the color point can be accurately determined based on the proportion parameter and the total luminance value of the color point.
[0106] The device can obtain the gray scale values of the three primary colors of each color point in the set color gamut through the above-mentioned manner, and the three primary color gray scale values of each color point can be constructed into a display lookup table corresponding to the standard color mode.
[0107] Based on the embodiments shown in Figure 3 and Figure 4 , specific reference is made to Figure 5 , a brief description of the calculation of the three primary color gray scale values is given:
[0108] 501. The device first sets the target color gamut (set color gamut) and the target white point (second white point) in the standard color mode.
[0109] 502. Calculate the coordinate points and luminance 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 three primary color proportions r, g, and b based on the primary color gamut vertices and the color coordinates of the target colors.
[0112] 505. Calculate the luminance of the three primary colors according to the target luminance (total luminance of the target color) and the three primary color proportions.
[0113] 506. Calculate the gray scale values of the three primary colors based on the gamma calculation method.
[0114] In the 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, so that the display lookup table under the standard color mode with high accuracy is obtained.
[0115] In an embodiment, the device stores the other color mode and the corresponding display lookup table in association after determining the display lookup table of the other color mode under the non-standard color mode each time.
[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 device obtains a preset display lookup table and a first display lookup table associated with the standard color mode 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 takes the historical display lookup table as a target display lookup table to update the gray scale values of the three primary colors of the pixel points in the display screen based on the target display lookup table.
[0117] In the embodiment, the gray scale values of the three primary colors of the pixel points in the display screen are quickly updated based on the historical display lookup table associated with the current color mode, and the calculation of the display lookup table of the current color mode is not needed, thereby saving the calculation resources of the device.
[0118] In an embodiment, the device stores a plurality of display lookup tables associated with target luminance values. In order to avoid the device using the display lookup table associated with the target luminance value, the device stores the target display lookup table in a setting module after obtaining the target display lookup table, and updates the gray scale values of the pixel points 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 is, for example, a C3D module of a DPU (Data Processing Unit). C3D refers to a virtual reality engine module.
[0119] Reference is made to Figure 6 The color correction method in the embodiment is briefly described as follows:
[0120] 601. Before the device is shipped, the display screen of the device is switched to a standard mode (standard color mode);
[0121] 602. The display screen is calibrated on a production line;
[0122] 603. A 3D Lut (display lookup table) corresponding to luminance (luminance under the standard color mode) is generated;
[0123] 604. The 3D Lut is sent to a mobile terminal, that is, stored in the device;
[0124] 605、The CPU module in the device obtains data (3D Lut) when the device is used after leaving the factory;
[0125] 606、The device generates corresponding 3D Lut based on different target modes, that is, generates 3D Lut corresponding to different color modes;
[0126] 607、The 3D Lut corresponding to different color modes is set in the C3D module of the DPU.
[0127] Further, Figure 6 The specific details of generating corresponding 3D Lut based on different target modes are described in Figure 7 :
[0128] 701、Calculate target 3D Lut (second display lookup table) based on white point color temperature conversion principle, target 3D Lut is obtained through color temperature conversion matrix and linearly processed 3D Lut, color temperature conversion matrix refers to 7011-7014, and processed 3D Lut is obtained based on 7021 and 7022;
[0129] 7011、Set target color gamut (set color gamut) and target white point (second white point);
[0130] 7012、Calculate the proportions r, g, and b of three primary colors based on the target color gamut vertex and the white point color coordinate;
[0131] 7013、Multiply the proportions r, g, and b of three primary colors with the target color gamut (matrix corresponding to the target color gamut) to obtain a matrix;
[0132] 7014、Multiply the matrix obtained in 7013 with the matrix of the calibration mode (matrix corresponding to the standard color mode) to obtain the color temperature conversion matrix;
[0133] 7021、Obtain original 3D Lut (17-cubic or 18-cubic display lookup table);
[0134] 7022、Linearly process the original 3D Lut;
[0135] 702、Perform trilinear interpolation on the target 3D Lut and the 3D Lut calibrated by the line (first display lookup table) to obtain the final color correction 3D Lut (target display lookup table);
[0136] 703、Set the final color correction 3D Lut to the C3D module of the DPU.
[0137] In the embodiment, the gray scale values of the three primary colors of the pixel points in the display screen are updated by using the display lookup table in the setting module, so that the device can correct the color of the display screen by using the correct display lookup table.
[0138] Based on the same inventive concept, the present application also provides a color correction device. The color correction device will be described in detail below. Figure 8 The color correction device provided by the embodiment of the present application is described in detail.
[0139] Figure 8 is a structural block diagram of a color correction device according to an exemplary embodiment.
[0140] As shown in Figure 8 , the color correction device 800 can be an electronic device with a display screen, and the color correction device 800 can include:
[0141] The first acquisition module 810 is configured to acquire the current color mode of the electronic device.
[0142] The second acquisition module 820 is configured 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 the standard color mode.
[0143] The first determination module 830 is 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.
[0144] The second determination module 840 is configured to determine 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 update the gray scale 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 as follows.
[0146] In one embodiment, the first determination module 830 further includes:
[0147] The first determination unit is configured to determine a target color gamut corresponding to the current color mode and a first white point corresponding to the target color gamut.
[0148] The second determination unit is configured to determine a first proportion parameter of the three primary colors corresponding to the current color mode according to the coordinates corresponding to the first white point.
[0149] The third determination unit is configured to determine the color temperature conversion matrix of the current color mode according to the first proportion parameter and a matrix corresponding to the target color gamut.
[0150] In one of the embodiments, the second obtaining module 840 further includes:
[0151] The fourth determining unit is configured to determine a set color gamut corresponding to the standard color mode and a second white point corresponding to the set color gamut.
[0152] The fifth determining unit is configured to determine, according to the coordinates and the luminance value of the second white point, a first color coordinate of each color point in the set color gamut.
[0153] The first obtaining unit is configured to obtain a second color coordinate of a red picture displayed 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.
[0154] The sixth determining unit is configured to determine, according to the first color coordinate, the second color coordinate, the third color coordinate, and the fourth color coordinate, a gray scale value of the three primary colors of the color point.
[0155] The constructing unit is configured to construct a first display lookup table associated with the standard color mode according to the gray scale value of the three primary colors of each color point.
[0156] In one of the embodiments, the fifth determining unit includes:
[0157] The first determining sub-unit is configured to determine, according to the coordinates and the luminance value of the second white point, a luminance value of the three primary colors of each color point in the set color gamut and a total luminance value of the color point.
[0158] The second determining sub-unit is configured to determine, according to the luminance value of the three primary colors of the color point and the total luminance value, the first color coordinate of the color point.
[0159] In one of the embodiments, the sixth determining unit includes:
[0160] The third determining sub-unit is configured to determine, according to the first color coordinate, the second color coordinate, the third color coordinate, and the fourth color coordinate, a second proportion parameter of the three primary colors of the color point.
[0161] The fourth determining sub-unit is configured to determine, according to the total luminance value of the color point and the second proportion parameter, the luminance value of the three primary colors of the color point.
[0162] The fifth determining sub-unit is configured to determine, according to the luminance value of the three primary colors of the color point, the gray scale value of the three primary colors of the color point.
[0163] In one of the embodiments, the second obtaining module 840 includes:
[0164] The storage unit is configured to store the target display lookup table to the setting module.
[0165] The updating unit is configured to update the gray scale 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 of the embodiments, the second obtaining module 840 comprises:
[0167] The second obtaining unit is configured to, when the current color mode is not associated with the historical display lookup table, obtain the preset display lookup table and the first display lookup table associated with the standard color mode.
[0168] The color correction apparatus in the embodiments 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 the terminal. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), and can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, and the like, and the embodiments of the present application are not limited in this regard.
[0169] The color correction apparatus in the embodiments of the present application can be a device with an operating system. The operating system can be an Android operating system, an ios operating system, or other possible operating systems, and the embodiments of the present application are not limited in this regard.
[0170] The color correction apparatus provided in the embodiments of the present application can implement each process of the method embodiments in the Figures 2-4 and achieve the same technical effects. To avoid repetition, details are not described herein.
[0171] In some embodiments, as Figure 9As shown, the embodiments of the present application further provide an electronic device 900, comprising a processor 901 and a memory 902, wherein the memory 902 stores a program or instructions executable on the processor 901, and the program or instructions are executed by the processor 901 to implement the steps of the color correction method embodiments described above and achieve the same technical effects. To avoid repetition, details are not described herein.
[0172] It should be noted that the electronic device in the embodiments of the present application includes the mobile electronic device and the non-mobile electronic device described above.
[0173] Figure 10 A hardware structure schematic diagram of an electronic device according to 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, etc.
[0175] Those skilled in the art can understand that the electronic device 1000 can further include a power supply (such as a battery) for supplying power to each component, and the power supply can be logically connected to the processor 1010 through a power management system, so as to realize the functions of power management, such as charging, discharging, and power consumption management, through the power management system. Figure 10 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device can include more or fewer components than the figure, or combine certain components, or different component arrangements, which are not described herein.
[0176] The processor 1010 is configured to obtain a current color mode of the electronic device.
[0177] In a case where the current color mode is not a standard color mode, a preset display lookup table and a first display lookup table associated with the standard color mode are obtained.
[0178] A color temperature conversion matrix of the current color mode is determined, and a second display lookup table is determined according to the color temperature conversion matrix and the 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 the gray scale 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.
[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, according to the first proportion parameter and a matrix corresponding to the target color gamut, a color temperature conversion matrix of the current color mode.
[0182] determine, according to the first proportion parameter and a matrix corresponding to the target color gamut, a color temperature conversion matrix of the current color mode.
[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, according to the coordinates of the second white point and the luminance value, a first color coordinate of each color point in the set color gamut;
[0185] obtain a second color coordinate of a red picture displayed based on the initial color gamut by the display screen, a third color coordinate of a green picture displayed based on the initial color gamut by the display screen, and a fourth color coordinate of a blue picture displayed based on the initial color gamut by the display screen;
[0186] determine, according to the first color coordinate, the second color coordinate, the third color coordinate, and the fourth color coordinate, a gray scale value of the three primaries of the color point;
[0187] construct a first display lookup table associated with the standard color mode according to the gray scale values of the three primaries of each color point.
[0188] In some embodiments, the processor 1010 is further configured to determine, according to the coordinates of the second white point and the luminance value, a luminance value of the three primaries of each color point in the set color gamut and a total luminance value of the color point;
[0189] determine, according to the luminance value of the three primaries of the color point and the total luminance value of the color point, the first color coordinate of the color point.
[0190] In some embodiments, the processor 1010 is further configured to determine, according to the first color coordinate, the second color coordinate, the third color coordinate, and the fourth color coordinate, a second proportion parameter of the three primaries of the color point;
[0191] determine, according to the total luminance value of the color point and the second proportion parameter, the luminance value of the three primaries of the color point;
[0192] determine, according to the luminance value of the three primaries of the color point, the gray scale value of the three primaries of the color point.
[0193] In some embodiments, the processing unit 1010 is further configured to store the target display lookup table to a setting module;
[0194] update the gray scale values of the three primaries of the pixel points in the display screen of the electronic device according to the target display lookup table in the setting module.
[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 embodiments of the present application, the input unit 1004 can include a graphics processing unit (GPU) 10041 and a microphone 10042. The graphics processing unit 10041 processes image data of a still picture or a video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 1006 can include a display panel 10061, which can be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 can include two parts of a touch detection device and a touch controller. The other input devices 10072 can include, but are not limited to, a physical keyboard, function keys (such as volume control keys, on-off keys, etc.), a trackball, a mouse, a joystick, and the like, which will not be described here in detail.
[0197] The memory 1009 can be used to store software programs and various data. The memory 1009 can mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area can store an operating system, application programs or instructions required by at least one function (such as a sound playing function, an image playing function, etc.), etc. In addition, the memory 1009 can include a volatile memory or a non-volatile memory, or the memory 1009 can include both volatile and non-volatile memories. The non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM), a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synch link DRAM (SLDRAM), and a Direct Rambus RAM (DRRAM). The memory 10010 in the embodiment of the present application includes but is not limited to these and any other suitable types of memories.
[0198] The processor 1010 can 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 an application program, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 1010.
[0199] The embodiment of the present application also provides a readable storage medium, and the readable storage medium stores programs or instructions, the programs or instructions are executed by a processor to realize various processes of the above-mentioned color correction method embodiment, and the same technical effects can be achieved, and thus details are not repeated here.
[0200] The processor is a processor in the electronic device in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable memory, a random access memory, a magnetic disk, or an optical disk.
[0201] The chip provided in the embodiments of the present application includes a processor and a communication interface. The communication interface is coupled with the processor. The processor is configured to execute programs or instructions to implement various processes of the color correction method embodiments and achieve the same technical effects. To avoid repetition, details are not described herein.
[0202] It should be understood that the chip mentioned in the embodiments of the present application can also be referred to as a system-level chip, a system chip, a chip system, or a system-on-chip, etc.
[0203] The embodiments of the present application provide a computer program product stored in a storage medium. The program product is executed by at least one processor to implement various processes of the color correction method embodiments and achieve the same technical effects. To avoid repetition, details are not described herein.
[0204] It should be noted that in this document, the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles, or devices including a series of elements not only include those elements, but also include other elements not explicitly listed, or include elements inherent to such processes, methods, articles, or devices. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional 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 the order of performing the functions as shown or discussed, but can also include performing the functions in a substantially simultaneous manner or in a reverse order, for example, the described method can be performed in an order different from the described order, and various steps can be added, omitted, or combined. In addition, the features described with reference to certain examples can be combined in other examples.
[0205] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned method embodiments can be realized by means of software and necessary general hardware platforms, of course, they can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk), and includes a plurality of instructions for making a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) execute the method of each embodiment of the present application.
[0206] The embodiments of the present application are described above with reference to the accompanying drawings, but the present application is not limited to the above-described specific embodiments, and the above-described specific embodiments are merely illustrative, but not restrictive, and a person of ordinary skill in the art can make many forms under the inspiration of the present application without departing from the purpose of the present application and the scope protected by the claims.
Claims
1. A color correction method characterized by, The method comprises the following steps: acquiring a current color mode of an electronic device; in a case where the current color mode is not a standard color mode, acquiring a preset display lookup table and a first display lookup table associated with the standard color mode; 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 the preset display lookup table; 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 the gray scale 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.
2. The method of claim 1, wherein, The method of determining the color temperature conversion matrix of the current color mode comprises the following steps: determining a target color gamut corresponding to the current color mode and a first white point corresponding to the target color gamut; determining a first proportion parameter of the three primary colors corresponding to the current color mode according to the coordinates of the first white point; determining the color temperature conversion matrix of the current color mode according to the first proportion parameter and a matrix corresponding to the target color gamut.
3. The method of claim 1, wherein, The method of acquiring the first display lookup table associated with the standard color mode comprises the following steps: determining a set color gamut corresponding to the standard color mode and a second white point corresponding to the set color gamut; determining a first color coordinate of each color point in the set color gamut according to the coordinates and luminance value of the second white point; acquiring a second color coordinate of a red picture displayed by 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; determining the gray scale 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; constructing the first display lookup table associated with the standard color mode according to the gray scale values of the three primary colors of each color point.
4. The method of claim 3, wherein, The method of determining the first color coordinate of each color point in the set color gamut according to the coordinates and luminance value of the second white point comprises the following steps: determining the luminance values of the three primary colors of each color point in the set color gamut and the total luminance value of the color point according to the coordinates and luminance value of the second white point; determining the first color coordinate of the color point according to the luminance values of the three primary colors of the color point and the total luminance value.
5. The method of claim 3, wherein, The method of determining the gray scale 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 comprises the following steps: determining a second proportion 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 the luminance values of the three primary colors of the color point according to the total luminance value of the color point and the second proportion parameter; determining the gray scale values of the three primary colors of the color point according to the luminance values of the three primary colors of the color point.
6. The method according to any one of claims 1-5, characterized in that, The method of updating the gray scale 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 comprises the following steps: storing the target display lookup table to a setting module; According to the target display lookup table in the setting module, the gray scale values of three primary colors of a pixel point in a display screen of the electronic device are updated.
7. The method according to any one of claims 1-5, characterized in that, The first display lookup table associated with the standard color mode is obtained according to the preset display lookup table. In a case where the historical display lookup table associated with the current color mode is not stored, the preset display lookup table and the first display lookup table associated with the standard color mode are obtained.
8. A color correction device, characterized by, The device comprises: The first obtaining module is configured to obtain a current color mode of an electronic device. The second obtaining module is configured to obtain a preset display lookup table and a first display lookup table associated with a standard color mode in a case where the current color mode is not the standard color mode. The first determining module is 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 determining module is configured to determine 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 update the gray scale values of three primary colors of a pixel point in a display screen of the electronic device according to the target display lookup table.
9. An electronic device, comprising: The readable storage medium stores programs or instructions, and the programs or instructions are executed by the processor to implement the steps of the color correction method according to any one of claims 1-7.
10. A readable storage medium, characterized by, The readable storage medium stores programs or instructions, and the programs or instructions are executed by the processor to implement the steps of the color correction method according to any one of claims 1-7.
Citation Information
Patent Citations
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