Color correction method, device, equipment and storage medium

By converting the image from RGB color space to uniform color space, obtaining and fusing overflow and truncation data, the problem of color overflow in color correction is solved, more accurate color restoration and image detail enhancement are achieved, and image quality is improved.

CN119071405BActive Publication Date: 2025-09-09VIVO MOBILE COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411068334.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2025-09-09
Estimated Expiration
2044-08-05

AI Technical Summary

Technical Problem

In the prior art, the correction coefficients of the color correction matrix are fixed, resulting in color overflow when processing high-color areas of the image, causing hue shift, loss of image details and color deviation, thereby reducing image quality.

Method used

By converting the image from RGB color space to uniform color space, obtaining overflow and truncation data, and performing data fusion processing, a second image in RGB color space is generated, and the data accuracy of the uniform color space is used to restore the true hue and image details after color correction.

Benefits of technology

While retaining the image hue and brightness, it corrects chroma, restores color levels, enhances the smoothness of color transitions, reduces color deviation, avoids color overflow, and improves image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119071405B_ABST
    Figure CN119071405B_ABST
Patent Text Reader

Abstract

The present application discloses a color correction method, apparatus, device and storage medium, belonging to the field of image processing technology. The method includes obtaining overflow data and truncated data of a first image converted from an RGB color space to a uniform color space, the overflow data being used to represent data actually acquired by an image acquisition device and unable to be displayed by a display device, and the truncated data being used to represent data that can be displayed by the display device; performing data fusion processing on the overflow data and the truncated data to obtain first color data of the first image in the uniform color space, the first color data including first brightness data, first hue data and first chromaticity data; generating a second image in the RGB color space based on the first brightness data, the first hue data and the second chromaticity data, wherein the second image is an image of the first image after color correction, and the second chromaticity data is determined by relative chromaticity data corresponding to the first chromaticity data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and specifically relates to a color correction method, device, equipment and storage medium. Background Art

[0002] Color correction is a common image processing technique in color digital image signal processing (ISP). Its purpose is to make the colors of digital images more realistic and accurate. A color correction matrix (CCM) can be used to perform global image processing, restoring the image to a color gamut that meets the display device or display standard, thereby reducing color bleeding.

[0003] In related technologies, CCM correction coefficients are used to adjust the color representation of an image to compensate for color deviation or distortion when a camera or other image acquisition device captures the image. Because the correction coefficient data is typically fixed, using a higher correction coefficient when processing areas with high RGB pixel data can cause some colors to exceed their color space. After truncation, the image will still exhibit hue shift, loss of image detail, and color deviation. Therefore, the aforementioned method of correcting image color through CCM cannot avoid color overflow, thus reducing image quality. Summary of the Invention

[0004] The purpose of the embodiments of the present application is to provide a color correction method, device and equipment that can avoid color overflow and improve the quality of digital images.

[0005] In a first aspect, an embodiment of the present application provides a color correction method, comprising:

[0006] Acquire overflow data and truncated data of the first image converted from the RGB color space to the uniform color space, wherein the overflow data is used to represent data actually captured by the image capture device and cannot be displayed by the display device, and the truncated data is used to represent data that can be displayed by the display device;

[0007] Performing data fusion processing on the overflow data and the truncated data to obtain first color data of the first image in a uniform color space, where the first color data includes first brightness data, first hue data, and first chromaticity data;

[0008] A second image in an RGB color space is generated according to the first brightness data, the first hue data, and the second chromaticity data, wherein the second image is an image after color correction of the first image, and the second chromaticity data is determined by relative chromaticity data corresponding to the first chromaticity data.

[0009] In a second aspect, an embodiment of the present application provides a color correction device, comprising:

[0010] an acquisition module, configured to acquire overflow data and truncated data resulting from conversion of the first image from the RGB color space to the uniform color space, wherein the overflow data is used to represent data actually acquired by the image acquisition device and that cannot be displayed by the display device, and the truncated data is used to represent data that can be displayed by the display device;

[0011] a processing module, configured to perform data fusion processing on the overflow data and the truncated data to obtain first color data of the first image in a uniform color space, where the first color data includes first brightness data, first hue data, and first chromaticity data;

[0012] A generation module is used to generate a second image in an RGB color space based on the first brightness data, the first hue data, and the second chromaticity data, wherein the second image is an image after color correction of the first image, and the second chromaticity data is determined by the relative chromaticity data corresponding to the first chromaticity data.

[0013] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the color correction method shown in the first aspect are implemented.

[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, which stores a program or instruction. When the program or instruction is executed by a processor, the steps of the color correction method shown in the first aspect are implemented.

[0015] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a display interface, the display interface and the processor are coupled, and the processor is used to run programs or instructions to implement the steps of the color correction method shown in the first aspect.

[0016] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the steps of the color correction method shown in the first aspect.

[0017] In an embodiment of the present application, overflow data and truncated data of the first image converted from the RGB color space to the uniform color space are obtained, the overflow data is used to represent the data actually collected by the image acquisition device and cannot be displayed by the display device, and the truncated data is used to represent the data that can be displayed by the display device. In this way, by converting the first image from the RGB color space to the uniform color space, the accuracy of obtaining the brightness, chromaticity and hue components representing the color can be improved. Compared with direct processing in the RGB color space, processing in the uniform color space can restore more accurate colors; then, data fusion processing is performed on the overflow data and the truncated data to obtain the first color data of the first image in the uniform color space, and the first color data includes first brightness data, first hue data and first hue data. A chromaticity data, therefore, considering that the brightness and hue may shift after overflow and truncation processing, color fusion can be performed based on the overflow data and the truncation data, so that the picture can restore the true hue after color correction and restore image details; then, based on the first brightness data, the first hue data and the second chromaticity data, a second image in the RGB color space is generated, the second image is the image of the first image after color correction, and the second chromaticity data is determined by the relative chromaticity data corresponding to the first chromaticity data. In this way, while retaining the hue and brightness of the first image, its chromaticity is corrected, thereby restoring the color level, enhancing the smoothness of the color transition, restoring the image details, enhancing the accuracy of the restored color, reducing color deviation, avoiding color overflow, and improving image quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A flowchart of a color correction method provided in an embodiment of the present application;

[0019] Figure 2 A schematic diagram of the application process of a color correction method provided in an embodiment of the present application;

[0020] Figure 3 A schematic diagram of a chromaticity mapping curve for a color correction method provided in an embodiment of the present application;

[0021] Figure 4 A schematic diagram of a relative chromaticity probability distribution curve of a color correction method provided in an embodiment of the present application;

[0022] Figure 5 A schematic diagram of a relative chromaticity mapping curve baseline for a color correction method provided in an embodiment of the present application;

[0023] Figure 6 A schematic structural diagram of a color correction device provided in an embodiment of the present application;

[0024] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0025] Figure 8 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.

