Color compensation method, device, electronic device and readable storage medium

By performing grayscale histogram statistics and calculation of dynamic contrast curves on the display screen, and combining preset limit gain curves, color compensation for each pixel point is solved, the color distortion problem of the monitor when using dynamic contrast technology is solved, and more accurate color compensation effect.

CN115147307BActive Publication Date: 2025-02-07SHENZHEN SKYWORTH RGB ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210783459.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-05
Publication Date
2025-02-07
Estimated Expiration
2042-07-05

AI Technical Summary

Technical Problem

When using dynamic contrast technology, existing monitors fail to effectively consider the impact of light and dark changes on color performance, resulting in distortion of the picture.

Method used

By performing grayscale histogram statistics on the current screen, a dynamic contrast curve is obtained, and the expected chromaticity gain curve is calculated based on the curve, and color compensation is performed for each pixel point in combination with the preset limit gain curve.

Benefits of technology

The calculation of the dynamic gain curve of each frame of the picture is realized. Through the role of the dynamic gain curve, the corresponding chromatic gain curve is matched according to the brightness change trend, thereby achieving the best color compensation effect, and solving the problem of color distortion of the display screen.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115147307B_ABST
    Figure CN115147307B_ABST
Patent Text Reader

Abstract

The present application discloses a color compensation method, device, electronic device and readable storage medium, which are applied to the field of image processing technology. The color compensation method includes: performing grayscale histogram statistics on the current picture to obtain grayscale histogram statistics results; obtaining a dynamic contrast curve based on the grayscale histogram statistics results, and setting the dynamic contrast value of each pixel point of the current picture through the dynamic contrast curve; calculating and obtaining an estimated chromaticity gain curve based on the dynamic contrast curve; and performing color compensation on each pixel point for which the dynamic contrast value has been set through the estimated chromaticity gain curve and the preset limit gain curve. The present application solves the technical problem of color distortion of display screens in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a color compensation method, device, electronic device and readable storage medium. Background Art

[0002] Today's televisions all use dynamic contrast technology, which adjusts the contrast of the picture frame by frame according to the content of the picture to achieve the effect of enhancing the depth of field and the sense of layering of the picture. This function generally optimizes the contrast between light and dark in the picture by adjusting the brightness, but when the picture is only adjusted in brightness, the brightened part will appear to be lighter in color, and the darkened part will appear to be more colorful. The dynamic contrast algorithm on existing displays only improves the contrast between light and dark, and does not take into account the obvious impact of changes in brightness on color performance, resulting in color distortion on the display. Summary of the invention

[0003] The main purpose of the present application is to provide a color compensation method, device, electronic device and readable storage medium, aiming to solve the technical problem of color distortion of display images in the prior art.

[0004] To achieve the above object, the present application provides a color compensation method, which is applied to a color compensation device. The color compensation method includes:

[0005] Perform grayscale histogram statistics on the current image to obtain grayscale histogram statistics results;

[0006] Obtaining a dynamic contrast curve according to the grayscale histogram statistical result, and setting the dynamic contrast value of each pixel point in the current picture according to the dynamic contrast curve;

[0007] Calculate an estimated chromaticity gain curve according to the dynamic contrast curve;

[0008] Color compensation is performed on each pixel point for which the dynamic contrast value has been set using the predicted chromaticity gain curve and the preset limit gain curve.

[0009] Optionally, the step of obtaining a dynamic contrast curve according to the grayscale histogram statistical result includes:

[0010] Obtaining an average brightness value of the current picture from the grayscale histogram statistical result;

[0011] According to the average brightness value, selecting at least one valid static curve from each preset static curve;

[0012] A dynamic contrast curve is determined according to the average brightness value and each of the effective static curves.

[0013] Optionally, the preset static curve includes at least a first preset static curve, a second preset static curve and a third preset static curve.

[0014] The step of selecting at least one valid static curve from each preset static curve according to the average brightness value comprises:

[0015] If the average brightness value is not greater than the first brightness threshold, taking the first preset static curve as the effective static curve;

[0016] If the average brightness value is equal to the second brightness threshold, the second preset static curve is used as the effective static curve;

[0017] If the average brightness value is not less than a third brightness threshold, taking the third preset static curve as a valid static curve;

[0018] If the average brightness value is greater than the first brightness threshold and less than the second brightness threshold, the first preset static curve and the second preset static curve are used as valid static curves;

[0019] If the average brightness value is greater than the second brightness threshold and less than the third brightness threshold, the second preset static curve and the third preset static curve are used as valid static curves.

[0020] Optionally, the step of determining a dynamic contrast curve according to the average brightness value and each of the effective static curves includes:

[0021] If the number of each of the valid static curves is not greater than a preset number threshold, taking the valid static curve as a dynamic contrast curve;

