Light supplementing method and device

By setting a color fill light area on the terminal screen, the color cast problem caused by screen fill light was solved, and the shooting effect of the terminal was improved.

CN122372847APending Publication Date: 2026-07-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2025-01-08
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In dimly lit environments, when the terminal screen provides supplemental lighting, the image is prone to color distortion, affecting the shooting effect.

Method used

By setting the fill light area of ​​the terminal screen to colored light, such as cyan, yellow, or purple light, color shift can be reduced, and color shift caused by the characteristics of the screen and image acquisition device can be corrected using fill light configuration information.

Benefits of technology

It effectively reduces color cast when capturing images from the terminal, thus improving the shooting effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122372847A_ABST
    Figure CN122372847A_ABST
Patent Text Reader

Abstract

A method and apparatus for supplemental lighting are disclosed. The method, applied to a terminal, includes: after the terminal enters a preview mode of a camera application, setting the supplemental lighting color of a first area according to pre-configured supplemental lighting configuration information; wherein the supplemental lighting configuration information indicates a first color value of the first area, at least two of the three component values ​​of the first color value are different, and the first area is the supplemental lighting area of ​​the terminal screen. Then, a first image in the preview mode is acquired, and the supplemental lighting color of the first area is further adjusted according to the color values ​​of the pixels in the first image. This reduces color cast when the terminal captures images by using different colors of light, thereby improving the shooting effect and image quality of the terminal. Furthermore, after the terminal projects light onto the first area of ​​the screen according to the supplemental lighting color, it further adjusts the supplemental lighting color of the first area to further reduce color cast when the terminal captures images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a supplementary lighting method and apparatus. Background Technology

[0002] With the widespread adoption and diversified functions of smart mobile terminal devices (hereinafter referred to as terminals), more and more users prefer to use terminals for photography. In low-light shooting environments, screen lighting can be used to avoid excessive noise and underexposure in the captured image, thereby achieving a clear image. Screen lighting refers to illuminating the subject using the light emitted from the terminal screen in low-light environments.

[0003] When using screen fill light, the light emitted by the terminal screen is generally of a single and fixed color, such as white light. This can lead to color cast in the captured image, affecting the shooting effect of the terminal.

[0004] Therefore, how to better supplement light, reduce the impact of color cast, and improve the shooting effect of the terminal needs further research. Summary of the Invention

[0005] This application provides a supplementary lighting method and apparatus to reduce color cast when a terminal captures images and improve the shooting effect of the terminal.

[0006] Firstly, this application provides a supplementary lighting method, which can be applied to a terminal, or to a chip, unit, or module within the terminal. The method includes: after the terminal enters the preview mode of a camera application, setting the supplementary lighting color of a first area according to supplementary lighting configuration information; wherein the supplementary lighting configuration information indicates a first color value for the first area, and at least two of the three component values ​​of the first color value are different, and the first area is the supplementary lighting area of ​​the terminal screen.

[0007] In the above method, setting the fill light color for the first area is equivalent to projecting light of that color onto the first area of ​​the terminal screen. This fill light color is associated with a first color value. Because at least two of the three component values ​​of the first color value are different, the fill light is colored light, such as cyan or yellow. In other words, the fill light is not colorless light; that is, the fill light color will not be black, white, or gray. This allows for the reduction of color cast when the terminal captures images, thereby improving the terminal's shooting effect. It can be understood that this fill light configuration information is pre-configured.

[0008] One possible implementation is that the complementary light color corresponding to the first color value is cyan. For example, the red component value in the first color value ranges from 191 to 207, the green component value ranges from 239 to 255, and the blue component value ranges from 239 to 255. It can be seen that in the first color value, the red component value is less than the green component value, the red component value is less than the blue component value, and generally, the blue component value is equal to the green component value. For example, the red, green, and blue component values ​​in the first color value are 207, 255, and 255, respectively.

[0009] One possible implementation is that the complementary light color corresponding to the first color value is purple. For example, the red component value in the first color value ranges from 239 to 255, the green component value ranges from 191 to 207, and the blue component value ranges from 239 to 255. It can be seen that in the first color value, the green component value is less than the red component value, the green component value is less than the blue component value, and generally, the red component value is equal to the blue component value. For example, the red, green, and blue component values ​​in the first color value are 255, 207, and 255, respectively.

[0010] One possible implementation is that the complementary light color corresponding to the first color value is yellow. For example, the red component value in the first color value ranges from 239 to 255, the green component value ranges from 239 to 255, and the blue component value ranges from 191 to 207. It can be seen that in the first color value, the blue component value is less than the green component value, the blue component value is less than the red component value, and generally, the green component value is equal to the red component value. For example, the red, green, and blue component values ​​in the first color value are 255, 255, and 207, respectively.

[0011] Optionally, the supplementary lighting configuration information is associated with the screen characteristics of the terminal. The supplementary lighting color corresponding to the first color value indicated by the supplementary lighting configuration information is used to correct the color shift caused by the screen characteristics when the terminal is taking pictures. The screen characteristics include, but are not limited to, the characteristics of light-emitting diodes (LEDs) and organic light-emitting diodes (OLEDs). These characteristics are manifested in the luminous efficiency of the three colors of light (red, green, and blue), and the influence of the screen material on the propagation path, intensity, and phase of the three colors of light. Therefore, screen characteristics may cause color shifts in images captured when the terminal uses white light for supplementary lighting (e.g., the captured image appears reddish). Based on this, by setting the supplementary lighting color of the supplementary lighting area of ​​the terminal screen (e.g., setting the supplementary lighting color of the supplementary lighting area of ​​the terminal screen to cyan according to the first color value), the color shift caused by the screen characteristics during terminal photography can be reduced, thereby achieving the effect of color shift correction.

[0012] Optionally, the supplementary lighting configuration information is also associated with the characteristics of the terminal's image acquisition device. The supplementary lighting color corresponding to the first color value indicated by the supplementary lighting configuration information is also used to adjust the color cast caused by the characteristics of the image acquisition device during terminal photography. The characteristics of the image acquisition device include, but are not limited to, filter capabilities and sensor capabilities. Filter capabilities and sensor capabilities affect image color, and therefore these characteristics can cause color cast in images captured when the terminal uses white light for supplementary lighting. Based on this, by setting the supplementary lighting color of the supplementary lighting area of ​​the terminal screen, the color cast caused by the characteristics of the image acquisition device during terminal photography can be reduced, thereby achieving the effect of color cast correction.

[0013] One possible implementation, before setting the fill light color of the first region according to the fill light configuration information, the method further includes: acquiring a first image in the preview mode, and then selecting the fill light configuration information from at least two candidate fill light configuration information according to the color values ​​of the pixels in the first image, wherein any two candidate fill light configuration information indicate different color values.

[0014] In the above implementation, the color value of the pixels in the first image is used to indicate the current ambient light color. Different ambient light colors will also cause color shifts in the images captured by the terminal. For example, if the current ambient light is blue, the image captured by the terminal will be bluish. Based on this, multiple candidate supplementary lighting configuration information (i.e., at least two candidate supplementary lighting configuration information) are pre-configured. These candidate supplementary lighting configuration information are associated with different color values ​​(or color value ranges). In this way, the optimal supplementary lighting configuration information can be matched from multiple candidate supplementary lighting configuration information based on the current ambient light color. Then, the supplementary lighting color can be set using the first color value indicated by the optimal supplementary lighting configuration information, thereby better reducing the color shift caused by the current ambient light color when the terminal captures the image.

