CN115862534A - Color correction method, color correction device, electronic device and storage medium - Google Patents

Color correction method, color correction device, electronic device and storage medium Download PDF

Info

Publication number
CN115862534A
CN115862534A CN202211477646.XA CN202211477646A CN115862534A CN 115862534 A CN115862534 A CN 115862534A CN 202211477646 A CN202211477646 A CN 202211477646A CN 115862534 A CN115862534 A CN 115862534A
Authority
CN
China
Prior art keywords
reference vertex
saturation
value
color
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211477646.XA
Other languages
Chinese (zh)
Inventor
田维军
苏晃永
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Eswin Computing Technology Co Ltd
Original Assignee
Beijing Eswin Computing Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Eswin Computing Technology Co Ltd filed Critical Beijing Eswin Computing Technology Co Ltd
Priority to CN202211477646.XA priority Critical patent/CN115862534A/en
Publication of CN115862534A publication Critical patent/CN115862534A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Color Image Communication Systems (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the application provides a color correction method and device, electronic equipment and a storage medium. The color correction method includes: the method comprises the steps of obtaining initial pixel data of a plurality of pixel points of an image to be displayed, then determining a correction pixel value of a reference vertex based on a display lookup table and a saturation difference between the pixel point and the reference vertex, wherein the reference vertex is a vertex of a color space formed based on a reference color, further performing linear interpolation processing on the initial pixel data based on the correction pixel value of the reference vertex to obtain correction pixel data corresponding to the pixel point, and the correction pixel data are used for outputting the display image. The embodiment of the application is used for solving the problem of color cast of the gray scale picture of the display image displayed by the current display equipment in the related art.

Description

颜色校正方法、装置、电子设备及存储介质Color correction method, device, electronic device and storage medium

技术领域technical field

本申请涉及显示技术领域,具体而言,本申请涉及一种颜色校正方法、装置、电子设备及存储介质。The present application relates to the field of display technology, and in particular, the present application relates to a color correction method, device, electronic equipment and storage medium.

背景技术Background technique

不同显示设备具有不同的显示色彩能力,如对于LCD来说color filter(彩色滤光片)的不同、背光光源的不同,如对于OLED来说发光材料的不同等,这些都会影响到最终显示设备能够显示的色彩区域。正因为如此,对于同样一张图像而言,在不同显示设备上往往具有不同的显示颜色。Different display devices have different display color capabilities, such as different color filters (color filters) for LCDs, different backlight sources, and different light-emitting materials for OLEDs, etc., all of which will affect the performance of the final display device. The displayed color area. Because of this, the same image often has different display colors on different display devices.

为了解决这个问题,CIE(国际照明委员会)规定了标准的颜色空间,如sRGB、adobeRGB或DCI-P3等,显示设备通过一定的颜色空间算法,将输入图像进行处理后,使得本显示设备显示的画面能够匹配标准的颜色空间,这种颜色空间算法,一般称之为colormanagement(色彩管理)。例如,3D_LUT(3direction look up table,3D显示查找表)的颜色空间算法。In order to solve this problem, CIE (International Commission on Illumination) stipulates a standard color space, such as sRGB, adobeRGB or DCI-P3, etc. The display device processes the input image through a certain color space algorithm, so that the display device displays The picture can match the standard color space. This color space algorithm is generally called color management (color management). For example, the color space algorithm of 3D_LUT (3direction look up table, 3D display lookup table).

然而,利用现有的颜色空间算法对输入图像进行处理后,显示设备所展示的显示图像仍然存在灰阶画面的色偏问题。However, after the input image is processed by using the existing color space algorithm, the display image displayed by the display device still has the problem of color shift of the gray scale image.

发明内容Contents of the invention

本申请针对现有方式的缺点,提出一种颜色校正方法、装置、电子设备及存储介质,用以解决相关技术存在的当前显示设备所展示的显示图像的灰阶画面的色偏问题。Aiming at the shortcomings of the existing methods, the present application proposes a color correction method, device, electronic equipment, and storage medium to solve the problem of color shift in grayscale images of display images displayed by current display equipment in the related art.

第一个方面,本申请实施例提供了一种颜色校正方法,包括:In the first aspect, the embodiment of the present application provides a color correction method, including:

获取待显示图像的多个像素点的初始像素数据;Obtain initial pixel data of multiple pixel points of the image to be displayed;

基于显示查找表、以及所述像素点与参考顶点的饱和度差距,确定所述参考顶点的校正像素值,所述参考顶点为基于参考颜色所形成的颜色空间的顶点;Based on the display lookup table and the saturation difference between the pixel point and a reference vertex, determine the corrected pixel value of the reference vertex, where the reference vertex is a vertex of a color space formed based on a reference color;

基于所述参考顶点的校正像素值,对所述初始像素数据进行线性插值处理,得到所述像素点对应的校正像素数据;performing linear interpolation processing on the initial pixel data based on the corrected pixel value of the reference vertex, to obtain corrected pixel data corresponding to the pixel point;

所述校正像素数据用于输出显示图像。The corrected pixel data is used to output a display image.

在一个可能的实现方式中,所述基于显示查找表、以及所述像素点与所述参考顶点的饱和度差距,确定所述参考顶点的校正像素值,包括:In a possible implementation manner, the determining the corrected pixel value of the reference vertex based on the display lookup table and the saturation difference between the pixel point and the reference vertex includes:

基于所述初始像素数据确定所述像素点的第一饱和度,基于所述参考顶点的输入值确定所述参考顶点的第二饱和度,所述参考顶点的输入值为所述参考顶点在原始颜色空间内的像素值;Determine the first saturation of the pixel point based on the initial pixel data, determine the second saturation of the reference vertex based on the input value of the reference vertex, the input value of the reference vertex is in the original pixel value in color space;

基于所述第一饱和度和所述第二饱和度,确定所述像素点与所述参考顶点的饱和度差距;Based on the first saturation and the second saturation, determine the saturation difference between the pixel point and the reference vertex;

基于所述显示查找表和所述饱和度差距,确定所述参考顶点的校正像素值。A corrected pixel value for the reference vertex is determined based on the display lookup table and the saturation gap.

在一个可能的实现方式中,所述基于所述显示查找表和所述饱和度差距,确定所述参考顶点的校正像素值,包括:In a possible implementation manner, the determining the corrected pixel value of the reference vertex based on the display lookup table and the saturation difference includes:

将所述参考顶点的输入值输入所述显示查找表,得到所述参考顶点的输出值;Inputting the input value of the reference vertex into the display lookup table to obtain the output value of the reference vertex;

基于所述参考顶点的输入值、所述参考顶点的输出值以及所述饱和度差距,确定所述参考顶点的校正像素值。Based on the input value of the reference vertex, the output value of the reference vertex and the saturation difference, the corrected pixel value of the reference vertex is determined.

在一个可能的实现方式中,所述基于所述参考顶点的输入值、所述参考顶点的输出值以及所述饱和度差距,确定所述参考顶点的校正像素值,包括:In a possible implementation manner, the determining the corrected pixel value of the reference vertex based on the input value of the reference vertex, the output value of the reference vertex and the saturation difference includes:

对所述饱和度差距进行加权;weighting the saturation difference;

基于所述参考顶点的输入值、所述参考顶点的输出值以及加权后的所述饱和度差距,确定所述参考顶点的校正像素值。Based on the input value of the reference vertex, the output value of the reference vertex and the weighted saturation difference, the corrected pixel value of the reference vertex is determined.

在一个可能的实现方式中,所述对所述饱和度差距进行加权,包括:In a possible implementation manner, the weighting the saturation difference includes:

基于显示面板的显示特性,对所述饱和度差距进行加权。The saturation difference is weighted based on display characteristics of the display panel.

在一个可能的实现方式中,所述待显示图像包含三个颜色通道;所述显示查找表为三维显示查找表;In a possible implementation manner, the image to be displayed includes three color channels; the display lookup table is a three-dimensional display lookup table;

所述基于所述参考顶点的校正像素值,对所述初始像素数据进行线性插值处理,得到所述像素点对应的校正像素数据,包括:The step of performing linear interpolation processing on the initial pixel data based on the corrected pixel value of the reference vertex to obtain the corrected pixel data corresponding to the pixel point includes:

所述基于所述参考顶点的校正像素值,对所述初始像素数据进行三次线性插值处理,得到所述像素点对应的校正像素数据。Performing cubic linear interpolation processing on the initial pixel data based on the corrected pixel value of the reference vertex to obtain corrected pixel data corresponding to the pixel.

第二个方面,本申请实施例提供了一种颜色校正装置,包括:In the second aspect, the embodiment of the present application provides a color correction device, including:

获取模块,获取待显示图像包含的多个像素点的初始像素数据;An acquisition module, which acquires the initial pixel data of a plurality of pixels contained in the image to be displayed;

确定模块,用于基于显示查找表、以及所述像素点与参考顶点的饱和度差距,确定所述参考顶点的校正像素值,所述参考顶点为基于参考颜色所形成的颜色空间的顶点;基于所述参考顶点的校正像素值,对所述初始像素数据进行线性插值处理,得到所述像素点对应的校正像素数据;所述校正像素数据用于输出显示图像。A determining module, configured to determine the corrected pixel value of the reference vertex based on the display lookup table and the saturation difference between the pixel point and the reference vertex, the reference vertex being a vertex of a color space formed based on a reference color; based on The corrected pixel value of the reference vertex is used to perform linear interpolation processing on the initial pixel data to obtain corrected pixel data corresponding to the pixel point; the corrected pixel data is used to output a display image.

第三个方面,本申请实施例提供了一种电子设备,包括处理器和存储器,所述处理器和存储器相互连接;In a third aspect, the embodiment of the present application provides an electronic device, including a processor and a memory, and the processor and the memory are connected to each other;

所述存储器用于存储计算机程序;The memory is used to store computer programs;

所述处理器被配置用于在调用所述计算机程序时,执行如上述的方法。The processor is configured to execute the above-mentioned method when invoking the computer program.

在一个可能的实现方式中,电子设备还包括显示面板;In a possible implementation manner, the electronic device further includes a display panel;

所述显示面板与所述处理器电连接,用于接收所述处理器输出的待显示图像的校正像素数据,以输出显示图像。The display panel is electrically connected to the processor for receiving corrected pixel data of the image to be displayed output by the processor to output a display image.

第四个方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现上述的方法。In a fourth aspect, the embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the above method.

本申请实施例提供的技术方案带来的有益技术效果至少包括:The beneficial technical effects brought by the technical solutions provided by the embodiments of the present application at least include:

本申请在颜色空间转换的过程中增加了饱和度参数用于评估参考顶点对于像素点的颜色影响,具体基于像素点与参考顶点之间饱和度差距来确定参考顶点的校正像素值,参考顶点为基于参考颜色所形成的颜色空间的顶点,颜色距离包括饱和度差距,利用饱和度差距来量化表达像素点和参考顶点之间的颜色距离。基于参考顶点的校正像素值,对初始像素数据进行线性插值处理,就能得到像素点对应的校正像素数据,校正像素数据用于输出显示图像;能够改善显示设备所展示的显示图像的灰阶画面的色偏,能够提高显示设备所展示的显示图像的色彩准确性。In the process of color space conversion, this application adds a saturation parameter to evaluate the influence of the reference vertex on the color of the pixel. Specifically, the corrected pixel value of the reference vertex is determined based on the saturation difference between the pixel and the reference vertex. The reference vertex is Based on the vertices of the color space formed by the reference color, the color distance includes a saturation gap, and the saturation gap is used to quantify the color distance between the expressed pixel point and the reference vertex. Based on the corrected pixel value of the reference vertex, the initial pixel data is linearly interpolated to obtain the corrected pixel data corresponding to the pixel point, and the corrected pixel data is used to output the display image; it can improve the grayscale picture of the display image displayed by the display device The color shift can improve the color accuracy of the displayed image displayed by the display device.

而且,不同的显示设备可以采用不同的饱和度差距进行修正,能够平衡不同显示设备的差异,能够提升像素点的校正像素数据与对应的显示设备的匹配度,能够提高不同显示设备所展示的显示图像的色彩准确性。Moreover, different display devices can be corrected with different saturation differences, which can balance the differences between different display devices, improve the matching degree of corrected pixel data of pixels and corresponding display devices, and improve the display performance displayed by different display devices. The color accuracy of the image.

本申请附加的方面和优点将在下面的描述中部分给出,这些将从下面的描述中变得明显,或通过本申请的实践了解到。Additional aspects and advantages of the application will be set forth in part in the description which follows, and will become apparent from the description, or may be learned by practice of the application.

附图说明Description of drawings

本申请上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present application will become apparent and easy to understand from the following description of the embodiments in conjunction with the accompanying drawings, wherein:

图1为相关技术的3D_LUT的原始的颜色空间中8个参考顶点对应的输入值的示意图;FIG. 1 is a schematic diagram of input values corresponding to 8 reference vertices in the original color space of the 3D_LUT of the related art;

图2为相关技术的3D_LUT的tuning(颜色空间转换)后的颜色空间中8个参考顶点对应的输出值的示意图;2 is a schematic diagram of output values corresponding to 8 reference vertices in the color space after tuning (color space conversion) of the 3D_LUT of the related art;

图3为相关技术的3D_LUT中像素点的输入值与输出值的非线性对应关系的示意图;FIG. 3 is a schematic diagram of a nonlinear corresponding relationship between input values and output values of pixels in a 3D_LUT of the related art;

图4为实际测量的OLED屏幕的w/r/g/b的gamma曲线图;Figure 4 is the gamma curve of w/r/g/b of the actually measured OLED screen;

图5为本申请实施例提供的一种颜色校正方法的流程示意图;FIG. 5 is a schematic flow chart of a color correction method provided by an embodiment of the present application;

图6为本申请实施例提供的一种颜色校正方法中确定参考顶点的校正像素值的流程示意图;FIG. 6 is a schematic flowchart of determining the corrected pixel value of a reference vertex in a color correction method provided by an embodiment of the present application;

图7为本申请实施例提供的各参考顶点和像素点的饱和度的示意图;FIG. 7 is a schematic diagram of the saturation of each reference vertex and pixel point provided by the embodiment of the present application;

图8为本申请实施例提供的又一种颜色校正方法中确定参考顶点的校正像素值的流程示意图;Fig. 8 is a schematic flowchart of determining the corrected pixel value of the reference vertex in another color correction method provided by the embodiment of the present application;

图9为加权系数weigh1与显示屏加载量的归一化值之间关系曲线图;Fig. 9 is a graph showing the relationship between the weighting coefficient weight1 and the normalized value of the loading amount of the display screen;

图10为8个参考顶点的校正像素值构成的立方体(即,tuning后的颜色空间)的示意图;Fig. 10 is a schematic diagram of a cube (ie, the color space after tuning) formed by the corrected pixel values of 8 reference vertices;

图11为本申请实施例提供的一个示例的颜色校正方法得到的像素点的输入输出曲线图;FIG. 11 is an input-output curve diagram of pixels obtained by an example color correction method provided by the embodiment of the present application;

图12为本申请实施例提供的一种颜色校正装置的结构示意图;Fig. 12 is a schematic structural diagram of a color correction device provided by an embodiment of the present application;

图13为本申请实施例提供的一种电子设备的结构示意图。FIG. 13 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面结合本申请中的附图描述本申请的实施例。应理解,下面结合附图所阐述的实施方式,是用于解释本申请实施例的技术方案的示例性描述,对本申请实施例的技术方案不构成限制。Embodiments of the present application are described below with reference to the drawings in the present application. It should be understood that the implementation manner described below in conjunction with the accompanying drawings is an exemplary description for explaining the technical solutions of the embodiments of the present application, and does not limit the technical solutions of the embodiments of the present application.

本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可包括复数形式。应该进一步理解的是,本申请的说明书中使用的措辞“包括”是指存在所述特征、整数、步骤、操作、元件和/或组件,但不排除实现为本技术领域所支持其他特征、信息、数据、步骤、操作、元件、组件和/或它们的组合等。这里使用的术语“和/或”指该术语所限定的项目中的至少一个,例如“A和/或B”可以实现为“A”,或者实现为“B”,或者实现为“A和B”。Those skilled in the art will understand that unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the wording "comprising" used in the description of the present application refers to the presence of the features, integers, steps, operations, elements and/or components, but does not exclude the realization of other features and information supported by the technical field. , data, steps, operations, elements, components and/or combinations thereof, etc. The term "and/or" used herein refers to at least one of the items defined by the term, for example, "A and/or B" can be implemented as "A", or as "B", or as "A and B ".

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the implementation manners of the present application will be further described in detail below in conjunction with the accompanying drawings.

现有的3D_LUT(LUT全拼为Look-Up-Table,即,显示查找表。每当输入一个信号就是输入一次地址进行查表,找出地址对应的内容并输出,对于显示器来说能起到颜色空间转换的作用。RGB 3个1D_LUT组成3D_LUT,输入的RGB三个通道颜色值按照3D_LUT的三个显示查找表做映射,得到转换后的颜色)的颜色空间算法,是通过对一定数量参考颜色进行颜色空间转换(即,tuning),然后通过三次线性插值的方式把结果运用到所有的颜色,从而能够很好的实现标准颜色空间匹配。The existing 3D_LUT (LUT spelled as Look-Up-Table, that is, display look-up table. Whenever a signal is input, an address is input to look up the table, and the content corresponding to the address is found and output, which can play a role in the display. The role of color space conversion. RGB three 1D_LUTs form a 3D_LUT, and the input RGB three-channel color values are mapped according to the three display lookup tables of the 3D_LUT to obtain the converted color). The color space algorithm is through a certain number of reference colors Carry out color space conversion (that is, tuning), and then apply the result to all colors through cubic linear interpolation, so that standard color space matching can be achieved very well.

线性插值是指插值函数为一次多项式的插值方式,其在插值节点上的插值误差为零。线性插值相比其他插值方式,如抛物线插值,具有简单、方便的特点。线性插值的几何意义即为概述图中利用过A点和B点的直线来近似表示原函数。线性插值可以用来近似代替原函数,也可以用来计算得到查表过程中表中没有的数值。Linear interpolation refers to the interpolation method in which the interpolation function is a polynomial, and its interpolation error on the interpolation node is zero. Compared with other interpolation methods, such as parabolic interpolation, linear interpolation is simple and convenient. The geometric meaning of linear interpolation is to approximate the original function by using a straight line passing through point A and point B in the overview diagram. Linear interpolation can be used to approximately replace the original function, and can also be used to calculate values that are not in the table during the table lookup process.

发明人发现,由于3D_LUT是一种纯数学的理论计算,当3D_LUT的颜色空间算法运用到OLED屏幕上进行图像显示后,由于OLED屏幕的显示特性,在灰阶过渡画面会出现变色的情况,即色偏问题。另外,对于OLED屏幕来说,相同的RGB(光学三原色)数据对应的颜色分布是非线性的,利用三次线性插值的方式进行拓展颜色,必然会造成颜色的误差。The inventor found that since 3D_LUT is a purely mathematical theoretical calculation, when the color space algorithm of 3D_LUT is applied to the OLED screen for image display, due to the display characteristics of the OLED screen, discoloration will occur in the grayscale transition screen, that is, Color cast problem. In addition, for OLED screens, the color distribution corresponding to the same RGB (optical three primary colors) data is nonlinear, and using cubic linear interpolation to expand colors will inevitably cause color errors.

具体的,如图1和图2所示,图1为3D_LUT的输入值(原始的颜色空间),图2为3D_LUT的输出值(tuning后的颜色空间)。为简单说明这里以颜色空间为一个立方块为例。Specifically, as shown in FIG. 1 and FIG. 2 , FIG. 1 shows the input value of 3D_LUT (original color space), and FIG. 2 shows the output value of 3D_LUT (color space after tuning). For a simple explanation, the color space is taken as an example here.

参见图1,参考颜色分别为红色、绿色和蓝色,红色的向量坐标为(256,0,0),绿色的向量坐标为(0,256,0),蓝色的向量坐标为(0,0,256)。三个向量可以构成一个三维立体空间,具体的,红色、绿色和蓝色这三个参考颜色形成原始的颜色空间(即,图1所示的立方体)。See Figure 1, the reference colors are red, green and blue respectively, the vector coordinates of red are (256,0,0), the vector coordinates of green are (0,256,0), and the vector coordinates of blue are (0,0,256) . The three vectors can form a three-dimensional space, specifically, the three reference colors of red, green and blue form the original color space (ie, the cube shown in FIG. 1 ).

继续参见图1,基于红色、绿色和蓝色这三个参考颜色所形成的颜色空间(即,图1所示的立方体)的8个顶点为参考顶点。8个参考顶点LUT0~LUT7的输入值分别为(0,0,0)、(256,0,0)、(0,256,0)、(0,0,256)、(256,256,0)、(256,0,256)、(0,256,256)、(256,256,256)。像素点P点的输入值为(R,G,B),R、G、B分别为P点的输入值的红色分量、绿色分量和蓝色分量。Continuing to refer to FIG. 1 , eight vertices of the color space (ie, the cube shown in FIG. 1 ) formed based on the three reference colors of red, green and blue are reference vertices. The input values of the 8 reference vertices LUT0~LUT7 are (0,0,0), (256,0,0), (0,256,0), (0,0,256), (256,256,0), (256,0,256 ), (0,256,256), (256,256,256). The input value of the pixel point P is (R, G, B), and R, G, and B are respectively the red component, the green component and the blue component of the input value of the P point.

参见图2,8个参考顶点LUT0~LUT7的输入值经过tuning(颜色空间转换,即,按照3D_LUT的显示查找表做映射),得到8个参考顶点LUT0~LUT7的输出值分别为(r0,g0,b0)、(r1,g1,b1)、(r2,g2,b2)、(r3,g3,b3)、(r4,g4,b4)、(r5,g5,b5)、(r6,g6,b6)、(r7,g7,b7)。也就是说,第i个参考顶点的输出值LUTi=(ri,gi,bi),ri、gi、bi分别为第i个参考顶点的输出值的红色分量、绿色分量和蓝色分量。P点的输出值(R’,G’,B’),R’、G’、B’分别为P点的输出值的红色分量、绿色分量和蓝色分量。Referring to Figure 2, the input values of the 8 reference vertices LUT0~LUT7 are tuned (color space conversion, that is, mapped according to the display lookup table of 3D_LUT), and the output values of the 8 reference vertices LUT0~LUT7 are respectively (r0, g0 , b0), (r1, g1, b1), (r2, g2, b2), (r3, g3, b3), (r4, g4, b4), (r5, g5, b5), (r6, g6, b6 ), (r7, g7, b7). That is to say, the output value LUTi of the i-th reference vertex=(ri, gi, bi), ri, gi, bi are the red component, green component and blue component of the output value of the i-th reference vertex respectively. The output value of P point (R', G', B'), R', G', B' are the red component, green component and blue component of the output value of P point respectively.

也就是说,8个参考顶点LUT0~LUT7的输出值分别为tuning后的颜色空间的8个顶点。That is to say, the output values of the eight reference vertices LUT0-LUT7 are respectively the eight vertices of the color space after tuning.

在已知8个参考顶点LUT0~LUT7的输入值的情况下,通过颜色空间转换(即,tuning),得到8个参考顶点LUT0~LUT7的输出值。When the input values of the eight reference vertices LUT0-LUT7 are known, the output values of the eight reference vertices LUT0-LUT7 are obtained through color space conversion (ie, tuning).

在已知P点输入值为(R,G,B)的情况下,通过三线性插值的方式,能够得到P点的输出值(R’,G’,B’)。When the input value of point P is known as (R, G, B), the output value of point P (R’, G’, B’) can be obtained through trilinear interpolation.

表1所示,为一块OLED屏幕实际tuning(颜色空间转换)出来的LUT0~LUT7的值,即,参考顶点的校正像素值。Table 1 shows the values of LUT0-LUT7 obtained from the actual tuning (color space conversion) of an OLED screen, that is, the corrected pixel values of the reference vertices.

LUTLUTs rr gg bb LUT0LUT0 00 00 00 LUT1LUT1 218218 4040 3333 LUT2LUT2 117117 237237 7171 LUT3LUT3 251251 246246 8383 LUT4LUT4 5555 00 233233 LUT5LUT5 227227 4141 237237 LUT6LUT6 133133 244244 245245 LUT7LUT7 255255 246246 243243

表1Table 1

如图3所示,考虑到灰阶过渡画面,当P点的输入值由(0,0,0)到(255,255,255)变化时,通过三线性插值计算得到P点输出值和输入值的关系。As shown in Figure 3, considering the grayscale transition picture, when the input value of point P changes from (0,0,0) to (255,255,255), the relationship between the output value of point P and the input value is obtained through trilinear interpolation calculation.

通常用8位表示一个像素,这样总共有256个灰度等级(像素值在0~255间),每个等级代表不同的亮度。P点作为灰阶画面输入,R=G=B(即,红色分量等于绿色分量等于蓝色分量),因此,所以P点可以表达为0~255。Usually 8 bits are used to represent a pixel, so there are a total of 256 gray levels (pixel values are between 0 and 255), and each level represents a different brightness. Point P is input as a gray scale image, R=G=B (that is, the red component is equal to the green component is equal to the blue component), therefore, the point P can be expressed as 0-255.

在其他可行的实施例中,也可以用10位表示一个像素,此时,P点的输入值由(0,0,0)到(1023,1023,1023)变化,P点作为灰阶画面输入,R=G=B,因此,P点可以表达为0~1023。当然,也可以用其他位数表示一个像素,此处不作限定。In other feasible embodiments, 10 bits can also be used to represent a pixel. At this time, the input value of point P changes from (0,0,0) to (1023,1023,1023), and point P is input as a grayscale image , R=G=B, therefore, the point P can be expressed as 0-1023. Of course, other bits may also be used to represent a pixel, which is not limited here.

所谓灰阶,是将最亮与最暗之间的亮度变化,区分为若干份。以便于进行信号输入相对应的屏幕亮度管控。每一个子像素,其背后的光源都可以显现出不同的亮度级别。而灰阶代表了由最暗到最亮之间不同亮度的层次级别。The so-called gray scale is to divide the brightness change between the brightest and the darkest into several parts. In order to facilitate the screen brightness control corresponding to the signal input. For each sub-pixel, the light source behind it can show different brightness levels. The gray scale represents the level of brightness from the darkest to the brightest.

对于彩色图像,其每个像素点都包含多个颜色分量,每个颜色分量被称为一个通道(Channel)。图像中所有像素的通道数是一致的,即每个通道都可以表示为一幅与原图像内容相同但颜色不同的分量图像。以RGB格式的彩色图像为例,一幅完整的图像可以被分割为蓝(B分量)、绿(G分量)、红(R分量)三基色的单色图。For a color image, each pixel contains multiple color components, and each color component is called a channel (Channel). The number of channels of all pixels in the image is the same, that is, each channel can be represented as a component image with the same content as the original image but with different colors. Taking a color image in RGB format as an example, a complete image can be divided into monochrome images of three primary colors of blue (B component), green (G component), and red (R component).

屏幕上每一个点的色彩变化,其实都是由构成这个点的三个RGB子像素的灰阶变化所带来的。The color change of each point on the screen is actually caused by the grayscale change of the three RGB sub-pixels that make up this point.

图3中r,g,b分别为以红色分量绘制得到的输入输出曲线、以绿色分量绘制得到的输入输出曲线、以蓝色分量绘制得到的输入输出曲线。In Figure 3, r, g, and b are the input-output curves drawn with red components, the input-output curves drawn with green components, and the input-output curves drawn with blue components.

由图3可以看出,随着输入灰阶的增大,r/g/b三条曲线呈现不同的变化趋势,在接近250灰阶的位置,甚至出现了g和b相对位置交换的情况。It can be seen from Figure 3 that as the input gray scale increases, the three r/g/b curves show different trends. At the position close to the 250 gray scale, there is even a situation where the relative positions of g and b are exchanged.

由于OLED屏幕最终呈现的颜色取决于r,g,b三色的混合,当三种颜色的比率变化甚至发生比率反转的时候,必然会导致最终呈现颜色的变化,目视的情况下即呈现色偏的现象。特别是在低亮度的人眼敏感的情况下,这种现象将更为明显。Since the final color of the OLED screen depends on the mixture of the three colors r, g, and b, when the ratio of the three colors changes or even reverses the ratio, it will inevitably lead to a change in the final color. The phenomenon of color cast. Especially in the case of low brightness and sensitive human eyes, this phenomenon will be more obvious.

另外,图4为实际测量的OLED屏幕的w/r/g/b的gamma曲线。In addition, Fig. 4 is the gamma curve of w/r/g/b of the actually measured OLED screen.

图4中w_gamma,r_gamma,g_gamma,b_gamma分别为OLED屏幕的白色gamma(伽马)曲线,红色gamma曲线、绿色gamma曲线和蓝色gamma曲线。其中,横坐标为输入到显示器上的灰阶,纵坐标为在显示器上输出的当前亮度与最大亮度的比值。In Figure 4, w_gamma, r_gamma, g_gamma, and b_gamma are the white gamma (gamma) curve, red gamma curve, green gamma curve and blue gamma curve of the OLED screen respectively. Wherein, the abscissa is the grayscale input to the display, and the ordinate is the ratio of the current luminance output on the display to the maximum luminance.

Gamma曲线是一种特殊的色调曲线,当Gamma值等于1的时候,曲线为与坐标轴成45°的直线,这个时候表示输入和输出密度相同。高于1的Gamma值将会造成输出暗化,低于1的Gamma值将会造成输出亮化。The Gamma curve is a special tone curve. When the Gamma value is equal to 1, the curve is a straight line at 45° to the coordinate axis, which means that the input and output densities are the same. Gamma values above 1 will darken the output, and Gamma values below 1 will lighten the output.

从图4可知,r/g/b的gamma曲线不一致,即从r/g/b数据到最终的亮度贡献趋势是不一致的,且是非线性的,因此,如果在3D_LUT的方案中对r/g/b不加区分,且完全利用线性插值的方式,必然会导致最终呈现颜色和理想颜色之间存在偏差。It can be seen from Figure 4 that the gamma curves of r/g/b are inconsistent, that is, the trend from r/g/b data to the final brightness contribution is inconsistent and non-linear. Therefore, if r/g is used in the 3D_LUT scheme /b does not distinguish, and fully utilizes the linear interpolation method, which will inevitably lead to a deviation between the final rendered color and the ideal color.

本申请提供的颜色校正方法、装置、电子设备及计算机可读存储介质,旨在解决相关技术的如上技术问题。The color correction method, device, electronic equipment, and computer-readable storage medium provided by the present application aim to solve the above technical problems of related technologies.

下面通过对几个示例性实施方式的描述,对本申请实施例的技术方案以及本申请的技术方案产生的技术效果进行说明。需要指出的是,下述实施方式之间可以相互参考、借鉴或结合,对于不同实施方式中相同的术语、相似的特征以及相似的实施步骤等,不再重复描述。The following describes the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application by describing several exemplary implementations. It should be pointed out that the following embodiments may refer to, learn from or combine with each other, and the same terms, similar features, and similar implementation steps in different embodiments will not be described repeatedly.

本申请实施例提供了一种颜色校正方法,如图5所示,可以应用于终端或服务器,该方法包括:The embodiment of the present application provides a color correction method, as shown in FIG. 5, which can be applied to a terminal or a server. The method includes:

S101:获取待显示图像的多个像素点的初始像素数据。S101: Acquire initial pixel data of multiple pixel points of an image to be displayed.

具体的,用于进行颜色校正的终端或服务器,从图像采集设备、图像存储设备或云存储下载待显示图像的多个像素点的初始像素数据。Specifically, the terminal or server used for color correction downloads the initial pixel data of multiple pixel points of the image to be displayed from the image acquisition device, image storage device or cloud storage.

其中,图像采集设备可以包括摄像头、摄像机、扫描仪或其他带有拍照功能的设备。图像存储设备可以包括硬盘或U盘等。Wherein, the image acquisition device may include a camera, a video camera, a scanner or other devices with a camera function. The image storage device may include a hard disk or a U disk, and the like.

云存储是一种网上在线存储(Cloud storage)的模式,即把数据存放在通常由第三方托管的多台虚拟服务器,而非专属的服务器上。数据中心营运商根据客户的需求,在后端准备存储虚拟化的资源,并将其以存储资源池(storage pool)的方式提供,客户便可自行使用此存储资源池来存放文件或对象。实际上,这些资源可能被分布在众多的服务器主机上。云存储这项服务是透过Web服务应用程序接口(API),或是透过Web化的用户界面来访问。Cloud storage is a mode of online online storage (Cloud storage), that is, data is stored on multiple virtual servers usually hosted by a third party, rather than on a dedicated server. According to the needs of customers, data center operators prepare storage virtualized resources at the back end and provide them in the form of storage resource pools (storage pools), and customers can use the storage resource pools to store files or objects. In fact, these resources may be distributed across numerous server hosts. Cloud storage is a service that is accessed through a Web service Application Programming Interface (API), or through a Web-based user interface.

每个图像都有一个或多个颜色通道,图像中默认的颜色通道数取决于其颜色模式,即一个图像的颜色模式将决定其颜色通道的数量。每个颜色通道都存放着图像中颜色元素的信息。所有颜色通道中的颜色叠加混合产生图像中像素的颜色。Each image has one or more color channels, and the default number of color channels in an image depends on its color mode, that is, the color mode of an image will determine the number of its color channels. Each color channel stores information about the color elements in the image. An additive mix of colors from all color channels produces the color of the pixels in the image.

本实施例中,待显示图像可以为RGB图像,RGB图像有3个颜色通道,分别为红色通道、绿色通道和蓝色通道。也就是说,每个像素点均包含蓝(B分量)、绿(G分量)、红(R分量)三基色。每个像素点的初始像素数据可以表示为(R,G,B)。In this embodiment, the image to be displayed may be an RGB image, and the RGB image has three color channels, namely a red channel, a green channel and a blue channel. That is to say, each pixel contains three primary colors of blue (B component), green (G component), and red (R component). The initial pixel data of each pixel can be expressed as (R, G, B).

本实施例中,可以用8位表示一个像素点,这样总共有256个灰度等级(像素值在0~255间),每个等级代表不同的亮度。也就是说,每个像素点的初始像素数据中各通道的像素值可以用0~255表示。In this embodiment, 8 bits can be used to represent a pixel, so there are 256 gray levels in total (pixel values are between 0 and 255), and each level represents a different brightness. That is to say, the pixel value of each channel in the initial pixel data of each pixel can be represented by 0-255.

S102:基于显示查找表、以及像素点与参考顶点的饱和度差距,确定参考顶点的校正像素值。S102: Based on the display lookup table and the saturation difference between the pixel point and the reference vertex, determine the corrected pixel value of the reference vertex.

其中,参考顶点为基于参考颜色所形成的颜色空间的顶点。Wherein, the reference vertex is a vertex of the color space formed based on the reference color.

颜色的饱和度(saturation)指颜色的鲜艳程度。颜色的饱和度是其纯度的量度。高度饱和的颜色将包含一组非常窄的波长。因此,基于像素点与参考顶点的饱和度差距,能够调整参考顶点的色偏,从而避免应用参考顶点的校正像素值得到的校正像素数据,所展示画面的色偏问题。The saturation of a color refers to the vividness of the color. The saturation of a color is a measure of its purity. A highly saturated color will contain a very narrow set of wavelengths. Therefore, based on the saturation difference between the pixel point and the reference vertex, the color shift of the reference vertex can be adjusted, thereby avoiding the problem of color shift of the displayed picture by applying the corrected pixel data obtained by applying the corrected pixel value of the reference vertex.

S103:基于参考顶点的校正像素值,对初始像素数据进行线性插值处理,得到像素点对应的校正像素数据。S103: Based on the corrected pixel value of the reference vertex, perform linear interpolation processing on the initial pixel data to obtain corrected pixel data corresponding to the pixel point.

校正像素数据用于输出显示图像。The corrected pixel data is used to output a display image.

本技术领域技术人员可以理解,这里所使用的“终端”可以是手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、MID(Mobile Internet Device,移动互联网设备)等;“服务器”可以用独立的服务器或者是多个服务器组成的服务器集群来实现。Those skilled in the art can understand that the "terminal" used here can be a mobile phone, a tablet computer, a PDA (Personal Digital Assistant, a personal digital assistant), a MID (Mobile Internet Device, a mobile Internet device), etc.; It can be realized by an independent server or a server cluster composed of multiple servers.

本申请在颜色空间转换的过程中增加了饱和度参数用于评估参考顶点对于像素点的颜色影响,具体基于像素点与参考顶点之间饱和度差距来确定参考顶点的校正像素值,参考顶点为基于参考颜色所形成的颜色空间的顶点,颜色距离包括饱和度差距,利用饱和度差距来量化表达像素点和参考顶点之间的颜色距离。基于参考顶点的校正像素值,对初始像素数据进行线性插值处理,就能得到像素点对应的校正像素数据,校正像素数据用于输出显示图像;能够改善显示设备所展示的显示图像的灰阶画面的色偏,能够提高显示设备所展示的显示图像的色彩准确性。In the process of color space conversion, this application adds a saturation parameter to evaluate the influence of the reference vertex on the color of the pixel. Specifically, the corrected pixel value of the reference vertex is determined based on the saturation difference between the pixel and the reference vertex. The reference vertex is Based on the vertices of the color space formed by the reference color, the color distance includes a saturation gap, and the saturation gap is used to quantify the color distance between the expressed pixel point and the reference vertex. Based on the corrected pixel value of the reference vertex, the initial pixel data is linearly interpolated to obtain the corrected pixel data corresponding to the pixel point, and the corrected pixel data is used to output the display image; it can improve the grayscale picture of the display image displayed by the display device The color shift can improve the color accuracy of the displayed image displayed by the display device.

而且,不同的显示设备可以采用不同的饱和度差距进行修正,能够平衡不同显示设备的差异,能够提升像素点的校正像素数据与对应的显示设备的匹配度,能够提高不同显示设备所展示的显示图像的色彩准确性。Moreover, different display devices can be corrected with different saturation differences, which can balance the differences between different display devices, improve the matching degree of corrected pixel data of pixels and corresponding display devices, and improve the display performance displayed by different display devices. The color accuracy of the image.

本申请实施例中提供了一种可能的实现方式中,如图6所示,基于显示查找表、以及像素点与参考顶点的饱和度差距,确定参考顶点的校正像素值,包括:In a possible implementation mode provided in the embodiment of the present application, as shown in FIG. 6, based on the display lookup table and the saturation difference between the pixel point and the reference vertex, the corrected pixel value of the reference vertex is determined, including:

S201:基于初始像素数据确定像素点的第一饱和度,基于参考顶点的输入值确定参考顶点的第二饱和度。S201: Determine a first saturation of a pixel point based on initial pixel data, and determine a second saturation of a reference vertex based on an input value of a reference vertex.

其中,所述参考顶点的输入值为所述参考顶点在原始颜色空间内的像素值。Wherein, the input value of the reference vertex is the pixel value of the reference vertex in the original color space.

由于饱和度公式为:saturation=1-min(r,g,b)/max(r,g,b),其中,saturation为饱和度,r、g、b分别为该像素点的红色分量、绿色分量和蓝色分量,min(r,g,b)为红色分量、绿色分量和蓝色分量中的最小值,max(r,g,b)为红色分量、绿色分量和蓝色分量中的最大值。Since the saturation formula is: saturation=1-min(r,g,b)/max(r,g,b), where saturation is the saturation, r, g, and b are the red component and green component of the pixel respectively. component and blue component, min(r,g,b) is the minimum value among red component, green component and blue component, max(r,g,b) is the maximum among red component, green component and blue component value.

对于8个参考顶点LUT0~LUT7,LUT0~LUT7的输入值可以参考图1所示。具体的,LUT0~LUT7的输入值分别为(0,0,0)、(256,0,0)、(0,256,0)、(0,0,256)、(256,256,0)、(256,0,256)、(0,256,256)、(256,256,256)。For the eight reference vertices LUT0-LUT7, the input values of LUT0-LUT7 can be referred to as shown in FIG. 1 . Specifically, the input values of LUT0~LUT7 are (0,0,0), (256,0,0), (0,256,0), (0,0,256), (256,256,0), (256,0,256) , (0,256,256), (256,256,256).

此时,LUT0的饱和度S0=0,LUT7的饱和度S7=0,其它点(LUT1~LUT6)的饱和度S1=S2=S3=S4=S5=S6=1,具体参见图7。At this time, the saturation of LUT0 is S0=0, the saturation of LUT7 is S7=0, and the saturation of other points (LUT1-LUT6) is S1=S2=S3=S4=S5=S6=1, see FIG. 7 for details.

也就是说,参考顶点的第二饱和度包括多个参考顶点的饱和度,分别为S0、S1、S2、S3、S4、S5、S6、S7,其中,S1=S7=0,S1=S2=S3=S4=S5=S6=1。That is to say, the second saturation of the reference vertex includes the saturation of a plurality of reference vertexes, respectively S0, S1, S2, S3, S4, S5, S6, S7, wherein, S1=S7=0, S1=S2= S3=S4=S5=S6=1.

图1所示的8个参考顶点LUT0~LUT7的输入值,表征是基于红色(256,0,0)、绿色(0,256,0)和蓝色(0,0,256)进行颜色空间转换(即,tuning),然后通过三次线性插值的方式把红色(256,0,0)、绿色(0,256,0)和蓝色(0,0,256)转换后的结果运用到所有的颜色。The input values of the eight reference vertices LUT0~LUT7 shown in Figure 1 are characterized by color space conversion based on red (256,0,0), green (0,256,0) and blue (0,0,256) (that is, tuning ), and then apply the converted results of red (256,0,0), green (0,256,0) and blue (0,0,256) to all colors by cubic linear interpolation.

需要说明的是,在另一些可行的实施例中,8个参考顶点LUT0~LUT7的输入值也可以采用其他数值,例如,可以基于红色(245,0,0)、绿色(0,250,0)和蓝色(0,0,254)进行颜色空间转换,此时,8个参考顶点LUT0~LUT7的输入值分别为(0,0,0)、(245,0,0)、(0,250,0)、(0,0,254)、(245,250,0)、(245,0,254)、(0,250,254)、(245,250,254)。It should be noted that, in some other feasible embodiments, the input values of the eight reference vertices LUT0-LUT7 can also adopt other values, for example, it can be based on red (245,0,0), green (0,250,0) and Blue (0,0,254) performs color space conversion. At this time, the input values of the eight reference vertices LUT0~LUT7 are (0,0,0), (245,0,0), (0,250,0), ( 0,0,254), (245,250,0), (245,0,254), (0,250,254), (245,250,254).

对于初始像素数据对应的像素点,以P点为例,P点的输入值为(R,G,B),P点的饱和度为Sp=1-min(R,G,B)/max(R,G,B)。For the pixel point corresponding to the initial pixel data, take point P as an example, the input value of point P is (R, G, B), and the saturation of point P is Sp=1-min(R, G, B)/max( R, G, B).

也就是说,初始像素数据的输入值为(R,G,B),像素点的第一饱和度为Sp=1-min(R,G,B)/max(R,G,B)。That is to say, the input value of the initial pixel data is (R, G, B), and the first saturation of the pixel is Sp=1-min(R, G, B)/max(R, G, B).

S202:基于第一饱和度和第二饱和度,确定像素点与参考顶点的饱和度差距。S202: Based on the first saturation and the second saturation, determine a saturation difference between the pixel point and the reference vertex.

本实施例中,饱和度差距可以包括像素点的第一饱和度分别与每个参考顶点的第二饱和度的差值。具体的,饱和度差距可以包括DeltaS0…DeltaS7,其中,In this embodiment, the saturation difference may include a difference between the first saturation of the pixel and the second saturation of each reference vertex. Specifically, the saturation difference may include DeltaS0...DeltaS7, wherein,

DeltaS0=(Sp-S0);DeltaS0=(Sp-S0);

DeltaS1=(Sp-S1);DeltaS1 = (Sp-S1);

DeltaS2=(Sp-S2);DeltaS2=(Sp-S2);

DeltaS3=(Sp-S3);DeltaS3=(Sp-S3);

DeltaS4=(Sp-S4);DeltaS4=(Sp-S4);

DeltaS5=(Sp-S5);DeltaS5=(Sp-S5);

DeltaS6=(Sp-S6);DeltaS6=(Sp-S6);

DeltaS7=(Sp-S7)。DeltaS7=(Sp-S7).

也就是说,任一个参考顶点的饱和度差距DeltaSi=(Sp-Si),Si为第i个参考顶点的饱和度。That is to say, the saturation difference of any reference vertex DeltaSi=(Sp-Si), where Si is the saturation of the i-th reference vertex.

S203:基于显示查找表和饱和度差距,确定参考顶点的校正像素值。S203: Based on the display lookup table and the saturation difference, determine the corrected pixel value of the reference vertex.

在一个可能的实现方式中,基于显示查找表和饱和度差距,确定参考顶点的校正像素值,可以包括:将参考顶点的输入值输入显示查找表,得到参考顶点的输出值;基于参考顶点的输入值、参考顶点的输出值以及饱和度差距,确定参考顶点的校正像素值。In a possible implementation, determining the corrected pixel value of the reference vertex based on the display lookup table and the saturation difference may include: inputting the input value of the reference vertex into the display lookup table to obtain the output value of the reference vertex; The input value, the output value of the reference vertex, and the saturation gap determine the corrected pixel value for the reference vertex.

在一个可能的实现方式中,基于参考顶点的输入值、参考顶点的输出值以及饱和度差距,确定参考顶点的校正像素值,可以包括:对饱和度差距进行加权;基于参考顶点的输入值、参考顶点的输出值以及加权后的饱和度差距,确定参考顶点的校正像素值。通过对饱和度差距进行加权,能够更好的平衡各个参考顶点对像素点的影响。In a possible implementation, determining the corrected pixel value of the reference vertex based on the input value of the reference vertex, the output value of the reference vertex, and the saturation difference may include: weighting the saturation difference; based on the input value of the reference vertex, The output value of the reference vertex and the weighted saturation difference determine the corrected pixel value of the reference vertex. By weighting the saturation difference, the influence of each reference vertex on the pixel can be better balanced.

为了便于理解,下面结合图8进行说明:For ease of understanding, the following will be described in conjunction with Figure 8:

S301:将参考顶点的输入值输入显示查找表,得到参考顶点的输出值。S301: Input the input value of the reference vertex into the display lookup table to obtain the output value of the reference vertex.

其中,参考顶点的输入值为参考顶点在原始颜色空间内的像素值,参考顶点的输出值表征参考顶点在转换后的颜色空间(即,参考颜色所形成的颜色空间内)内的像素值。显示查找表包括参考顶点的输入值与参考顶点的输出值之间的对应关系。Wherein, the input value of the reference vertex is the pixel value of the reference vertex in the original color space, and the output value of the reference vertex represents the pixel value of the reference vertex in the converted color space (ie, the color space formed by the reference color). The display lookup table includes correspondences between input values of the reference vertices and output values of the reference vertices.

本实施例中,显示查找表可以为三维显示查找表,8个参考顶点的输入值可以参考图1所示,通过tuning,8个参考顶点对应的输出值可以参考图2所示。In this embodiment, the display lookup table may be a three-dimensional display lookup table, and the input values of the eight reference vertices may refer to FIG. 1 . Through tuning, the output values corresponding to the eight reference vertices may refer to FIG. 2 .

S302:对饱和度差距进行加权。S302: Weighting the saturation difference.

具体的,加权后的饱和度差距可以包括DeltaS0’…DeltaS7’,其中,Specifically, the weighted saturation difference may include DeltaS0'...DeltaS7', where,

DeltaS0’=(Sp-S0)*weigh1;DeltaS0'=(Sp-S0)*weight1;

DeltaS1’=(Sp-S1)*weigh2;DeltaS1'=(Sp-S1)*weight2;

DeltaS2’=(Sp-S2)*weigh3;DeltaS2'=(Sp-S2)*weight3;

DeltaS3’=(Sp-S3)*weigh4;DeltaS3'=(Sp-S3)*weight4;

DeltaS4’=(Sp-S4)*weigh5;DeltaS4'=(Sp-S4)*weight5;

DeltaS5’=(Sp-S5)*weigh6;DeltaS5'=(Sp-S5)*weight6;

DeltaS6’=(Sp-S6)*weigh7;DeltaS6'=(Sp-S6)*weight7;

DeltaS7’=(Sp-S7)*weigh8。DeltaS7'=(Sp-S7)*weight8.

也就是说,任一个参考顶点的饱和度差距DeltaSi’=(Sp-Si)*weighi。That is to say, the saturation difference DeltaSi'=(Sp-Si)*weighti of any reference vertex.

其中,weighi为第i个参考顶点的加权系数,weigh1…weigh8分别为8个参考顶点LUT0~LUT7的加权系数。Among them, weighti is the weighting coefficient of the i-th reference vertex, and weight1...weight8 are the weighting coefficients of the eight reference vertices LUT0-LUT7 respectively.

实际应用中,weigh1…weigh8可以根据实际需要预先设定。若应用该颜色校正方法的显示屏为LCD屏幕,weigh1~weigh8可以均等于1。若应用该颜色校正方法的显示屏为OLED屏幕,可以基于OLED屏幕的显示特性(例如,电压降特性),设定weigh1~weigh8。In practical applications, weight1...weight8 can be preset according to actual needs. If the display screen to which the color correction method is applied is an LCD screen, weight1 to weight8 may all be equal to 1. If the display screen to which the color correction method is applied is an OLED screen, weight1 to weight8 may be set based on display characteristics (eg, voltage drop characteristics) of the OLED screen.

本实施例中,对饱和度差距进行加权,可以包括:基于显示面板的显示特性,对饱和度差距进行加权。也就是说,可以基于显示面板的显示特性,设置不同的加权系数weigh1…weigh8,以更好的适应不同的显示屏幕。In this embodiment, weighting the saturation difference may include: weighting the saturation difference based on display characteristics of the display panel. That is to say, based on the display characteristics of the display panel, different weighting coefficients weight1...weight8 can be set to better adapt to different display screens.

进一步的,基于显示面板的显示特性,对饱和度差距进行加权,可以包括:基于显示面板的电压降特性,对饱和度差距进行加权。由于不同颜色的子像素对显示屏的电压降的影响不同,故显示不同画面时显示屏的loading(负载)不同,因此,weigh1~weigh8的设定可以考量显示屏的电压降特性,对颜色的偏差做进一步细微的修正。Further, weighting the saturation difference based on the display characteristics of the display panel may include: weighting the saturation difference based on the voltage drop characteristic of the display panel. Since the sub-pixels of different colors have different effects on the voltage drop of the display screen, the loading (load) of the display screen is different when different images are displayed. Therefore, the setting of weight1~weight8 can consider the voltage drop characteristics of the display screen and affect the color. Deviations are further fine-tuned.

实际应用中,weigh1~weigh8的权重曲线可以根据当前画面显示颜色的测量结果进行确定。具体的,可以在显示若干样本画面(显示每个样本画面时,显示屏的负载不同)时,根据经验调整该样本画面对应的加权系数weigh1…weigh8。根据多个样本画面的加权系数weighi(可以为weigh1~weigh8),得到每个加权系数weighi与显示屏loading(负载)的归一化值之间关系曲线图。In practical applications, the weight curves of weight1-weight8 can be determined according to the measurement results of the colors displayed on the current screen. Specifically, when several sample pictures are displayed (when each sample picture is displayed, the load of the display screen is different), the weighting coefficients weight1...weight8 corresponding to the sample pictures may be adjusted according to experience. According to the weight coefficients weighti (which may be weight1-weight8) of a plurality of sample images, a graph of the relationship between each weight coefficient weighti and the normalized value of the display screen loading (load) is obtained.

例如,根据每个样本画面的加权系数weigh1,得到加权系数weigh1与显示屏loading(负载)的归一化值之间关系曲线图。根据每个样本画面的加权系数weigh2,得到加权系数weigh2与显示屏loading(负载)的归一化值之间关系曲线图。For example, according to the weighting coefficient weight1 of each sample picture, a graph of the relationship between the weighting coefficient weight1 and the normalized value of the display screen loading (load) is obtained. According to the weighting coefficient weight2 of each sample picture, a graph of the relationship between the weighting coefficient weight2 and the normalized value of the display screen loading (load) is obtained.

如图9所示,图9为加权系数weigh1与显示屏加载量的归一化值之间关系曲线图。其中,横坐标为显示屏的loading(负载)的归一化值,纵坐标为加权系数weigh1的值。As shown in FIG. 9 , FIG. 9 is a graph showing the relationship between the weighting coefficient weight1 and the normalized value of the loading amount of the display screen. Wherein, the abscissa is the normalized value of loading (load) of the display screen, and the ordinate is the value of the weighting coefficient weight1.

当loading最大(即loading=1)时,weigh1为最大值;当loading最小(即loading=0)时,weighi为最小值。根据显示屏当前的loading的归一化值,得到weigh1的当前值。随着显示画面的不断变化,显示屏的loading的归一化值随之改变,weigh1的值也随之变化。When loading is the largest (ie loading=1), weight1 is the maximum value; when loading is the smallest (ie loading=0), weighti is the minimum value. According to the normalized value of the current loading of the display, the current value of weight1 is obtained. As the display screen changes continuously, the normalized value of the loading of the display screen changes accordingly, and the value of weight1 also changes accordingly.

另外,加权系数Weigh2…weigh8的确定方式与加权系数Weigh1类似,此处不再赘述。In addition, the method of determining the weighting coefficients Weigh2...weight8 is similar to that of the weighting coefficient Weigh1, and will not be repeated here.

S303:基于参考顶点的输入值、参考顶点的输出值以及加权后的饱和度差距,确定参考顶点的校正像素值。S303: Based on the input value of the reference vertex, the output value of the reference vertex, and the weighted saturation difference, determine the corrected pixel value of the reference vertex.

本实施例中,参考顶点的校正像素值包括LUT0_S…LUT7_S,其中,In this embodiment, the corrected pixel values of the reference vertices include LUT0_S...LUT7_S, where,

LUT0_S=(0,0,0)*DeltaS0’+(r0,g0,b0)*(1-DeltaS0’);LUT0_S=(0,0,0)*DeltaS0'+(r0,g0,b0)*(1-DeltaS0');

LUT1_S=(256,0,0)*DeltaS1’+(r1,g1,b1)*(1-DeltaS1’);LUT1_S=(256,0,0)*DeltaS1'+(r1,g1,b1)*(1-DeltaS1');