[0027] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0028] During digital image acquisition and processing, various factors, such as lighting conditions, sensor color response, and color space conversion, may cause image color distortion. Therefore, it is necessary to perform color correction on the image to restore it to the color gamut that meets the display device or display standard to reduce color overflow.

[0029] During color correction, a 3x3 color correction matrix can be used to globally process the image. However, because the correction coefficients of a 3x3 color correction matrix are typically fixed, using higher correction coefficients in areas with high RGB pixel data can cause some colors to exceed their corresponding color space. This can still cause hue shift, loss of image detail, and color deviation. Therefore, using CCM to correct image color cannot prevent color overflow, which degrades image quality.

[0030] In order to solve the problems in the related art, the embodiments of the present application provide a color correction method, device, equipment and storage medium, which can alleviate the color distortion in the image through color overflow protection for the common overflow situation after color correction.

[0031] Based on this, the following Figures 1 to 6 , the color correction method provided in the embodiment of the present application is described in detail through specific embodiments and their application scenarios.

[0032] First, combine Figure 1 A color correction method provided in an embodiment of the present application is described in detail.

[0033] Figure 1 A flowchart of a color correction method provided in an embodiment of the present application.

[0034] like Figure 1 As shown, the color correction method provided in the embodiment of the present application can be applied to electronic devices. Based on this, the color correction method can include the following steps:

[0035] Step 110, obtaining overflow data and truncated data of the first image converted from the RGB color space to the uniform color space, the overflow data being used to represent data actually captured by the image capture device and unable to be displayed by the display device, and the truncated data being used to represent data that can be displayed by the display device; Step 120, performing data fusion processing on the overflow data and the truncated data to obtain first color data of the first image in the uniform color space, the first color data including first brightness data, first hue data, and first chromaticity data; Step 130, generating a second image in the RGB color space based on the first brightness data, the first hue data, and the second chromaticity data, wherein the second image is an image of the first image after color correction, and the second chromaticity data is determined by the relative chromaticity data corresponding to the first chromaticity data.

[0036] In this way, by converting the first image from the RGB color space to the uniform color space, the accuracy of obtaining the brightness, chromaticity, and hue components that represent the color can be improved. Compared with direct processing in the RGB color space, processing in the uniform color space can restore more accurate colors. In addition, considering that the brightness and hue may shift after overflow and truncation processing, color fusion can be performed based on the overflow data and the truncation data, so that the picture can restore the true hue after color correction and restore image details. In this way, while retaining the hue and brightness of the first image, its chromaticity is corrected, thereby restoring the color hierarchy, enhancing the smoothness of color transitions, restoring image details, enhancing the accuracy of color restoration, reducing color deviation, avoiding color overflow, and improving image quality.

[0037] It should be noted that the embodiments of the present application specifically relate to a solution for color overflow protection in color correction, that is, it can repair the overflow phenomenon caused by the color being truncated in the RGB color space after the color exceeds the color gamut during the color correction process. Figure 2As shown, the color correction method provided in the embodiments of this application can be applied to the ISP process after RGB demosaicing and before linear domain processing. While optimizing the ISP process, it can restore image details, enhance color gradation, and improve image quality. Furthermore, it can also be used for color correction in multimedia data image processing and display video processing. In this way, the CCM-based image color correction method can be combined with the color overflow protection step to avoid color overflow and improve image quality.

[0038] The above steps are described in detail below.

[0039] First, involving step 110, the color space conversion involved in the embodiments of the present application refers to converting or representing the color data of an image from one color space into corresponding color data in another color space, for example, converting or representing the color data of an image from an RGB color space into corresponding color data in an XYZ color space.

[0040] Furthermore, the image acquisition device and display device in the embodiments of the present application can be the same device, such as an electronic device, a camera, or other device that has the function of capturing images and processing image data. For example, the image acquisition device can be a camera of an electronic device, and the display device can be a display screen of the electronic device. Alternatively, the image acquisition device and display device in the embodiments of the present application can be different devices, such as a camera and a computer.

[0041] Based on this, step 110 may specifically include two processes of obtaining overflow data and obtaining truncated data, which are described below respectively.

[0042] In some embodiments of the present application, overflow data may be obtained through steps 1101 and 1102, as shown below.

[0043] Step 1101: convert a first image from an RGB color space to an XYZ color space.

[0044] Step 1102 : Process the data of the first image converted from the XYZ color space to the uniform color space using a color correction algorithm to obtain overflow data of the first image in the uniform color space.

[0045] The color correction algorithm includes but is not limited to a white balance correction algorithm, CCM and other color correction algorithms applicable to the RGB color space.

[0046] The overflow data in the embodiment of the present application may include data that exceeds the channel range of the current color space after the color space conversion. Taking the color correction algorithm as an example, the following describes the process of converting the first image from the XYZ color space to the uniform color space and performing data processing to obtain the overflow data of the first image in the uniform color space.

[0047] Exemplarily, in the process of converting the first image from the matrix operation of the RGB color space to the matrix operation on the XYZ color space, and converting the first image from the matrix operation of the XYZ color space to the matrix operation of the uniform color space through CCM processing, data that exceeds the upper limit of the three-channel range of the RGB color space (for example, the upper limit of an 8-bit image is 255) and cannot be converted to the uniform color space is determined as overflow data.