[0015] One possible implementation is that, before setting the fill light color of the first region according to the fill light configuration information, the fill light color of the first region is white light.

[0016] One possible implementation is that, after setting the fill light color of the first region according to the fill light configuration information, the method further includes: acquiring a second image in the preview mode, and adjusting the fill light color of the first region according to the color values ​​of the pixels in the second image.

[0017] In the above implementation, the second image is captured after the fill light color is set according to the first color value. After the terminal projects light onto the first area of ​​the screen according to the fill light color set according to the first color value, it can also capture an image to further adjust the fill light color of the first area, thereby further reducing the color shift phenomenon that exists when the terminal captures the image.

[0018] One possible implementation is that adjusting the fill light color of the first region based on the color values ​​of pixels in the second image includes: determining a second color value of the first region based on the color values ​​of pixels in the second region of the second image; and setting the fill light color of the first region based on the second color value.

[0019] One possible implementation is that the second region is the region where the face is located in the first image; to this end, determining the second color value of the first region based on the color values ​​of the pixels in the second region of the second image includes: determining the second color value based on the color values ​​of the pixels in the second region of the second image and the reference color value of the face.

[0020] One possible implementation is that the reference color value of the face includes a red reference component value, a green reference component value, and a blue reference component value. Based on this, determining the second color value according to the color values ​​of pixels in the second region of the second image and the reference color value of the face includes: calculating an average red component value, an average green component value, and an average blue component value based on the color values ​​of each pixel in the second region of the second image; determining the red component value in the second color value based on the average red component value and the red reference component value; determining the green component value in the second color value based on the average green component value and the green reference component value; and determining the blue component value in the second color value based on the average blue component value and the blue reference component value.

[0021] One possible implementation is that when the average color component value is greater than the corresponding color reference component value, the corresponding color component value in the second color value is less than 255; when the average color component value is less than or equal to the corresponding color reference component value, the corresponding color component value in the second color value is equal to 255.

[0022] Optionally, the component value of the second color value can be calculated according to the following formula (1):

[0023]

[0024] Where L is a color component value (red / green / blue) in the second color value, Tar is the corresponding base color component value (red / green / blue), Avg is the corresponding average color component value (red / green / blue), f(d) is the attenuation function of the supplementary light brightness as the distance increases, d is the distance between the object being photographed (such as a human face) and the terminal screen, and k is a preset constant.

[0025] In the above implementation method, due to the diversity and complexity of ambient light colors, there may be a complementary light color corresponding to the first color value indicated by the complementary light configuration information. The effect of reducing the color shift caused by the current ambient light color on the image captured by the terminal is not ideal. Therefore, by acquiring the second image after the terminal projects light according to the complementary light color, the complementary light color of the first area is further adjusted, thereby further reducing the color shift phenomenon in the image captured by the terminal and improving the shooting effect of the terminal.

[0026] One possible implementation is that, in the preview mode of the camera application, the interface of the camera application includes a first function option; based on this, acquiring the second image in the preview mode includes: receiving a user operation on the first function option; and in response to the user operation, acquiring the first image acquired by the image acquisition device of the terminal.

[0027] In the above implementation, the first function option can be understood as controlling whether the terminal adjusts the fill light color of the first area by acquiring the second image. That is, adjusting the fill light color of the first area can be performed based on user operation, thereby ensuring the flexibility of fill light.

[0028] Secondly, this application provides a supplementary lighting method, which can be applied to a terminal, or to a chip, unit, or module within the terminal. The method includes: the terminal entering a preview mode of a camera application; then acquiring an image in the preview mode; determining the color value of a first region based on the color values ​​of pixels in the image, wherein the first region is the supplementary lighting region of the terminal screen; and finally setting the supplementary lighting color of the first region based on the color values ​​of the first region.

[0029] In the above method, the terminal determines the fill light color based on the color values ​​of the pixels in the currently acquired image, thereby reducing color cast when the terminal captures images. Generally, at least two of the three component values ​​of the fill light color are different; that is, the determined fill light is not colorless light (i.e., black, white, or gray light), but colored light (such as cyan or yellow light). This allows the use of different colored light to reduce color cast when the terminal captures images, thus improving the terminal's shooting effect.

[0030] One possible implementation is that determining the color value of the first region based on the color values ​​of the pixels in the image includes: determining the color value of the first region based on the color values ​​of the pixels in the region where the face is located in the image, and the reference color value of the face.

[0031] One possible implementation is that the reference color values ​​of the face include red reference component values, green reference component values, and blue reference component values; determining the color value of the first region based on the color values ​​of the pixels in the region where the face is located in the image, and the reference color values ​​of the face, includes: calculating the average red component value, average green component value, and average blue component value based on the color values ​​of each pixel in the region where the face is located in the image; determining the red component value in the color value of the first region based on the average red component value and the red reference component value; determining the green component value in the color value of the first region based on the average green component value and the green reference component value; and determining the blue component value in the color value of the first region based on the average blue component value and the blue reference component value.

[0032] One possible implementation is that when any average color component value is greater than the corresponding color reference component value, the corresponding color component value in the color value of the first region is less than 255; when any average color component value is less than or equal to the corresponding color reference component value, the corresponding color component value in the color value of the first region is equal to 255.

[0033] Thirdly, this application provides an apparatus comprising a processing module and an acquisition module; wherein, the processing module is configured to, when entering a preview mode of a camera application, set the fill light color of a first area according to fill light configuration information in the preview mode; wherein, the fill light configuration information is used to indicate a first color value of the first area, wherein at least two of the three component values ​​of the first color value are different, and the first area is a fill light area of ​​a terminal screen; the acquisition module is configured to acquire an image in the preview mode.

[0034] In one possible implementation, before the processing module sets the fill light color of the first region according to the fill light configuration information, it is further configured to: control the acquisition module to acquire the first image in the preview mode; and then select the fill light configuration information from at least two candidate fill light configuration information according to the color value of the pixels in the first image, wherein any two candidate fill light configuration information indicate different color values.

[0035] One possible implementation is that, before setting the fill light color of the first region according to the fill light configuration information, the fill light color of the first region is white light.

[0036] In one possible implementation, after the processing module sets the fill light color of the first region according to the fill light configuration information, it is further configured to: control the acquisition module to acquire the second image in the preview mode; and then adjust the fill light color of the first region according to the color value of the pixels in the second image.

[0037] One possible implementation is that the processing module is specifically used to: determine a second color value of the first region based on the color value of the pixels in the second region of the second image; and set the fill light color of the first region based on the second color value.

[0038] One possible implementation is that the second region is the region where the face is located in the first image; to this end, the processing module is specifically used to: determine the second color value based on the color value of the pixels in the second region of the second image and the reference color value of the face.

[0039] One possible implementation is that the reference color values ​​of the face include red reference component values, green reference component values, and blue reference component values; based on this, the processing module is specifically used to: calculate the average red component value, average green component value, and average blue component value according to the color values ​​of each pixel in the second region of the second image; determine the red component value in the second color value according to the average red component value and the red reference component value; determine the green component value in the second color value according to the average green component value and the green reference component value; and determine the blue component value in the second color value according to the average blue component value and the blue reference component value.

[0040] One possible implementation is that when the average color component value is greater than the corresponding color reference component value, the corresponding color component value in the second color value is less than 255; when the average color component value is less than or equal to the corresponding color reference component value, the corresponding color component value in the second color value is equal to 255.

