Color correction method and device, equipment and storage medium
By converting the image from RGB color space to uniform color space and fusing overflow and truncating data, the problem of color overflow in color correction is solved, and more accurate color recovery and image detail improvement is achieved.
Patent Information
- Application Number
- CN202411068334.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-05
AI Technical Summary
The prior art cannot avoid color overflow during the color correction process, resulting in a decrease in image quality. Especially when RGB color space processing, high correction coefficient causes colors to exceed the gamut, resulting in loss of image details and color deviation.
By converting the image from the RGB color space to the uniform color space, overflow and truncate data, perform data fusion processing, generate color correction images, avoid color overflow, and restore true hue and details in the RGB color space.
Improves the color accuracy and detail recovery of the image, reduces color deviation, enhances the smoothness of color transitions, avoids color overflow, and improves image quality.
Smart Images

Figure CN119071405A_ABST
Abstract
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 technology in the color digital image signal processing (ISP) process, and its purpose is to make the color of digital images more realistic and accurate. The image can be globally processed through the color correction matrix (CCM) to restore the image to the color gamut that meets the display device or display standard to reduce color overflow.
[0003] In the related art, the correction coefficient of CCM is used to adjust the color performance of the image to compensate for the color deviation or distortion when the camera or other image acquisition device captures the image. Since the correction coefficient data is usually fixed, when the correction coefficient with higher data is used to process the area with higher RGB pixel data, some colors will exceed the color space where they are located. After truncation, the image will still have hue shift, image detail loss, image color deviation, etc. In this way, the aforementioned method of correcting the image color through CCM cannot avoid the color overflow phenomenon and reduce the 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, which 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, the overflow data being used to represent data actually acquired by the image acquisition 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;
[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 the 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 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.
[0009] In a second aspect, an embodiment of the present application provides a color correction device, including:
[0010] an acquisition module, used to 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 acquired by the image acquisition 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;
[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, wherein the first color data includes first brightness data, first hue data, and first chromaticity data;
[0012] A generating module is used to generate a second image in an RGB color space according to first brightness data, first hue data and 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.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, which includes 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 shown in the first aspect.
[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. 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, the chip including a processor and a display interface, the display interface and the processor are coupled, and the processor is used to run a program or instruction 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 is 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 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 luminance 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 the 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 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A flow chart of a color correction method provided in an embodiment of the present application;
[0019] Figure 2 A schematic diagram of an application flow of a color correction method provided in an embodiment of the present application;
[0020] Figure 3 A schematic diagram of a chromaticity mapping curve of 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 of a color correction method provided in an embodiment of the present application;
[0023] Figure 6 A schematic diagram of the structure 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 drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0027] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0028] In the process of digital image acquisition and processing, image color distortion may occur due to various factors, such as lighting conditions, sensor color response, color space conversion, etc. Therefore, it is necessary to perform color correction on the image to restore the image to the color gamut that meets the display device or display standard to reduce color overflow.
[0029] In the process of color correction, the image can be processed globally through the 3x3 color correction matrix. However, since the correction coefficient data of the 3x3 color correction matrix is usually fixed, the correction coefficient with higher data will cause some colors to exceed their color space when processing the area with higher RGB pixel data. The image will still have hue shift, image detail loss, image color deviation, etc. In this way, the above-mentioned method of correcting image color through CCM cannot avoid color overflow and reduce 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 phenomenon 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 is used to characterize the data actually acquired by the image acquisition device and cannot be displayed by the display device, and the truncated data is used to characterize the 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 according to 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 restored colors, 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 exceeding the color gamut and being truncated in the RGB color space during the color correction process. Figure 2As shown, the color correction method provided in the embodiment of the present application can be applied to the ISP process after RGB de-mosaicing and before linear domain processing. While optimizing the ISP process, it can restore image details, enhance color levels, and improve image quality. In addition, it can also be used in the scene of color correction of multimedia data image processing and display video processing. In this way, the color correction method of the image based on CCM 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, as shown below.
[0039] First, involving step 110, the color space conversion involved in the embodiment 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 the display device in the embodiment of the present application may be the same device, such as an electronic device, a camera, or other device having the function of capturing images and processing image data. For example, the image acquisition device may be a camera of an electronic device, and the display device may be a display screen of the electronic device. Alternatively, the image acquisition device and the display device in the embodiment of the present application may be different devices, such as an image acquisition device may be a camera, and the display device may be 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 specifically described 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 by 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 color space conversion. Taking the color correction algorithm as an example, the process of converting the first image from the XYZ color space to the uniform color space and processing the data to obtain the overflow data of the first image in the uniform color space is explained below.
[0047] Exemplarily, the first image is converted from a matrix operation in an RGB color space to a matrix operation in an XYZ color space, and in the process of converting the first image from a matrix operation in an XYZ color space to a matrix operation in a 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 on the RGB color space, the color data in the RGB color space, such as the red (R), green (G), and blue (B) three-channel data, 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 performing 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, so that 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 shown below.
[0050] Step 1103 , converting the first image from the RGB color space to the XYZ color space through 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.
[0051] Step 1104: 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.
[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 by 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, three-channel data consisting of brightness (L), chromaticity (C), and hue (H) can be obtained; M is the matrix in the 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 the truncated 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 data fusion processing shown in the following 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 brightness data and the second fused brightness data are weighted and summed by a first preset weight set to obtain the first brightness 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 L can be calculated by the following formula (2): 3 :
[0064] L 3 =L 1 *W 1+L 2 *W 2 (2)
[0065] Among them, L 1 is the first fused brightness data, W 1 is the first weight value, L 2 is the second fused brightness data, W 2 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 by the 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 H can be calculated by the following formula (3): 3 :
[0069] H 3 =H 1 *W 3 +H 2 *W 4 (2)
[0070] Among them, H 1 is the first fusion hue data, W 3 is the third weight value, H 2 is the second fused hue data, W 4 is the fourth weight value.
[0071] Step 1203, filtering 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 obtained by (L 3 , C, H 3 )express.
[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 the first image is converted from the RGB color space to the LCH color space through the color correction algorithm, considering that the brightness and hue may be offset after the overflow and truncation processing, for the hue, based on the color style requirements, the hue data in the overflow data and the truncation data are weighted and fused through the weight values in the second preset weight set, and in order 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 can be weighted and fused through the weight values in the first preset weight set. In this way, while maintaining a high chroma, the loss of details caused by brightness overflow is also repaired. While meeting people's demand for rich colors in photo shooting, details can also be optimized in high-brightness and high-saturation areas, so that the perceptible details of the image are far richer than the effect before optimization. In this way, the image can restore the 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 in the embodiments of the present application can be applied to scenarios of multi-frame image processing of display videos, such as edge detection, object recognition, etc., since the image is corrected only by CCM, color overflow will occur, 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, and some image details can be restored by fusing brightness and hue. 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, and the color correction method provided in the embodiment of the present application can also include steps 1401 and 1402.
[0079] Step 1401, obtaining 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 abscissa of the chromaticity mapping curve may be a value corresponding to the first chromaticity data, and the first chromaticity data C is matched on the abscissa of the chromaticity mapping curve. The first relative chromaticity value of C on the ordinate may be obtained through the chromaticity mapping curve. For example, if the first relative chromaticity data C is C on the abscissa of the chromaticity mapping curve 1 , then the first relative chromaticity data corresponding to the first chromaticity data is R 1 .
[0081] Step 1402: determine the first relative chromaticity data as the second chromaticity data.
[0082] Exemplarily, still taking the example shown in step 1401 above, the first relative chromaticity data R 1 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 effect of color overflow protection 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 only based 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, obtaining first relative chromaticity data corresponding to the first chromaticity data according to the chromaticity mapping curve. Based on the above step 1401, it can be known that the chromaticity mapping curve represents 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.
[0086] For example, Figure 3 As shown, the abscissa of the chromaticity mapping curve may be a value corresponding to the first chromaticity data, and the first chromaticity data C is matched on the abscissa of the chromaticity mapping curve. The first relative chromaticity value of C on the ordinate may be obtained through the chromaticity mapping curve. For example, if the first relative chromaticity data C is C on the abscissa of the chromaticity mapping curve1 , then the first relative chromaticity data corresponding to the first chromaticity data is R 1 Step 1403: Acquire first color gamut boundary data corresponding to the first brightness data and the first hue data according to the association information between the brightness data and the hue data and the color gamut boundary data.
[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 the association information between the brightness data and the hue data and the color gamut boundary data.
[0088] For example, common color spaces have a certain boundary range. Color data beyond the range is considered to be color overflow and cannot be displayed on the device of 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, in order to ensure that the maximum absolute chromaticity is still the maximum chromaticity, it is necessary to find the color gamut boundary data where the maximum absolute chromaticity corresponding to the first brightness data and the first hue data in the associated information is located.
[0089] Step 1404: Generate second chromaticity data based on the first color gamut boundary data and the first relative chromaticity data.
[0090] Exemplarily, 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 may 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 association 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 embodiments of the present application respectively provide steps for generating a chromaticity mapping curve and a process for generating associated 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, constructing a relative chromaticity probability distribution curve according to the data distribution of sample chromaticity data of the image in the uniform color space, wherein the relative chromaticity probability distribution curve is used to characterize the corresponding relationship between the relative chromaticity data of the image in the uniform color space and a preset quantity.
[0095] For example, Figure 4 As shown, 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 process, 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, 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; 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, generating a relative chromaticity mapping curve baseline according to the control data of the preset chromaticity distribution curve and the preset relative chromaticity protection interval data.
[0100] For example, based on Figure 4 The curve settings P1, P2, P3 shown in the figure select appropriate control points C1, C2, C3, where the statistical object is a 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, 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, smoothing 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, obtaining 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 , generating 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 of 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 the sample hue data in the i-th sample color data with the sample color gamut boundary data of the first color gamut, and obtaining 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 obtained by converting LCH into RGB values, and then calculating them in layers and precision cycles according to brightness and hue, and then storing them in a memory with brightness and hue as directory values and C-boundary as content values. Then, through two-dimensional interpolation, the maximum value of the color gamut boundary under each hue is called the cusp value, and the brightness corresponding to the maximum chromaticity is called the cusp brightness. Through the cycle, when the C corresponding to different L and H is determined in turn, it is converted into RGB just inside and outside the boundary, so as to obtain the color gamut boundary on the LCH uniform color space.
[0111] Therefore, by compressing and controlling the chromaticity of the overflow color gamut, the color gradation can be restored while retaining the hue and brightness of the color, thereby enhancing the smoothness of the color transition.
[0112] Then, step 130 is involved. 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 as to be displayed on the display device. Based on this, step 130 can include step 1301 and step 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 in color space to RGB color space for output, so that the second image can be displayed according to the RGB three-channel data converted from the second color data to the RGB color space.
[0116] Thus, while retaining the hue and brightness of the first image, its chromaticity 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 the pixel information that originally exceeded the dynamic range, which is beneficial to the operation of the subsequent AI algorithm. 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 a 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 executed 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 6 A schematic diagram of the structure 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 equipment, and the color correction device 60 can specifically include:
[0122] An acquisition module 601 is used to 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 acquired by the image acquisition 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;
[0123] A processing module 602 is used 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 used to generate a second image in the RGB color space according to the first brightness data, the first hue data and the second chromaticity data, wherein the second image is an image after the first image is color corrected, and the second chromaticity data is determined by the 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] The data of the first image converted from the XYZ color space to the uniform color space is processed by 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, which is used to convert the first image from the RGB color space to the XYZ color space through a color correction algorithm to perform data processing, and 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 brightness data, first fused hue data, and first fused chromaticity data of the first image in a uniform color space; and 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, perform weighted summation on the first fused brightness data and the second fused brightness data to obtain first brightness 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 used 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, which is used 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 also be used to acquire the first color gamut boundary data corresponding to the first brightness data and the first hue data according to the association information between the brightness data and the hue data and the color gamut boundary data, when the second chromaticity data is also determined by the first color gamut boundary data corresponding to the first brightness data and the first hue 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 according to the data distribution of the sample chromaticity data of the image in the uniform color space, and the relative chromaticity probability distribution curve is used to characterize the corresponding relationship between the relative chromaticity data of the image in the uniform color space and the preset quantity;
[0139] The color correction device 60 in the embodiment of the present application further includes an adjustment module, which is used to adjust 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 used to generate a color gamut of each sample color data in 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;
[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, which is used to associate 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 also be used to generate second color data of the first image in a uniform color space according to 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, which is used to convert 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 the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or a device other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. It can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0149] The color correction device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0150] The device coordination device 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 in 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 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 chromaticity data and first hue components. A hue data and a first 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 real hue after color correction and restore the 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 hierarchy, enhancing the smoothness of the color transition, restoring the image details, enhancing the accuracy of the restored color, reducing the color deviation, avoiding the color overflow phenomenon, and improving the image quality.
[0152] Optional, such as Figure 7 As shown, the embodiment of the present application also provides an electronic device 70, including a processor 701 and a memory 702, and the memory 702 stores a program or instruction that can be executed 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 appreciate that the electronic device 800 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 810 through a power management system, thereby implementing functions such as managing 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 described in detail here.
[0157] Among them, in the embodiment of the present application, the processor 810 is 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 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 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 chromaticity data. The processor 810 can also be used to generate a second image in the RGB color space according to 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.
[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] The data of the first image converted from the XYZ color space to the uniform color space is processed by 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 used to convert the first image from the RGB color space to the XYZ color space through a color correction algorithm to perform data processing to obtain first truncated data of the first image within the three-channel range of the RGB color space;
[0162] 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;
[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 brightness data, first fused hue data, and first fused chromaticity data of the first image in a uniform color space; and 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, perform weighted summation on the first fused brightness data and the second fused brightness data to obtain first brightness 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 obtain, when the second chromaticity data is also determined by the first color gamut boundary data corresponding to the first brightness data and the first hue data, the first color gamut boundary data corresponding to the first brightness data and the first hue data according to the association information between the brightness 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 used to construct a relative chromaticity probability distribution curve according to the data distribution of the sample chromaticity data of the image in the uniform color space, where the relative chromaticity probability distribution curve is used to characterize the corresponding relationship between the relative chromaticity data of the image in the uniform color space and the 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 used 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 of each sample color data in 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 according to 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 the uniform color space to the 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 a static image or video obtained by an image capture device (such as a camera) in a video capture mode or an 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 at least one of a touch panel 8071 and other input devices 8072. The touch panel 8071 is also referred to as 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 can mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area can store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 809 can include a volatile memory or a non-volatile memory, or the memory 809 can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 809 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0183] The processor 810 may include one or more processing units; optionally, the processor 810 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless display signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the 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, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned color correction method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[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. The program product is executed by at least one processor to implement the various processes of the above-mentioned color correction method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0189] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0190] In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. In addition, 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 a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.
[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 the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A color correction method, It is 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 acquired by the image acquisition 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, wherein 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 according to 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.
2. The method according to claim 1, It is characterized in that The step of acquiring overflow data and truncated data of converting the first image from the RGB color space to the uniform color space comprises: converting the first image from the RGB color space to an XYZ color space; Data processing is performed on data converted from the XYZ color space to the uniform color space of the first image through a color correction algorithm to obtain overflow data of the first image in the uniform color space.
3. The method according to claim 1, It is characterized in that The step of acquiring overflow data and truncated data of converting the first image from the RGB color space to the uniform color space comprises: Convert the first image from the RGB color space to the XYZ color space through 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; 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; 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, It is characterized in that The overflow data includes first fused brightness data, first fused hue data and first fused chromaticity 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 chromaticity 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 weighted summation on the first fused brightness data and the second fused brightness data to obtain the first brightness data; Performing 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, It is characterized in that 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 the 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 5, It is characterized in that The second chromaticity data is also 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: According to the association information between the brightness data and the hue data and the color gamut boundary data, acquiring first color gamut boundary data corresponding to the first brightness data and the first hue 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, It is characterized in that The method further comprises: Constructing a relative chromaticity probability distribution curve according to 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 characterize the corresponding relationship between the relative chromaticity data of the image in the uniform color space and a preset quantity; 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 the chromaticity mapping curve; 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.
8. The method according to claim 6, It is 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; Generate 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, It is 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: Generate 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, It is characterized in that include: An acquisition module, used to 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 acquired by the image acquisition 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; 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, wherein the first color data includes first brightness data, first hue data and first chromaticity data; A generating module is used to generate a second image in the RGB color space according to the first brightness data, the first hue data and the second chromaticity data, wherein the second image is an image after the first image is color-corrected, and the second chromaticity data is determined by relative chromaticity data corresponding to the first chromaticity data.
11. An electronic device, It is 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
Image color adjusting method and electronic device using the same
US20140333654A1
Improved high dynamic range video color remapping
US20200357100A1