[0048] It should be noted that since the CCM processing process is based on the RGB color space, the color data in the RGB color space, such as the three-channel data of red (R), green (G), and blue (B), will exceed the upper limit of the three-channel range of the RGB color space (for example, the upper limit of an 8-bit image is 255) when undergoing CCM processing. The RGB three-channel data that exceeds the upper limit cannot be converted to a uniform color space. Therefore, in order to retain these data that may exceed the upper limit, the embodiment of the present application converts the first image from the RGB color space to the XYZ color space before performing CCM processing. In this way, the data converted from the XYZ color space to the uniform color space can retain the information of the original image as much as possible.

[0049] In other embodiments of the present application, the truncated data may be obtained through steps 1103 to 1105 , as specifically shown below.

[0050] Step 1103 : Convert the first image from the RGB color space to the XYZ color space using a color correction algorithm and perform data processing to obtain first truncated data of the first image within the three-channel range of the RGB color space.

[0051] Step 1104 : Convert the first image from the XYZ color space to a uniform color space to obtain second truncated data of the first image in the XYZ color space.

[0052] Step 1105 : Generate truncated data of the first image in a uniform color space based on the first truncated data and the second truncated data.

[0053] Among them, if it cannot be displayed on the display device of the corresponding color gamut after each color space conversion, it exceeds the original data bit width for the hardware and cannot be stored. At this time, the overflow data can be truncated based on the channel range of the converted color space, that is, the data within the channel range of the converted color space is used as the truncated data.

[0054] For example, the first image can be converted from the RGB color space to the XYZ color space through color space conversion, and then the first image can be converted from the XYZ color space to the uniform color space. Therefore, CCM can also be divided into two steps: RGB to XYZ space and XYZ to uniform color space. For the matrix operation of color space conversion, it can be shown as the following formula (1):

[0055] M ccm =M RGB2XYZ *M XYZ2LCH (1)

[0056] Among them, LCH is used to represent the uniform color space, that is, to obtain three-channel data consisting of brightness (L), chroma (C), and hue (H); M is the matrix in matrix operation, and its full name is Matrix.

[0057] In this way, data of an image that conforms to human eye perception can be retained by extracting and truncating the data.

[0058] Therefore, the above steps can obtain the brightness, chromaticity and hue components representing the color by converting the RGB color space before and after matrix correction to a uniform color space. Compared with processing in the RGB color space, processing in the uniform color space can restore more accurate colors in the first image.

[0059] Next, involving step 120, the overflow data in the embodiment of the present application includes first fused brightness data, first fused hue data and first fused chromaticity data of the first image in a uniform color space; the truncated data includes second fused brightness data, second fused hue data and second fused chromaticity data of the first image in a uniform color space.

[0060] Based on this, the embodiment of the present application provides the following data fusion processing process shown in steps 1201 to 1203.

[0061] Step 1201: Perform weighted summation on the first fused brightness data and the second fused brightness data to obtain first brightness data.

[0062] Specifically, the first fused luminance data and the second fused luminance data are weighted and summed using a first preset weight set to obtain the first luminance data, wherein the first preset weight set may include a first weight value and a second weight value.

[0063] For example, the first brightness data L3 can be calculated by the following formula (2):

[0064] L3=L1*W1+L2*W2 (2)

[0065] Among them, L1 is the first fused brightness data, W1 is the first weight value, L2 is the second fused brightness data, and W2 is the second weight value.

[0066] Step 1202 : Perform weighted summation on the first fused hue data and the second fused hue data to obtain first hue data.

[0067] Specifically, the first fused hue data and the second fused hue data are weighted and summed using a second preset weight set, to obtain the first hue data. The second preset weight set may include a third weight value and a fourth weight value.

[0068] For example, the first hue data H3 can be calculated using the following formula (3):

[0069] H3=H1*W3+H2*W4 (2)

[0070] Among them, H1 is the first fused hue data, W3 is the third weight value, H2 is the second fused hue data, and W4 is the fourth weight value.

[0071] Step 1203: Filter the first chromaticity data from the first fused chromaticity data and the second fused hue data.

[0072] Here, the first fused chromaticity data may be determined as the first chromaticity data, namely, C.

[0073] Thus, in the embodiment of the present application, the first color data can be represented by (L3, C, H3).

[0074] It should be noted that, since the first color data may include first brightness data, first hue data and first chromaticity data, the above steps 1201 to 1203 may be executed in parallel or sequentially, and the order of execution is not limited in the embodiments of the present application.

[0075] Therefore, when converting the first image from the RGB color space to the LCH color space using the color correction algorithm, considering that brightness and hue may shift after overflow and truncation, with respect to hue, based on color style requirements, weighted fusion is performed on the hue data in the overflow data and the truncation data using the weight values ​​in the second preset weight set. Furthermore, to ensure that the processed second image does not lose brightness details due to overexposure, the brightness data in the overflow data and the truncation data are weighted fused using the weight values ​​in the first preset weight set. This maintains high chroma while also repairing detail lost due to brightness overflow. While satisfying people's demand for rich colors in photographs, it also optimizes details in high-brightness and high-saturation areas, resulting in a far richer perceived detail in the image than before optimization. This allows the image to restore its true hue after color correction and restore image details.

[0076] Furthermore, in the embodiment of the present application, before executing step 130, it is necessary to determine the second chromaticity data to generate a second image in the RGB color space. Therefore, before step 130, the color correction method provided in the embodiment of the present application may also include a method for determining the second chromaticity data.

[0077] Here, the embodiments of the present application provide the following two methods for determining the second chromaticity data based on different application scenarios of the color correction method, which are described in detail below.

[0078] In some embodiments of the present application, since the color correction method provided by the embodiment of the present application can be applied to scenarios of multi-frame image processing of display videos, such as edge detection, object recognition, etc., correcting the image only by CCM will cause color overflow, causing the channel data of the RGB color space to exceed the dynamic range, resulting in data loss. Therefore, the embodiment of the present application repairs the color overflow caused by CCM from the perspective of chromaticity. By fusing brightness and hue, some image details can be restored. Then, considering that the transition in chromaticity affects the subjective effect more, in this embodiment, the chromaticity mapping can ignore statistics and directly use the chromaticity mapping curve for adjustment. In this way, the second chromaticity data is determined by the relative chromaticity data corresponding to the first chromaticity data. The color correction method provided by the embodiment of the present application can also include steps 1401 and 1402.