[0041] Fourthly, this application provides an apparatus comprising a processing module and an acquisition module; wherein the processing module is configured to, when entering the preview mode of a camera application, control the acquisition module to acquire an image in the preview mode, and then determine the color value of a first region based on the color values ​​of pixels in the image, wherein the first region is a fill light region of the terminal screen; and finally set the fill light color of the first region based on the color value of the first region.

[0042] One possible implementation is that the processing module is specifically used to: determine the color value of the first region based on the color value of the pixels in the region where the face is located in the image, and the reference color value of the face.

[0043] One possible implementation is that the reference color values ​​of the face include red reference component values, green reference component values, and blue reference component values; the processing module is specifically used for:

[0044] Based on the color values ​​of each pixel within the area where the face is located in the image, calculate the average red component value, average green component value, and average blue component value; based on the average red component value and the red reference component value, determine the red component value in the color value of the first area; based on the average green component value and the green reference component value, determine the green component value in the color value of the first area; based on the average blue component value and the blue reference component value, determine the blue component value in the color value of the first area.

[0045] One possible implementation is that when any average color component value is greater than the corresponding color reference component value, the corresponding color component value in the color value of the first region is less than 255; when any average color component value is less than or equal to the corresponding color reference component value, the corresponding color component value in the color value of the first region is equal to 255.

[0046] Fifthly, a terminal is provided, the device including a unit or module for performing the method as described in any of the first aspects above, or the device including a unit or module for performing the method as described in any of the second aspects above.

[0047] A sixth aspect provides an apparatus comprising: one or more processors and one or more memories; the one or more memories storing one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause the apparatus to perform the method as described in any one of the first aspects above, or cause the apparatus to perform the method as described in any one of the second aspects above.

[0048] A seventh aspect provides a readable storage medium including a computer program that, when run on a device, causes the device to perform the method as described in any one of the first aspects above, or causes the device to perform the method as described in any one of the second aspects above.

[0049] Eighthly, a computer program product is provided that, when run on a device, causes the device to perform the method as described in any one of the first aspects above, or causes the device to perform the method as described in any one of the second aspects above.

[0050] A ninth aspect provides a chip system comprising: a processor; wherein, when the processor retrieves and executes a computer program from a memory, a device having the chip system mounted thereon performs the method as described in any one of the first aspects above, or a device having the chip system mounted thereon performs the method as described in any one of the second aspects above.

[0051] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. Attached Figure Description

[0052] Figure 1 A schematic diagram of the hardware structure of a possible electronic device provided in this application;

[0053] Figure 2 A software system architecture block diagram of an electronic device provided in this application;

[0054] Figure 3A schematic diagram of screen fill light provided in this application;

[0055] Figure 4 A flowchart illustrating a supplementary lighting method provided in this application;

[0056] Figure 5 A schematic diagram illustrating yet another type of screen illumination provided in this application;

[0057] Figure 6 A flowchart illustrating another supplemental lighting method provided in this application;

[0058] Figure 7 A schematic diagram illustrating another type of screen illumination provided in this application;

[0059] Figure 8 A schematic diagram of the structure of a device provided in this application;

[0060] Figure 9 This is a schematic diagram of the structure of a device provided in this application. Detailed Implementation

[0061] With the widespread adoption and diversified functions of smart mobile terminal devices (hereinafter referred to as terminals), more and more users prefer to use terminals for photography. Furthermore, due to the increased screen brightness, screen lighting can, to some extent, replace traditional fill lights. Screen lighting refers to illuminating the subject using the light emitted from the terminal screen in dimly lit environments. Therefore, in low-light shooting conditions, screen lighting can help avoid excessive noise and underexposure in the captured image, thus achieving a clearer image.

[0062] In relevant technical solutions, when using screen fill light, the color of the light emitted by the terminal screen is generally singular and fixed, such as white light. This leads to color cast in the captured image, affecting the shooting effect. Color cast refers to a difference in hue and saturation of a certain color in the captured image compared to the true image. This difference tends to favor a particular color, such as a yellowish, bluish, or reddish tint. Factors causing color cast include, but are not limited to, the hardware characteristics of the shooting device, such as the terminal's camera parameters (e.g., pixels, aperture), as well as the shooting environment and the reflectivity of the subject.

[0063] In scenarios where screen illumination is used, factors causing color shift include screen characteristics, including but not limited to: the characteristics of Light-Emitting Diodes (LEDs) and Organic Light-Emitting Diodes (OLEDs). These characteristics relate to the luminous efficiency of the three colors of light (red, green, and blue), and the influence of the screen material on the propagation path, intensity, and phase of these colors. Therefore, screen characteristics may cause color shifts in images captured when the terminal uses white light for illumination (e.g., the captured image appears reddish). Factors causing color shift also include the characteristics of the image acquisition device, including but not limited to: filter capabilities and sensor capabilities. Filter capabilities and sensor capabilities affect the image color. For example, filters include those using RYYB, RGBW, and other color filter arrays; different color filter arrays produce different colors in the image. Sensors include types such as Complementary Metal Oxide Semiconductor (CMOS) and Charge-Coupled Device (CDD). Different types of sensors are sensitive to different wavelengths of light; for example, CMOS sensors are sensitive to the 460nm light band. Therefore, different types of sensors produce images with different colors. Understandably, these characteristics can cause color casts in images captured with white fill light (e.g., a reddish tint to a face), thus affecting the image quality.

[0064] In summary, due to the diversity of terminals, the screen characteristics of different terminals vary. When using a single color for screen illumination, images captured by different terminals may exhibit varying degrees of color shift, which may affect the terminal's shooting performance.

[0065] Therefore, this application provides a supplementary lighting method, which is applied to a terminal, or to a chip, unit, or module within the terminal. By using pre-configured supplementary lighting configuration information, the supplementary lighting color (non-white) of the supplementary lighting area on the terminal screen is set to reduce color shift when the terminal captures images, thereby improving the terminal's shooting effect.

[0066] It should be understood that in the embodiments of this application, the character " / " generally indicates that the preceding and following objects are in an "or" relationship. Words such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance, nor should they be construed as indicating or implying order.

[0067] In some embodiments of this application, the terminal is generally an electronic device with camera functionality and other functions such as a personal digital assistant and / or music player, such as a mobile phone, tablet computer, or wearable device with wireless communication capabilities (such as a smartwatch). Exemplary embodiments of the electronic device include, but are not limited to, electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned electronic device may also be other electronic devices, such as a camera with data processing capabilities; this application does not limit the specific form of the terminal.

[0068] See Figure 1 This illustration shows an internal hardware structure diagram of an electronic device provided in an embodiment of this application. The electronic device can execute the methods provided in this embodiment. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0069] Processor 110 may include one or more processing units. For example, processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, a display processing unit (DPU), and / or a neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors. In some embodiments, electronic device 100 may also include one or more processors 110. The processor is the nerve center and command center of electronic device 300. The processor can generate operation control signals according to instruction opcodes and timing signals to control instruction fetching and execution. Processor 110 may also include memory for storing instructions and data.

[0070] In some embodiments, the processor 110 may include one or more interfaces. These interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc. The USB interface 130 is a USB-compliant interface, specifically a Mini USB interface, a Micro USB interface, a USB Type-C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used for data transfer between the electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback.