[0022] If the number of each of the valid static curves is greater than the preset number threshold, each of the valid static curves is merged into the dynamic contrast curve according to the first brightness threshold, the second brightness threshold, the third brightness threshold and the average brightness value.

[0023] Optionally, the step of fusing the effective static curves into the dynamic contrast curve according to the first brightness threshold, the second brightness threshold, the third brightness threshold and the average brightness value includes:

[0024] According to the average brightness value, selecting a valid brightness threshold from the first brightness threshold, the second brightness threshold, and the third brightness threshold;

[0025] Determine the static curve action coefficient by obtaining the ratio of the average brightness value to the effective brightness threshold;

[0026] The static curve action coefficient and the effective brightness threshold are calculated to generate a dynamic contrast curve.

[0027] Optionally, the step of calculating the estimated chromaticity gain curve according to the dynamic contrast curve comprises:

[0028] Obtaining an input brightness value and an output brightness value of each pixel point according to the dynamic contrast curve;

[0029] Determining a target gain coefficient curve according to the input brightness value and the output brightness value;

[0030] The input brightness value, the output brightness value and the gain coefficient curve are calculated to obtain an estimated chromaticity gain curve.

[0031] Optionally, the step of determining a target gain coefficient curve according to the input brightness value and the output brightness value comprises:

[0032] If the input brightness value is greater than the output brightness value, the first preset gain curve is used as the target gain coefficient curve;

[0033] If the input brightness value is less than the output brightness value, the second preset gain curve is used as the target gain coefficient curve;

[0034] If the input brightness value is equal to the output brightness value, the third preset gain curve is used as the target gain coefficient curve.

[0035] To achieve the above object, the present application further provides a color compensation device, which is applied to a color compensation device, and includes:

[0036] Grayscale statistics module, used to perform grayscale histogram statistics on the current picture to obtain grayscale histogram statistics results;

[0037] A dynamic contrast module, used to obtain a dynamic contrast curve according to the grayscale histogram statistical result, and set the dynamic contrast value of each pixel point in the current picture according to the dynamic contrast curve;

[0038] An estimated gain module, used for calculating an estimated chromaticity gain curve according to the dynamic contrast curve;

[0039] The color compensation module is used to perform color compensation on each pixel point for which the dynamic contrast value has been set through the predicted chromaticity gain curve and the preset limit gain curve.

[0040] Optionally, the dynamic contrast module is further used for:

[0041] Obtaining an average brightness value of the current picture from the grayscale histogram statistical result;

[0042] According to the average brightness value, selecting at least one valid static curve from each preset static curve;

[0043] A dynamic contrast curve is determined according to the average brightness value and each of the effective static curves.

[0044] Optionally, the preset static curve includes at least a first preset static curve, a second preset static curve and a third preset static curve.

[0045] The dynamic contrast module is also used for:

[0046] If the average brightness value is not greater than the first brightness threshold, taking the first preset static curve as the effective static curve;

[0047] If the average brightness value is equal to the second brightness threshold, the second preset static curve is used as the effective static curve;

[0048] If the average brightness value is not less than a third brightness threshold, taking the third preset static curve as a valid static curve;

[0049] If the average brightness value is greater than the first brightness threshold and less than the second brightness threshold, the first preset static curve and the second preset static curve are used as valid static curves;

[0050] If the average brightness value is greater than the second brightness threshold and less than the third brightness threshold, the second preset static curve and the third preset static curve are used as valid static curves.

[0051] Optionally, the dynamic contrast module is further used for:

[0052] If the number of each of the valid static curves is not greater than a preset number threshold, taking the valid static curve as a dynamic contrast curve;

[0053] If the number of each of the valid static curves is greater than the preset number threshold, each of the valid static curves is merged into the dynamic contrast curve according to the first brightness threshold, the second brightness threshold, the third brightness threshold and the average brightness value.

[0054] Optionally, the dynamic contrast module is further used for:

[0055] According to the average brightness value, selecting a valid brightness threshold from the first brightness threshold, the second brightness threshold, and the third brightness threshold;

[0056] Determine the static curve action coefficient by obtaining the ratio of the average brightness value to the effective brightness threshold;

[0057] The static curve action coefficient and the effective brightness threshold are calculated to generate a dynamic contrast curve.

[0058] Optionally, the predicted gain module is further used for:

[0059] Obtaining an input brightness value and an output brightness value of each pixel point according to the dynamic contrast curve;

[0060] Determining a target gain coefficient curve according to the input brightness value and the output brightness value;

[0061] The input brightness value, the output brightness value and the gain coefficient curve are calculated to obtain an estimated chromaticity gain curve.

[0062] Optionally, the predicted gain module is further used for:

[0063] If the input brightness value is greater than the output brightness value, the first preset gain curve is used as the target gain coefficient curve;

[0064] If the input brightness value is less than the output brightness value, the second preset gain curve is used as the target gain coefficient curve;