[0079] Step 1401: Obtain first relative chromaticity data corresponding to first chromaticity data according to a chromaticity mapping curve, wherein the chromaticity mapping curve represents a mapping relationship between chromaticity data of an image converted from an RGB color space to the uniform color space and relative chromaticity data of the image in the uniform color space.

[0080] For example, Figure 3As shown, the horizontal coordinate of the chromaticity mapping curve can be the value corresponding to the first chromaticity data, and the first chromaticity data C is matched on the horizontal coordinate of the chromaticity mapping curve. The first relative chromaticity value of C on the vertical coordinate can be obtained through the chromaticity mapping curve. For example, if the first relative chromaticity data C is C1 on the horizontal coordinate of the chromaticity mapping curve, then the first relative chromaticity data corresponding to the first chromaticity data is R1.

[0081] Step 1402: Determine the first relative chromaticity data as the second chromaticity data.

[0082] Exemplarily, still taking the example shown in the above step 1401, the first relative chromaticity data R1 is the second chromaticity data.

[0083] Therefore, the embodiment of the present application can appropriately reduce the demand for color transition in an artificial intelligence (AI) pre-processing scenario when the original first image undergoes basic processing without considering the optimization of human eye details. Therefore, the color overflow protection effect can be obtained with relatively less computing overhead, that is, the first relative chromaticity data determined by the chromaticity mapping curve can be directly determined as absolute chromaticity data, that is, the second chromaticity data. In this way, compared with traditional processing in the RGB color space, this step can restore more effective information, which is beneficial to AI processing and improves image quality.

[0084] In other embodiments of the present application, different from the aforementioned method of determining the second chromaticity data based only on the relative chromaticity data corresponding to the first chromaticity data, the second chromaticity data is jointly determined by the relative chromaticity data corresponding to the first chromaticity data and the first color gamut boundary data corresponding to the first brightness data and the first hue data. Based on this, the color correction method provided in the embodiments of the present application may also include the above-mentioned steps 1401, 1403 and 1404.

[0085] Step 1401: Obtain first relative chromaticity data corresponding to the first chromaticity data based on a chromaticity mapping curve. Based on step 1401, it can be seen that the chromaticity mapping curve represents a mapping relationship between the chromaticity data of an image converted from an RGB color space to the uniform color space and the relative chromaticity data of the image in the uniform color space.

[0086] For example, Figure 3As shown, the abscissa of the chromaticity mapping curve can be a value corresponding to the first chromaticity data. The abscissa of the chromaticity mapping curve matches the first chromaticity data C. The chromaticity mapping curve can be used to obtain a first relative chromaticity value of C on the ordinate. For example, if the first relative chromaticity data C is C1 on the abscissa of the chromaticity mapping curve, then the first relative chromaticity data corresponding to the first chromaticity data is R1. Step 1403: Based on the association information between the luminance data, the hue data, and the color gamut boundary data, first color gamut boundary data corresponding to the first luminance data and the first hue data is obtained.

[0087] Specifically, the first color gamut boundary data corresponding to the first brightness data and the first hue data may be acquired through a two-dimensional interpolation algorithm according to association information between the brightness data, the hue data and the color gamut boundary data.

[0088] For example, common color spaces have a certain boundary range. Color data outside this range is considered to overflow and cannot be displayed on devices with the corresponding color gamut. For each fixed brightness and hue, there is a corresponding color gamut boundary (C-boundary). Therefore, based on the fused first brightness data and first hue data, to ensure that the maximum absolute chromaticity remains the maximum chromaticity, it is necessary to search the color gamut boundary data in the associated information for the maximum absolute chromaticity corresponding to the first brightness data and the first hue data.

[0089] Step 1404: Generate second chromaticity data based on the first color gamut boundary data and the first relative chromaticity data.

[0090] For example, if the first chromaticity data C is 1.4, the first relative chromaticity data 0.9 corresponding to the first chromaticity data is obtained through the chromaticity mapping curve. Then, if the first color gamut boundary data is 0.345, the second chromaticity data can be 0.345*0.9.

[0091] Therefore, the color fusion process based on color gamut boundary data provided in the embodiment of the present application takes into account the problem that brightness and hue may be offset after overflow truncation, and uses the correlation information of brightness data and hue data with color gamut boundary data as the basis for color fusion, which can further restore the true hue of the image after color correction and restore image details.

[0092] It should be noted that the chromaticity mapping curve that appears in the above steps and the association information of brightness data, hue data and color gamut boundary data are all generated in advance before step 1401. Based on this, the embodiment of the present application provides the steps of generating the chromaticity mapping curve and the process of generating the association information, as shown below.

[0093] In some embodiments of the present application, before step 1401, a chromaticity mapping curve may be generated through steps 1501 and 1502 provided in the embodiments of the present application.

[0094] Step 1501: construct a relative chromaticity probability distribution curve based on the data distribution of sample chromaticity data of the image in the uniform color space. The relative chromaticity probability distribution curve is used to represent the correspondence between the relative chromaticity data of the image in the uniform color space and a preset quantity.

[0095] For example, Figure 4 As shown in the figure, the chromaticity can be normalized through the chromaticity boundary. Based on the differences in the color distribution range of different hues, the relative chromaticity proportion under different brightness and the impact on the compression weight, the relative chromaticity distribution of the image can be statistically processed through weighted data. During the period, adjustments are made based on factors such as brightness, maximum chromaticity, and absolute maximum chromaticity boundary to obtain the relative chromaticity distribution curve within the specified relative chromaticity interval under the corresponding hue, where, Figure 4 The horizontal axis of the middle curve is the relative chromaticity data, and the vertical axis is the preset quantity P, expressed in percentage.