[0071] The sensor module 180 may include one or more of the following: a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and a gravity sensor. Optionally, in this embodiment, the sensor can detect the unfolding angle of the foldable display screen, so that the processor 110 can trigger the execution of user interface animations based on changes in the unfolding angle. Optionally, the sensor used to detect the unfolding angle of the foldable display screen may include a Hall effect sensor, a load sensor, an infrared sensor, a pressure sensor, or an electromagnetic sensor, etc. Optionally, in this embodiment, the sensor (such as a gravity sensor) can also detect the usage mode of the foldable display screen (e.g., including a vertical split-screen usage mode and a horizontal split-screen usage mode).

[0072] The charging management module 140 receives charging input from the charger. The power management module 141 connects to the battery 142, and the charging management module 140 connects to the processor 110. The wireless communication function of the electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor, etc.

[0073] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0074] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110.

[0075] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0076] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as Wi-Fi), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR). The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0077] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. Electronic device 100 can implement shooting functions through ISP, camera 193, video codec, GPU, display screen 194, and application processor, etc.

[0078] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0079] The electronic device 100 can realize display functions through a GPU, a display screen 194, and an application processor (AP). The display screen 194 is used to display images, videos, etc. In this embodiment, the display screen 194 is a foldable display screen.

[0080] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0081] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0082] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses a layered architecture software system (such as Android). Taking a system as an example, the software structure of an electronic device is illustrated.

[0083] See Figure 2 This is a schematic diagram of the layered software architecture of an electronic device provided in an embodiment of this application. The layered architecture divides the software system of the electronic device into several layers, each with its own role and function. The layers communicate with each other through software interfaces.

[0084] The Android system is divided into four layers: applications (210), application framework (220), Android runtime (ART), system libraries, and kernel. This application embodiment does not limit the layering of the electronic device's software structure. The Android runtime, system libraries, and kernel can be considered as one layer, referred to as system layer (230). It should be understood that... Figure 2 The Android system is supplemented by a hardware layer 240 for electronic devices.

[0085] It should be understood that Figure 2 The modules included in each layer shown are those involved in the embodiments of this application. The modules included in each layer below do not constitute a limitation on the structure of the electronic device and the hierarchy of module deployment (example illustration). Figure 2 The modules shown can be deployed individually, or several modules can be deployed together. Figure 2The module division and module names shown are just one example.

[0086] The application layer may include a series of application packages. The application layer may include applications such as camera, contacts, call logs, gallery, calendar, calling (video and / or voice calls), map, navigation, Bluetooth, music, video, and SMS. Applications may include system applications and third-party applications. Only the first application 211 and the second application 212 are shown as examples in the figure. For example, the first application 211 may be a game application, and the second application 212 may be an application assistant. An application assistant is client management software that can be installed on an electronic device. The application assistant provided in this embodiment of the application has the function of enabling scenario-based resource control.

[0087] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications within the application layer. The application framework layer may include some predefined functions. (See reference...) Figure 2 The application framework layer may include: a resource control module 221, a graphics and image processing module 222, a window manager service (WMS) module 223, and other modules (such as a Bluetooth module). The resource control module 221 can implement the methods provided in this embodiment. The graphics and image processing module 222 is used to draw the user interface. The window manager service module 223 is used to manage the user interface. For example, the graphics and image processing module 222 may include a rendering module and a layer compositor. The rendering module is used to render the user interface, and the layer compositor is used to composite the rendered layers to obtain the user interface to be displayed.

[0088] Because the Android runtime, system libraries, and kernel layer are considered as a single layer in this embodiment, the system layer 230 may include the Android runtime, system libraries, and functional modules from the kernel layer. (Refer to...) Figure 2 The system layer may include hardware drivers for driving hardware operations. Examples include display driver 231, sensor driver 232, graphics processing unit driver (GPU driver) 233, etc., but this application embodiment does not limit this.

[0089] Hardware layer 240 includes the hardware in electronic devices. This is understandable. Figure 2 The hardware layer shows the display screen 241, camera 242, speaker 243, microphone 244, etc. involved in the following embodiments.

[0090] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the software structure of electronic devices.

[0091] The following explanations and descriptions of some technologies and terms involved in the embodiments of this application are provided to facilitate understanding by those skilled in the art.

[0092] (1) First area

[0093] The first area refers to the fill light area of ​​the terminal screen. This fill light area is used to project light when the terminal takes a picture of the subject after entering the preview mode of the camera application. Figure 3 A schematic diagram of a screen fill light provided in this application is shown below. Figure 3 One possible implementation is that the fill light area is a portion of the terminal screen, such as... Figure 3 As shown in Figure A, after the user clicks on the camera app on their phone, they enter preview mode. This preview mode includes a fill light area (shaded area) and a preview interface (or viewfinder), which is used to display the subject being photographed (such as a face). Optionally, the first area can be, for example, around the preview frame, or above or below the preview frame; this application does not limit this.

[0094] One possible implementation is, such as Figure 3 As shown in Figure B, the fill light area covers all areas of the terminal screen except for the preview interface; one possible implementation is as follows: Figure 3 As shown in Figure C, the fill light area includes the area on the terminal screen excluding the preview interface, as well as the area excluding the face area in the preview interface.

[0095] Optionally, the transparency of the fill light area can be preset. Based on this, different areas within the fill light area can have different transparency, which can create a more layered and nuanced fill light effect. For example, Figure 3 In Figure C, the fill light transparency of the preview interface area is lower than that of other fill light areas. The fill light areas corresponding to different transparency levels can be achieved by setting layers. Furthermore, this application can also divide the fill light into more areas corresponding to different transparency levels; however, this application does not limit this to any specific method.

[0096] One possible implementation is to increase the fill light area when taking a photo. For example, in preview mode... Figure 3 Use the fill light area shown in Figure A to provide fill light when taking the picture. Figure 3 The fill light area shown in Figure C is used for supplemental lighting. This allows you to improve the fill light effect during photography by increasing the fill light area. Based on this, the fill light area can be reduced after taking the picture, for example, from... Figure 3The supplementary lighting area shown in Figure C is reduced to Figure 3 The supplementary lighting area shown in Figure A can reduce resource consumption.

[0097] One possible implementation is that the fill light area can be the entire screen of the terminal. In this implementation, the transparency of the fill light area can be set so that the terminal screen can both display the subject and provide fill light. Optionally, when taking a picture, the fill light area can be the entire screen of the terminal, and the transparency of the fill light area is set to minimum (i.e., opaque), which can improve the fill light effect. In other words, the terminal can provide fill light to the entire screen and take a picture based on the user's photo-taking operation (such as when the user positions the subject in preview mode and clicks the shutter button), thereby triggering the entire screen of the terminal to provide fill light (with the fill light transparency set to opaque) and take a picture.

[0098] One possible implementation is that the shape, position, and extent of the first region can be pre-configured or set based on user operations. For example, the first region can be set by the user to a circle, hexagon, etc. This application does not specifically limit the first region.

[0099] (2) Color value

[0100] Color value refers to the color value corresponding to different colors in a color mode. This application takes the RGB color mode as an example. The RGB color mode is a color standard that obtains various colors by varying the three color channels (red (R), green (G), and blue (B)) and superimposing them. RGB represents the colors corresponding to the red, green, and blue channels. For example, the color value of red in the RGB color mode is 255, 0, 0; the color value of green in the RGB color mode is 0, 255, 0; and the color value of blue in the RGB color mode is 0, 0, 255.

[0101] It is understood that other color modes may also be applied in this application, and this application does not limit them here.

[0102] (3) Fill light configuration information