LUT2_S=(0,256,0)*DeltaS2’+(r2,g2,b2)*(1-DeltaS2’);LUT2_S=(0,256,0)*DeltaS2'+(r2,g2,b2)*(1-DeltaS2');

LUT3_S=(0,0,256)*DeltaS3’+(r3,g3,b3)*(1-DeltaS3’);LUT3_S=(0,0,256)*DeltaS3'+(r3,g3,b3)*(1-DeltaS3');

LUT4_S=(0,0,256)*DeltaS4’+(r4,g4,b4)*(1-DeltaS4’);LUT4_S=(0,0,256)*DeltaS4'+(r4,g4,b4)*(1-DeltaS4');

LUT5_S=(256,0,256)*DeltaS5’+(r5,g5,b5)*(1-DeltaS5’);LUT5_S=(256,0,256)*DeltaS5'+(r5,g5,b5)*(1-DeltaS5');

LUT6_S=(0,256,256)*DeltaS6’+(r6,g6,b6)*(1-DeltaS6’);LUT6_S=(0,256,256)*DeltaS6'+(r6,g6,b6)*(1-DeltaS6');

LUT7_S=(256,256,256)*DeltaS7’+(r7,g7,b7)*(1-DeltaS7’)。LUT7_S=(256,256,256)*DeltaS7'+(r7,g7,b7)*(1-DeltaS7').