[0096] Among them, the chromaticity boundary is equivalent to converting the color gamut boundary from the RGB color space domain to the LCH color space, and then by fixing L and H, the boundary becomes the value of C. If C ≤ boundary, it is in the color gamut space, otherwise it is outside.

[0097] Step 1502: Adjust the relative chromaticity probability distribution curve based on the control data of the preset chromaticity distribution curve and the preset relative chromaticity protection interval data to obtain a chromaticity mapping curve; wherein the chromaticity mapping curve is used to represent the mapping relationship between the chromaticity data of the image converted from the RGB color space to the uniform color space and the relative chromaticity data of the image in the uniform color space.

[0098] Specifically, step 1502 may include step 15021 and step 15022.

[0099] Step 15021: Generate a relative chromaticity mapping curve baseline based on the preset chromaticity distribution curve control data and the preset relative chromaticity protection interval data.

[0100] For example, based on Figure 4 The curve settings P1, P2, P3 are shown in the figure, and appropriate control points C1, C2, and C3 are selected. The statistical object is the number greater than the preset relative chromaticity protection interval data, namely C-th, and the number smaller than C-th is not considered. Then, based on the established C-th and R1, R2, and R3, the corresponding chromaticity mapping curve benchmark is obtained, as shown below. Figure 5 The relative colorimetric mapping curve baseline is shown.

[0101] Step 15022: Smooth the relative chromaticity mapping curve baseline to obtain a chromaticity mapping curve.

[0102] For example, based on the benchmark of the relative chromaticity mapping curve, a mapping curve is generated by combining a Bezier curve or a spline function, and then based on the standard control curve, both the lifting and the suppression are controlled to obtain a chromaticity mapping curve. Figure 6 shown.

[0103] Here, by setting a standard control curve, the values ​​above and below the baseline curve use preset fusion rates respectively, which can effectively suppress the excessive increase of non-overflow chromaticity while retaining the gradual decrease of overflow chromaticity, so that the affected data without overflow can be closer to the original optimization target.

[0104] In some embodiments of the present application, before step 1403, association information of brightness data, hue data and color gamut boundary data may be generated through steps 1503 to 1507 provided in the embodiments of the present application.

[0105] Step 1503 : Obtain N sample color data of the image in a uniform color space, where the sample color data includes sample brightness data, sample chromaticity data, and sample hue data.

[0106] Step 1504: convert the image from the uniform color space to the RGB color space.

[0107] Step 1505 : Generate a color gamut for each of the N sample color data according to a first color gamut in the RGB color space that matches the i-th sample color data among the N sample color data.

[0108] Step 1506: Generate sample color gamut boundary data of the color gamut according to the color gamut of each sample color data.

[0109] Step 1507 : Associating the sample brightness data and sample hue data in the i-th sample color data with the sample color gamut boundary data of the first color gamut to obtain association information between the brightness data and the hue data and the color gamut boundary data.

[0110] For example, the color gamut boundary can be determined by converting LCH into RGB values, then performing a hierarchical and precision-based cyclic calculation based on brightness and hue. The values ​​are then stored in a memory with brightness and hue as directory values ​​and C-boundary as content values. Two-dimensional interpolation is then used to find the maximum value of the color gamut boundary at each hue, called the cusp value, and the brightness corresponding to the maximum chromaticity is called the cusp brightness. By looping through the values ​​of C corresponding to different L and H values, the RGB values ​​are converted to values ​​that are just inside or outside the boundaries, thus obtaining the color gamut boundary in the LCH uniform color space.

[0111] Therefore, by compressing and controlling the chromaticity that overflows the color gamut, the color hierarchy can be restored while retaining the hue and brightness of the color, thereby enhancing the smoothness of the color transition.

[0112] Then, in step 130, in order to facilitate the display of the color-corrected image, after determining the three-channel data of the image in the uniform color space, it can be converted from the uniform color space to the RGB color space so that it can be displayed on the display device. Based on this, step 130 can include steps 1301 and 1302.

[0113] Step 1301 : Generate second color data of a first image in a uniform color space according to first brightness data, first hue data, and second chromaticity data.

[0114] Step 1302: Based on the second color data, convert the first image from the uniform color space to the RGB color space to obtain a second image in the RGB color space.

[0115] Exemplarily, based on the second color data, the image is converted into a color space and outputted into an RGB color space. Thus, the second image can be displayed according to the RGB three-channel data converted from the second color data into the RGB color space.

[0116] In this way, while retaining the hue and brightness of the first image, its chroma is corrected, thereby restoring the color hierarchy, enhancing the smoothness of color transition, restoring image details, enhancing the accuracy of color restoration, reducing color deviation, avoiding color overflow, and improving image quality.

[0117] In addition, the color correction method provided in the embodiment of the present application can effectively enrich the details of the image and restore pixel information that originally exceeded the dynamic range, which is beneficial to the operation of subsequent AI algorithms. In the AI ​​pre-processing scenario, in order to pursue higher processing efficiency, the various color spaces in the embodiment of the present application can be replaced with a simple color space with one brightness channel, such as YUV color space, YIQ color space, HSV color space, etc.

[0118] The color correction method provided in the embodiment of the present application can be performed by a color correction device. In the embodiment of the present application, the color correction device is used as an example to illustrate the device of the color correction method provided in the embodiment of the present application.

[0119] Based on the same inventive concept, the present application also provides a color correction device. Figure 6 Provide detailed explanation.

[0120] Figure 6A schematic structural diagram of a color correction device provided in an embodiment of the present application.

[0121] like Figure 6 As shown, the color correction device 60 can be applied to electronic devices, and the color correction device 60 can specifically include:

[0122] An acquisition module 601 is configured to acquire overflow data and truncated data resulting from conversion of a first image from an RGB color space to a uniform color space, wherein the overflow data is used to represent data actually acquired by an image acquisition device and that cannot be displayed by a display device, and the truncated data is used to represent data that can be displayed by a display device;

[0123] A processing module 602 is configured to perform data fusion processing on the overflow data and the truncated data to obtain first color data of the first image in a uniform color space, where the first color data includes first brightness data, first hue data, and first chromaticity data;