[0065] If the input brightness value is equal to the output brightness value, the third preset gain curve is used as the target gain coefficient curve.

[0066] The present application also provides an electronic device, comprising: a memory, a processor, and a program of the color compensation method stored in the memory and executable on the processor. When the program of the color compensation method is executed by the processor, the steps of the color compensation method as described above can be implemented.

[0067] The present application also provides a readable storage medium, which is a computer-readable storage medium. A program for implementing a color compensation method is stored on the computer-readable storage medium. When the program of the color compensation method is executed by a processor, the steps of the color compensation method as described above are implemented.

[0068] The present application also provides a computer program product, including a computer program, which implements the steps of the color compensation method as described above when executed by a processor.

[0069] The present application provides a color compensation method, device, electronic device and readable storage medium, that is, grayscale histogram statistics are performed on the current picture to obtain grayscale histogram statistics results; a dynamic contrast curve is obtained according to the grayscale histogram statistics results, and the dynamic contrast value of each pixel point of the current picture is set by the dynamic contrast curve; an estimated chromaticity gain curve is calculated according to the dynamic contrast curve; color compensation is performed on each pixel point for which the dynamic contrast value has been set by the estimated chromaticity gain curve and the preset limit gain curve, so that the dynamic gain curve of each frame of the picture is calculated, the brightness change of the pixel point of the current frame is obtained after the dynamic gain curve is applied, and the corresponding chromaticity gain curve is matched according to the brightness change trend to achieve the best color compensation effect, thereby solving the problem of color distortion of the display picture. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0071] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0072] Figure 1 This is a schematic diagram of the flow chart of the first embodiment of the color compensation method of the present application;

[0073] Figure 2 is a dynamic contrast curve acting on the current picture frame corresponding to the grayscale histogram statistical result in the embodiment of the present application;

[0074] Figure 3 The estimated chromaticity gain curve obtained by calculation in the embodiment of the present application;

[0075] Figure 4 It is the chromaticity compensation curve actually applied to the current picture after the preset limit gain curve is applied in the embodiment of the present application;

[0076] Figure 5 This is a flow chart of a second embodiment of the color compensation method of the present application;

[0077] Figure 6 Schematic diagram of the device structure of the hardware operating environment involved in the color compensation method in the embodiment of the present application.

[0078] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0079] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0080] Embodiment 1

[0081] The present application provides a color compensation method. In the first embodiment of the color compensation method of the present application, refer to Figure 1 , the color compensation method comprises:

[0082] Step S10, performing grayscale histogram statistics on the current image to obtain grayscale histogram statistics results;

[0083] Step S20, obtaining a dynamic contrast curve according to the grayscale histogram statistical result, and setting the dynamic contrast value of each pixel point in the current picture according to the dynamic contrast curve;

[0084] Step S30, calculating and obtaining an estimated chromaticity gain curve according to the dynamic contrast curve;

[0085] Step S40: performing color compensation on each pixel point for which the dynamic contrast value has been set, using the estimated chromaticity gain curve and the preset limit gain curve.

[0086] In this embodiment, it should be noted that the grayscale histogram is defined as the statistical relationship between each grayscale level and its frequency of occurrence in a digital image. It can describe the general appearance of the image, such as the grayscale range of the image, the frequency of occurrence of each grayscale level, the distribution of grayscale levels, the average brightness and contrast of the entire image, etc. The average brightness value refers to the average grayscale value; the dynamic contrast refers to the contrast value measured by the display under certain specific conditions, such as testing each area of ​​the screen one by one, and taking the contrast value of the area with the largest contrast as the contrast parameter of the product. The dynamic contrast is mainly to ensure the brightness of bright scenes and sufficient darkness in dim scenes. Therefore, the dynamic contrast is very important for those who need The application of frequently switching between bright scenes and dim scenes has obvious practical significance; the predicted chromaticity gain curve is a curve calculated according to the input brightness, output brightness and preset gain curve, and the curve has different color gain values ​​according to different input brightness values. By applying the predicted chromaticity gain curve, the influence on color caused by adjusting the dynamic contrast can be compensated; the preset limit gain curve is a preset curve to avoid the side effect of overexposure of the main picture due to the expected chromaticity gain curve being too large. The corresponding overexposure processing value can be determined according to the input brightness value, and the curve obtained by combining the predicted chromaticity gain curve with the preset limit gain curve is the curve that actually acts on the current picture.

[0087] Exemplarily, steps S10 to S20 include:

[0088] The chip front end performs grayscale histogram statistics on each frame of the displayed image to obtain grayscale histogram statistics results; according to the grayscale histogram statistics results combined with a preset static curve (static curve) and a histogram slope curve (histogram curve), a dynamic contrast curve is obtained, such as Figure 2 As shown, the dynamic contrast value of each pixel in the current picture frame is set according to the dynamic contrast curve to achieve frame-by-frame dynamic contrast; the input brightness value and the output brightness value of each pixel are obtained according to the dynamic contrast curve, and the gain coefficient curve is determined according to the input brightness value and the output brightness value. The following is calculated by the gain coefficient curve, the input brightness value and the output brightness value: Figure 3 The estimated chromaticity gain curve shown; determine the color gain value required for each pixel point according to the estimated chromaticity gain curve, and determine the overexposure processing value of each pixel point according to the preset limit gain curve, and apply the color gain value and the overexposure processing value to each pixel point at the same time.

[0089] At the same time, the chroma gain curve and the preset limit gain curve are applied to the current picture frame as follows Figure 4 Actual color compensation shown.

[0090] In step S30, the step of calculating the estimated chromaticity gain curve according to the dynamic contrast curve includes:

[0091] Step S31, obtaining an input brightness value and an output brightness value of each pixel point according to the dynamic contrast curve;

[0092] Step S32, determining a target gain coefficient curve according to the input brightness value and the output brightness value;

[0093] Step S33, obtaining an estimated chromaticity gain curve by calculating the input brightness value, the output brightness value and the gain coefficient curve.

[0094] Exemplarily, steps S31 to S33 include:

[0095] According to the dynamic contrast curve, the input brightness value and the output brightness value of each pixel in the current picture are obtained; according to the input brightness value and the output brightness value, the brightness change trend of each pixel is judged, so as to select one from each preset gain coefficient curve as the target gain coefficient curve; the input brightness value, the output brightness value and the target gain coefficient curve are subjected to preset calculation to obtain an expected chromaticity gain curve.

[0096] In this embodiment, it should be noted that the obtained predicted chromaticity gain curve is an ideal compensation for chromaticity. However, in some cases, the gain of the picture after the predicted chromaticity gain curve is too large, which causes color distortion. Therefore, it is necessary to act simultaneously with another preset extreme gain curve to avoid overexposure of the picture.

[0097] In step S32, the step of determining a target gain coefficient curve according to the input brightness value and the output brightness value includes:

[0098] Step S321, if the input brightness value is less than the output brightness value, taking the first preset gain curve as the target gain coefficient curve;

[0099] Step S322, if the input brightness value is greater than the output brightness value, taking the second preset gain curve as the target gain coefficient curve;

[0100] Step S323: If the input brightness value is equal to the output brightness value, the third preset gain curve is used as the target gain coefficient curve.

[0101] In this embodiment, it should be noted that three sets of gain curves are preset, such as Figure 3 and Figure 4As shown, they are the first preset gain curve table0, the second preset gain curve table1, and the third preset gain curve table3, respectively representing the situations where the brightness of the current pixel point increases, decreases, and remains unchanged after the action of the dynamic contrast curve.

[0102] Exemplarily, steps S321 to S323 include:

[0103] Obtain the brightness change of each pixel point after the action of the dynamic contrast curve based on the input brightness value and the output brightness value. If the brightness of the current pixel point increases, use the first preset gain curve as the target gain coefficient curve; if the brightness of the current pixel point decreases, use the second preset gain curve as the target gain coefficient curve; if the brightness of the current pixel point remains unchanged, use the third preset gain curve as the target gain coefficient curve.

[0104] Specifically, let the input brightness value be Yin and the output brightness value be Yout. If the pixel point value Yin < Yout, table0 can be selected; if Yin > Yout, table1 can be selected; if Yin = Yout, table3 can be selected. After obtaining the preset gain curve (table_gain), the pre-calculation formula for calculating the chroma gain curve (chroma_gain) is:

[0105]

[0106] In step S40, the steps of performing color compensation on each pixel point with the set dynamic contrast value through the predicted chroma gain curve and the preset limit gain curve include:

[0107] Step S41, obtain the input brightness value of each pixel point with the set dynamic contrast value;

[0108] Step S42, determine the target color gain value of each pixel point according to the input brightness value and the predicted chroma gain curve;

[0109] Step S43, determine the overexposure processing value of each pixel point according to the input brightness value and the preset limit gain curve;

[0110] Step S44, adjust the color of each pixel point according to the target color gain value and the overexposure processing value to perform color compensation on each pixel point.

[0111] In this embodiment, it should be noted that the predicted chroma gain curve is as Figure 3As shown, the horizontal axis represents the input brightness value, and the vertical axis represents the target color gain value. Similarly, the preset limit gain curve is as follows: Figure 3 and Figure 4 The horizontal axis represents the input brightness value, and the vertical axis represents the overexposure processing value, wherein, Figure 4 The actual chromaticity compensation curve is an actual compensation curve obtained by simultaneously passing through the estimated chromaticity gain curve and the preset limit gain curve; the target color gain value and the overexposure processing value are obtained to adjust the color, and a multiplication operation is performed on the color based on the RGB mode.