也就是说,任一个参考顶点的校正像素值为LUTi_S=(第i个参考顶点的输入值)*DeltaSi’+(ri,gi,bi)*(1-DeltaSi’),其中,(ri,gi,bi)为第i个参考顶点的输出值。具体的,各参考顶点的输入值可以参考图1,各参考顶点的输出值可以参考图2。That is to say, the corrected pixel value of any reference vertex is LUTi_S=(input value of the i-th reference vertex)*DeltaSi'+(ri,gi,bi)*(1-DeltaSi'), where (ri,gi ,bi) is the output value of the i-th reference vertex. Specifically, the input value of each reference vertex can refer to FIG. 1 , and the output value of each reference vertex can refer to FIG. 2 .

需要说明的是,步骤S301与步骤S302之间没有固定的先后顺序,可以先执行步骤S301再执行步骤S302,也可以先执行步骤S302再执行步骤S301,此处不作限定。It should be noted that there is no fixed sequence between step S301 and step S302, step S301 may be performed first and then step S302 may be performed, or step S302 may be performed first and then step S301 is performed, which is not limited herein.

当weigh1…weigh8均取值为1,P点的输入值由(0,0,0)到(255,255,255)变化(即,R,G,B相等,Sp为0)时,实际计算得到的LUT0_S~LUT7_S可参考表2:When weight1...weight8 take the average value of 1, and the input value of point P changes from (0,0,0) to (255,255,255) (that is, R, G, B are equal, Sp is 0), the actual calculated LUT0_S~ LUT7_S can refer to Table 2:

Figure BDA0003959906210000151
Figure BDA0003959906210000151

Figure BDA0003959906210000161
Figure BDA0003959906210000161

表2Table 2

前面介绍了如何确定参考顶点的校正像素值,后续介绍如何将参考顶点的校正像素值应用到所有像素点,以实现待显示图像的每个像素点的颜色校正。The previous section introduces how to determine the corrected pixel value of the reference vertex, and then introduces how to apply the corrected pixel value of the reference vertex to all pixels to achieve color correction for each pixel of the image to be displayed.

本实施例中,待显示图像可以包含三个颜色通道,显示查找表可以为三维显示查找表,基于参考顶点的校正像素值,对初始像素数据进行线性插值处理,得到像素点对应的校正像素数据,包括:基于参考顶点的校正像素值,对初始像素数据进行三次线性插值处理,得到像素点对应的校正像素数据。In this embodiment, the image to be displayed may include three color channels, and the display lookup table may be a three-dimensional display lookup table. Based on the corrected pixel value of the reference vertex, the initial pixel data is linearly interpolated to obtain the corrected pixel data corresponding to the pixel. , including: performing cubic linear interpolation processing on the initial pixel data based on the corrected pixel value of the reference vertex to obtain corrected pixel data corresponding to the pixel point.

如图10所示,图10为8个参考顶点的校正像素值构成的立方体(即,tuning后的颜色空间)。首先假定使用左手坐标系,x轴、y轴、z轴参见图10。As shown in FIG. 10 , FIG. 10 is a cube formed by the corrected pixel values of 8 reference vertices (that is, the color space after tuning). First assume that a left-handed coordinate system is used, see Figure 10 for the x-axis, y-axis, and z-axis.