[0124] The generating module 603 is configured to generate a second image in an RGB color space based on the first brightness data, the first hue data, and the second chromaticity data, wherein the second image is a color-corrected image of the first image, and the second chromaticity data is determined by relative chromaticity data corresponding to the first chromaticity data.

[0125] The color correction device 60 in the embodiment of the present application is described in detail below, as shown below.

[0126] In some embodiments of the present application, the color correction device 60 in the embodiment of the present application further includes a conversion module for converting the first image from the RGB color space to the XYZ color space;

[0127] Data processing is performed on the data of the first image converted from the XYZ color space to the uniform color space by using a color correction algorithm to obtain overflow data of the first image in the uniform color space.

[0128] In some embodiments of the present application, the color correction device 60 in the embodiment of the present application further includes a conversion module for converting the first image from the RGB color space to the XYZ color space using a color correction algorithm and performing data processing to obtain first truncated data of the first image within the three-channel range of the RGB color space;

[0129] The conversion module may also be used to convert the first image from the XYZ color space to the uniform color space to obtain second truncated data of the first image in the XYZ color space;

[0130] The generating module 603 may also be configured to generate truncated data of the first image in a uniform color space based on the first truncated data and the second truncated data.

[0131] In some embodiments of the present application, the processing module 602 may be specifically configured to, when the overflow data includes first fused luminance data, first fused hue data, and first fused chrominance data of the first image in a uniform color space; and the truncated data includes second fused luminance data, second fused hue data, and second fused chrominance data of the first image in a uniform color space, perform weighted summation on the first fused luminance data and the second fused luminance data to obtain first luminance data;

[0132] Performing weighted summation on the first fused hue data and the second fused hue data to obtain first hue data;

[0133] And, the first chromaticity data is filtered from the first fused chromaticity data and the second fused hue data.

[0134] In some embodiments of the present application, the acquisition module 601 may also be configured to acquire first relative chromaticity data corresponding to the first chromaticity data according to the chromaticity mapping curve;

[0135] The color correction device 60 in the embodiment of the present application further includes a determination module, configured to determine the first relative chromaticity data as the second chromaticity data.

[0136] In some embodiments of the present application, the acquisition module 601 may further be configured to, when the second chromaticity data is further determined by the first color gamut boundary data corresponding to the first luminance data and the first hue data, acquire the first color gamut boundary data corresponding to the first luminance data and the first hue data according to the association information between the luminance data and the hue data and the color gamut boundary data;

[0137] The generating module 603 may also be configured to generate second chromaticity data based on the first color gamut boundary data and the first relative chromaticity data.

[0138] In some embodiments of the present application, the color correction device 60 in the embodiment of the present application further includes a construction module for constructing a relative chromaticity probability distribution curve based on the data distribution of the sample chromaticity data of the image in the uniform color space, wherein the relative chromaticity probability distribution curve is used to represent the correspondence between the relative chromaticity data of the image in the uniform color space and a preset quantity;

[0139] The color correction device 60 in the embodiment of the present application further includes an adjustment module for adjusting the relative chromaticity probability distribution curve according to the control data of the preset chromaticity distribution curve and the preset relative chromaticity protection interval data to obtain a chromaticity mapping curve;

[0140] The chromaticity mapping curve is used to represent the mapping relationship between the chromaticity data of the image converted from the RGB color space to the uniform color space and the relative chromaticity data of the image in the uniform color space.

[0141] In some embodiments of the present application, the acquisition module 601 may also be used to acquire N sample color data of the image in a uniform color space, where the sample color data includes sample brightness data, sample chromaticity data, and sample hue data;

[0142] The color correction device 60 in the embodiment of the present application further includes a conversion module for converting the image from a uniform color space to an RGB color space;

[0143] The generating module 603 may also be configured to generate a color gamut of each of the N sample color data according to a first color gamut in the RGB color space that matches the i-th sample color data in the N sample color data;

[0144] The generating module 603 may also be used to generate sample color gamut boundary data of the color gamut according to the color gamut of each sample color data;

[0145] The color correction device 60 in the embodiment of the present application also includes an association module for associating the sample brightness data and sample hue data in the i-th sample color data with the sample color gamut boundary data of the first color gamut to obtain association information between the brightness data and hue data and the color gamut boundary data.

[0146] In some embodiments of the present application, the generating module 603 may further be configured to generate second color data of the first image in a uniform color space based on the first brightness data, the first hue data, and the second chromaticity data;

[0147] The color correction device 60 in the embodiment of the present application further includes a conversion module for converting the first image from a uniform color space to an RGB color space based on the second color data to obtain a second image in the RGB color space.

[0148] The color correction device in the embodiment of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or chip. The electronic device can be a terminal or other device other than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc. It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not specifically limit it.

[0149] The color correction device in the embodiment of the present application can be a device having an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0150] The device coordination apparatus provided in the embodiment of the present application can achieve Figures 1 to 5 The various processes implemented in the color correction method embodiment shown achieve the same technical effect, and will not be described again here to avoid repetition.

[0151] Based on this, the color correction device provided by the embodiment of the present application can be used to obtain overflow data and truncated data of the first image converted from the RGB color space to the uniform color space, the overflow data is used to represent the data actually collected by the image acquisition device and cannot be displayed by the display device, and the truncated data is used to represent the data that the display device can display. In this way, by converting the first image from the RGB color space to the uniform color space, the accuracy of obtaining the brightness, chromaticity and hue components representing the color can be improved. Compared with direct processing in the RGB color space, processing in the uniform color space can restore more accurate colors; then, the overflow data and the truncated data are subjected to data fusion processing to obtain the first color data of the first image in the uniform color space, and the first color data includes first brightness data, first chromaticity and hue components. The invention provides a hue data and a first chromaticity data. Therefore, considering that the brightness and hue may be offset after overflow and truncation processing, color fusion can be performed based on the overflow data and the truncation data, so that the picture can restore the true hue after color correction and restore image details; then, according to the first brightness data, the first hue data and the second chromaticity data, a second image in the RGB color space is generated. The second image is the image of the first image after color correction, and the second chromaticity data is determined by the relative chromaticity data corresponding to the first chromaticity data. In this way, while retaining the hue and brightness of the first image, its chromaticity is corrected, thereby restoring the color level, enhancing the smoothness of the color transition, restoring the image details, enhancing the accuracy of the restored color, reducing color deviation, avoiding color overflow, and improving image quality.