[0103] The fill light configuration information is used to indicate the first color value of the first area. It can be understood that the first color value is used to set the fill light color of the first area. Therefore, it can be understood that the fill light configuration information is used to indicate the first color value of each pixel in the first area, so that each pixel in the first area projects the fill light color corresponding to the first color value. For example, if the first color value indicated by the fill light configuration information is 245, 245, 255 (here, the color corresponding to this color value is called cyan), the color value of each pixel in the first area of ​​the terminal screen is set based on this first color value, so that the terminal screen projects cyan light into the first area, and thus achieves screen fill light based on this cyan light.

[0104] In this application, at least two of the three component values ​​of the first color value are different. These three component values ​​are the red component value, the green component value, and the blue component value. For example, the red, green, and blue component values ​​of the first color value may all be different; or the red component value may be different from the green component value and the red component value may be the same as the blue component value; or the red component value may be the same as the green component value and the red component value may be different from the blue component value. This ensures that the fill light color corresponding to the first color value is a color other than black, white, or gray, such as cyan or yellow. This type of fill light can reduce color cast when the terminal captures images.

[0105] Optionally, in the first color value, the red component value ranges from 191 to 207, the green component value ranges from 239 to 255, and the blue component value ranges from 239 to 255. It can be seen that in the first color value, the red component value is less than the green component value, the red component value is less than the blue component value, and generally, the blue component value is equal to the green component value. Specifically, the red, green, and blue component values ​​in the first color value are 207, 255, and 255 respectively, meaning the complementary light color corresponding to the first color value is cyan.

[0106] Optionally, in the first color value, the red component value ranges from 239 to 255, the green component value ranges from 191 to 207, and the blue component value ranges from 239 to 255. It can be seen that in the first color value, the green component value is less than the red component value, the green component value is less than the blue component value, and generally, the red component value is equal to the blue component value. For example, if the red, green, and blue component values ​​in the first color value are 255, 207, and 255 respectively, then the complementary light color corresponding to the first color value is purple.

[0107] Optionally, in the first color value, the red component value ranges from 239 to 255, the green component value ranges from 239 to 255, and the blue component value ranges from 191 to 207. It can be seen that in the first color value, the blue component value is less than the green component value, and the blue component value is less than the red component value. Generally, the green component value is equal to the red component value. For example, if the red, green, and blue component values ​​in the first color value are 255, 255, and 207 respectively, then the complementary light color corresponding to the first color value is yellow.

[0108] In summary, the fill light corresponding to the first color value is light with color, such as cyan, yellow, etc., or the fill light is not colorless light, that is, the fill light color will not be black, white, or gray.

[0109] In one possible implementation, the supplementary lighting configuration information is associated with the terminal's screen characteristics. The supplementary lighting color corresponding to the first color value indicated by the supplementary lighting configuration information is used to correct the color cast caused by the screen characteristics during terminal photography. For example, when the terminal captures an image based on white supplementary lighting, the image may appear reddish due to screen characteristics. If the supplementary lighting color corresponding to the first color value is cyan, then when the terminal captures an image based on cyan supplementary lighting, the reddish tint is reduced or eliminated. In other words, the supplementary lighting configuration information is associated with the color cast caused by the screen characteristics during terminal image capture, thus reducing the color cast caused by the screen characteristics during terminal photography based on the supplementary lighting configuration information.

[0110] In one possible implementation, the fill light configuration information is pre-configured. Therefore, the fill light configuration information can exist in the camera application's process as logic code, so that when the camera application starts, the fill light color of the first area can be directly set according to this configuration information. Alternatively, the fill light configuration information can exist as a configuration file, and when the camera application starts, the fill light configuration information is obtained by calling this configuration file, and then the fill light color of the first area is set according to this configuration information.

[0111] In one possible implementation, the supplementary lighting configuration information can be multiple (or at least two candidate supplementary lighting configuration information). Any two of these candidate supplementary lighting configuration information indicate different color values; that is, each candidate supplementary lighting configuration information indicates a single color value, and each candidate supplementary lighting configuration information is associated with an ambient light color (or a range of color values). For example, the at least two candidate supplementary lighting configuration information includes a first candidate supplementary lighting configuration information and a second candidate supplementary lighting configuration information. Since cyan light can be mixed with red light, to make the color of the mixed light approach a preset face color, the first candidate supplementary lighting configuration information can be set to indicate cyan, and the ambient light color associated with the first candidate supplementary lighting configuration information is red. Similarly, since yellow light can be mixed with blue light, the second candidate supplementary lighting configuration information can be set to indicate yellow, and the ambient light color associated with the second candidate supplementary lighting configuration information is blue. Optionally, a candidate fill light configuration information can be associated with a color value range, and the color value ranges associated with different candidate fill light configuration information do not overlap; alternatively, a candidate fill light configuration information can be associated with a color value, and the color values ​​associated with different candidate fill light configuration information are different.

[0112] Therefore, when setting the fill light color for the first area, a first image can be captured in preview mode. Based on the color values ​​of the pixels in the first image (which can be used as the color values ​​corresponding to the current ambient light), a fill light configuration can be matched from at least two candidate fill light configurations. This allows for matching the optimal fill light configuration based on the current ambient light color, and then using the first color value indicated by this optimal fill light configuration for fill light application. This flexibly reduces the color cast caused by different ambient light colors when the terminal captures images, addressing the diversity of ambient light colors.

[0113] Based on the above description Figure 4 This is a schematic flowchart illustrating a supplementary lighting method provided in an embodiment of this application. Figure 4 As shown, the method may include the following steps:

[0114] Step 401: The terminal enters the preview mode of the camera application.

[0115] In this process, the camera application's preview mode on the terminal includes a fill light area, a preview frame, a shutter button (or record button), and camera attributes (such as "portrait," "night scene," "landscape," etc.), as described above. Figure 3 The corresponding descriptions will not be elaborated here.

[0116] Step 402: In preview mode, the terminal sets the fill light color of the first area according to the fill light configuration information; wherein, the fill light configuration information is used to indicate the first color value of the first area, and at least two of the three component values ​​of the first color value are different, and the first area is the fill light area of ​​the terminal screen.

[0117] In this process, the description of the first area and the supplementary lighting configuration information can be found in the above-mentioned content, and will not be repeated here.

[0118] One possible implementation involves setting the fill light color of the first area based on pre-configured fill light configuration information. This can be understood as follows: based on the first color value indicated by the fill light configuration information, the color value of each pixel in the first area of ​​the terminal screen is set to the first color value, thereby enabling the first area of ​​the terminal screen to project light of the color corresponding to the first color value. For example, each pixel of the terminal screen corresponds to at least three light-emitting diodes (LEDs), which correspond to red, green, and blue light. The intensity of the LEDs is adjusted based on the first color value (i.e., the intensity of the red-emitting diodes corresponds to the red component value in the first color value, the intensity of the green-emitting diodes corresponds to the green component value in the first color value, and the intensity of the blue-emitting diodes corresponds to the blue component value in the first color value), thereby enabling each pixel in the first area to project light of the color corresponding to the first color value.

[0119] In this application, the fill light color corresponding to the first color value is a color other than black, white, and gray, such as cyan or yellow. This type of fill light can reduce color cast when the terminal captures images based on white fill light. For example, Figure 5 This is a schematic diagram of a screen fill light provided in an embodiment of this application, with reference to... Figure 5 When a user takes a selfie, in an image captured by the terminal based on white light, the user's face appears reddish, while in an image captured by the terminal based on cyan light (i.e., the color corresponding to the first color value), the user's face appears closer to the user's original skin color.