[0112] Exemplarily, steps S41 to S44 include:

[0113] The input brightness value of each pixel point is obtained; the target color gain value corresponding to the input brightness value is obtained according to the expected chromaticity gain curve; the overexposure processing value corresponding to the input brightness value is obtained according to the preset limit gain curve; the RGB value of each pixel point is adjusted by the target color gain value and the overexposure processing value at the same time to perform color compensation on each pixel point.

[0114] The estimated chromaticity gain curve is used to gain color, while the preset limit gain curve avoids the side effect of overexposure of the gained picture, so as to achieve the best compensation effect.

[0115] The present application provides a color compensation method, device, electronic device and readable storage medium, that is, grayscale histogram statistics are performed on the current picture to obtain grayscale histogram statistics results; a dynamic contrast curve is obtained according to the grayscale histogram statistics results, and the dynamic contrast value of each pixel point of the current picture is set by the dynamic contrast curve; an estimated chromaticity gain curve is calculated according to the dynamic contrast curve; color compensation is performed on each pixel point for which the dynamic contrast value has been set by the estimated chromaticity gain curve and the preset limit gain curve, so that the dynamic gain curve of each frame of the picture is calculated, the brightness change of the pixel point of the current frame is obtained after the dynamic gain curve is applied, and the corresponding chromaticity gain curve is matched according to the brightness change trend to achieve the best color compensation effect, thereby solving the problem of color distortion of the display picture.

[0116] Embodiment 2

[0117] Further, refer to Figure 5 Based on the first embodiment of the present application, in another embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction and will not be described in detail later. On this basis, in step S20, the step of obtaining a dynamic contrast curve according to the grayscale histogram statistical result includes:

[0118] Step A10, obtaining the average brightness value of the current picture from the grayscale histogram statistics result;

[0119] Step A20, selecting at least one valid static curve from the preset static curves according to the average brightness value;

[0120] Step A30: determining a dynamic contrast curve according to the average brightness value and each of the effective static curves.

[0121] In this embodiment, it should be noted that the grayscale histogram is defined as the statistical relationship between each grayscale level in a digital image and its frequency of occurrence. It can describe the general appearance of the image, such as the grayscale range of the image, the frequency of occurrence of each grayscale level, the distribution of grayscale levels, the average brightness and contrast of the entire image, etc. The average brightness value refers to the average grayscale value; the dynamic contrast curve will act on the current frame to achieve a frame-by-frame dynamic contrast effect.

[0122] Exemplarily, steps A10 to A30 include:

[0123] The average brightness value of the current picture is obtained from the grayscale histogram statistical result; the average brightness value is compared with each preset brightness threshold, and at least one valid static curve is selected from each preset static curve; if there is one valid static curve, the valid static curve is directly used as the dynamic contrast curve; if there are multiple valid static curves, it is necessary to set the static curve action coefficient according to the average brightness value, and determine the dynamic contrast according to the static curve action coefficient.

[0124] In step A20, the preset static curve includes at least a first preset static curve, a second preset static curve and a third preset static curve.

[0125] The step of selecting at least one valid static curve from each preset static curve according to the average brightness value comprises:

[0126] Step A21, if the average brightness value is not greater than the first brightness threshold, taking the first preset static curve as the effective static curve;

[0127] Step A22, if the average brightness value is equal to the second brightness threshold, taking the second preset static curve as the effective static curve;

[0128] Step A23, if the average brightness value is not less than the third brightness threshold, taking the third preset static curve as the effective static curve;

[0129] Step A24, if the average brightness value is greater than the first brightness threshold and less than the second brightness threshold, the first preset static curve and the second preset static curve are used as valid static curves;

[0130] Step A25, if the average luminance value is greater than the second luminance threshold and less than the third luminance threshold, then use the second preset static curve and the third preset static curve as the effective static curves.

[0131] In the embodiment, it should be noted that there are three preset static curves in the system, namely static curve H, static curve M, and static curve L. Different preset static curves represent different changes in the ratio of white to black in the same picture, and the effective static curves are selected from the preset static curves; there are three preset thresholds, namely the first luminance threshold YAvg L, the second luminance threshold YAvg M, and the third luminance threshold YAvg H.

[0132] Exemplarily, steps A21 to A25 include:

[0133] Let the average luminance value of the current picture be Yavg. If Yavg <= YAvg L, then use static curve H as the effective static curve; if Yavg = YAvg M, then use static curve M as the effective static curve; if Yavg >= YAvg H, then use static curve L as the effective static curve; if YAvg L < Yavg < YAvg M, then use static curve H and static curve M as the effective static curves; if YAvg M < Yavg < YAvg H, then use static curve L and static curve M as the effective static curves.

[0134] In step A30, the step of determining the dynamic contrast curve according to the average luminance value and each of the effective static curves includes:

[0135] Step A31, if the number of each of the effective static curves is not greater than the preset number threshold, then use the effective static curves as the dynamic contrast curve;

[0136] Step A32, if the number of each of the effective static curves is greater than the preset number threshold, then fuse each of the effective static curves into the dynamic contrast curve according to the first luminance threshold, the second luminance threshold, the third luminance threshold, and the average luminance value.

[0137] In this embodiment, it should be noted that an effective static curve can be selected from various preset static curves through the average brightness value, the preset number threshold is usually one, and there is at least one effective static curve. If the number is one, the effective static curve is directly used as the dynamic contrast curve. If the number is two, the dynamic contrast curve needs to be redetermined based on the ratio of the average brightness value to the preset threshold.

[0138] Exemplarily, step A31 to step A32 include:

[0139] If the number of the valid static curves is not greater than the preset number threshold, including one preset static curve, the valid static curve is directly used as the dynamic contrast curve; if the number of each of the valid static curves is greater than the preset number threshold, then according to the first brightness threshold, the second brightness threshold, the third brightness threshold and the average brightness value, each of the valid static curves is merged into the dynamic contrast curve.

[0140] In step A32, the step of fusing the effective static curves into the dynamic contrast curve according to the first brightness threshold, the second brightness threshold, the third brightness threshold and the average brightness value includes:

[0141] Step B10, selecting a valid brightness threshold from the first brightness threshold, the second brightness threshold and the third brightness threshold according to the average brightness value;

[0142] Step B20, determining a static curve action coefficient by obtaining a ratio of the average brightness value to the effective brightness threshold;

[0143] Step B30, calculating the static curve action coefficient and the effective brightness threshold to generate a dynamic contrast curve.

[0144] In this embodiment, it should be noted that, the larger the static curve action coefficient is, the more the fitted dynamic contrast curve is biased towards the histogram slope curve, and vice versa.

[0145] Exemplarily, steps B10 to B30 include:

[0146] If YAvg L < Yavg < YAvg M or YAvg M < Yavg < YAvg H, take CurveModeMixAlpha1 = Yavg / Yavg L and CurveModeMixAlpha2 = Yavg / Yavg H, and let CurveModeMixAlpha = max{CurveModeMixAlpha1, CurveModeMixAlpha2}, and take the maximum value as the static curve effect coefficient; if YAvg L < Yavg < YAvg M and the current frame Yavg is closer to Yavg L, the dynamic contrast curve of the current frame depends on: Yavg L * CurveModeMixAlpha + Yavg M * (1 - CurveModeMixAlpha); if YAvg M < Yavg < YAvg H and the previous frame Yavg is closer to Yavg H, the dynamic contrast curve of the current frame depends on Yavg L * CurveModeMixAlpha + YavgM * (1 - CurveModeMixAlpha).

[0147] The embodiment of the present application provides a method for obtaining dynamic contrast, that is, obtaining the average brightness value of the current frame from the statistical result of the gray histogram; according to the average brightness value, selecting at least one effective static curve from each preset static curve; according to the average brightness value and each of the effective static curves, determining the dynamic contrast curve, realizing the gray histogram statistics for each frame of the image, and then combining the static curve with multiple preset brightness thresholds to achieve the per-frame dynamic contrast effect, so as to obtain accurate input and output brightness, make the chromaticity gain more accurate, and solve the problem of color distortion of the display screen.

[0148] Embodiment III

[0149] The embodiment of the present application further provides a color compensation device, which is applied to a color compensation device, and the color compensation device includes:

[0150] A gray scale statistics module, configured to perform gray histogram statistics on the current frame to obtain a gray histogram statistical result;

[0151] A dynamic contrast module, configured to obtain a dynamic contrast curve according to the gray histogram statistical result, and set the dynamic contrast value of each pixel point of the current frame through the dynamic contrast curve;

[0152] An expected gain module, configured to calculate an expected chromaticity gain curve according to the dynamic contrast curve;

[0153] The color compensation module is used to perform color compensation on each pixel point for which the dynamic contrast value has been set through the predicted chromaticity gain curve and the preset limit gain curve.

[0154] Optionally, the dynamic contrast module is further used for:

[0155] Obtaining an average brightness value of the current picture from the grayscale histogram statistical result;

[0156] According to the average brightness value, selecting at least one valid static curve from each preset static curve;

[0157] A dynamic contrast curve is determined according to the average brightness value and each of the effective static curves.

[0158] Optionally, the preset static curve includes at least a first preset static curve, a second preset static curve and a third preset static curve.

[0159] The dynamic contrast module is also used for:

[0160] If the average brightness value is not greater than the first brightness threshold, taking the first preset static curve as the effective static curve;

[0161] If the average brightness value is equal to the second brightness threshold, the second preset static curve is used as the effective static curve;

[0162] If the average brightness value is not less than a third brightness threshold, taking the third preset static curve as a valid static curve;

