Image processing method and device, equipment and storage medium
By determining the color characteristic parameters of the image block and the target color characteristic parameters in the image processing, calculating the color tone gain coefficient and performing the color color tone processing of the image block, the problem of unreasonable color temperature adjustment between the image blocks in image color temperature adjustment is solved, and the color characteristic parameters of the target image are in line with expectations and smooth and natural color transition.
Patent Information
- Application Number
- CN202510283886.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-06-24
AI Technical Summary
During image color temperature adjustment, color temperature adjustment of different image blocks of the same image may lead to unreasonable results, such as the color temperature of the left image block is lower than the color temperature of the right image block.
By determining the color characteristic parameters of the image block of the image to be processed, and determining the target color characteristic parameters according to the predefined mapping relationship, calculating the color gain coefficient of the image block, and then color matching processing is performed on the color components of the image block to determine the target image.
Ensure that the color characteristic parameters of the target image meet expectations, avoid the problem of unreasonable color temperature adjustment between image blocks, and achieve smooth and natural color transition.
Smart Images

Figure CN120201138A_ABST
Abstract
Description
Technical Field
[0001] This application relates to computer vision technology, including but not limited to image processing methods, devices, equipment, and storage media. Background Art
[0002] Image color temperature adjustment is a technology that adjusts the color distribution of an image to make it more in line with the human eye's perception of the color of the light source. Color temperature is a physical quantity that describes the color of a light source, with the unit of Kelvin (K). Low color temperature (such as 2700K) usually appears as a warm color tone (biased towards yellow / red), while high color temperature (such as 6500K) appears as a cold color tone (biased towards blue). The core goal of color temperature adjustment is to adjust the RGB channel gain of the image through an algorithm to make the color of the image closer to the visual effect under the target color temperature. However, for the same image, if the color temperature of the left image block is higher than that of the right image block, after color temperature adjustment, it may occur that the color temperature of the left image block is lower than that of the right image block, which is obviously unreasonable. Summary of the Invention
[0003] Embodiments of this application provide an image processing method, device, equipment, and storage medium; wherein,
[0004] In a first aspect, embodiments of this application provide an image processing method, the method includes: determining color characteristic parameters of an image block of a to-be-processed image; determining target color characteristic parameters corresponding to the color characteristic parameters according to a predefined first mapping relationship; wherein, the first mapping relationship includes the mapping relationship between the color characteristic parameters and the target color characteristic parameters; the parameter types of the color characteristic parameters and the target color characteristic parameters are the same; determining a color adjustment gain coefficient of the image block according to the target color characteristic parameters and the color characteristic parameters of the image block; and performing color adjustment processing on the color components of the image block according to the color adjustment gain coefficient of the image block to determine a target image of the to-be-processed image.
[0005] Second aspect, an embodiment of the present application provides an image processing apparatus, the apparatus includes: a first determination module configured to determine color characteristic parameters of an image block of an image to be processed; a second determination module configured to determine target color characteristic parameters corresponding to the color characteristic parameters according to a predefined first mapping relationship; wherein, the first mapping relationship includes a mapping relationship between the color characteristic parameters and the target color characteristic parameters; the parameter types of the color characteristic parameters and the target color characteristic parameters are the same; a third determination module configured to determine a color adjustment gain coefficient of the image block according to the target color characteristic parameters and the color characteristic parameters of the image block; a color adjustment processing module configured to perform color adjustment processing on color components of the image block according to the color adjustment gain coefficient of the image block to determine a target image of the image to be processed.
[0006] Third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, the memory stores a computer program that can run on the processor, and when the processor executes the program, it implements the method described in the first aspect.
[0007] Fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the method described in the first aspect.
[0008] Fifth aspect, an embodiment of the present application provides a computer program product, including a computer program or instruction, when the computer program or instruction is executed by a processor, it implements the method described in the first aspect of the present application.
[0009] Sixth aspect, an embodiment of the present application provides a computer program, and the computer program causes a processor to execute the method described in the first aspect.
[0010] In the embodiment of the present application, the first mapping relationship restricts the relationship between the color characteristic parameters of the image block of the image to be processed and the target color characteristic parameters, and the adjustment gain coefficient of the image component is determined based on the target color characteristic parameters and the color characteristic parameters of the image block. That is to say, the adjustment gain coefficient is restricted by the target color characteristic parameters and the color characteristic parameters of the image block, and based on the restricted adjustment gain coefficient, color adjustment processing is performed on the color components of the image block to determine the target image of the image to be processed. Thus, since the adjustment gain coefficient for determining the target image is restricted by the target color characteristic parameters and the color characteristic parameters of the image block, rather than being free or random, it is beneficial to make the color characteristic parameters of the target image meet the expectations.
[0011] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. Description of the Drawings
[0012] The accompanying drawings here are incorporated into the description and form a part of this description. These drawings show embodiments consistent with this application and, together with the description, are used to illustrate the technical solutions of this application. Obviously, the drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0013] The flowcharts shown in the drawings are only illustrative and do not necessarily include all contents and operations / steps, nor do they necessarily need to be executed in the described order. For example, some operations / steps can be decomposed, while some operations / steps can be combined or partially combined. Therefore, the actual execution order may change according to the actual situation.
[0014] Figure 1 Schematic diagram of the implementation process of the image processing method provided by the embodiments of this application Figure 1 ;
[0015] Figure 2 Schematic diagram of the implementation process for determining the color characteristic parameters of an image block provided by the embodiments of this application;
[0016] Figure 3 Schematic diagram of the implementation process for determining the color adjustment gain coefficient provided by the embodiments of this application;
[0017] Figure 4 Schematic diagram of the implementation process of step 403 provided by the embodiments of this application;
[0018] Figure 5 Schematic diagram of the implementation process of the image processing method provided by the embodiments of this application Figure 2 ;
[0019] Figure 6 Schematic diagram of the structure of the image processing device provided by the embodiments of this application;
[0020] Figure 7 Schematic diagram of the structure of the electronic device provided by the embodiments of this application. Detailed implementation manners
[0021] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will further describe the specific technical solutions of this application in detail in combination with the accompanying drawings in the embodiments of this application. The following embodiments are used to illustrate this application but do not limit the scope of this application.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0023] In the following description, terms such as "some embodiments", "this embodiment", "embodiments of the present application", and examples are involved, which describe subsets of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0024] The descriptions such as "first", "second", "third", etc. that appear in the embodiments of the present application do not have specific meanings (such as no order, nor do they represent special limitations on the number of devices in the embodiments of the present application). They are only for the convenience of clearly describing the embodiments of the present application and cannot constitute any limitation to the embodiments of the present application.
[0025] Before further elaborating on the embodiments of the present application, the nouns and terms that may be involved in the embodiments of the present application are described first. The nouns and terms involved in the embodiments of the present application are applicable to the following explanations.
[0026] (1) Correlated Color Temperature (CCT)
[0027] The correlated color temperature refers to the temperature of a black body when the light color of a light source is the same as that of the black body radiation at a certain temperature. Since the light colors of the vast majority of lighting sources do not exactly fall on the black body radiation line, the concept of correlated color temperature is introduced to represent the relative color temperature of the light source with the temperature having the shortest distance on the uniform chromaticity diagram. Among them, in black body radiation, the black body is an idealized object that can completely absorb and emit radiation at any temperature. As the temperature increases, the spectral composition of the black body radiation changes from infrared to visible light and then to ultraviolet. The chromaticity diagram is a graph used to represent the quality and characteristics of the color of a light source. On the chromaticity diagram, each point represents a specific color.
[0028] (2) Difference of UV value (DUV)
[0029] U represents the blue chromaticity and is used to describe the blue component in an image; V represents the red chromaticity and is used to describe the red component in an image. DUV describes the distance and deviation direction of the chromaticity coordinates of the light source to be measured from the Planck black body radiation trajectory. When the DUV value is too large, it means that the light color of the light source deviates too far from "white", and the human eye will observe yellowing, greening, or purpling, etc.
[0030] (3) r value color adjust gain (rClorGain)
[0031] The r component color adjustment gain coefficient refers to the gain value used to adjust the red component (r component) in digital image processing or photography. This gain coefficient can affect the image's red saturation, brightness, and contrast, thereby achieving fine adjustment of the image color. By increasing or decreasing the r component gain coefficient, the red saturation in the image can be increased or decreased accordingly, making the image appear more vivid or soft red.
[0032] (4) b value color adjust gain (bColorGain)
[0033] The b-component color adjustment gain coefficient refers to the gain value used to adjust the blue component (b component) in the field of digital image processing or photography. This gain coefficient has an important impact on the blue saturation, brightness and overall color balance of the image. Increasing the b-component gain coefficient will make the blue in the image more vivid and increase the blue saturation. Reducing the b-component gain coefficient will make the blue in the image darker and reduce the blue saturation.
[0034] (5) Automatic white balance
[0035] Automatic White Balance (AWB) is a technology used in digital cameras and camcorders to ensure that white in photos or videos taken under different lighting conditions appears pure white while keeping other colors accurate. This technology is critical to improving image quality because it helps ensure that the image colors are faithfully restored regardless of the color of the ambient light used for shooting.
[0036] (6) Local white balance
[0037] Local White Balance (LWB) is an image processing technique that focuses on adjusting the color balance of specific areas in an image rather than making global adjustments to the entire image. Local white balance calculates and adjusts the color balance by analyzing specific areas in the image (usually areas with more neutral or close to white colors) and using them as reference points. This method ensures that these specific areas in the image appear accurately white or neutral gray, thereby improving the color accuracy of the image.
[0038] (7)rpg (r value proportion g value): the ratio of r to g components in the raw image.
[0039] (8)bpg (b value proportion g value): the ratio of b to g components in the raw image.
[0040] (9)awbGain (Awb Gain): Automatic white balance correction gain coefficient.
[0041] To facilitate the understanding of the technical solutions of the embodiments of the present application, the related technologies or terms of the embodiments of the present application are described below. The following related technologies or related terms can be arbitrarily combined with the technical solutions of the embodiments of the present application as optional solutions, and they all fall within the protection scope of the embodiments of the present application.
[0042] When the camera takes pictures, due to the inaccurate automatic white balance correction result, the color effect of the image may be too warm or too cold. Moreover, for different usage scenarios such as different ethnic groups, different regions, and different occasions, the subjective preferred color temperature of the image is different; for example, sometimes it is preferred to be a little warmer than the objective actual color, and sometimes it is preferred to be a little colder.
[0043] In a related technology, a color temperature sequence is defined. Each color temperature has corresponding adjustable rColorGain and bColorGain. Multiply rColorGain and bColorGain by the r and b components of the image. If it is between two of the color temperature sequences, use interpolation to obtain the interpolated rColorGain and bColorGain.
[0044] Through research and analysis, the inventors of the present application found that there is a color adjustment gain coefficient for each color temperature, and there is no constraint on the color adjustment gain coefficients between two color temperatures, resulting in too high a degree of freedom. Taking the adjustment of Region 1 and Region 2 in an image as an example, the original color temperature of Region 1 is a high color temperature, denoted as srcHighCCT (this is the relative color temperature), and the original color temperature of Region 2 is a low color temperature, denoted as srcLowCCT, that is, srcHighCCT > srcLowCCT. The color temperature adjustment coefficient of the r component corresponding to srcHighCCT is denoted as rHighGain, and the color temperature adjustment coefficient of the b component corresponding to srcHighCCT is denoted as bHighGain. Then, the r component and b component of Region 1 are multiplied by their respective corresponding color temperature adjustment coefficients rHighGain and bHighGain, and the r component and b component of Region 2 are multiplied by their respective corresponding color temperature adjustment coefficients rLowGain and bLowGain. The color temperature of Region 1 in the image after color temperature adjustment is denoted as dstHighCCT, and the color temperature of Region 2 is denoted as dstLowCCT. Their relationship may be dstHighCCT < dstLowCCT. Obviously, the result of the adjustment violates the original intention of the size relationship of the original color temperature during color temperature adjustment, that is, the result is not as expected. When adjusting the color temperature of the entire image with rColorGain and bColorGain, the effect is not obvious. However, when performing block-by-block local color adjustment in the Local WhiteBalance (LWB) algorithm, there will be an obvious contrast in the color temperature between blocks, resulting in abnormal effects such as sudden color changes between image blocks and uneven color transitions between blocks.
[0045] In view of the analysis of the generation principle of the above technical problems, an embodiment of the present application provides an image processing method. Figure 1 Schematic implementation process of the image processing method provided by the embodiment of the present application Figure 1 . As Figure 1 shown, the method includes the following steps 101 to 104:
[0046] Step 101, determining color characteristic parameters of an image block of an image to be processed;
[0047] Step 102, determining target color characteristic parameters corresponding to the color characteristic parameters according to a predefined first mapping relationship; wherein, the first mapping relationship includes a mapping relationship between the color characteristic parameters and the target color characteristic parameters; the parameter types of the color characteristic parameters and the target color characteristic parameters are the same;
[0048] Step 103, determining a color adjustment gain coefficient of the image block according to the target color characteristic parameters and the color characteristic parameters of the image block;
[0049] Step 104: Perform color adjustment processing on the color components of the image block according to the color adjustment gain coefficient of the image block to determine the target image of the image to be processed.
[0050] It can be understood that in the embodiment of the present application, the first mapping relationship constrains the relationship between the color characteristic parameters of the image block of the image to be processed and the target color characteristic parameters, and the adjustment gain coefficient of the image component is determined based on the target color characteristic parameters and the color characteristic parameters of the image block, that is, the adjustment gain coefficient is constrained by the target color characteristic parameters and the color characteristic parameters of the image block, and based on the constrained adjustment gain coefficient, the color component of the image block is subjected to color adjustment processing to determine the target image of the image to be processed. In this way, since the adjustment gain coefficient of the target image is constrained by the target color characteristic parameters and the color characteristic parameters of the image block, rather than being free or random, it is beneficial to make the color characteristic parameters of the target image meet expectations.
[0051] The following describes further optional implementations and related terms of each of the above steps.
[0052] In step 101, color characteristic parameters of an image block of an image to be processed are determined.
[0053] It should be understood that in the embodiment of the present application, the division strategy of the image blocks of the image to be processed and the size of the image blocks are not limited. In the embodiment of the present application, the color characteristic parameters are also not limited, and the color characteristic parameters are used to quantitatively describe the color attributes of the image. In some embodiments, the color characteristic parameters of the image block include a first color characteristic parameter and a second color characteristic parameter; wherein the first color characteristic parameter is used to characterize the color warmth of the image block; the second color characteristic parameter is used to characterize the degree of deviation of the color of the image block from the standard light source; the target color characteristic parameter includes a first target color characteristic parameter and a second target color characteristic parameter, the first target color characteristic parameter corresponds to the first color characteristic parameter and has the same parameter type, and the second target color characteristic parameter corresponds to the second color characteristic parameter and has the same parameter type.
[0054] In some embodiments, the "degree of deviation of the color of the image block from the standard light source" is one of the factors that affect the color warmth or coldness of the image block. In other words, the "degree of deviation of the color of the image block from the standard light source" will affect the overall atmosphere and emotional expression of the image. For example, the deviation of warm tones may make the image appear too cold, while the deviation of cold tones may make the image appear too warm.
[0055] It can be understood that in the embodiments of the present application, the color characteristic parameters of the image block include: a first color characteristic parameter for characterizing the warmth or coolness of the color of the image block and a second color characteristic parameter for characterizing the degree of deviation of the color of the image block from a standard light source. The first target color characteristic parameter corresponds to and is the same as the first color characteristic parameter, and the second target color characteristic parameter corresponds to the second color characteristic parameter and has the same parameter type. Then, the adjustment gain coefficient is constrained based on the first target color characteristic parameter, the second target color characteristic parameter, the first color characteristic parameter, and the second color characteristic parameter, that is, the adjustment gain coefficient is constrained based on the color characteristic parameters related to the warmth or coolness of the color in the image block and the target color characteristic parameters related to the warmth or coolness of the color, and the target image is determined, thereby being beneficial to making the warmth or coolness of the color of the target image meet the expectations.
[0056] In the embodiments of the present application, the "warmth or coolness of the color of the image block" can be understood as the temperature feeling given by the color presented in a certain area of the image, and this feeling stems from people's color associations with objects of different temperatures in nature. The warmth or coolness of the color is a relative concept and is usually associated with the color temperature. Cool colors usually include blue, green, purple, etc., and these colors make people associate with water, ice, the sky, shadows, etc., giving people a feeling of coolness, calmness, and profundity. In an image, cool colors can be used to represent a cold environment, a serene atmosphere, or a deep space. Warm colors usually include red, orange, yellow, etc., and these colors make people associate with the sun, fire, the earth, etc., giving people a feeling of warmth, vitality, and intimacy. In an image, warm colors can be used to represent a warm scene, a passionate emotion, or a prominent subject.
[0057] In the embodiments of the present application, the "degree of deviation of the color of the image block from a standard light source" can be understood as the difference between the color of a certain area in the image and the color observed under a standard light source. This difference can be quantified and described by chromaticity parameters, such as color difference (ΔE) or color deviation (i.e., the difference in UV color components, DUV). Among them, the color difference (ΔE) is an index for quantifying the difference between two colors. In color science, ΔE is a value calculated based on a color space (such as CIELAB), representing the distance between two colors in the color space. The smaller the ΔE value, the closer the colors; the larger the ΔE value, the more obvious the color difference. The color deviation is a parameter for measuring the degree of deviation of the light source color from the color of an ideal blackbody radiation. In image processing, DUV can be used to evaluate the deviation between the color of the image block and the color under a standard light source. The smaller the DUV value, the closer the color of the image block is to the standard light source color; the larger the DUV value, the greater the deviation.
[0058] In some embodiments, Figure 2 is a schematic flowchart for implementing the determination of the color characteristic parameters of the image block provided by the embodiments of the present application, as Figure 2As shown, the color characteristic parameters of the image block can be determined through the following steps 201 to 203:
[0059] Step 201, determining a first ratio of a first color component to a second color component of the image block;
[0060] Step 202, determining a second ratio of a third color component to the second color component of the image block;
[0061] Step 203, determining the color characteristic parameters corresponding to the first ratio and the second ratio according to a predefined second mapping relationship; wherein, the second mapping relationship includes the mapping relationship between the first ratio, the second ratio and the color characteristic parameters.
[0062] It should be understood that in the embodiments of the present application, the first color component, the second color component and the third color component are not limited; wherein, there is a mapping relationship between the first ratio of the first color component to the second color component, the second ratio of the third color component to the second color component and the color characteristic parameters.
[0063] Exemplarily, in a possible implementation manner, in the RGB color space, the color components of an image block can be represented as (R, G, B); wherein, R represents the red component, G represents the green component, and B represents the blue component. In the RGB color space, the image blocks of warm colors usually have higher red (R) and green (G) components, while the blue (B) component is lower. The image blocks of cold colors usually have higher blue (B) components, while the red (R) and green (G) components are lower.
[0064] Exemplarily, in another possible implementation manner, in the Lab color space, it can be represented as (L, a, b); wherein, L represents the brightness, and a and b represent two chromaticity components. The chromaticity component a represents the position of the color on the red-green axis. When a is positive, it is biased towards red, and when a is negative, it is biased towards green. The larger the absolute value of a, the more obvious the red or green tendency of the color. The chromaticity component b represents the position of the color on the yellow-blue axis. When b is positive, it is biased towards yellow, and when b is negative, it is biased towards blue. The larger the absolute value of b, the more obvious the yellow or blue tendency of the color. In the Lab color space, the chromaticity components a and b can be used to describe the warmth and coldness of the color; wherein, when it is a warm color, the a component is positive (biased towards red), and the b component is positive (biased towards yellow), and when it is a cold color, the a component is negative (biased towards green), and the b component is negative (biased towards blue).
[0065] In some embodiments, the first ratio is the mean or weighted average of the third ratios of the sample points of the image block; wherein, the third ratio is the ratio of the first color component to the second color component of the sample point; the second ratio is the mean or weighted average of the fourth ratios of the sample points of the image block; wherein, the fourth ratio is the ratio of the third color component to the second color component of the sample point.
[0066] It should be understood that in the embodiments of the present application, the sample points of the image block are not limited. In some embodiments, the sample points are all pixel points in the image block. In other embodiments, the sample points are pixel points sampled from the pixel points in the image block. In the embodiments of the present application, the sampling method is also not limited.
[0067] In some embodiments, determining the first ratio of the first color component to the second color component of the image block includes: determining the third ratio of the first color component to the second color component of the pixel points of the image block; performing an average operation or a weighted average operation on the third ratios of the pixel points of the image block to determine the first ratio.
[0068] In some embodiments, determining the second ratio of the third color component to the second color component of the image block includes: determining the fourth ratio of the third color component to the second color component of the pixel points of the image block; performing an average operation or a weighted average operation on the fourth ratios of the pixel points of the image block to determine the second ratio.
[0069] It should be understood that in the embodiments of the present application, when performing a weighted average operation, the weights of the weighted average operation and the method for determining the weights are not limited. In some embodiments, the weights are positively correlated with the magnitude of the ratio, and the magnitude of the weights is normalized within the range of 0 to 1.
[0070] In other embodiments, determining the color characteristic parameters of the image block of the image to be processed includes: directly obtaining the srcCCT (i.e., an example of the first color characteristic parameter) and srcDUV (i.e., an example of the second color characteristic parameter) corresponding to each image / image block area through a color sensor (CS) or a multi-color sensor (MCS).
[0071] Exemplarily, in a possible implementation, multiple groups of images of the same scene are captured to obtain the original R, G, and B values, which are then converted into rpg (i.e., an example of the first ratio) and bpg (i.e., an example of the second ratio); wherein, one image block corresponds to one rpg and one bpg, rpg is the average value of rpg of all pixel points of the image block, and bpg is the average value of bpg of all pixel points of the image block. At the same time, a light meter is used to obtain the CCT and DUV of the scene, and through a fitting method, the conversion relationship between CCT and DUV and rpg and bpg is obtained, that is, the second mapping relationship. After the image is segmented, srcRpg and srcBpg are calculated for each block, and the calibrated conversion relationship table (i.e., the second mapping relationship) is used to perform the conversion, that is, the conversion from (srcRpg, srcBpg) to (srcCCT, srcDUV), or the srcCCT / srcDUV of the corresponding area of each image / image block can be directly obtained by CS / MCS.
[0072] In step 102, according to a predefined first mapping relationship, a target color characteristic parameter corresponding to the color characteristic parameter is determined; wherein, the first mapping relationship includes the mapping relationship between the color characteristic parameter and the target color characteristic parameter; the parameter types of the color characteristic parameter and the target color characteristic parameter are the same.
[0073] It should be understood that in the embodiments of the present application, the first mapping relationship is not limited. The first mapping relationship includes the correspondence between the color characteristic parameter of the image block and the target color characteristic parameter. In some embodiments, the first mapping relationship can be determined according to the usage scenario of the image to be processed and / or the target image. In other embodiments, the first mapping relationship can be determined according to the region or ethnicity of the image to be processed and / or the target image. In still other embodiments, the first mapping relationship can be determined according to the subjective preference for the image to be processed and / or the target image.
[0074] In step 103, according to the target color characteristic parameter and the color characteristic parameter of the image block, the color adjustment gain coefficient of the image block is determined.
[0075] It should be understood that in the embodiments of the present application, the color adjustment gain coefficient is not limited. The color adjustment gain coefficient is an important parameter for adjusting color attributes in image processing to achieve the color adjustment effect of the image. In some embodiments, the color adjustment gain coefficient adjusts the gain coefficients of the R, G, and B channels to perform color adjustment on the image.
[0076] It should be understood that in the embodiments of the present application, the specific implementation manner for determining the color adjustment gain coefficient of the image block is not limited. In some embodiments, Figure 3 is a schematic diagram of the implementation process for determining the color adjustment gain coefficient provided by the embodiments of the present application, asFigure 3 As shown, the color adjustment gain coefficient can be determined through the following steps 301 to 303:
[0077] Step 301, convert the color characteristic parameters of the image block into a first result, the first result including: the first standard value of the first color component, the first standard value of the second color component, and the first standard value of the third color component;
[0078] Step 302, convert the target color characteristic parameters into a second result, the second result including: the second standard value of the first color component, the second standard value of the second color component, and the second standard value of the third color component;
[0079] Step 303, determine the color adjustment gain coefficient of the image block according to the first result and the second result; the color adjustment gain coefficient includes the color adjustment gain coefficient of the first color component and the color adjustment gain coefficient of the third color component.
[0080] It should be understood that in the embodiments of the present application, the specific conversion methods for converting the color characteristic parameters of the image block into the first result and converting the target color characteristic parameters into the second result are not limited. In some embodiments, a standard conversion relationship independent of the sensor device is used to convert the color characteristic parameters of the image block into the first result and convert the target color characteristic parameters into the second result.
[0081] In some embodiments, converting the color characteristic parameters of the image block into the first result includes: converting the first color characteristic parameter and the second color characteristic parameter of the image block into the first result; converting the target color characteristic parameters into the second result includes: converting the first target color characteristic parameter and the second target color characteristic parameter into the second result.
[0082] In some embodiments, the color characteristic parameters of the image block include the color temperature and DUV of the image block; the target color characteristic parameters include the target color temperature and target DUV; the first color component is the R component, the second color component is the G component, and the third color component is the B component.
[0083] In some embodiments, the first color characteristic parameter of the image block includes the color temperature of the image block, the second color characteristic parameter of the image block includes the DUV of the image block, the first target color characteristic parameter includes the target color temperature, and the second target color characteristic parameter includes the target DUV.
[0084] In some embodiments, the converting the first color characteristic parameter and the second color characteristic parameter of the image block into a first result includes: converting the color temperature of the image block and the DUV of the image block into a first result; the converting the first target color characteristic parameter and the second target color characteristic parameter into a second result includes: converting the target color temperature and the target DUV into a second result.
[0085] In some embodiments, the determining a first ratio of a first color component to a second color component of the image block includes: determining a first ratio of the R component of the image block to the G component of the image block; the determining a second ratio of a third color component to the second color component of the image block includes: determining a second ratio of the B component of the image block to the G component of the image block.
[0086] In some embodiments, according to the standard conversion relationship from the CIE 1960 UCS color space to the CIE 1976 UCS color space, the color characteristic parameter of the image block is converted into a first result; the converting the target color characteristic parameter into a second result includes: according to the standard conversion relationship from the CIE 1960 UCS color space to the CIE 1976 UCS color space, the target color characteristic parameter is converted into a second result.
[0087] It should be understood that in the embodiments of the present application, the CIE 1960 UCS (Uniform Chromaticity Scale) color space is a color space proposed by the International Commission on Illumination (CIE) in 1960, aiming to improve the non-uniformity of the CIE 1931 xy color space and make the color difference more in line with the perception of the human eye. The CIE 1976 UCS (Uniform Chromaticity Scale) color space is a color space proposed by the International Commission on Illumination (CIE) in 1976, aiming to further improve the uniformity of the CIE 1960 UCS color space and make the calculation of color difference more in line with the perception of the human eye.
[0088] In some embodiments, the conversion relationship from CIE 1960 UCS (u, v) to CIE 1976 UCS (u', v') is: u' = u, v' = 3 / 2 v.
[0089] In some embodiments, according to the standard conversion relationship from the CIE 1960 UCS color space to the CIE 1976 UCS color space, converting the color characteristic parameters of the image block into a first result includes: determining the chromaticity coordinates (u, v) in the CIE 1960 UCS color space through the CCT of the image block and the DUV of the image block; determining the chromaticity coordinates (u', v') in the CIE 1976 UCS color space based on the chromaticity coordinates (u, v) in the CIE 1960 UCS color space; determining the tristimulus values in the CIE XYZ color space based on the chromaticity coordinates (u', v') in the CIE 1976 UCS color space; and determining the R, G, and B values of the image block in the RGB space based on the tristimulus values in the CIE XYZ color space.
[0090] In some embodiments, Figure 4 is a schematic flowchart for implementing step 403 provided by an embodiment of the present application. As Figure 4 shown, step 303 can be implemented through the following steps 401 to 406:
[0091] Step 401, determining a fifth ratio of the first standard value of the first color component to the first standard value of the second color component;
[0092] Step 402, determining a sixth ratio of the first standard value of the third color component to the first standard value of the second color component;
[0093] Step 403, determining a seventh ratio of the second standard value of the first color component to the second standard value of the second color component;
[0094] Step 404, determining an eighth ratio of the second standard value of the third color component to the second standard value of the second color component;
[0095] Step 405, determining a color adjustment gain coefficient of the first color component according to the fifth ratio and the seventh ratio;
[0096] Step 406, determining a color adjustment gain coefficient of the third color component according to the sixth ratio and the eighth ratio.
[0097] In some embodiments, the determining the color adjustment gain coefficient of the first color component according to the fifth ratio and the seventh ratio includes: determining the color adjustment gain coefficient of the first color component according to the ratio of the fifth ratio to the seventh ratio; and the determining the color adjustment gain coefficient of the third color component according to the sixth ratio and the eighth ratio includes: determining the color adjustment gain coefficient of the third color component according to the ratio of the sixth ratio to the eighth ratio.
[0098] Exemplarily, in one possible implementation, the srcCCT (i.e., an example of the first color characteristic parameter) and srcDUV (i.e., an example of the second color characteristic parameter) are converted into srcStandRpg (i.e., an example of the fifth ratio) and srcStandBpg (i.e., an example of the sixth ratio) using a standard conversion relationship independent of the sensor device, that is, srcStandUV is determined based on srcCCT and srcDUV, srcStandRGB is determined based on srcStandUV, and srcStandRpg and srcStandBpg are determined based on srcStandRGB. The dstCCT (i.e., an example of the first target color characteristic parameter) and dstDUV (i.e., an example of the second target color characteristic parameter) are inversely converted using the standard conversion relationship, that is, dstStandUV is determined based on dstCCT and dstDUV, dstStandRGB is determined based on dstStandUV, and dstStandRpg (i.e., an example of the seventh ratio) and dstStandBpg (i.e., an example of the eighth ratio) are determined based on dstStandRGB. Based on the determined srcStandRpg, srcStandBpg, dstStandRpg, and dstStandBpg, the final color adjustment gain coefficient is calculated, where rColorGain = srcStandRpg ÷ dstStandRpg; bColorGain = srcStandBpg ÷ dstStandBpg.
[0099] In step 104, according to the color adjustment gain coefficient of the image block, the color components of the image block are color-adjusted to determine the target image of the image to be processed.
[0100] In some embodiments, the step of according to the color adjustment gain coefficient of the image block, color-adjusting the color components of the image block to determine the target image of the image to be processed includes: respectively color-adjusting the corresponding color components of the image block according to the color adjustment gain coefficient of the first color component of the image block and the color adjustment gain coefficient of the second color component of the image block to determine the target image of the image to be processed.
[0101] In some embodiments, the step of according to the color adjustment gain coefficient of the image block, color-adjusting the color components of the image block to determine the target image of the image to be processed includes: determining the color adjustment gain coefficient between the first image block and the second image block according to the color adjustment gain coefficient of the first image block and the color adjustment gain coefficient of the second image block; based on the color adjustment gain coefficient between the first image block and the second image block, color-adjusting the color components between the first image block and the second image block to determine the target image of the image to be processed.
[0102] In a possible implementation, the image is divided into multiple blocks, and each block corresponds to a color adjustment gain coefficient. For each pixel point between the image blocks, find the block where it is located and its adjacent blocks. Use the bilinear interpolation formula to calculate the color adjustment gain coefficient of this pixel point. Apply the interpolated color adjustment gain coefficient to the color components of the pixel points between the image blocks.
[0103] The following is an example to describe a possible implementation solution of the image processing method described in one or more of the above embodiments.
[0104] An embodiment of the present application provides an image processing method. According to the method of pre-calibration or detection by a multi-window color temperature sensor, the objective color temperature of the corresponding area of each image block is obtained, and a subjective preference color adjustment table set in advance and independent of the sensor device is used to calculate the color adjustment gain coefficient of each image block, so as to adjust the color of the image block. After adjustment, the transition between blocks is smooth and natural.
[0105] In some embodiments, Figure 5 is a schematic implementation process of the image processing method provided by the embodiment of the present application Figure 2 , such as Figure 5 shown, the method includes the following steps 501 to step 508:
[0106] Step 501: Calibrate the color temperature and color conversion table. Calibrate the sensor to determine the mutual conversion relationship table between (CCT, DUV) and (rpg, bpg). Shoot multiple groups of images of the same scene to obtain the original R, G, and B values, and convert them into rpg (i.e., an example of the first ratio) and bpg (i.e., an example of the second ratio); where, an image block corresponds to an rpg and a bpg, rpg is the average value of the rpgs of all pixel points of this image block, and bpg is the average value of the bpgs of all pixel points of this image block. At the same time, use an illuminometer to obtain the CCT and DUV of this scene, and through fitting, obtain the conversion relationship between CCT and DUV and rpg and bpg, that is, the second mapping relationship.
[0107] Step 502: Set the color adjustment conversion table. Define and set the conversion table from the (srcCCT, srcDUV) array to the (dstCCT, dstDUV) array for color adjustment, that is, the first mapping relationship.
[0108] Step 503: Obtain the original CCT / DUV of the image block. After the image is segmented, calculate srcRpg and srcBpg for each block, and use the calibrated conversion relation table (i.e., the second mapping relation) to perform conversion on them, that is, the conversion from (srcRpg, srcBpg) to (srcCCT, srcDUV), or directly use CS / MCS to directly obtain srcCCT / srcDUV of the corresponding area of each image / image block.
[0109] Step 504: Convert CCT / DUV to the ratio of standard colors. Use the standard conversion relation independent of the sensor device to convert srcCCT (i.e., an example of the first color characteristic parameter) and srcDUV (i.e., an example of the second color characteristic parameter) to srcStandRpg (i.e., an example of the fifth ratio) and srcStandBpg (i.e., an example of the sixth ratio), that is, determine srcStandUV based on srcCCT and srcDUV, determine srcStandRGB based on srcStandUV, and determine srcStandRpg and srcStandBpg based on srcStandRGB.
[0110] Step 505: Interpolate and look up the table to adjust the color to obtain the target CCT / DUV. Interpolate and look up the table (i.e., the first mapping relation) to map srcCCT and srcDUV to obtain the target dstCCT and dstDUV.
[0111] Step 506: Reverse conversion of the target CCT / DUV. Use the standard conversion relation to perform reverse conversion on dstCCT (i.e., an example of the first target color characteristic parameter) and dstDUV (i.e., an example of the second target color characteristic parameter), that is, determine dstStandUV based on dstCCT and dstDUV, determine dstStandRGB based on dstStandUV, and determine dstStandRpg (i.e., an example of the seventh ratio) and dstStandBpg (i.e., an example of the eighth ratio)
[0112] Step 507: Calculate the color adjustment gain coefficient. Based on the determined srcStandRpg, srcStandBpg, dstStandRpg, and dstStandBpg, calculate the final color adjustment gain coefficient, where rColorGain = srcStandRpg ÷ dstStandRpg; bColorGain = srcStandBpg ÷ dstStandBpg.
[0113] Step 508: Interpolate and adjust the color of the image blocks. Adjust the color of each block, that is, multiply the r component by rColorGain and multiply the b component by bColorGain. For the color adjustment gain coefficients between blocks, bilinear interpolation is used.
[0114] It can be understood that in the embodiments of the present application, the consistency of color temperature adjustment can be solved, and the high and low trends of color temperature can be maintained before and after color adjustment. When performing color temperature adjustment for each block, the problem of uneven transition between blocks can be solved. This is because in the embodiments of the present application, the color adjustment gain coefficients of the image blocks are calculated through steps 501 to 507, rather than predefined. Briefly speaking, the color adjustment gain coefficients of the image blocks are closely related to the R value, G value, and B value of the image blocks. And in the embodiments of the present application, a color temperature adjustment method independent of the sensor device is used, based on the objective color temperature and the standard UV color space, and the stability and consistency of the color adjustment effect can be guaranteed. Moreover, applying the image processing method provided in the embodiments of the present application to a single full-image can also be applied to the processing of video image sequences to reduce color jumps between frames.
[0115] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that these steps must be executed in that specific order, or that all the steps shown must be executed to achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution, etc.; or, the steps in different embodiments may be combined into a new technical solution.
[0116] Based on the foregoing embodiments, the embodiments of the present application provide an image processing device. The device includes each module included and each unit included in each module, and can be implemented by a processor; of course, it can also be implemented by specific logic circuits; during the implementation process, the processor can be an AI acceleration engine (such as an NPU, etc.), GPU, central processing unit (CPU), microprocessor (MPU), digital signal processor (DSP), or field programmable gate array (FPGA), etc.
[0117] Figure 6 For the structural schematic diagram of the image processing device provided in the embodiments of the present application, as Figure 6 shown, the image processing device 600 includes a first determination module 601, a second determination module 602, a third determination module 603, and a color adjustment processing module 604, where:
[0118] The first determination module 601 is configured to determine the color characteristic parameters of the image blocks of the image to be processed;
[0119] A second determination module 602, configured to determine a target color characteristic parameter corresponding to the color characteristic parameter according to a predefined first mapping relationship; wherein, the first mapping relationship includes a mapping relationship between the color characteristic parameter and the target color characteristic parameter; the parameter types of the color characteristic parameter and the target color characteristic parameter are the same;
[0120] A third determination module 603, configured to determine a color adjustment gain coefficient of the image block according to the target color characteristic parameter and the color characteristic parameter of the image block;
[0121] A color adjustment processing module 604, configured to perform color adjustment processing on the color components of the image block according to the color adjustment gain coefficient of the image block to determine a target image of the image to be processed.
[0122] In some embodiments, a first determination module 601 is configured to determine a first ratio of a first color component to a second color component of the image block; determine a second ratio of a third color component to the second color component of the image block; determine a color characteristic parameter corresponding to the first ratio and the second ratio according to a predefined second mapping relationship; wherein, the second mapping relationship includes a mapping relationship between the first ratio, the second ratio and the color characteristic parameter.
[0123] In some embodiments, the first ratio is an average value or a weighted average value of third ratios of sample points of the image block; wherein, the third ratio is a ratio of the first color component to the second color component of the sample point; the second ratio is an average value or a weighted average value of fourth ratios of sample points of the image block; wherein, the fourth ratio is a ratio of the third color component to the second color component of the sample point.
[0124] In some embodiments, the color characteristic parameters of the image block include a first color characteristic parameter and a second color characteristic parameter; wherein, the first color characteristic parameter is used to characterize the warmth or coolness of the color of the image block; the second color characteristic parameter is used to characterize the degree of deviation of the color of the image block from a standard light source; the target color characteristic parameters include a first target color characteristic parameter and a second target color characteristic parameter, the first target color characteristic parameter corresponds to the first color characteristic parameter and has the same parameter type, and the second target color characteristic parameter corresponds to the second color characteristic parameter and has the same parameter type.
[0125] In some embodiments, the third determination module 603 is configured to convert the color characteristic parameters of the image block into a first result, where the first result includes: a first standard value of a first color component, a first standard value of a second color component, and a first standard value of a third color component; convert the target color characteristic parameters into a second result, where the second result includes: a second standard value of the first color component, a second standard value of the second color component, and a second standard value of the third color component; determine a color adjustment gain coefficient of the image block according to the first result and the second result; the color adjustment gain coefficient includes a color adjustment gain coefficient of the first color component and a color adjustment gain coefficient of the third color component.
[0126] In some embodiments, the color characteristic parameters of the image block include the color temperature and DUV of the image block; the target color characteristic parameters include a target color temperature and a target DUV; the first color component is the R component, the second color component is the G component, and the third color component is the B component.
[0127] In some embodiments, the third determination module 603 is configured to convert the color characteristic parameters of the image block into a first result according to a standard conversion relationship from the CIE 1960 UCS color space to the CIE 1976 UCS color space; convert the target color characteristic parameters into a second result according to a standard conversion relationship from the CIE 1960 UCS color space to the CIE 1976 UCS color space.
[0128] In some embodiments, the third determination module 603 is configured to determine a fifth ratio of the first standard value of the first color component to the first standard value of the second color component; determine a sixth ratio of the first standard value of the third color component to the first standard value of the second color component; determine a seventh ratio of the second standard value of the first color component to the second standard value of the second color component; determine an eighth ratio of the second standard value of the third color component to the second standard value of the second color component; determine the color adjustment gain coefficient of the first color component according to the fifth ratio and the seventh ratio; determine the color adjustment gain coefficient of the third color component according to the sixth ratio and the eighth ratio.
[0129] In some embodiments, the third determination module 603 is configured to determine the color adjustment gain coefficient of the first color component according to a ratio of the fifth ratio to the seventh ratio; determine the color adjustment gain coefficient of the third color component according to a ratio of the sixth ratio to the eighth ratio.
[0130] In some embodiments, the color adjustment processing module 604 is configured to perform color adjustment processing on the corresponding color components of the image block according to the color adjustment gain coefficient of the first color component of the image block and the color adjustment gain coefficient of the second color component of the image block, and determine the target image of the image to be processed.
[0131] The description of the above device embodiments is similar to the description of the above method embodiments and has similar beneficial effects to those of the method embodiments. For the technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
[0132] It should be noted that the division of modules in the embodiments of the present application is illustrative only, and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in the various embodiments of the present application may be integrated in one processing unit, may exist separately physically, or two or more units may be integrated in one unit. The above integrated units may be implemented in the form of hardware, or in the form of software functional units, or in the form of a combination of software and hardware.
[0133] It should be noted that in the embodiments of the present application, if the above method is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the related technology, may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing an electronic device to execute all or part of the methods described in the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), magnetic disks, or optical discs that can store program codes. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0134] The embodiments of the present application provide an electronic device, Figure 7 which is a schematic structural diagram of the electronic device provided by the embodiments of the present application Figure 2 As Figure 7 shown, the electronic device 70 includes a memory 701 and a processor 702. The memory 701 stores a computer program that can run on the processor 702, and when the processor 702 executes the program, it implements the steps in the method provided in the above embodiments.
[0135] It should be noted that the memory 701 is configured to store instructions and applications executable by the processor 702, and can also cache data to be processed or already processed by each module in the processor 702 and the electronic device 70 (such as image data, audio data, voice communication data, and video communication data), which can be implemented by flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0136] In the embodiments of the present application, there is no limitation on the type of the electronic device, and the electronic device can be various devices with image processing capabilities. For example, the electronic device can be a smart phone, a laptop computer, a tablet computer, a smart home device, a headset, a speaker, a keyboard, a mouse, a smart bracelet, an Internet of Things (IoT) device, or a vehicle-mounted device, etc.
[0137] The embodiments of the present application also provide a computer-readable storage medium for storing a computer program.
[0138] Optionally, the computer-readable storage medium can be applied to the electronic device in the embodiments of the present application, and the computer program causes the processor to execute the various methods of the embodiments of the present application. For the sake of brevity, details are not described herein again.
[0139] The embodiments of the present application also provide a computer program product including computer program instructions.
[0140] Optionally, the computer program product can be applied to the electronic device in the embodiments of the present application, and the computer program instructions cause the processor to execute the various methods of the embodiments of the present application. For the sake of brevity, details are not described herein again.
[0141] The embodiments of the present application also provide a computer program.
[0142] Optionally, the computer program can be applied to the electronic device in the embodiments of the present application. When the computer program runs on the processor, it causes the processor to execute the various methods of the embodiments of the present application. For the sake of brevity, details are not described herein again.
[0143] It should be pointed out here that the descriptions of the above electronic device, storage medium, computer program product, and computer program embodiments are similar to the descriptions of the above method embodiments and have beneficial effects similar to those of the method embodiments. For the technical details not disclosed in the embodiments of the electronic device, storage medium, computer program product, and computer program of the present application, please refer to the descriptions of the method embodiments of the present application for understanding.
[0144] It should be understood that the "one embodiment" or "an embodiment" or "some embodiments" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the "in one embodiment" or "in an embodiment" or "in some embodiments" that appear throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the magnitudes of the serial numbers of the above processes do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages or disadvantages of the embodiments. The descriptions of the above embodiments tend to emphasize the differences between the embodiments, and their similarities or similarities can be referred to each other. For the sake of brevity, they will not be elaborated herein.
[0145] As used herein, the term "and / or" is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, object A and / or object B can represent: object A exists alone, object A and object B exist simultaneously, and object B exists alone.
[0146] It should be noted that, as used herein, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device comprising such element.
[0147] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The above-described embodiments are merely illustrative. For example, the division of the modules is only a logical function division, and there can be other division methods in actual implementation. For example, multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed with each other can be through some interfaces, and the indirect coupling or communication connection of the devices or modules can be electrical, mechanical or other forms.
[0148] The modules described above as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network elements; some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0149] In addition, each functional module in the embodiments of the present application may be all integrated in a processing unit, or each module may be separately used as a unit, or two or more modules may be integrated in a unit; the above-mentioned integrated modules may be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.
[0150] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including the above method embodiments; and the foregoing storage medium includes: removable storage devices, read-only memory (ROM), magnetic disks, or optical disks, etc., all kinds of media that can store program codes.
[0151] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application essentially or the part that contributes to the related technology can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing an electronic device to execute all or part of the methods described in the embodiments of the present application. And the foregoing storage medium includes: removable storage devices, ROM, magnetic disks, or optical disks, etc., all kinds of media that can store program codes.
[0152] The methods disclosed in several method embodiments provided by the present application can be arbitrarily combined without conflict to obtain new method embodiments. The features disclosed in several product embodiments provided by the present application can be arbitrarily combined without conflict to obtain new product embodiments.
[0153] The features disclosed in several method or device embodiments provided by the present application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0154] As described above, it is only the implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claimed rights.
Claims
1. An image processing method, characterized in that: The method comprises: Determine color characteristic parameters of an image block of the image to be processed; Determine a target color characteristic parameter corresponding to the color characteristic parameter according to a predefined first mapping relationship; wherein the first mapping relationship includes a mapping relationship between the color characteristic parameter and the target color characteristic parameter; the color characteristic parameter and the target color characteristic parameter have the same parameter type; Determining a color adjustment gain coefficient of the image block according to the target color characteristic parameter and the color characteristic parameter of the image block; According to the toning gain coefficient of the image block, toning processing is performed on the color components of the image block to determine the target image of the image to be processed.
2. The method according to claim 1, characterized in that The step of determining the color characteristic parameters of the image block of the image to be processed includes: Determining a first ratio of a first color component to a second color component of the image block; determining a second ratio of a third color component to the second color component of the image block; According to a predefined second mapping relationship, a color characteristic parameter corresponding to the first ratio and the second ratio is determined; wherein the second mapping relationship includes a mapping relationship between the first ratio and the second ratio and the color characteristic parameter.
3. The method according to claim 2, characterized in that The first ratio is a mean or a weighted average of third ratios of sample points of the image block; wherein the third ratio is a ratio of a first color component to the second color component of the sample point; The second ratio is the mean or weighted average of the fourth ratios of the sample points of the image block; wherein the fourth ratio is the ratio of the third color component of the sample point to the second color component.
4. The method according to claim 1, characterized in that The color characteristic parameters of the image block include a first color characteristic parameter and a second color characteristic parameter; wherein the first color characteristic parameter is used to characterize the coldness or warmth of the color of the image block; and the second color characteristic parameter is used to characterize the degree of deviation of the color of the image block from a standard light source; The target color characteristic parameters include a first target color characteristic parameter and a second target color characteristic parameter, the first target color characteristic parameter corresponds to the first color characteristic parameter and has the same parameter type, and the second target color characteristic parameter corresponds to the second color characteristic parameter and has the same parameter type.
5. The method according to any one of claims 1 to 4, characterized in that The step of determining the color adjustment gain coefficient of the image block according to the target color characteristic parameter and the color characteristic parameter of the image block comprises: Converting the color characteristic parameter of the image block into a first result, wherein the first result includes: a first standard value of a first color component, a first standard value of a second color component, and a first standard value of a third color component; Converting the target color characteristic parameter into a second result, wherein the second result includes: a second standard value of the first color component, a second standard value of the second color component, and a second standard value of the third color component; According to the first result and the second result, a toning gain coefficient of the image block is determined; the toning gain coefficient includes a toning gain coefficient of the first color component and a toning gain coefficient of the third color component.
6. The method according to claim 5, characterized in that The color characteristic parameters of the image block include the color temperature and DUV of the image block; The target color characteristic parameters include target color temperature and target DUV; The first color component is an R component, the second color component is a G component, and the third color component is a B component.
7. The method according to claim 6, characterized in that The converting the color characteristic parameter of the image block into a first result comprises: According to a standard conversion relationship from CIE 1960UCS color space to CIE 1976UCS color space, converting the color characteristic parameters of the image block into a first result; The converting the target color characteristic parameter into a second result comprises: The target color characteristic parameters are converted into a second result according to a standard conversion relationship from the CIE 1960UCS color space to the CIE 1976UCS color space.
8. The method according to any one of claims 5 to 7, characterized in that: Determining the color gain coefficient of the image block according to the first result and the second result includes: determining a fifth ratio of the first standard value of the first color component to the first standard value of the second color component; determining a sixth ratio of the first standard value of the third color component to the first standard value of the second color component; determining a seventh ratio of the second standard value of the first color component to the second standard value of the second color component; determining an eighth ratio of the second standard value of the third color component to the second standard value of the second color component; Determining a color adjustment gain coefficient of the first color component according to the fifth ratio and the seventh ratio; A color adjustment gain coefficient of the third color component is determined according to the sixth ratio and the eighth ratio.
9. The method according to claim 8, characterized in that The step of determining the color adjustment gain coefficient of the first color component according to the fifth ratio and the seventh ratio includes: Determining a color adjustment gain coefficient of the first color component according to a ratio of the fifth ratio to the seventh ratio; The step of determining the color adjustment gain coefficient of the third color component according to the sixth ratio and the eighth ratio includes: A color adjustment gain coefficient of the third color component is determined according to a ratio of the sixth ratio to the eighth ratio.
10. The method according to any one of claims 5 to 9, characterized in that: The step of performing color adjustment processing on the color components of the image block according to the color adjustment gain coefficient of the image block to determine the target image of the image to be processed includes: According to the toning gain coefficient of the first color component of the image block and the toning gain coefficient of the second color component of the image block, toning processing is performed on the corresponding color components of the image block respectively to determine the target image of the image to be processed.
11. An image processing device, characterized in that: The device comprises: A first determination module is configured to determine color characteristic parameters of an image block of an image to be processed; a second determination module configured to determine a target color characteristic parameter corresponding to the color characteristic parameter according to a predefined first mapping relationship; wherein the first mapping relationship includes a mapping relationship between the color characteristic parameter and the target color characteristic parameter; and the color characteristic parameter and the target color characteristic parameter have the same parameter type; A third determination module is configured to determine a color adjustment gain coefficient of the image block according to the target color characteristic parameter and the color characteristic parameter of the image block; The color adjustment processing module is configured to perform color adjustment processing on the color components of the image block according to the color adjustment gain coefficient of the image block to determine the target image of the image to be processed.
12. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 10 is implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
14. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the method according to any one of claims 1 to 10 is implemented.