[0120] In one possible implementation, based on the content corresponding to the aforementioned supplementary lighting configuration information, before setting the supplementary lighting color of the first region according to the pre-configured supplementary lighting configuration information, the required supplementary lighting configuration information can be selected from at least two candidate supplementary lighting configuration information. For example, a first image in preview mode is captured, and then the required supplementary lighting configuration information is selected from at least two candidate supplementary lighting configuration information based on the color values ​​of the pixels in the first image. The color values ​​of the pixels in the first image can be used to determine the current ambient light color. For example, for any component value (red / green / blue), the average value of that component value for each pixel in the first image is calculated, thereby obtaining the average color value corresponding to the first image. The color corresponding to this average color value is the current ambient light color. Based on this, since the candidate supplementary lighting configuration information can be associated with a color value range, a corresponding supplementary lighting configuration information can be matched from at least two candidate supplementary lighting configuration information based on this average color value. Then, the supplementary lighting color of the first region is set according to this supplementary lighting configuration information, thereby reducing the color shift effect of the current ambient light color on the image captured by the terminal.

[0121] Based on the above description Figure 6 This is a schematic flowchart illustrating another supplementary lighting method provided in an embodiment of this application. One possible implementation is... Figure 6 The method described above can be based on the above. Figure 4 This method is implemented based on the aforementioned approach; one possible implementation method is... Figure 6 The method described can be implemented individually. For example... Figure 6 As shown, the method may include the following steps:

[0122] Step 601: The terminal enters the preview mode of the camera application.

[0123] This step is the same as step 401 above, and will not be repeated here.

[0124] Step 602: The terminal acquires an image in preview mode and determines the color value of the first region based on the color values ​​of the pixels in the image; wherein, the first region is the fill light area of ​​the terminal screen.

[0125] This step, based on the implementation scenario, is divided into the following two implementation methods:

[0126] Implementation method 1 Figure 6 The method described above Figure 4 Based on the method described above, the image acquired in this implementation method 1 can be a second image following the first image in step 402 above; or, the image acquired in this implementation method 1 can be the first image described above, but in this implementation method 1, after acquiring the first image, the method of selecting supplementary lighting configuration information from at least two candidate supplementary lighting configuration information is not executed, but the following step 603 is executed instead.

[0127] Implementation method 2 Figure 6 The method described above can be implemented independently. In this implementation 2, the image acquired can be the first image described above. In this implementation 2, after acquiring the first image, the method of selecting supplementary lighting configuration information from at least two candidate supplementary lighting configuration information is not executed. Instead, step 603 is executed. Alternatively, the image acquired in this implementation 2 can be a third image, which is independent of the first and second images.

[0128] The following description uses the above implementation method 1 as an example. The specific implementation process of implementation method 2 can be referred to the description using implementation method 1 as an example. This application will not repeat the details.

[0129] The terminal selects a fill light configuration from at least two candidate fill light configurations based on the first image, sets the fill light color of the first area according to the fill light configuration, and then captures a second image in preview mode. That is, the second image is captured under fill light of the color corresponding to the first color value in step 402 above. For example, the terminal captures the second image using its own image acquisition device.

[0130] Optionally, the second image can be acquired periodically, such as once every 1 second. Alternatively, the second image can be acquired based on user interaction; for example, in the camera application's preview mode, the camera application interface includes a first function option that controls whether to acquire the second image and whether to perform [an action]. Figure 6 The method described above. Based on this, the terminal receives a user operation applied to the first function option, the user operation indicating execution. Figure 6 The method described above. Then, in response to the user's operation, the terminal acquires a second image captured by its own image acquisition device (such as a camera). It can be understood that the difference between the second image and the first image is that the second image is acquired after the supplementary light color set according to the first color value, while the first image is acquired before the supplementary light color set according to the first color value. Optionally, the second image can be an image containing the subject that the terminal periodically acquires.

[0131] One possible implementation is that after the terminal captures the second image in preview mode, it also determines whether the color reflected from the subject in the second image differs from the subject's original color by more than a threshold. If the difference is greater than or equal to the threshold, the subsequent process (i.e., determining the color value of the first region based on the color values ​​of the pixels in the image) is executed. If the difference is less than the threshold, the subsequent process is not executed, and the current color's fill light continues to be used. For example, if the subject is a face, and the face color in the second image is blue, while the actual face color should be pale yellow, then determining that the difference is greater than the threshold indicates a significant difference between the face color in the second image and the actual face color, thus executing the subsequent process to improve the terminal's shooting effect. Conversely, if the difference between the face color in the second image and the actual face color is less than the threshold, it indicates a small (or no) difference, so the subsequent process is not executed, thus avoiding wasting computational resources.

[0132] One possible implementation involves determining the second color value of the first region based on the color values ​​of pixels within a second region of the second image; where the second region refers to the area of ​​the photographed object within the preview frame. Optionally, the second region can be the area containing a face in the second image, or it could be the area containing other photographed objects. Another possible implementation involves performing face recognition on the second image to obtain the area containing the face.

[0133] The following description focuses on the second region, which is the area where the face is located in the second image.

[0134] Specifically, the second color value is determined based on the color values ​​of pixels in the second region of the second image and the reference color value of the face. The reference color value of the face can be understood as the user's original skin color. Optionally, the reference color value of the face is preset, which is not limited in this application. For example, the reference color value of the face is 230, 190, and 160.

[0135] As can be seen, the reference color values ​​of a human face include red reference component values, green reference component values, and blue reference component values. Therefore, the component values ​​of the second color value can be calculated based on these component values. For example, based on the color values ​​of each pixel in the face region of the second image, the average red component value, average green component value, and average blue component value are calculated; based on the average red component value and the red reference component value, the red component value in the second color value is determined; based on the average green component value and the green reference component value, the green component value in the second color value is determined; based on the average blue component value and the blue reference component value, the blue component value in the second color value is determined.

[0136] One possible implementation is to calculate the component value of the second color value according to the following formula (1):

[0137]

[0138] Where L is a color component value (red / green / blue) in the second color value, Tar is the corresponding base color component value (red / green / blue), Avg is the corresponding average color component value (red / green / blue), f(d) is the attenuation function of the supplementary light brightness with increasing distance, d is the distance between the subject (e.g., a face) and the terminal screen, and k is a preset constant (e.g., k = 0.5). The average (red / green / blue) color component value refers to the average value of the (red / green / blue) color components corresponding to all pixels in the face region of the second image.

[0139] For example, the average red component value AvgR = 240, the average green component value AvgG = 200, the average blue component value AvgB = 160, the red reference component value TarR = 230, the green reference component value TarG = 190, and the blue reference component value TarB = 16. It can be seen that the color values ​​of the face region in the current second image still differ significantly from the reference color values ​​of the face, indicating a color cast in the face region of the second image. To reduce the color cast in the face region, the average red component value AvgR, the average green component value AvgG, and the average blue component value AvgB = 160 need to be approximated to the red reference component value TarR, the green reference component value TarG, and the blue reference component value TarB, respectively.

[0140] Generally, at least two of the three components of the second color value are different. That is, the fill light corresponding to the second color value is not colorless light (i.e., black light, white light, gray light), but colored light (such as cyan light, yellow light). This can reduce the color cast phenomenon when the terminal captures images by using different colored light, thereby improving the shooting effect of the terminal. For example, based on the above formula (1), the red component value LR = 245, the green component value LG = 245, and the blue component value LB = 255 are calculated. After screen fill light based on this second color value, the average red component value AvgR = 233, the average green component value AvgG = 190, and the average blue component value AvgB = 160 for all pixels in the face area. It can be seen that screen fill light using the second color value can make the face closer to the preset skin color, thereby further reducing the color cast phenomenon when the terminal captures images and improving the shooting effect of the terminal.