[0163] If the average brightness value is greater than the first brightness threshold and less than the second brightness threshold, the first preset static curve and the second preset static curve are used as valid static curves;

[0164] If the average brightness value is greater than the second brightness threshold and less than the third brightness threshold, the second preset static curve and the third preset static curve are used as valid static curves.

[0165] Optionally, the dynamic contrast module is further used for:

[0166] If the number of each of the valid static curves is not greater than a preset number threshold, taking the valid static curve as a dynamic contrast curve;

[0167] If the number of each of the valid static curves is greater than the preset number threshold, each of the valid static curves is merged into the dynamic contrast curve according to the first brightness threshold, the second brightness threshold, the third brightness threshold and the average brightness value.

[0168] Optionally, the dynamic contrast module is further used for:

[0169] According to the average brightness value, selecting a valid brightness threshold from the first brightness threshold, the second brightness threshold, and the third brightness threshold;

[0170] Determine the static curve action coefficient by obtaining the ratio of the average brightness value to the effective brightness threshold;

[0171] The static curve action coefficient and the effective brightness threshold are calculated to generate a dynamic contrast curve.

[0172] Optionally, the predicted gain module is further used for:

[0173] Obtaining an input brightness value and an output brightness value of each pixel point according to the dynamic contrast curve;

[0174] Determining a target gain coefficient curve according to the input brightness value and the output brightness value;

[0175] The input brightness value, the output brightness value and the gain coefficient curve are calculated to obtain an estimated chromaticity gain curve.

[0176] Optionally, the predicted gain module is further used for:

[0177] If the input brightness value is greater than the output brightness value, the first preset gain curve is used as the target gain coefficient curve;

[0178] If the input brightness value is less than the output brightness value, the second preset gain curve is used as the target gain coefficient curve;

[0179] If the input brightness value is equal to the output brightness value, the third preset gain curve is used as the target gain coefficient curve.

[0180] The color compensation device provided by the present invention adopts the color compensation method in the above-mentioned embodiment 1 or embodiment 2 to solve the technical problem of color distortion of the display screen. Compared with the prior art, the beneficial effects of the color compensation device provided by the embodiment of the present invention are the same as the beneficial effects of the color compensation method provided by the above-mentioned embodiment, and other technical features in the color compensation device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0181] Embodiment 4

[0182] An embodiment of the present invention provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the color compensation method in the above-mentioned embodiment 1 or embodiment 2.

[0183] Reference below Figure 6 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The electronic device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0184] like Figure 6 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0185] Typically, the following systems can be connected to the I / O interface: input devices including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices including, for example, a magnetic tape, a hard disk, etc.; and communication devices. The communication device can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.

[0186] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0187] The electronic device provided by the present invention adopts the color compensation method in the above-mentioned embodiment 1 or embodiment 2 to solve the technical problem of color distortion of the display screen. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiment of the present invention are the same as the beneficial effects of the color compensation method provided by the above-mentioned embodiment 1, and other technical features in the electronic device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0188] It should be understood that the various parts of the present disclosure can be implemented with hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0189] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0190] Embodiment 5

[0191] This embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon, and the computer-readable program instructions are used to execute the color compensation method in the above-mentioned embodiment 1 or embodiment 2.

[0192] The computer-readable storage medium provided in the embodiment of the present invention may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0193] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0194] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device: performs grayscale histogram statistics on the current picture to obtain grayscale histogram statistics results; obtains a dynamic contrast curve based on the grayscale histogram statistics results, and sets the dynamic contrast value of each pixel point of the current picture through the dynamic contrast curve; calculates an estimated chromaticity gain curve based on the dynamic contrast curve; and performs color compensation on each pixel point for which the dynamic contrast value has been set through the estimated chromaticity gain curve and a preset limit gain curve.

[0195] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0196] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0197] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of the module does not limit the unit itself in some cases.

[0198] The computer-readable storage medium provided by the present invention stores computer-readable program instructions for executing the above-mentioned color compensation method, which solves the technical problem of color distortion of the display screen. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the embodiment of the present invention are the same as the beneficial effects of the color compensation method provided by the above-mentioned embodiment 1 or embodiment 2, and will not be repeated here.

[0199] Embodiment 6

[0200] The present application also provides a computer program product, including a computer program, which implements the steps of the color compensation method as described above when executed by a processor.

[0201] The computer program product provided by the present application solves the technical problem of color distortion of display screens. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present invention are the same as the beneficial effects of the color compensation method provided by the above-mentioned embodiment 1 or embodiment 2, which will not be repeated here.

[0202] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.

Claims