图10中,8个参考顶点的校正像素值分别为C000、C100、C010、C001、C101、C011、C110、C111。In FIG. 10 , the corrected pixel values of the eight reference vertices are C000, C100, C010, C001, C101, C011, C110, and C111, respectively.

在x方向上,利用初始像素数据的x坐标值,对四条棱边进行插值,得到每条边上的四个点的值C00、C01、C10、C11。具体的,对C000、C100得到进行插值,得到C00;对C001、C101得到进行插值,得到C01;对C010、C110得到进行插值,得到C10;对C011、C111得到进行插值,得到C11。In the x direction, use the x coordinate value of the initial pixel data to interpolate the four edges to obtain the values C00, C01, C10, and C11 of the four points on each edge. Specifically, C000 and C100 are interpolated to obtain C00; C001 and C101 are interpolated to obtain C01; C010 and C110 are interpolated to obtain C10; C011 and C111 are interpolated to obtain C11.

然后,在y方向上,利用初始像素数据的y坐标值,对C00、C01、C10、C11四个点进行插值,得到两条线段以及中间的两个点的值C0、C1。Then, in the y direction, use the y coordinate value of the initial pixel data to interpolate the four points C00, C01, C10, and C11 to obtain the values C0, C1 of the two line segments and the two points in the middle.