[0141] Based on the above description, when the average component value of any color is greater than the corresponding base component value, the corresponding color component value in the second color value is less than 255; when the average component value of any color is less than or equal to the corresponding base component value, the corresponding color component value in the second color value is equal to 255. For example, if the average red component value is greater than the red base component value, then the red component value in the second color value is less than 255; if the average red component value is less than or equal to the red base component value, then the red component value in the second color value is equal to 255. Similarly, if the average green component value is greater than the green base component value, then the green component value in the second color value is less than 255; if the average green component value is less than or equal to the green base component value, then the green component value in the second color value is equal to 255. If the average blue component value is greater than the blue base component value, then the blue component value in the second color value is less than 255; if the average red component value is less than or equal to the blue base component value, then the blue component value in the second color value is equal to 255.

[0142] One possible implementation involves selecting the red median, green median, and blue median component values ​​based on the color values ​​of each pixel within the face region of the first image; then determining the red component value of the second color value based on the red median component value and the red reference component value; determining the green component value of the second color value based on the green median component value and the green reference component value; and determining the blue component value of the second color value based on the blue median component value and the blue reference component value. In other words, this application can determine the second color value using an average algorithm, or it can determine the second color value using other algorithms such as the median; this application does not specifically limit this method.

[0143] Step 603: The terminal sets the fill light color of the first area according to the color value of the first area.

[0144] Based on step 602 above, after determining the second color value, the fill light color of the first area is set according to the second color value. For the specific color value method, please refer to the description in step 402 above regarding setting the fill light color of the first area according to the first color value; this application will not elaborate further here.

[0145] Figure 7 This is a schematic diagram of a screen fill light provided in an embodiment of this application, with reference to... Figure 7 The user is in an environment where the ambient light is blue (such as a concert). Figure 7 In Figure A, when the terminal uses white light for illumination, the face in the preview frame is similar in color to the current ambient light, that is, the face is blue. Figure 7 In Figure B, when the terminal uses pale yellow light (the light corresponding to the first color value) for supplementary lighting, it can reduce the color shift caused by the current ambient light. However, the color of the face in the preview frame is still affected by the current ambient light. Figure 7In Figure C, when the terminal uses yellow light (the light corresponding to the second color value) for supplementary lighting, it can better reduce the color shift caused by the current ambient light, making the color of the face in the preview frame closer to the original skin color. In other words, implementing this alone... Figure 4 The method described above, or implemented separately. Figure 6 The method described, or, Figure 4 The method described and Figure 6 The methods described in combination can reduce color cast when the terminal captures images and improve the shooting effect of the terminal.

[0146] One possible implementation is to set the fill light color of the first region based on the second color value, and then determine the difference between the color value of the face and the reference color value of the face under the fill light color corresponding to the second color value. If the difference is greater than the threshold, the second image can be acquired again, and steps 602-603 can be repeated until the difference between the color value of the face and the reference color value of the face is less than the threshold. For specific implementation, please refer to the above content, and this application will not elaborate further here.

[0147] In summary, by using different colors of light, color cast in images captured by the terminal can be reduced, thereby improving the terminal's shooting effect. Furthermore, after the terminal projects light onto the fill light area of ​​the screen according to the fill light color, it further adjusts the fill light color in the fill light area to further reduce color cast in the captured images.

[0148] In the above text Figure 4 , Figure 6 The supplementary lighting method provided in this application is described in detail below, and will be combined with... Figure 8 , Figure 9 This application describes the apparatus provided for performing the above-described method.

[0149] Figure 8 This is a schematic diagram of a supplementary lighting device provided in this application. This device 800 can be used to implement the above-described supplementary lighting method, and therefore can also achieve the beneficial effects of the above-described method embodiments.

[0150] like Figure 8 As shown, the device 800 includes a processing module 810 and a acquisition module 820; wherein, the processing module 810 is used to set the fill light color of a first area according to fill light configuration information when entering the preview mode of the camera application; wherein, the fill light configuration information is used to indicate a first color value of the first area, wherein at least two of the three component values ​​of the first color value are different, and the first area is the fill light area of ​​the terminal screen; the acquisition module 820 is used to acquire images in the preview mode.

[0151] In one possible implementation, before the processing module 810 sets the fill light color of the first region according to the fill light configuration information, it is further configured to: control the acquisition module 820 to acquire the first image in the preview mode; and then select the fill light configuration information from at least two candidate fill light configuration information according to the color value of the pixels in the first image, wherein any two candidate fill light configuration information indicate different color values.

[0152] One possible implementation is that, before setting the fill light color of the first region according to the fill light configuration information, the fill light color of the first region is white light.

[0153] In one possible implementation, after the processing module 810 sets the fill light color of the first region according to the fill light configuration information, it is further configured to: control the acquisition module 820 to acquire the second image in the preview mode; and then adjust the fill light color of the first region according to the color value of the pixels in the second image.

[0154] In one possible implementation, the processing module 810 is specifically used to: determine a second color value of the first region based on the color value of the pixels in the second region of the second image; and set the fill light color of the first region based on the second color value.

[0155] In one possible implementation, the second region is the region where the face is located in the first image; to this end, the processing module 810 is specifically used to: determine the second color value based on the color value of the pixels in the second region of the second image and the reference color value of the face.

[0156] In one possible implementation, the reference color value of the face includes a red reference component value, a green reference component value, and a blue reference component value. Based on this, the processing module 810 is specifically used to: calculate the average red component value, the average green component value, and the average blue component value according to the color value of each pixel in the second region of the second image; determine the red component value in the second color value according to the average red component value and the red reference component value; determine the green component value in the second color value according to the average green component value and the green reference component value; and determine the blue component value in the second color value according to the average blue component value and the blue reference component value.

[0157] One possible implementation is that when the average color component value is greater than the corresponding color reference component value, the corresponding color component value in the second color value is less than 255; when the average color component value is less than or equal to the corresponding color reference component value, the corresponding color component value in the second color value is equal to 255.

[0158] Both the processing module 810 and the acquisition module 820 can be implemented in software or in hardware. For example, the implementation of the processing module 810 will be described below. Similarly, the implementation of the acquisition module 820 can be referenced from that of the processing module 810.

[0159] As an example of a software functional unit, processing module 810 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, or a container. Further, the aforementioned computing instance may be one or more. For example, processing module 810 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed within the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed within the same availability zone (AZ) or in different AZs, each AZ including one or more geographically proximate data centers. Typically, a region may include multiple AZs.

[0160] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.

[0161] As an example of a hardware functional unit, the processing module 810 may include at least one computing device, such as a server. Alternatively, the processing module 810 may be implemented using a central processing unit (CPU), an application-specific integrated circuit (ASIC), or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a data processing unit (DPU), a neural network processing unit (NPU), a system-on-chip (SoC), an offload card, an accelerator card, or any combination thereof.

[0162] The processing module 810 includes multiple computing devices that can be distributed in the same region or in different regions. Similarly, the processing module 810 includes multiple computing devices that can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the processing module 810 includes multiple computing devices that can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, GALs, DPUs, NPUs, SoCs, offloading cards, and accelerator cards.

[0163] It is understood that in other embodiments, the processing module 810 and the acquisition module 820 can be used for any step in the above-described supplementary lighting method.

