Color control method and device, electronic equipment and computer readable storage medium
By determining the target color temperature and color temperature offset based on the color temperature information of the picture image and the face area in the color control method, the problem of inaccurate traditional color control methods is solved, and more accurate image color control is achieved.
Patent Information
- Application Number
- CN202311127526.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-01
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2043-09-01
AI Technical Summary
Traditional color control methods have the problem of inaccurate color control.
The target color temperature of the face area is determined based on the first color temperature of the picture image and the second color temperature of the face area; the color temperature offset and the human eye visual offset are determined based on the second color temperature and the target color temperature; and the third color temperature is determined based on the first color temperature, the color temperature offset and the human eye visual offset, so as to more accurately control the color of the image.
It improves the accuracy of color control, ensures that the color of the image is more in line with the perception of the human eye's visual, and reduces the complexity of user adjustment.
Smart Images

Figure CN119562041A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of imaging technology, and in particular to a color control method, device, electronic device and computer-readable storage medium. Background Art
[0002] With the development of imaging technology, shooting technology has emerged. During the shooting process, the color information of the picture is controlled by the ratio of the R (Red) channel, the G (Green) channel and the B (Blue) channel, so as to capture images with accurate colors.
[0003] However, the traditional color control method has the problem of inaccurate color control. Summary of the invention
[0004] The embodiments of the present application provide a color control method, device, electronic device, computer-readable storage medium, and computer program product, which can improve the accuracy of color control.
[0005] In a first aspect, the present application provides a color control method. The method comprises:
[0006] Determine a target color temperature of the face area based on a first color temperature of the screen image and a second color temperature of the face area in the screen image;
[0007] Based on the second color temperature and the target color temperature, determining a color temperature offset and a human eye visual offset; the human eye visual offset is an offset in human eye vision generated when the color temperature of the image is adjusted from the second color temperature to the target color temperature;
[0008] A third color temperature is determined based on the first color temperature, the color temperature offset, and the human eye visual offset; the third color temperature is used to control the color of the image.
[0009] In a second aspect, the present application also provides a color control device. The device comprises:
[0010] A target color temperature determination module, configured to determine a target color temperature of a face region in the picture image based on a first color temperature of the picture image and a second color temperature of the face region in the picture image;
[0011] An offset determination module is used to determine a color temperature offset and a human eye visual offset based on the second color temperature and the target color temperature; the human eye visual offset is an offset in human eye vision generated when the color temperature of the image is adjusted from the second color temperature to the target color temperature;
[0012] The third color temperature determination module is used to determine a third color temperature based on the first color temperature, the color temperature offset and the human eye visual offset; the third color temperature is used to control the color of the image.
[0013] In a third aspect, the present application further provides an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0014] Determining a target color temperature of the face region based on a first color temperature of the screen image and a second color temperature of the face region in the screen image;
[0015] Based on the second color temperature and the target color temperature, determining a color temperature offset and a human eye visual offset; the human eye visual offset is an offset in human eye vision generated when the color temperature of the image is adjusted from the second color temperature to the target color temperature;
[0016] Based on the first color temperature, the color temperature offset and the human eye visual offset, a third color temperature is determined; the third color temperature is used to control the color of the image.
[0017] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0018] Determine a target color temperature of the face area based on a first color temperature of the screen image and a second color temperature of the face area in the screen image;
[0019] Based on the second color temperature and the target color temperature, determining a color temperature offset and a human eye visual offset; the human eye visual offset is an offset in human eye vision generated when the color temperature of the image is adjusted from the second color temperature to the target color temperature;
[0020] Based on the first color temperature, the color temperature offset and the human eye visual offset, a third color temperature is determined; the third color temperature is used to control the color of the image.
[0021] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0022] Determining a target color temperature of the face region based on a first color temperature of the screen image and a second color temperature of the face region in the screen image;
[0023] Based on the second color temperature and the target color temperature, determining a color temperature offset and a human eye visual offset; the human eye visual offset is an offset in human eye vision generated when the color temperature of the image is adjusted from the second color temperature to the target color temperature;
[0024] A third color temperature is determined based on the first color temperature, the color temperature offset, and the human eye visual offset; the third color temperature is used to control the color of the image.
[0025] The above-mentioned color control method, device, electronic device, computer-readable storage medium and computer program product, the electronic device determines the target color temperature of the face area based on the first color temperature of the screen image and the second color temperature of the face area in the screen image; determines the color temperature offset and the human eye vision offset based on the second color temperature of the face area in the screen image, and the human eye vision offset is the human eye vision offset generated when the color temperature of the image is adjusted from the second color temperature to the target color temperature; then, based on the first color temperature, the color temperature offset and the human eye vision offset, the third color temperature can be determined more accurately, so that the third color temperature can be used more accurately to control the color of the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 is a flow chart of a color control method in one embodiment;
[0028] Figure 2 is a flow chart of a color control method in another embodiment;
[0029] Figure 3 is a structural block diagram of a color control device in one embodiment;
[0030] Figure 4 FIG. 4 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0032] In one embodiment, Figure 1As shown, a color control method is provided. This embodiment uses the method applied to an electronic device as an example. The electronic device can be a terminal or a server. It can be understood that the method can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be but not limited to various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, smart cars, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster consisting of multiple servers.
[0033] In this embodiment, the color control method includes the following steps:
[0034] Step S102, determining a target color temperature of the face area based on the first color temperature of the screen image and the second color temperature of the face area in the screen image.
[0035] The screen image is an image of a screen displayed on a screen of an electronic device. Optionally, the screen image can be an image of the entire screen displayed on the screen, that is, a full-screen image, or can be an image of a partial screen displayed on the screen.
[0036] Color temperature is a unit of measurement that indicates the color components contained in light. Theoretically, blackbody temperature refers to the color that an absolute blackbody exhibits after being heated from absolute zero (-273°C). After being heated, a blackbody gradually changes from black to red, then yellow, then white, and finally emits blue light. When heated to a certain temperature, the spectral components contained in the light emitted by a blackbody are called the color temperature at this temperature, and the unit of measurement is "K" (Kelvin).
[0037] The first color temperature is the color temperature of the screen image, the second color temperature is the color temperature of the face area, and the target color temperature is the desired color temperature of the face area determined based on the first color temperature and the second color temperature. The screen image may include one or at least two face areas, and each face area may include one or at least two faces.
[0038] Optionally, the electronic device estimates the color temperature of the screen image to determine a first color temperature of the screen image; estimates the color temperature of the face area in the screen image to determine a second color temperature of the face area; and determines a target color temperature of the face area based on the first color temperature and the second color temperature.
[0039] In one implementation, the electronic device uses a color temperature estimation algorithm to estimate the color temperature of a screen image to determine a first color temperature of the screen image; and uses a color temperature estimation algorithm to estimate the color temperature of a face area in the screen image to determine a second color temperature of the face area.
[0040] In another embodiment, the electronic device obtains a first correspondence between color information and color temperature for a screen image, and obtains a second correspondence between color and color temperature for a facial area; collects color information of the screen image, matches the color information of the screen image with the first correspondence, and determines a first color temperature corresponding to the color information of the screen image; collects color information of the facial area, matches the color information of the facial area with the second correspondence, and determines a second color temperature corresponding to the color information of the facial area.
[0041] Among them, based on the color information of the picture image, the scene of the picture image can be determined, such as indoor scene, outdoor scene, sunny scene, cloudy scene, cloudy scene, night scene, sunset scene, front-lit scene, back-lit scene, high dynamic scene or low dynamic scene, etc.; based on the color information of the face area, the color temperature state of the face can be determined, such as monochrome temperature, mixed color temperature, high color temperature, low color temperature or medium color temperature, etc.
[0042] If both the first corresponding relationship and the second corresponding relationship are discrete data pairs, and the color information of the screen image or the color information of the face area does not match the corresponding discrete data pair, linear interpolation can be performed using a fitting curve.
[0043] Exemplarily, in the first corresponding relationship, the color information corresponding to the color temperature of 6500K is 1.0, and the color information corresponding to the color temperature of 5000K is 0.8. If the color information of the screen image is 0.95, linear interpolation is performed using the fitting curve to determine that the color information of the screen image is 6500*((0.95-0.8) / (1-0.8))+5500*((1-0.95) / (1-0.8))=6250.
[0044] The calibration method of the first correspondence includes: calibrating the light source color temperature information through a standard light source light box. For example, when the color temperature of the light source is 7500K, 6500K, 5000K, 4100K, 4000K, 2800K, 2300K and other light source states, for each light source, the electronic device measures a gray card with an 18% reflectivity photographed by a camera sensor, obtains the corresponding color information (R / G / B), and establishes a first correspondence between the color temperature of the light source and the corresponding color information.
[0045] The calibration method of the second correspondence includes: calibrating the light source color temperature information through a standard light source box. For example, when the color temperature of the light source is 7500K, 6500K, 5000K, 4100K, 4000K, 2800K, 2300K and other light source states, for each light source, the electronic device measures the face card taken by the camera sensor, obtains the corresponding color information (R / G / B), and establishes a second correspondence between the color temperature of the light source and the corresponding color information.
[0046] It is understandable that the electronic device obtains more facial color information and distribution information, which can be used for subsequent accurate restoration of facial color and control and adjustment of facial color stability.
[0047] Step S104, determining the color temperature offset and the human eye visual offset based on the second color temperature and the target color temperature; the human eye visual offset is the human eye visual offset generated when the color temperature of the image is adjusted from the second color temperature to the target color temperature.
[0048] The color temperature offset is the offset of the face area from the second color temperature to the target color temperature. The human eye visual offset is the offset of the human eye visual when the color temperature of the image is adjusted from the second color temperature to the target color temperature. It can be understood that the screen image and the face area are both in RGB color space, the first color temperature of the screen image is 6500K, the second color temperature of the face area is 3000K, and the target color temperature of the face area is 5000K. Within this coordinate, the color temperature offset △CCT is 2000K. After a large number of human eye vision and psychological experiments, it is known that after the electronic device converts the screen image and the face area from the RGB color space to the human eye vision space LMS, if the second color temperature of the face area is adjusted from 3000K to the target color temperature 5000K, the human eye will have an adaptive color temperature adjustment of 150K at this time. 150K is also the human eye vision offset, that is, from the human eye's perspective, the color temperature of the face area is 5150K, which exceeds the target color temperature of 5000K. Therefore, when adjusting the color temperature, the human eye vision offset also needs to be considered to more accurately control the color of the screen.
[0049] Among them, the human eye visual space LMS (Long, Short, Middle) is a color space represented by the response of the three cones of the human eye, named for its responsivity (sensitivity) peaks at long wavelengths, medium wavelengths, and short wavelengths. Radiation in the visible light range directly from a light source or indirectly from a surface produces a color stimulus, which produces a color value - a color value - in the three cones of the human visual organ. In the subsequent process of the body, this is seen as a hue. The term "three stimuli" is used for the "stimulus" response of the color center, although the term is used for the corrected standardized valence. The color receptors of each eye have a separate spectral sensitivity; in the process of perception, it is shaped into a specific sensory impression in the nervous system. This applies to each eye, whether animal or human, and the subsequent neural instruments. Every person with normal color has three types of "color-sensitive" cones. These are called the locations of the maximum sensitivity of the L, M, and S cones.
[0050] Optionally, the electronic device performs difference processing on the second color temperature and the target color temperature to determine the color temperature offset. For example, if the second color temperature of the face area is 3000K and the target color temperature of the face area is 5000K, the color temperature offset for adjusting the color temperature of the face area from the second color temperature to the target color temperature is △CCT=2000K.
[0051] Optionally, the electronic device may also adopt other methods, such as multiplying the target color temperature by the influence factor, and then performing difference processing on the product and the second color temperature to determine the color temperature offset; the method for determining the color temperature offset can be set as needed and is not limited here.
[0052] Optionally, the electronic device searches for a human eye visual offset generated by adjusting the second color temperature to the target color temperature from a human eye visual adaptive relationship.
[0053] The human vision adaptive relationship refers to the corresponding relationship between the image color temperature adjustment and the human vision offset. Exemplarily, the human vision adaptive relationship can be a lookup table of the human vision offset.
[0054] Step S106, determining a third color temperature based on the first color temperature, the color temperature offset and the human eye visual offset; the third color temperature is used to control the color of the image.
[0055] The third color temperature is the final color temperature for adjusting the color of the picture.
[0056] Optionally, the electronic device adds the first color temperature, the color temperature offset and the human eye visual offset to obtain a third color temperature, as shown in the following formula: CCT=CCT0+△CCT+△CCT-CS; wherein CCT is the third color temperature, CCT0 is the first color temperature, △CCT is the color temperature offset, and △CCT-CS is the human eye visual offset.
[0057] Optionally, the electronic device may also adopt an implementation method to determine the third color temperature, such as multiplying the color temperature offset and the human eye visual offset with the weight coefficient and then adding the first color temperature to obtain the third color temperature; and so on, which is not limited here.
[0058] Optionally, in the photo mode, the electronic device can adjust the color of the screen image based on the third color temperature corresponding to the screen image to generate a new screen image. In the video mode, the electronic device can adjust the color of the subsequent screen image frame based on the third color temperature corresponding to the previous screen image frame to generate a color-adjusted screen in real time.
[0059] Optionally, the electronic device searches for color compensation information corresponding to the third color temperature from the correspondence between color temperature and color compensation information, performs color compensation on the image using the color compensation information, and obtains a compensated target image to achieve white balance in the face area of the target image.
[0060] The corresponding relationship between the color temperature and the color compensation information includes at least two sets of discrete data pairs. If the third color temperature matches the discrete data pair from the corresponding relationship, the color compensation information of the discrete data pair is used as the color compensation information corresponding to the third color temperature. If the third color temperature does not match the discrete data pair from the corresponding relationship, at least two sets of discrete data pairs in the corresponding relationship are interpolated to generate color compensation information corresponding to the third color temperature. The color compensation information may be R / G / B compensation gain.
[0061] Exemplarily, the third color temperature is 6300K, and no discrete data pairs are matched from the corresponding relationship, then the two groups of discrete data pairs adjacent to the third color temperature in the corresponding relationship are interpolated, that is, the discrete data pairs belonging to the color temperature 6500K and the discrete data pairs belonging to the color temperature 5000K in the corresponding relationship are interpolated to obtain color compensation information corresponding to the third color temperature, that is, the color compensation information corresponding to the color temperature 6500K and the color compensation information corresponding to the color temperature 5000K in the corresponding relationship are interpolated to obtain color compensation information corresponding to the third color temperature.
[0062] In the above-mentioned color control method, the electronic device determines the target color temperature of the face area based on the first color temperature of the screen image and the second color temperature of the face area in the screen image; determines the color temperature offset and the human eye vision offset based on the second color temperature of the face area in the screen image, and the human eye vision offset is the human eye vision offset generated when the color temperature of the image is adjusted from the second color temperature to the target color temperature; then, based on the first color temperature, the color temperature offset and the human eye vision offset, the third color temperature can be determined more accurately, thereby more accurately controlling the color of the image.
[0063] In addition, the above-mentioned color control method simultaneously utilizes the first color temperature of the screen image and the second color temperature of the face area in the screen image, taking into account the color temperature determination of the screen image and the face area, and can obtain a screen color setting that is more in line with human eye vision while maintaining color stability; based on the third color temperature, the color of the image can be controlled, that is, when the camera is shooting, the color information of the image can be restored more accurately, while taking into account accuracy and stability.
[0064] Furthermore, when the user is taking pictures, the camera module of the electronic device can perform color restoration more accurately in automatic mode, that is, control the color of the image based on the third color temperature, obtain a more comfortable and human-eye-friendly color restoration, and reduce the complexity of user adjustment.
[0065] In one embodiment, the electronic device may also determine the lighting position of the face area based on the first color temperature and the second color temperature, and adjust the third color temperature based on the lighting position to obtain a new third color temperature.
[0066] It is understandable that when the color temperature of the face area deviates greatly from the color temperature of the screen image, if the color temperature of the face area is fully adjusted, it will have a greater impact on the color temperature of the entire screen image, causing the entire screen image to be distorted. Therefore, the electronic device can correct the third color temperature determined by the face area based on the lighting position of the face area.
[0067] For example, the first color temperature of the screen image is 6500K, and the second color temperature of the face area is 3000K. It can be determined that the lighting position of the face area is at a low color temperature in the mixed color temperature environment; therefore, the electronic device can determine the offset of the lighting position to adjust the third color temperature to obtain a more accurate third color temperature.
[0068] In this embodiment, the electronic device distinguishes different lighting positions of the face area to avoid the difference in color perception of the face in the shadow and in the sun, that is, the human eye will adapt to the huge difference in color temperature under the light source and in the shadow, but the difference does not appear obvious to the human eye, thereby obtaining a more accurate third color temperature to keep the image adjusted with the new third color temperature consistent with the perception of the human eye.
[0069] Furthermore, by determining the brightness offset through the lighting state of the face, it is possible to avoid differences in the perception of the face under different lighting states, such as avoiding differences in the brightness perception of the face in the shadow and in the sun. That is, the human eye will adapt to the brightness of the image and predict the brightness of the face in the shadow, so the face will not be too bright; and predict the brightness of the face in low light, so the face will not be too dark.
[0070] In one embodiment, based on the second color temperature and the target color temperature, the color temperature offset and the human eye vision offset are determined, including: performing difference processing on the second color temperature and the target color temperature to determine the color temperature offset; matching the second color temperature, the target color temperature and the human eye vision adaptive relationship to determine the human eye vision offset; the human eye vision adaptive relationship is the corresponding relationship between color temperature adjustment and human eye vision adaptation.
[0071] Optionally, the electronic device determines the human eye vision offset corresponding to the adjustment from the second color temperature to the target color temperature from the human eye vision adaptive relationship, wherein the color temperature adjustment direction can be determined by adjusting from the second color temperature to the target color temperature.
[0072] Exemplarily, if the second color temperature is 2000K and the target color temperature is 5000K, the color temperature adjustment direction from the second color temperature to the target color temperature is from 2000K to 5000K; if the second color temperature is 5000K and the target color temperature is 2000K, the color temperature adjustment direction from the second color temperature to the target color temperature is from 5000K to 2000K.
[0073] Optionally, the electronic device calibrates the adaptive relationship of human eye vision, including: the electronic device photographs a gray card with a reflectivity of 18% under at least two light sources respectively to obtain an image, wherein the image contains color information (R / G / B); the color temperatures of the light sources are 7500K, 6500K, 5000K, 4100K, 4000K, 2800K and 2300K respectively; at least two persons pre-view standard color information corresponding to the standard color temperatures, and for each light source, perform color compensation on the photographed image according to a state observed by the human eye, and compensate the color of the image to the standard color information observed by the human eye; the difference between the human eye visual color temperature corresponding to the standard color information observed by the human eye and the standard color temperature, that is, the color temperature of the light source is adjusted to the human eye visual offset corresponding to the standard color temperature; based on the color temperature of each light source being adjusted to the human eye visual offset corresponding to the standard color temperature, the adaptive relationship of human eye vision is calibrated.
[0074] Among them, the standard color temperature can be set as needed, such as 5000K, 4000K, etc.
[0075] For example, in a study of human visual psychology, a number of test subjects (such as 7-50 people) are selected to perform color restoration calibration under different color temperature environments. For example, the light source is 7500K, and at least two people pre-watch the standard color information corresponding to the standard color temperature of 5000K. The captured image is color compensated according to the state observed by the human eye, and the color of the image is compensated to the standard color information observed by the human eye. That is, the color information observed by the human eye is compensated to the standard color information corresponding to 5000K observed by the human eye. If the color temperature corresponding to the standard color information observed by the human eye is 5500K, then 5500K-5000K=500K, indicating that the image color temperature is adjusted from 7500K to 5000K, and the human eye vision offset is 500K.
[0076] Similarly, if the color temperature of the light source is 6500K, the standard color temperature is 5000K, and the color temperature corresponding to the standard color information observed by the human eye is 5200K, which means that the image color temperature is adjusted from 6500K to 5000K, and the human eye vision offset is 200K; if the color temperature of the light source is 5000K, the standard color temperature is 5000K, and the color temperature corresponding to the standard color information observed by the human eye is 5000K, which means that the image color temperature is adjusted from 5000K to 5000K, and the human eye vision offset is 0; if the color temperature of the light source is 4100K, the standard color temperature is 5000K, and the color temperature corresponding to the standard color information observed by the human eye is 4800K, which means that the image color temperature is adjusted from 4100K to 5000K, and the human eye vision offset is 200K; If the color temperature of the light source is 4000K and the standard color temperature is 5000K, the color temperature corresponding to the standard color information observed by the human eye is 4700K, which means that the image color temperature is adjusted from 4000K to 5000K, and the human eye vision is offset by 300K; if the color temperature of the light source is 2800K and the standard color temperature is 5000K, the color temperature corresponding to the standard color information observed by the human eye is 4200K, which means that the image color temperature is adjusted from 2800K to 5000K, and the human eye vision is offset by 800K; if the color temperature of the light source is 2300K and the standard color temperature is 5000K, the color temperature corresponding to the standard color information observed by the human eye is 4000K, which means that the image color temperature is adjusted from 2300K to 5000K, and the human eye vision is offset by 1000K.
[0077] In this embodiment, the electronic device performs difference processing on the second color temperature and the target color temperature to determine the color temperature offset; by matching the second color temperature, the target color temperature and the adaptive relationship of human eye vision, the human eye vision offset can be determined more accurately, thereby more accurately determining the third color temperature and more accurately controlling the color of the picture.
[0078] In one embodiment, based on the first color temperature of the screen image and the second color temperature of the face area in the screen image, determining the target color temperature of the face area includes: based on the first color temperature of the screen image and the second color temperature of the face area in the screen image, determining the degree of difference between the first color temperature and the second color temperature; determining the target color temperature of the face area according to the degree of difference; the color temperature offset between the target color temperature and the second color temperature is negatively correlated with the degree of difference.
[0079] Optionally, the electronic device performs difference processing on the first color temperature of the screen image and the second color temperature of the face area in the screen image to obtain the difference between the first color temperature and the second color temperature; the difference represents the degree of difference between the first color temperature and the second color temperature, and the difference is positively correlated with the degree of difference.
[0080] It is understandable that the greater the difference between the first color temperature and the second color temperature, the greater the difference between the overall color temperature of the screen image and the color temperature of the face area. If the color temperature offset between the target color temperature of the face area and the second color temperature is greater, the final third color temperature will also be greater, and the electronic device will adjust the color of the screen with the third color temperature. This will cause the overall screen image, which is originally very different from the face area, to also adjust the color at the same time, resulting in distortion. Therefore, the greater the difference between the first color temperature and the second color temperature, the smaller the color temperature offset between the target color temperature and the second color temperature, that is, the value of the determined target color temperature is closer to the value of the second color temperature.
[0081] In this embodiment, the electronic device determines the degree of difference between the first color temperature and the second color temperature based on the first color temperature of the screen image and the second color temperature of the face area in the screen image, and then determines the target color temperature of the face area according to the degree of difference, so that the color temperature offset between the target color temperature and the second color temperature is negatively correlated with the degree of difference, which can avoid the problem of picture distortion caused by the final control of the picture color adjustment, that is, more accurately determine the target color temperature and the final third color temperature.
[0082] In one embodiment, a method for determining the second color temperature of a face region in a screen image includes: detecting the skin color of the face region in the screen image; and determining the second color temperature of the face region based on the skin color and color information of the face region.
[0083] It is understandable that the color temperature of the face region is different due to the different skin colors of the face region, so the second color temperature of the face region can be determined more accurately with the help of the skin color of the face region.
[0084] Optionally, the electronic device detects the skin color of a facial area in a screen image and determines a color temperature range corresponding to the skin color; uses a color temperature estimation algorithm to perform color temperature estimation on the color information of the facial area and determines a candidate color temperature of the facial area; if the candidate color temperature is within the color temperature range corresponding to the skin color, the candidate color temperature is used as the second color temperature of the facial area; if the candidate color temperature is not within the color temperature range corresponding to the skin color, the color temperature of the color information of the facial area is re-estimated until the candidate color temperature obtained by the color temperature estimation is within the color temperature range corresponding to the skin color, and the candidate color temperature is used as the second color temperature of the facial area.
[0085] In this embodiment, the electronic device detects the skin color of the face area in the screen image, and can use the skin color to assist in estimating the color temperature of the face area, thereby more accurately determining the second color temperature of the face area.
[0086] In one embodiment, determining a third color temperature based on the first color temperature, the color temperature offset and the human eye visual offset includes: determining a first weight coefficient corresponding to the color temperature offset and a second weight coefficient corresponding to the human eye visual offset; determining the third color temperature based on the first color temperature, the color temperature offset and the corresponding first weight coefficient, and the human eye visual offset and the corresponding second weight coefficient.
[0087] The first weight coefficient is a coefficient that affects the color temperature offset, and the second weight coefficient is a coefficient that affects the human eye's visual offset. Both the first weight coefficient and the second weight coefficient can be set as needed, and the first weight coefficient and the second weight coefficient can be the same or different.
[0088] Optionally, the electronic device multiplies the color temperature offset and the corresponding first weight coefficient to obtain a first product, and multiplies the human eye visual offset and the corresponding second weight coefficient to obtain a second product, and adds the first color temperature, the first product and the second product to obtain a third color temperature.
[0089] Exemplarily, if the first weight coefficient and the second weight coefficient are the same, the third color temperature can be calculated using the following formula: CCT=CCT0+a*(△CCT+△CCT-CS); wherein CCT is the third color temperature, CCT0 is the first color temperature, △CCT is the color temperature offset, △CCT-CS is the human eye visual offset, and a is the first weight coefficient or the second weight coefficient.
[0090] Optionally, the difference between the first color temperature and the second color temperature is negatively correlated with the first weight coefficient; the difference between the first color temperature and the second color temperature is negatively correlated with the second weight coefficient.
[0091] It is understandable that the greater the difference between the first color temperature and the second color temperature, the greater the difference between the overall color temperature of the screen image and the color temperature of the face area. If the first weight coefficient or the second weight coefficient is larger at this time, the color temperature offset or the human eye visual offset will be larger, and the final third color temperature will also be larger. The electronic device will adjust the color of the screen with the third color temperature to a greater extent, which will cause the overall screen image that is originally very different from the face area to also adjust the color and cause distortion. Therefore, the greater the difference between the first color temperature and the second color temperature, the smaller the first weight coefficient or the second weight coefficient.
[0092] Optionally, determining a first weight coefficient corresponding to the color temperature offset and a second weight coefficient corresponding to the human eye visual offset includes: determining the first weight coefficient corresponding to the color temperature offset and the second weight coefficient corresponding to the human eye visual offset based on at least one of the size of the face area in the picture image and the distance between the face area and the center of the picture; the first weight coefficient is positively correlated with the size, the first weight coefficient is negatively correlated with the distance, the second weight coefficient is positively correlated with the size, and the second weight coefficient is negatively correlated with the distance.
[0093] Among them, the size of the face area in the picture image can be divided into a large face or a small face, etc.; the distance between the face area and the center of the picture can be small or large. A smaller distance indicates that the face area is a face in the center position, and a larger distance indicates that the face area is a face in the edge position.
[0094] Optionally, the electronic device detects a face area in a screen image, obtains at least one of the size of the face area in the screen image and the distance between the face area and the center of the screen, and determines a first weight coefficient corresponding to the color temperature offset and a second weight coefficient corresponding to the human eye visual offset based on at least one of the size of the face area in the screen image and the distance between the face area and the center of the screen.
[0095] Optionally, the electronic device obtains a third correspondence between the first weight coefficient and the size of the face area in the screen image and the distance between the face area and the center of the screen, in which the first weight coefficient and the size are positively correlated, and the first weight coefficient and the distance are negatively correlated; if the electronic device detects the size of the face area in the screen image, it matches the size with the third correspondence to determine the first weight coefficient corresponding to the size; if the electronic device detects the distance between the face area and the center of the screen, it matches the distance with the third correspondence to determine the first weight coefficient corresponding to the distance; if the electronic device detects the size of the face area in the screen image and the distance between the face area and the center of the screen, it matches the size and the distance with the third correspondence, multiplies the sub-weight coefficient corresponding to the size by the sub-weight coefficient corresponding to the distance, and obtains the first weight coefficient corresponding to the size and the distance.
[0096] Optionally, the electronic device obtains a fourth correspondence between the second weight coefficient and the size of the face area in the screen image, and the distance between the face area and the center of the screen, in which the second weight coefficient and the size are positively correlated, and the second weight coefficient and the distance are negatively correlated; if the electronic device detects the size of the face area in the screen image, it matches the size with the fourth correspondence to determine the second weight coefficient corresponding to the size; if the electronic device detects the distance between the face area and the center of the screen, it matches the distance with the fourth correspondence to determine the second weight coefficient corresponding to the distance; if the electronic device detects the size of the face area in the screen image and the distance between the face area and the center of the screen, it matches the size and the distance with the fourth correspondence, multiplies the sub-weight coefficient corresponding to the size by the sub-weight coefficient corresponding to the distance, and obtains the second weight coefficient corresponding to the size and the distance.
[0097] For example, for a face that is located in the center of the screen image and is relatively large, the first weight coefficient can be a=0.95*1*1, where 0.95 is the sub-weight coefficient corresponding to the size, the first 1 is the sub-weight coefficient corresponding to the center position, and the second 1 indicates that there is only one face area in the screen image. If there are multiple face areas, the corresponding sub-weight coefficients will become smaller.
[0098] Optionally, if the screen image includes at least two face areas, for each face area, the total offset of the face area is determined based on the color temperature offset of the face area and the corresponding first weight coefficient, the human eye visual offset and the corresponding second weight coefficient; and the third color temperature is determined based on the first color temperature and the total offset of at least two face areas.
[0099] Optionally, for each face area, the electronic device multiplies the color temperature offset of the face area by the corresponding first weight coefficient to obtain a first product, and multiplies the human eye visual offset by the corresponding second weight coefficient to obtain a second product, and adds the first product and the second product to obtain a total offset of the face area; averages the total brightness offsets of at least two face areas to obtain an averaged offset; and adds the first color temperature to the averaged offset to determine a third color temperature.
[0100] Exemplarily, the screen image includes two human face areas. The size of the first human face area in the screen image is larger, so the first weight coefficient and the second weight coefficient of the human face area are both larger. The size of the second human face area in the screen image is smaller, so the first weight coefficient and the second weight coefficient of the human face area are both smaller. For each human face area, the electronic device multiplies the color temperature offset of the human face area by the corresponding first weight coefficient to obtain a first product, and adds the human eye visual offset and the corresponding second weight coefficient to obtain a second product, and then adds the first product and the second product to obtain the total offset of the human face area. Finally, the total offset of the two human face areas is averaged, and the first color temperature is added to the offset after averaging to determine the third color temperature.
[0101] In this embodiment, the electronic device determines the first weight coefficient corresponding to the color temperature offset and the second weight coefficient corresponding to the human eye visual offset. Then, based on the first color temperature, the color temperature offset and the corresponding first weight coefficient, and the human eye visual offset and the corresponding second weight coefficient, the third color temperature can be accurately determined. Further, the electronic device determines the first weight coefficient corresponding to the color temperature offset and the second weight coefficient corresponding to the human eye visual offset based on at least one of the size of the face area in the screen image and the distance between the face area and the center of the screen; the first weight coefficient is positively correlated with the size, the first weight coefficient is negatively correlated with the distance, the second weight coefficient is positively correlated with the size, and the second weight coefficient is negatively correlated with the distance. The first weight coefficient and the second weight coefficient can be more accurately determined, so as to more accurately determine the third color temperature.
[0102] In one embodiment, Figure 2 As shown, when the electronic device detects a face from a screen image, it counts the R / G / B color information of the screen image and the R / G / B color information of the face area respectively; based on the R / G / B color information of the screen image, the R / G ratio and B / G ratio of the screen image are determined, and the first color temperature of the screen image is calculated; based on the R / G / B color information of the face area, the R / G ratio and B / G ratio of the face area are determined, and the electronic device normalizes the pixels of the screen image, and based on the normalized face area, the R / G ratio and B / G ratio, and the lookup table of skin color and color temperature range, the second color temperature of the face area is calculated.
[0103] It is understandable that the electronic device first normalizes the pixels of the screen image, so that the pixel data of the face area after the normalization processing can be more concentrated, and the second color temperature of the face area can be estimated more accurately.
[0104] The electronic device determines a target color temperature of a face area based on a first color temperature of a screen image and a second color temperature of the face area in the screen image; determines a color temperature offset through the second color temperature and the target color temperature of the face area; searches for a human eye vision offset for adjusting from the second color temperature to the target color temperature from a human eye vision adaptive relationship; and outputs a final third color temperature based on the first color temperature, the color temperature offset, and the human eye vision offset.
[0105] In one embodiment, another color control method is provided, which is applied to an electronic device and includes the following steps:
[0106] Step A1, detecting the skin color of the face area in the picture image.
[0107] Step A2: determining a second color temperature of the face area based on the skin color and the color information of the face area.
[0108] Step A3: determining the degree of difference between the first color temperature and the second color temperature based on the first color temperature and the second color temperature of the picture image.
[0109] Step A4, determining the target color temperature of the face area according to the degree of difference; the color temperature offset between the target color temperature and the second color temperature is negatively correlated with the degree of difference.
[0110] Step A5: performing difference processing on the second color temperature and the target color temperature to determine the color temperature offset.
[0111] Step A6, matching the second color temperature, the target color temperature and the human eye vision adaptive relationship to determine the human eye vision offset; the human eye vision offset is the human eye vision offset generated when the color temperature of the image is adjusted from the second color temperature to the target color temperature, and the human eye vision adaptive relationship is the corresponding relationship between the color temperature adjustment and the human eye vision adaptive relationship.
[0112] Step A7, based on at least one of the size of the face area in the picture image and the distance between the face area and the center of the picture, determine the first weight coefficient corresponding to the color temperature offset and the second weight coefficient corresponding to the human eye visual offset; the first weight coefficient is positively correlated with the size, the first weight coefficient is negatively correlated with the distance, the second weight coefficient is positively correlated with the size, and the second weight coefficient is negatively correlated with the distance; and the degree of difference between the first color temperature and the second color temperature is negatively correlated with the first weight coefficient; the degree of difference between the first color temperature and the second color temperature is negatively correlated with the second weight coefficient.
[0113] Step A8, determining a third color temperature based on the first color temperature, the color temperature offset and the corresponding first weight coefficient, and the human eye visual offset and the corresponding second weight coefficient; the third color temperature is used to control the color of the image.
[0114] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0115] Based on the same inventive concept, the embodiment of the present application also provides a color control device for implementing the color control method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more color control device embodiments provided below can refer to the limitations of the color control method above, and will not be repeated here.
[0116] In one embodiment, Figure 3 As shown, a color control device is provided, including: a target color temperature determination module 302, an offset determination module 304 and a third color temperature determination module 306, wherein:
[0117] The target color temperature determination module 302 is used to determine the target color temperature of the face area based on the first color temperature of the picture image and the second color temperature of the face area in the picture image.
[0118] The offset determination module 304 is used to determine the color temperature offset and the human eye visual offset based on the second color temperature and the target color temperature; the human eye visual offset is the human eye visual offset generated when the color temperature of the image is adjusted from the second color temperature to the target color temperature.
[0119] The third color temperature determination module 306 is used to determine a third color temperature based on the first color temperature, the color temperature offset and the human eye visual offset; the third color temperature is used to control the color of the image.
[0120] In the above-mentioned color control device, the electronic device determines the target color temperature of the face area based on the first color temperature of the screen image and the second color temperature of the face area in the screen image; determines the color temperature offset and the human eye vision offset based on the second color temperature of the face area in the screen image, and the human eye vision offset is the human eye vision offset generated when the color temperature of the image is adjusted from the second color temperature to the target color temperature; then, based on the first color temperature, the color temperature offset and the human eye vision offset, the third color temperature can be determined more accurately, thereby more accurately controlling the color of the image.
[0121] In one embodiment, the above-mentioned offset determination module 304 is also used to perform difference processing on the second color temperature and the target color temperature to determine the color temperature offset; match the second color temperature, the target color temperature and the human eye vision adaptive correspondence to determine the human eye vision offset; the human eye vision adaptive relationship is the correspondence between color temperature adjustment and human eye vision adaptation.
[0122] In one embodiment, the target color temperature determination module 302 is further used to determine the degree of difference between the first color temperature and the second color temperature based on the first color temperature of the screen image and the second color temperature of the face area in the screen image; determine the target color temperature of the face area according to the degree of difference; and the color temperature offset between the target color temperature and the second color temperature is negatively correlated with the degree of difference.
[0123] In one embodiment, the above device also includes a second color temperature determination module, which is used to detect the skin color of the face area in the picture image; based on the skin color and color information of the face area, determine the second color temperature of the face area.
[0124] In one embodiment, the third color temperature determination module 306 is further used to determine a first weight coefficient corresponding to the color temperature offset and a second weight coefficient corresponding to the human eye visual offset; and the third color temperature is determined based on the first color temperature, the color temperature offset and the corresponding first weight coefficient, and the human eye visual offset and the corresponding second weight coefficient.
[0125] In one embodiment, the third color temperature determination module 306 is further used to determine a first weight coefficient corresponding to the color temperature offset and a second weight coefficient corresponding to the human eye visual offset based on at least one of the size of the face area in the picture image and the distance between the face area and the center of the picture; the first weight coefficient is positively correlated with the size, the first weight coefficient is negatively correlated with the distance, the second weight coefficient is positively correlated with the size, and the second weight coefficient is negatively correlated with the distance.
[0126] In one embodiment, the difference between the first color temperature and the second color temperature is negatively correlated with the first weight coefficient; the difference between the first color temperature and the second color temperature is negatively correlated with the second weight coefficient.
[0127] Each module in the above color control device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in the electronic device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0128] In one embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown. The electronic device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a color control method is implemented. The display unit of the electronic device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the electronic device casing, or an external keyboard, touchpad or mouse.
[0129] Those skilled in the art will understand that Figure 4 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0130] The embodiment of the present application further provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, when the computer-executable instructions are executed by one or more processors, the processors execute the steps of the color control method.
[0131] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the color control method.
[0132] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0133] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0134] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0135] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A color control method, characterized in that: include: Determine a target color temperature of the face area based on a first color temperature of the screen image and a second color temperature of the face area in the screen image; Based on the second color temperature and the target color temperature, determining a color temperature offset and a human eye visual offset; the human eye visual offset is an offset in human eye vision generated when the color temperature of the image is adjusted from the second color temperature to the target color temperature; A third color temperature is determined based on the first color temperature, the color temperature offset, and the human eye visual offset; the third color temperature is used to control the color of the image.
2. The method according to claim 1, characterized in that The determining of the color temperature offset and the human eye vision offset based on the second color temperature and the target color temperature includes: Performing difference processing on the second color temperature and the target color temperature to determine a color temperature offset; The second color temperature, the target color temperature and the human vision adaptive relationship are matched to determine the human vision offset; the human vision adaptive relationship is the corresponding relationship between color temperature adjustment and human vision adaptation.
3. The method according to claim 1, characterized in that The step of determining a target color temperature of the face area based on the first color temperature of the screen image and the second color temperature of the face area in the screen image includes: Determine, based on a first color temperature of a screen image and a second color temperature of a face region in the screen image, a degree of difference between the first color temperature and the second color temperature; According to the degree of difference, a target color temperature of the face area is determined; and a color temperature offset between the target color temperature and the second color temperature is negatively correlated with the degree of difference.
4. The method according to claim 1, characterized in that: The method for determining the second color temperature of the face area in the picture image includes: Detecting the skin color of the face area in the picture image; Based on the skin color and the color information of the face area, a second color temperature of the face area is determined.
5. The method according to claim 1, characterized in that The determining of a third color temperature based on the first color temperature, the color temperature offset, and the human eye visual offset includes: Determine a first weight coefficient corresponding to the color temperature offset and a second weight coefficient corresponding to the human eye vision offset; A third color temperature is determined based on the first color temperature, the color temperature offset and the corresponding first weight coefficient, and the human eye visual offset and the corresponding second weight coefficient.
6. The method according to claim 5, characterized in that The determining of the first weight coefficient corresponding to the color temperature offset and the second weight coefficient corresponding to the human eye vision offset includes: Based on at least one of the size of the face area in the screen image and the distance between the face area and the center of the screen, determine a first weight coefficient corresponding to the color temperature offset and a second weight coefficient corresponding to the human eye visual offset; the first weight coefficient is positively correlated with the size, the first weight coefficient is negatively correlated with the distance, the second weight coefficient is positively correlated with the size, and the second weight coefficient is negatively correlated with the distance.
7. The method according to claim 5, characterized in that The difference between the first color temperature and the second color temperature is negatively correlated with the first weight coefficient; the difference between the first color temperature and the second color temperature is negatively correlated with the second weight coefficient.
8. A color control device, characterized in that: include: A target color temperature determination module, configured to determine a target color temperature of a face region in the picture image based on a first color temperature of the picture image and a second color temperature of the face region in the picture image; An offset determination module is used to determine a color temperature offset and a human eye visual offset based on the second color temperature and the target color temperature; the human eye visual offset is an offset in human eye vision generated when the color temperature of the image is adjusted from the second color temperature to the target color temperature; The third color temperature determination module is used to determine a third color temperature based on the first color temperature, the color temperature offset and the human eye visual offset; the third color temperature is used to control the color of the image.
9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the color control method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Automatic white balance method based on face color features and electronic media device
CN105187810A
White balance correction method based on skin color information and image processing device thereof
CN110392245A
Image processing method and device based on face features, equipment and storage medium
CN114945087A
Method and device for controlling white balance function of electronic device
US20200053332A1
Flexible region of interest color processing for cameras
US20230017498A1