最后,在z方向上,利用初始像素数据的z坐标值,对两个点C0、C1进行插值,得到最终的C点的值(即,像素点对应的校正像素数据)。Finally, in the z direction, the two points C0 and C1 are interpolated using the z coordinate value of the initial pixel data to obtain the final value of point C (ie, the corrected pixel data corresponding to the pixel point).

考虑到灰阶过度画面,当P点的输入值由(0,0,0)到(255,255,255)变化时,使用参考顶点的校正像素值LUT0_S~LUT7_S,通过三次线性插值计算得到P点的输出值和输入值的关系如图11所示。Considering the excessive gray scale, when the input value of point P changes from (0,0,0) to (255,255,255), use the corrected pixel values LUT0_S~LUT7_S of the reference vertex to calculate the output value of point P through cubic linear interpolation The relationship with the input value is shown in Figure 11.

P点的输入值表征像素点的初始像素数据,P点的输出值表征像素点对应的校正像素数据。The input value of point P represents the initial pixel data of the pixel point, and the output value of point P represents the corrected pixel data corresponding to the pixel point.

图11中r,g,b分别为以红色分量绘制得到的输入输出曲线、以绿色分量绘制得到的输入输出曲线、以蓝色分量绘制得到的输入输出曲线。In Fig. 11, r, g, and b are the input-output curves drawn with red components, the input-output curves drawn with green components, and the input-output curves drawn with blue components, respectively.

参见图11,可知,r/g/b三条曲线均呈现线性的变化趋势,且相对比率固定,从而能够改善OLED屏幕最终呈现的显示画面的色偏现象。Referring to FIG. 11 , it can be seen that the three curves of r/g/b all present a linear change trend, and the relative ratio is fixed, so that the color shift phenomenon of the final display screen presented by the OLED screen can be improved.

本申请在颜色空间转换的过程中增加了饱和度参数用于评估参考顶点对于像素点的颜色影响,具体基于像素点与参考顶点之间饱和度差距来确定参考顶点的校正像素值,参考顶点为基于参考颜色所形成的颜色空间的顶点,颜色距离包括饱和度差距,利用饱和度差距来量化表达像素点和参考顶点之间的颜色距离。基于参考顶点的校正像素值,对初始像素数据进行线性插值处理,就能得到像素点对应的校正像素数据,校正像素数据用于输出显示图像;能够改善显示设备所展示的显示图像的灰阶画面的色偏,能够提高显示设备所展示的显示图像的色彩准确性。In the process of color space conversion, this application adds a saturation parameter to evaluate the influence of the reference vertex on the color of the pixel. Specifically, the corrected pixel value of the reference vertex is determined based on the saturation difference between the pixel and the reference vertex. The reference vertex is Based on the vertices of the color space formed by the reference color, the color distance includes a saturation gap, and the saturation gap is used to quantify the color distance between the expressed pixel point and the reference vertex. Based on the corrected pixel value of the reference vertex, the initial pixel data is linearly interpolated to obtain the corrected pixel data corresponding to the pixel point, and the corrected pixel data is used to output the display image; it can improve the grayscale picture of the display image displayed by the display device The color shift can improve the color accuracy of the displayed image displayed by the display device.

而且,不同的显示设备可以采用不同的饱和度差距进行修正,能够平衡不同显示设备的差异,能够提升像素点的校正像素数据与对应的显示设备的匹配度,能够提高不同显示设备所展示的显示图像的色彩准确性。Moreover, different display devices can be corrected with different saturation differences, which can balance the differences between different display devices, improve the matching degree of corrected pixel data of pixels and corresponding display devices, and improve the display performance displayed by different display devices. The color accuracy of the image.

基于同一发明构思,本申请实施例提供了一种颜色校正装置,如图12所示,该颜色校正装置包括:获取模块401和确定模块402。Based on the same inventive concept, an embodiment of the present application provides a color correction device. As shown in FIG. 12 , the color correction device includes: an acquisition module 401 and a determination module 402 .

其中,获取模块401,获取待显示图像包含的多个像素点的初始像素数据;Wherein, the acquiring module 401 acquires initial pixel data of a plurality of pixel points contained in the image to be displayed;

确定模块402,用于基于显示查找表、以及像素点与参考顶点的饱和度差距,确定参考顶点的校正像素值,参考顶点为基于参考颜色所形成的颜色空间的顶点;基于参考顶点的校正像素值,对初始像素数据进行线性插值处理,得到像素点对应的校正像素数据;校正像素数据用于输出显示图像。The determination module 402 is configured to determine the corrected pixel value of the reference vertex based on the display lookup table and the saturation difference between the pixel point and the reference vertex. The reference vertex is the vertex of the color space formed based on the reference color; the corrected pixel based on the reference vertex Value, linear interpolation processing is performed on the initial pixel data to obtain the corrected pixel data corresponding to the pixel point; the corrected pixel data is used to output the display image.

在一个可能的实现方式中,确定模块402基于显示查找表、以及像素点与参考顶点的饱和度差距,确定参考顶点的校正像素值时,用于:In a possible implementation, the determination module 402 is used to determine the corrected pixel value of the reference vertex based on the display lookup table and the saturation difference between the pixel point and the reference vertex:

基于初始像素数据确定像素点的第一饱和度,基于参考顶点的输入值确定参考顶点的第二饱和度,所述参考顶点的输入值为所述参考顶点在原始颜色空间内的像素值;Determining the first saturation of the pixel point based on the initial pixel data, determining the second saturation of the reference vertex based on the input value of the reference vertex, the input value of the reference vertex is the pixel value of the reference vertex in the original color space;

基于第一饱和度和第二饱和度,确定像素点与参考顶点的饱和度差距;Based on the first saturation and the second saturation, determine the saturation difference between the pixel point and the reference vertex;