[0152] Optional, such as Figure 7 As shown, an embodiment of the present application further provides an electronic device 70, including a processor 701 and a memory 702, wherein the memory 702 stores a program or instruction that can be run on the processor 701. When the program or instruction is executed by the processor 701, the various steps of the above-mentioned color correction method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0153] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0154] Figure 8 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.

[0155] The electronic device 800 includes but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, a processor 810 and other components.

[0156] Those skilled in the art will understand that the electronic device 800 may also include a power source (such as a battery) to power each component, and the power source may be logically connected to the processor 810 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system. Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be repeated here.

[0157] In an embodiment of the present application, the processor 810 is used to obtain overflow data and truncated data when converting the first image from the RGB color space to the uniform color space. The overflow data is used to represent the data actually captured by the image acquisition device and cannot be displayed by the display device, and the truncated data is used to represent the data that can be displayed by the display device. The processor 810 can also be used to perform data fusion processing on the overflow data and the truncated data to obtain first color data of the first image in the uniform color space, where the first color data includes first brightness data, first hue data, and first chromaticity data. The processor 810 can also be used to generate a second image in the RGB color space based on the first brightness data, the first hue data, and the second chromaticity data, where the second image is the image of the first image after color correction, and the second chromaticity data is determined by the relative chromaticity data corresponding to the first chromaticity data.

[0158] The electronic device 800 is described in detail below, as shown below.

[0159] In some embodiments of the present application, the processor 810 is configured to convert the first image from an RGB color space to an XYZ color space;

[0160] Data processing is performed on the data of the first image converted from the XYZ color space to the uniform color space by using a color correction algorithm to obtain overflow data of the first image in the uniform color space.

[0161] In some embodiments of the present application, the processor 810 is configured to convert the first image from the RGB color space to the XYZ color space using a color correction algorithm, and perform data processing to obtain first truncated data of the first image within a three-channel range of the RGB color space;

[0162] Converting the first image from the XYZ color space to a uniform color space to obtain second truncated data of the first image in the XYZ color space;

[0163] Based on the first truncated data and the second truncated data, truncated data of the first image in a uniform color space is generated.

[0164] In some embodiments of the present application, the processor 810 is configured to, when the overflow data includes first fused luminance data, first fused hue data, and first fused chrominance data of the first image in a uniform color space, and the truncated data includes second fused luminance data, second fused hue data, and second fused chrominance data of the first image in the uniform color space, perform weighted summation on the first fused luminance data and the second fused luminance data to obtain first luminance data;

[0165] Performing weighted summation on the first fused hue data and the second fused hue data to obtain first hue data;

[0166] And, the first chromaticity data is filtered from the first fused chromaticity data and the second fused hue data.

[0167] In some embodiments of the present application, the processor 810 is configured to obtain first relative chromaticity data corresponding to the first chromaticity data according to the chromaticity mapping curve;

[0168] The first relative chromaticity data is determined as second chromaticity data.

[0169] In some embodiments of the present application, the processor 810 is configured to, when the second chromaticity data is further determined by the first color gamut boundary data corresponding to the first luminance data and the first hue data, obtain the first color gamut boundary data corresponding to the first luminance data and the first hue data according to association information between the luminance data and the hue data and the color gamut boundary data;

[0170] Second chromaticity data is generated based on the first color gamut boundary data and the first relative chromaticity data.

[0171] In some embodiments of the present application, the processor 810 is configured to construct a relative chromaticity probability distribution curve based on the data distribution of sample chromaticity data of the image in the uniform color space, where the relative chromaticity probability distribution curve is used to represent the correspondence between the relative chromaticity data of the image in the uniform color space and a preset quantity;

[0172] According to the control data of the preset chromaticity distribution curve and the preset relative chromaticity protection interval data, the relative chromaticity probability distribution curve is adjusted to obtain a chromaticity mapping curve;

[0173] The chromaticity mapping curve is used to represent the mapping relationship between the chromaticity data of the image converted from the RGB color space to the uniform color space and the relative chromaticity data of the image in the uniform color space.

[0174] In some embodiments of the present application, the processor 810 is configured to obtain N sample color data of an image in a uniform color space, where the sample color data includes sample brightness data, sample chromaticity data, and sample hue data;

[0175] Convert the image from uniform color space to RGB color space;

[0176] Generate a color gamut for each of the N sample color data according to a first color gamut matching the i-th sample color data in the N sample color data in the RGB color space;

[0177] Generate sample color gamut boundary data of the color gamut according to the color gamut of each sample color data;

[0178] The sample brightness data and the sample hue data in the i-th sample color data are associated with the sample color gamut boundary data of the first color gamut to obtain association information between the brightness data and the hue data and the color gamut boundary data.

[0179] In some embodiments of the present application, the processor 810 is configured to generate second color data of the first image in a uniform color space based on the first brightness data, the first hue data, and the second chromaticity data;

[0180] Based on the second color data, the first image is converted from a uniform color space to an RGB color space to obtain a second image in the RGB color space.

[0181] It should be understood that the input unit 804 may include a graphics processing unit (GPU) 8041 and a microphone 8042, and the graphics processor 8041 processes the image data of the static image or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 806 may include a display panel, and the display panel may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 807 includes a touch panel 8071 and at least one of the other input devices 8072. The touch panel 8071 is also called a touch screen. The touch panel 8071 may include two parts: a touch detection device and a touch display. Other input devices 8072 may include but are not limited to a physical keyboard, function keys (such as a volume display button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0182] The memory 809 can be used to store software programs and various data. The memory 809 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 809 may include volatile memory or non-volatile memory, or the memory 809 may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 809 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0183] Processor 810 may include one or more processing units. Optionally, processor 810 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless display signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 810.