[0164] It should be noted that the module division in the embodiments of this application is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, exist as separate physical entities, or have two or more units integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units.

[0165] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0166] Based on the above embodiments, this application also provides an apparatus that can implement the methods in the above embodiments and has the functions of device 800. (See also...) Figure 9 As shown, the device 900 includes a transceiver 901, a processor 902, and a memory 903. The transceiver 901, the processor 902, and the memory 903 are interconnected.

[0167] Optionally, the transceiver 901, the processor 902, and the memory 903 are interconnected via a bus 904. The bus 904 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 9 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0168] The transceiver 901 is used to receive and send signals to enable communication with other devices.

[0169] The function of the processor 902 can be referred to the description in the above embodiments, and will not be repeated here.

[0170] The processor 902 can be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP, etc. The processor 902 may further include hardware chips. These hardware chips can be application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. The PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. When implementing the above functions, the processor 902 can be implemented in hardware, or it can be implemented by hardware executing corresponding software. The steps of the method disclosed in the above embodiments of this application can be directly reflected as the processor 902 completing the execution, or as the hardware and software modules in the processor 902 combining to complete the execution.

[0171] The memory 903 is used to store program instructions and data. Specifically, the program instructions may include program code, which includes computer operation instructions. The memory 903 may include volatile memory, such as random access memory (RAM); it may also include non-volatile memory, such as at least one disk storage device, hard disk drive (HDD), or solid state drive (SSD). The memory 903 may also be any other medium capable of carrying or storing program code in the form of instructions or data structures and accessible by a computer; this application does not limit this. The processor 902 executes the program instructions stored in the memory 903 to implement the above functions, thereby implementing the method provided in the above embodiments.

[0172] Based on the above embodiments, this application also provides an electronic device, which includes multiple functional modules. These multiple functional modules interact to implement the functions performed by the electronic device in the methods described in the embodiments of this application. These multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and can be arbitrarily combined or divided based on specific implementations. For example, [the following is an example of implementation details]. Figure 4 The method and process in the process.

[0173] Based on the above embodiments, this application also provides an electronic device (or terminal), which includes at least one processor and at least one memory. The at least one memory stores computer program instructions. When the electronic device is running, the at least one processor executes the functions performed by the electronic device in the methods described in the embodiments of this application. For example, when executing... Figure 4 The method and process in the process.

[0174] Based on the above embodiments, this application also provides a computer program product, which includes a computer program (also referred to as code or instructions) that, when run, causes the methods described in the embodiments of this application to be executed.

[0175] Based on the above embodiments, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program (also referred to as code or instructions), which, when executed by a computer, causes the computer to perform the methods described in the embodiments of this application.

[0176] Based on the above embodiments, this application also provides a chip. The chip is used to read a computer program stored in a memory and implement the methods described in the embodiments of this application.

[0177] Based on the above embodiments, this application provides a chip system including a processor for supporting a computer device in implementing the methods described in the embodiments of this application. In one possible embodiment, the chip system further includes a memory for storing necessary programs and data of the computer device. The chip system may be composed of chips or may include chips and other discrete devices.

[0178] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0179] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0180] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0181] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0182] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of protection of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for supplemental lighting, characterized in that, Applied to a terminal, the method includes: Enter the camera app's preview mode; In the preview mode, the fill light color of the first area is set according to the fill light configuration information; wherein, the fill light configuration information is used to indicate the first color value of the first area, and at least two of the three component values ​​of the first color value are different, and the first area is the fill light area of ​​the terminal screen.

2. The method according to claim 1, characterized in that, Before setting the fill light color of the first region according to the fill light configuration information, the method further includes: Capture the first image in the preview mode; Based on the color values ​​of the pixels in the first image, the fill light configuration information is selected from at least two candidate fill light configuration information, wherein any two candidate fill light configuration information indicate different color values.

3. The method according to claim 2, characterized in that, Before setting the fill light color of the first area according to the fill light configuration information, the fill light color of the first area is white light.

4. The method according to any one of claims 1-3, characterized in that, After setting the fill light color for the first region based on the fill light configuration information, the method further includes: Capture the second image in the preview mode; The fill light color of the first region is adjusted based on the color values ​​of the pixels in the second image.

5. The method according to claim 4, characterized in that, The step of adjusting the fill light color of the first region based on the color values ​​of the pixels in the second image includes: The second color value of the first region is determined based on the color value of the pixels in the second region of the second image; The fill light color for the first area is set according to the second color value.

6. The method according to claim 5, characterized in that, The second region is the area where the face is located in the first image; Determining the second color value of the first region based on the color values ​​of pixels within the second region of the second image includes: The second color value is determined based on the color values ​​of the pixels in the second region of the second image and the reference color value of the face.

7. The method according to claim 6, characterized in that, The reference color values ​​of the face include red reference component values, green reference component values, and blue reference component values; Determining the second color value based on the color values ​​of pixels in the second region of the second image and the reference color value of the face includes: Calculate the average red component value, average green component value, and average blue component value based on the color values ​​of each pixel in the second region of the second image. The red component value in the second color value is determined based on the red average component value and the red reference component value. The green component value in the second color value is determined based on the green average component value and the green reference component value. The blue component value in the second color value is determined based on the average blue component value and the blue reference component value.

8. The method according to claim 7, characterized in that, When the average component value of any color is greater than the corresponding reference component value of the color, the corresponding color component value in the second color value is less than 255; When the average component value of any color is less than or equal to the corresponding reference component value of the color, the corresponding color component value in the second color value is equal to 255.

9. A method for supplemental lighting, characterized in that, Applied to a terminal, the method includes: Enter the camera app's preview mode; The image in the preview mode is acquired, and the color value of the first region is determined based on the color value of the pixels in the image. The first region is the fill light region of the terminal screen. Set the fill light color for the first region based on the color value of the first region.

10. The method according to claim 9, characterized in that, Determining the color value of the first region based on the color values ​​of the pixels in the image includes: The color value of the first region is determined based on the color values ​​of the pixels in the region where the face is located in the image, and the reference color value of the face.

11. The method according to claim 10, characterized in that, The reference color values ​​of the face include red reference component values, green reference component values, and blue reference component values; Determining the color value of the first region based on the color values ​​of the pixels in the region where the face is located in the image, and the reference color value of the face, includes: Calculate the average red component value, average green component value, and average blue component value based on the color values ​​of each pixel in the area where the face is located in the image. Based on the average red component value and the reference red component value, determine the red component value in the color value of the first region; The green component value in the color value of the first region is determined based on the green average component value and the green reference component value. The blue component value in the color value of the first region is determined based on the average blue component value and the blue reference component value.

12. The method according to claim 11, characterized in that, When the average component value of any color is greater than the corresponding reference component value of the color, the corresponding color component value in the color value of the first region is less than 255. When the average component value of any color is less than or equal to the corresponding reference component value, the corresponding color component value in the color value of the first region is equal to 255.

13. A terminal, characterized in that, It includes units or modules for performing the method as described in any one of claims 1-8, or includes units or modules for performing the method as described in any one of claims 9-12.

14. A readable storage medium, characterized in that, Includes a computer program that, when run on the device, causes the device to perform the method as claimed in any one of claims 1-8, or causes the device to perform the method as claimed in any one of claims 9-12.

15. A computer program product, characterized in that, When it is operated on the device, it causes the device to perform the method as described in any one of claims 1-8, or causes the device to perform the method as described in any one of claims 9-12.