基于显示查找表和饱和度差距,确定参考顶点的校正像素值。Based on the display lookup table and the saturation gap, the corrected pixel value for the reference vertex is determined.

在一个可能的实现方式中,确定模块402基于显示查找表和饱和度差距,确定参考顶点的校正像素值时,用于:In a possible implementation manner, when the determination module 402 determines the corrected pixel value of the reference vertex based on the display lookup table and the saturation difference, it is used to:

将参考顶点的输入值输入显示查找表,得到参考顶点的输出值;Input the input value of the reference vertex into the display lookup table to obtain the output value of the reference vertex;

基于参考顶点的输入值、参考顶点的输出值以及饱和度差距,确定参考顶点的校正像素值。Based on the input value of the reference vertex, the output value of the reference vertex, and the saturation difference, a corrected pixel value of the reference vertex is determined.

在一个可能的实现方式中,确定模块402基于参考顶点的输入值、参考顶点的输出值以及饱和度差距,确定参考顶点的校正像素值时,用于:In a possible implementation manner, when determining the corrected pixel value of the reference vertex based on the input value of the reference vertex, the output value of the reference vertex and the saturation difference, the determination module 402 is used for:

对饱和度差距进行加权;weighting the saturation difference;

基于参考顶点的输入值、参考顶点的输出值以及加权后的饱和度差距,确定参考顶点的校正像素值。Based on the input value of the reference vertex, the output value of the reference vertex, and the weighted saturation difference, the corrected pixel value of the reference vertex is determined.

在一个可能的实现方式中,确定模块402对饱和度差距进行加权时,用于:In a possible implementation manner, when the determining module 402 weights the saturation difference, it is used to:

基于显示面板的显示特性,对饱和度差距进行加权。Saturation differences are weighted based on the display characteristics of the display panel.

在一个可能的实现方式中,待显示图像包含三个颜色通道;显示查找表为三维显示查找表;In a possible implementation, the image to be displayed includes three color channels; the display lookup table is a three-dimensional display lookup table;

确定模块402基于参考顶点的校正像素值,对初始像素数据进行线性插值处理,得到像素点对应的校正像素数据时,用于:The determination module 402 performs linear interpolation processing on the initial pixel data based on the corrected pixel value of the reference vertex, and when obtaining the corrected pixel data corresponding to the pixel point, it is used for:

基于参考顶点的校正像素值,对初始像素数据进行三次线性插值处理,得到像素点对应的校正像素数据。Based on the corrected pixel value of the reference vertex, the initial pixel data is subjected to cubic linear interpolation processing to obtain the corrected pixel data corresponding to the pixel point.

本申请实施例的装置可执行本申请实施例所提供的方法,其实现原理相类似,本申请各实施例的装置中的各模块所执行的动作是与本申请各实施例的方法中的步骤相对应的,对于装置的各模块的详细功能描述具体可以参见前文中所示的对应方法中的描述,此处不再赘述。The device in the embodiment of the present application can execute the method provided in the embodiment of the present application, and its implementation principle is similar. The actions performed by the modules in the device in the embodiments of the present application are the same as the steps in the methods of the embodiments of the present application Correspondingly, for the detailed functional description of each module of the device, reference may be made to the description in the corresponding method shown above, which will not be repeated here.

本申请在颜色空间转换的过程中增加了饱和度参数用于评估参考顶点对于像素点的颜色影响,具体基于像素点与参考顶点之间饱和度差距来确定参考顶点的校正像素值,参考顶点为基于参考颜色所形成的颜色空间的顶点,颜色距离包括饱和度差距,利用饱和度差距来量化表达像素点和参考顶点之间的颜色距离。基于参考顶点的校正像素值,对初始像素数据进行线性插值处理,就能得到像素点对应的校正像素数据,校正像素数据用于输出显示图像;能够改善显示设备所展示的显示图像的灰阶画面的色偏,能够提高显示设备所展示的显示图像的色彩准确性。In the process of color space conversion, this application adds a saturation parameter to evaluate the influence of the reference vertex on the color of the pixel. Specifically, the corrected pixel value of the reference vertex is determined based on the saturation difference between the pixel and the reference vertex. The reference vertex is Based on the vertices of the color space formed by the reference color, the color distance includes a saturation gap, and the saturation gap is used to quantify the color distance between the expressed pixel point and the reference vertex. Based on the corrected pixel value of the reference vertex, the initial pixel data is linearly interpolated to obtain the corrected pixel data corresponding to the pixel point, and the corrected pixel data is used to output the display image; it can improve the grayscale picture of the display image displayed by the display device The color shift can improve the color accuracy of the displayed image displayed by the display device.

而且,不同的显示设备可以采用不同的饱和度差距进行修正,能够平衡不同显示设备的差异,能够提升像素点的校正像素数据与对应的显示设备的匹配度,能够提高不同显示设备所展示的显示图像的色彩准确性。Moreover, different display devices can be corrected with different saturation differences, which can balance the differences between different display devices, improve the matching degree of corrected pixel data of pixels and corresponding display devices, and improve the display performance displayed by different display devices. The color accuracy of the image.

基于同一发明构思,本申请实施例提供了一种电子设备,包括处理器和存储器,处理器和存储器相互连接,存储器用于存储计算机程序,处理器被配置用于在调用计算机程序时,执行如上述的方法的步骤,与相关技术相比可实现:在颜色空间转换的过程中增加了饱和度参数用于评估参考顶点对于像素点的颜色影响,具体基于像素点与参考顶点之间饱和度差距来确定参考顶点的校正像素值,参考顶点为基于参考颜色所形成的颜色空间的顶点,颜色距离包括饱和度差距,利用饱和度差距来量化表达像素点和参考顶点之间的颜色距离。基于参考顶点的校正像素值,对初始像素数据进行线性插值处理,就能得到像素点对应的校正像素数据,校正像素数据用于输出显示图像;能够改善显示设备所展示的显示图像的灰阶画面的色偏,能够提高显示设备所展示的显示图像的色彩准确性。而且,不同的显示设备可以采用不同的饱和度差距进行修正,能够平衡不同显示设备的差异,能够提升像素点的校正像素数据与对应的显示设备的匹配度,能够提高不同显示设备所展示的显示图像的色彩准确性。Based on the same inventive concept, an embodiment of the present application provides an electronic device, including a processor and a memory, the processor and the memory are connected to each other, the memory is used to store a computer program, and the processor is configured to execute such as The steps of the above-mentioned method, compared with related technologies, can be realized: in the process of color space conversion, a saturation parameter is added to evaluate the influence of the reference vertex on the color of the pixel, specifically based on the saturation gap between the pixel and the reference vertex To determine the corrected pixel value of the reference vertex, the reference vertex is the vertex of the color space formed based on the reference color, the color distance includes the saturation gap, and the saturation gap is used to quantify the color distance between the expressed pixel point and the reference vertex. Based on the corrected pixel value of the reference vertex, the initial pixel data is linearly interpolated to obtain the corrected pixel data corresponding to the pixel point, and the corrected pixel data is used to output the display image; it can improve the grayscale picture of the display image displayed by the display device The color shift can improve the color accuracy of the displayed image displayed by the display device. Moreover, different display devices can be corrected with different saturation differences, which can balance the differences between different display devices, improve the matching degree of corrected pixel data of pixels and corresponding display devices, and improve the display performance displayed by different display devices. The color accuracy of the image.

在一个可选实施例中提供了一种电子设备,如图13所示,图13所示的电子设备50包括:处理器501和存储器503。其中,处理器501和存储器503相连,如通过总线502相连。An optional embodiment provides an electronic device. As shown in FIG. 13 , the electronic device 50 shown in FIG. 13 includes: a processor 501 and a memory 503 . Wherein, the processor 501 is connected to the memory 503 , such as through a bus 502 .

在一个可能的实现方式中,电子设备50还可以包括显示面板,显示面板与处理器501电连接,用于接收处理器501输出的待显示图像的校正像素数据,以输出显示图像。In a possible implementation manner, the electronic device 50 may further include a display panel, and the display panel is electrically connected to the processor 501 for receiving corrected pixel data of the image to be displayed output by the processor 501 to output a display image.

可选地,电子设备50还可以包括收发器504,收发器504可以用于该电子设备与其他电子设备之间的数据交互,如数据的发送和/或数据的接收等。需要说明的是,实际应用中收发器504不限于一个,该电子设备50的结构并不构成对本申请实施例的限定。Optionally, the electronic device 50 may further include a transceiver 504, and the transceiver 504 may be used for data interaction between the electronic device and other electronic devices, such as sending data and/or receiving data. It should be noted that, in practical applications, the transceiver 504 is not limited to one, and the structure of the electronic device 50 does not limit the embodiment of the present application.

处理器501可以是CPU(Central Processing Unit,中央处理器),通用处理器,DSP(Digital Signal Processor,数据信号处理器),ASIC(Application SpecificIntegrated Circuit,专用集成电路),FPGA(Field Programmable Gate Array,现场可编程门阵列)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器501也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等。The processor 501 can be a CPU (Central Processing Unit, central processing unit), a general-purpose processor, a DSP (Digital Signal Processor, a data signal processor), an ASIC (Application Specific Integrated Circuit, an application specific integrated circuit), an FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various illustrative logical blocks, modules and circuits described in connection with the present disclosure. The processor 501 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

总线502可包括一通路,在上述组件之间传送信息。总线502可以是PCI(Peripheral Component Interconnect,外设部件互连标准)总线或EISA(ExtendedIndustry Standard Architecture,扩展工业标准结构)总线等。总线502可以分为地址总线、数据总线、控制总线等。为便于表示,图12中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。Bus 502 may include a path for communicating information between the components described above. The bus 502 may be a PCI (Peripheral Component Interconnect, Peripheral Component Interconnect Standard) bus or an EISA (Extended Industry Standard Architecture, Extended Industry Standard Architecture) bus or the like. The bus 502 can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in FIG. 12 , but it does not mean that there is only one bus or one type of bus.