1. A color compensation method, characterized in that: The color compensation method comprises: Perform grayscale histogram statistics on the current image to obtain grayscale histogram statistics results; Obtaining a dynamic contrast curve according to the grayscale histogram statistical result, and setting the dynamic contrast value of each pixel point in the current picture according to the dynamic contrast curve; Calculate the estimated chromaticity gain curve according to the dynamic contrast curve; Performing color compensation on each pixel point for which the dynamic contrast value has been set by using the predicted chromaticity gain curve and the preset limit gain curve; The step of calculating the estimated chromaticity gain curve according to the dynamic contrast curve comprises: Obtaining an input brightness value and an output brightness value of each pixel point according to the dynamic contrast curve; Determining a target gain coefficient curve according to the input brightness value and the output brightness value; The input brightness value, the output brightness value and the target gain coefficient curve are calculated to obtain an estimated chromaticity gain curve, wherein the input brightness value is Yin, the output brightness value is Yout, the target gain coefficient curve is table_gain, the estimated chromaticity gain curve is chroma_gain, and the preset calculation formula of the estimated chromaticity gain curve is .

2. The color compensation method according to claim 1, characterized in that: The step of obtaining a dynamic contrast curve according to the grayscale histogram statistical result comprises: Obtaining an average brightness value of the current picture from the grayscale histogram statistical result; According to the average brightness value, selecting at least one valid static curve from each preset static curve; A dynamic contrast curve is determined according to the average brightness value and each of the effective static curves.

3. The color compensation method according to claim 2, characterized in that: The preset static curves include at least a first preset static curve, a second preset static curve and a third preset static curve. The step of selecting at least one valid static curve from each preset static curve according to the average brightness value comprises: If the average brightness value is not greater than the first brightness threshold, taking the first preset static curve as the effective static curve; If the average brightness value is equal to the second brightness threshold, the second preset static curve is used as the effective static curve; If the average brightness value is not less than a third brightness threshold, taking the third preset static curve as a valid static curve; If the average brightness value is greater than the first brightness threshold and less than the second brightness threshold, the first preset static curve and the second preset static curve are used as valid static curves; If the average brightness value is greater than the second brightness threshold and less than the third brightness threshold, the second preset static curve and the third preset static curve are used as valid static curves.

4. The color compensation method according to claim 3, characterized in that: The step of determining a dynamic contrast curve according to the average brightness value and each of the effective static curves comprises: If the number of each of the valid static curves is not greater than a preset number threshold, taking the valid static curve as a dynamic contrast curve; If the number of each of the valid static curves is greater than the preset number threshold, each of the valid static curves is merged into the dynamic contrast curve according to the first brightness threshold, the second brightness threshold, the third brightness threshold and the average brightness value.

5. The color compensation method according to claim 4, characterized in that: The step of fusing the effective static curves into the dynamic contrast curve according to the first brightness threshold, the second brightness threshold, the third brightness threshold and the average brightness value comprises: According to the average brightness value, selecting a valid brightness threshold from the first brightness threshold, the second brightness threshold, and the third brightness threshold; Determine the static curve action coefficient by obtaining the ratio of the average brightness value to the effective brightness threshold; The static curve action coefficient and the effective brightness threshold are calculated to generate a dynamic contrast curve.

6. The color compensation method according to claim 1, wherein: The step of determining a target gain coefficient curve according to the input brightness value and the output brightness value comprises: If the input brightness value is greater than the output brightness value, the first preset gain curve is used as the target gain coefficient curve; If the input brightness value is less than the output brightness value, the second preset gain curve is used as the target gain coefficient curve; If the input brightness value is equal to the output brightness value, the third preset gain curve is used as the target gain coefficient curve.

7. A color compensation device, characterized in that: The color compensation device comprises: Grayscale statistics module, used to perform grayscale histogram statistics on the current picture to obtain grayscale histogram statistics results; A dynamic contrast module, used to obtain a dynamic contrast curve according to the grayscale histogram statistical result, and set the dynamic contrast value of each pixel point in the current picture according to the dynamic contrast curve; An estimated gain module, used for calculating an estimated chromaticity gain curve according to the dynamic contrast curve; A color compensation module, used to perform color compensation on each pixel point for which the dynamic contrast value has been set, by using the predicted chromaticity gain curve and the preset limit gain curve; Wherein, the predicted gain module is specifically used for: Obtaining an input brightness value and an output brightness value of each pixel point according to the dynamic contrast curve; Determining a target gain coefficient curve according to the input brightness value and the output brightness value; The input brightness value, the output brightness value and the target gain coefficient curve are calculated to obtain an estimated chromaticity gain curve, wherein the input brightness value is Yin, the output brightness value is Yout, the target gain coefficient curve is table_gain, the estimated chromaticity gain curve is chroma_gain, and the preset calculation formula of the estimated chromaticity gain curve is 。 8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the color compensation method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program for implementing the color compensation method, and the program for implementing the color compensation method is executed by a processor to implement the steps of the color compensation method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Image contrast adjustment method and device, terminal equipment and storage medium

    CN110809146A

  • Display device and display method

    CN113015006A