[0184] The embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned color correction method embodiment is implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0185] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0186] In addition, an embodiment of the present application further provides a chip, which includes a processor and a display interface. The display interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-mentioned color correction method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0187] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0188] An embodiment of the present application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above-mentioned color correction method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0189] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0190] Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of the present application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in reverse order depending on the functions involved. For example, the methods described may be performed in an order different from that described, and various steps may be added, omitted, or combined. Furthermore, features described with reference to certain examples may be combined in other examples.

[0191] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0192] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. A color correction method, characterized in that: include: Acquire overflow data and truncated data of the first image converted from the RGB color space to the uniform color space, wherein the overflow data is used to represent data actually captured by the image capture device and cannot be displayed by the display device, and the truncated data is used to represent data that can be displayed by the display device; performing data fusion processing on the overflow data and the truncated data to obtain first color data of the first image in the uniform color space, where the first color data includes first brightness data, first hue data, and first chromaticity data; A second image in the RGB color space is generated based on the first brightness data, the first hue data, and the second chromaticity data, wherein the second image is an image after color correction of the first image, and the second chromaticity data is determined by relative chromaticity data corresponding to the first chromaticity data.

2. The method according to claim 1, characterized in that The obtaining of overflow data and truncated data of the first image converted from the RGB color space to the uniform color space includes: converting the first image from the RGB color space to an XYZ color space; Data processing is performed on the data of the first image converted from the XYZ color space to the uniform color space using a color correction algorithm to obtain overflow data of the first image in the uniform color space.

3. The method according to claim 1, characterized in that The obtaining of overflow data and truncated data of the first image converted from the RGB color space to the uniform color space includes: Converting the first image from the RGB color space to the XYZ color space using a color correction algorithm and performing data processing on the first image to obtain first truncated data of the first image within a three-channel range of the RGB color space; Converting the first image from the XYZ color space to the uniform color space to obtain second truncated data of the first image in the XYZ color space; Based on the first truncated data and the second truncated data, truncated data of the first image in the uniform color space is generated.

4. The method according to claim 1, wherein The overflow data includes first fused brightness data, first fused hue data, and first fused chrominance data of the first image in the uniform color space; the truncated data includes second fused brightness data, second fused hue data, and second fused chrominance data of the first image in the uniform color space; The performing data fusion processing on the overflow data and the truncated data to obtain first color data of the first image in the uniform color space includes: performing a weighted summation on the first fused luminance data and the second fused luminance data to obtain the first luminance data; Performing a weighted summation on the first fused hue data and the second fused hue data to obtain the first hue data; And, the first chromaticity data is filtered from the first fused chromaticity data and the second fused hue data.

5. The method according to claim 1, wherein Before generating the second image in the RGB color space according to the first brightness data, the first hue data, and the second chromaticity data, the method further includes: Acquire, according to a chromaticity mapping curve, first relative chromaticity data corresponding to the first chromaticity data; The first relative chromaticity data is determined as the second chromaticity data.

6. The method according to claim 1, characterized in that The second chromaticity data is further determined by first color gamut boundary data corresponding to the first brightness data and the first hue data; Before generating the second image in the RGB color space according to the first brightness data, the first hue data, and the second chromaticity data, the method further includes: Acquire, according to a chromaticity mapping curve, first relative chromaticity data corresponding to the first chromaticity data; acquiring first color gamut boundary data corresponding to the first brightness data and the first hue data according to association information between the brightness data, the hue data, and the color gamut boundary data; The second chromaticity data is generated based on the first color gamut boundary data and the first relative chromaticity data.

7. The method according to claim 5, characterized in that The method further comprises: constructing a relative chromaticity probability distribution curve based on the data distribution of the sample chromaticity data of the image in the uniform color space, wherein the relative chromaticity probability distribution curve is used to represent the corresponding relationship between the relative chromaticity data of the image in the uniform color space and a preset number; Adjusting the relative chromaticity probability distribution curve according to the control data of the preset chromaticity distribution curve and the preset relative chromaticity protection interval data to obtain the chromaticity mapping curve; The chromaticity mapping curve is used to represent a mapping relationship between the chromaticity data of an image converted from the RGB color space to the uniform color space and the relative chromaticity data of the image in the uniform color space.

8. The method according to claim 6, characterized in that The method further comprises: Acquire N sample color data of the image in the uniform color space, wherein the sample color data includes sample brightness data, sample chromaticity data, and sample hue data; Converting the image from the uniform color space to the RGB color space; generating a color gamut of each sample color data in the N sample color data according to a first color gamut in the RGB color space that matches the i-th sample color data in the N sample color data; Generate sample color gamut boundary data of the color gamut according to the color gamut of each sample color data; The sample brightness data and the sample hue data in the i-th sample color data are associated with the sample color gamut boundary data of the first color gamut to obtain association information between the brightness data and the hue data and the color gamut boundary data.

9. The method according to claim 1, characterized in that Generating the second image in the RGB color space according to the first brightness data, the first hue data, and the second chromaticity data includes: generating second color data of the first image in the uniform color space according to the first brightness data, the first hue data, and the second chromaticity data; Based on the second color data, the first image is converted from the uniform color space to the RGB color space to obtain a second image in the RGB color space.

10. A color correction device, characterized in that: include: an acquisition module, configured to acquire overflow data and truncated data resulting from conversion of the first image from the RGB color space to the uniform color space, wherein the overflow data is used to represent data actually acquired by the image acquisition device and that cannot be displayed by the display device, and the truncated data is used to represent data that can be displayed by the display device; a processing module, configured to perform data fusion processing on the overflow data and the truncated data to obtain first color data of the first image in the uniform color space, where the first color data includes first brightness data, first hue data, and first chromaticity data; A generation module is used to generate a second image in the RGB color space based on the first brightness data, the first hue data, and the second chromaticity data, wherein the second image is an image after color correction of the first image, and the second chromaticity data is determined by relative chromaticity data corresponding to the first chromaticity data.

11. An electronic device, characterized in that: include: A processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the color correction method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Color calibration method and device, computer equipment and computer readable storage medium

    CN116524045A

  • Color processor, program and image forming apparatus

    JP2009232418A