存储器503可以是ROM(Read Only Memory,只读存储器)或可存储静态信息和指令的其他类型的静态存储设备,RAM(Random Access Memory,随机存取存储器)或者可存储信息和指令的其他类型的动态存储设备,也可以是EEPROM(Electrically ErasableProgrammable Read Only Memory,电可擦可编程只读存储器)、CD-ROM(Compact DiscRead Only Memory,只读光盘)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质、其他磁存储设备、或者能够用于携带或存储计算机程序并能够由计算机读取的任何其他介质,在此不做限定。Memory 503 may be ROM (Read Only Memory, read-only memory) or other types of static storage devices that can store static information and instructions, RAM (Random Access Memory, random access memory) or other types of memory that can store information and instructions A dynamic storage device can also be EEPROM (Electrically Erasable Programmable Read Only Memory, Electrically Erasable Programmable Read-Only Memory), CD-ROM (Compact DiscRead Only Memory, CD-ROM) or other CD storage, CD storage (including compact CD, Laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation.

存储器503用于存储执行本申请实施例的计算机程序,并由处理器501来控制执行。处理器501用于执行存储器503中存储的计算机程序,以实现前述方法实施例所示的步骤。The memory 503 is used to store the computer programs for executing the embodiments of the present application, and the execution is controlled by the processor 501 . The processor 501 is configured to execute the computer program stored in the memory 503 to implement the steps shown in the foregoing method embodiments.

其中,电子设备包括但不限于:诸如移动电话、笔记本电脑、PAD等等移动终端以及诸如数字TV、台式计算机等等固定终端。Wherein, the electronic equipment includes, but is not limited to: mobile terminals such as mobile phones, notebook computers, PADs, etc., and fixed terminals such as digital TVs, desktop computers, etc.

基于同一发明构思,本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时可实现前述方法实施例的步骤及相应内容。Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiments can be realized.

本申请实施例提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行时实现如下情况:An embodiment of the present application provides a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device realizes the following when executing:

获取待显示图像的多个像素点的初始像素数据;Obtain initial pixel data of multiple pixel points of the image to be displayed;

基于显示查找表、以及像素点与参考顶点的饱和度差距,确定参考顶点的校正像素值,参考顶点为基于参考颜色所形成的颜色空间的顶点;Based on the display lookup table and the saturation difference between the pixel point and the reference vertex, determine the corrected pixel value of the reference vertex, where the reference vertex is a vertex of a color space formed based on the reference color;

基于参考顶点的校正像素值,对初始像素数据进行线性插值处理,得到像素点对应的校正像素数据;Based on the corrected pixel value of the reference vertex, the initial pixel data is linearly interpolated to obtain the corrected pixel data corresponding to the pixel point;

校正像素数据用于输出显示图像。The corrected pixel data is used to output a display image.

本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”、“1”、“2”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除图示或文字描述以外的顺序实施。The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the description and claims of this application and the above drawings are used for Distinguishes between similar objects and does not necessarily describe a particular order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described in writing.

应该理解的是,虽然本申请实施例的流程图中通过箭头指示各个操作步骤,但是这些步骤的实施顺序并不受限于箭头所指示的顺序。除非本文中有明确的说明,否则在本申请实施例的一些实施场景中,各流程图中的实施步骤可以按照需求以其他的顺序执行。此外,各流程图中的部分或全部步骤基于实际的实施场景,可以包括多个子步骤或者多个阶段。这些子步骤或者阶段中的部分或全部可以在同一时刻被执行,这些子步骤或者阶段中的每个子步骤或者阶段也可以分别在不同的时刻被执行。在执行时刻不同的场景下,这些子步骤或者阶段的执行顺序可以根据需求灵活配置,本申请实施例对此不限制。It should be understood that although arrows indicate various operation steps in the flow chart of the embodiment of the present application, the execution order of these steps is not limited to the order indicated by the arrows. Unless otherwise specified herein, in some implementation scenarios of the embodiments of the present application, the implementation steps in each flowchart may be performed in other orders as required. In addition, part or all of the steps in each flow chart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each of these sub-steps or stages may also be executed at different times. In scenarios where execution times are different, the execution order of these sub-steps or stages can be flexibly configured according to requirements, which is not limited in this embodiment of the present application.

以上仅是本申请部分实施场景的可选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请的方案技术构思的前提下,采用基于本申请技术思想的其他类似实施手段,同样属于本申请实施例的保护范畴。The above are only optional implementations of some implementation scenarios of this application. It should be pointed out that for those of ordinary skill in the art, on the premise of not departing from the technical concept of this application, other similar methods based on the technical ideas of this application can be adopted. The means of implementation also belong to the scope of protection of the embodiments of the present application.

Claims (10)

1. A color correction method, comprising:
acquiring initial pixel data of a plurality of pixel points of an image to be displayed;
determining a corrected pixel value of a reference vertex based on a display lookup table and a saturation difference between the pixel point and the reference vertex, wherein the reference vertex is a vertex of a color space formed based on a reference color;
performing linear interpolation processing on the initial pixel data based on the correction pixel value of the reference vertex to obtain correction pixel data corresponding to the pixel point;
the corrected pixel data is used to output a display image.
2. The method of claim 1, wherein determining the corrected pixel value for the reference vertex based on the display lookup table and the saturation difference between the pixel point and the reference vertex comprises:
determining a first saturation of the pixel point based on the initial pixel data, determining a second saturation of the reference vertex based on an input value of the reference vertex, the input value of the reference vertex being a pixel value of the reference vertex in an original color space;
determining a saturation gap between the pixel point and the reference vertex based on the first saturation and the second saturation;
determining a corrected pixel value for the reference vertex based on the display lookup table and the saturation gap.
3. The method of claim 2, wherein determining the corrected pixel value for the reference vertex based on the display lookup table and the saturation gap comprises:
inputting the input value of the reference vertex into the display lookup table to obtain the output value of the reference vertex;
determining a corrected pixel value for the reference vertex based on the input value for the reference vertex, the output value for the reference vertex, and the saturation gap.
4. The method of claim 3, wherein determining the corrected pixel value for the reference vertex based on the input value for the reference vertex, the output value for the reference vertex, and the saturation gap comprises:
weighting the saturation differences;
and determining a correction pixel value of the reference vertex based on the input value of the reference vertex, the output value of the reference vertex and the weighted saturation difference.
5. The method of claim 4, wherein weighting the saturation gaps comprises:
weighting the saturation gap based on display characteristics of the display panel.
6. The method of claim 1, wherein the image to be displayed comprises three color channels; the display lookup table is a three-dimensional display lookup table;
the performing linear interpolation processing on the initial pixel data based on the corrected pixel value of the reference vertex to obtain corrected pixel data corresponding to the pixel point includes:
and performing cubic linear interpolation processing on the initial pixel data based on the correction pixel value of the reference vertex to obtain correction pixel data corresponding to the pixel point.
7. A color correction apparatus, characterized by comprising:
the acquisition module is used for acquiring initial pixel data of a plurality of pixel points contained in an image to be displayed;
a determining module, configured to determine a corrected pixel value of a reference vertex based on a display lookup table and a saturation difference between the pixel point and the reference vertex, where the reference vertex is a vertex of a color space formed based on a reference color; performing linear interpolation processing on the initial pixel data based on the correction pixel value of the reference vertex to obtain correction pixel data corresponding to the pixel point; the corrected pixel data is used to output a display image.
8. An electronic device comprising a processor and a memory, the processor and the memory being interconnected;
the memory is used for storing a computer program;
the processor is configured to perform the method of any of claims 1 to 6 when the computer program is invoked.
9. The electronic device of claim 8, further comprising a display panel;
the display panel is electrically connected with the processor and used for receiving the corrected pixel data of the image to be displayed output by the processor so as to output the display image.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executed by a processor to implement the method of any one of claims 1 to 6.
CN202211477646.XA 2022-11-23 2022-11-23 Color correction method, color correction device, electronic device and storage medium Pending CN115862534A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211477646.XA CN115862534A (en) 2022-11-23 2022-11-23 Color correction method, color correction device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211477646.XA CN115862534A (en) 2022-11-23 2022-11-23 Color correction method, color correction device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN115862534A true CN115862534A (en) 2023-03-28

Family

ID=85665589

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211477646.XA Pending CN115862534A (en) 2022-11-23 2022-11-23 Color correction method, color correction device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN115862534A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118098176A (en) * 2024-04-26 2024-05-28 Tcl华星光电技术有限公司 Image compensation method of display device and display device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101123080A (en) * 2007-09-14 2008-02-13 北京中视中科光电技术有限公司 A color gamut mapping real-time processing method and real-time processing circuit
JP2010074317A (en) * 2008-09-16 2010-04-02 Ricoh Co Ltd Image processor, image processing program, and image processing method
CN104836995A (en) * 2014-02-06 2015-08-12 富士通株式会社 Information processing device, color interpolation method, and table generation method
CN107784993A (en) * 2017-09-30 2018-03-09 上海顺久电子科技有限公司 A kind of gamut compression method, apparatus and display device
CN111770320A (en) * 2020-07-14 2020-10-13 深圳市洲明科技股份有限公司 Color correction method and device, color correction equipment and storage medium
CN114842814A (en) * 2022-05-16 2022-08-02 Oppo广东移动通信有限公司 Color calibration method and device, electronic device, storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101123080A (en) * 2007-09-14 2008-02-13 北京中视中科光电技术有限公司 A color gamut mapping real-time processing method and real-time processing circuit
JP2010074317A (en) * 2008-09-16 2010-04-02 Ricoh Co Ltd Image processor, image processing program, and image processing method
CN104836995A (en) * 2014-02-06 2015-08-12 富士通株式会社 Information processing device, color interpolation method, and table generation method
CN107784993A (en) * 2017-09-30 2018-03-09 上海顺久电子科技有限公司 A kind of gamut compression method, apparatus and display device
CN111770320A (en) * 2020-07-14 2020-10-13 深圳市洲明科技股份有限公司 Color correction method and device, color correction equipment and storage medium
CN114842814A (en) * 2022-05-16 2022-08-02 Oppo广东移动通信有限公司 Color calibration method and device, electronic device, storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118098176A (en) * 2024-04-26 2024-05-28 Tcl华星光电技术有限公司 Image compensation method of display device and display device
CN118098176B (en) * 2024-04-26 2024-07-05 Tcl华星光电技术有限公司 Image compensation method of display device and display device

Similar Documents

Publication Publication Date Title
US7081899B2 (en) Image processing support system, image processing device and image display device
RU2670774C9 (en) Greyscale value setting method for liquid crystal panel and liquid crystal display
CN102893610B (en) The gamut compression of video display apparatus
US20200098333A1 (en) Method and System for Display Color Calibration
JP5496556B2 (en) Color enhancement for graphic images
CN108596828B (en) Image floodlight processing method and device, electronic equipment and storage medium
JP2013232746A (en) Semiconductor device, image processing system, and program
WO2013103462A1 (en) Image perceptual attribute adjustment
EP1835727B1 (en) Color correction method, color correction device, and color correction program
WO2020216085A1 (en) Tetrahedral interpolation calculation method and apparatus, gamut conversion method and apparatus, and medium
CN111312141A (en) Color gamut adjusting method and device
US11302287B1 (en) Color correction in computing systems for color vision deficiency
CN115862534A (en) Color correction method, color correction device, electronic device and storage medium
CN107534763B (en) Adaptive Color Level Interpolation Method and Apparatus
CN109410874B (en) Method and device for converting three-color data into four-color data
CN113470591B (en) Monitor color matching method and device, electronic equipment and storage medium
CN114842814B (en) Color calibration methods and devices, electronic equipment, storage media
WO2020000255A1 (en) Rgb data color adjustment method
JP2019095711A (en) Correction data generation device, display device, correction data generation method, and program
CN109461418B (en) Method and device for converting three-color data into four-color data
JP5321089B2 (en) Image processing apparatus, image display apparatus, and image processing method
US8630488B2 (en) Creating a duotone color effect using an ICC profile
WO2016151944A1 (en) Image correction device, image correction method, and image correction program
US12087249B2 (en) Perceptual color enhancement based on properties of responses of human vision system to color stimulus
CN115917639B (en) Method to reduce brightness loss in color gamut mapping

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination