Exposure control method and related equipment
By detecting user operations and facial skin color characteristics and adjusting camera exposure parameters, the problem of mismatch between the brightness of the face image and the actual skin color brightness in the prior art is solved, and the image visual experience and user experience are improved.
Patent Information
- Application Number
- CN202311510576.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-10
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2043-11-10
AI Technical Summary
When shooting face images of different skin colors, it is difficult to accurately match the brightness of the face images and the brightness of the actual skin colors, resulting in distortion of the skin tone and affecting the user experience.
By detecting user operations, the current brightness information of the face image is obtained, the target brightness information is determined based on the characteristics of the face skin color, and the exposure parameters of the camera are adjusted to match the brightness of the face image and the brightness of the actual skin color.
The brightness of the face image matches the brightness of the actual skin color, improves the visual perception and user experience of the image, reduces the difficulty of subsequent image signal processing, and improves the accuracy of skin color correction.
Smart Images

Figure CN118450259B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to an exposure control method and related equipment. Background Art
[0002] At present, with the development of terminal technology, terminal devices have become a part of people's work and life. Terminal devices are usually equipped with camera components, which can realize functions such as video recording, greatly facilitating people's work and life.
[0003] Automatic exposure control (AEC) is an essential part of camera control. The AEC algorithm adjusts exposure by adjusting one or more of the following exposure parameters: lens aperture, sensor exposure time, sensor analog gain, and digital gain. The purpose of automatic exposure (AE) is to recognize luminance levels in different lighting conditions and scenes, and adjust exposure parameters in real time so that the captured video or image appears to be of appropriate brightness to the human eye. Summary of the invention
[0004] The present application provides an exposure control method and related equipment, which can improve user experience.
[0005] In a first aspect, an exposure control method is provided, comprising: detecting a user operation and displaying a first preview image; acquiring first current brightness information of a first original format image, the first original format image comprising a face, the first original format image being acquired by a camera based on a first exposure parameter, and the first original format image being used to generate the first preview image; determining first target brightness information of the first original format image according to the skin color of the face; and displaying a second preview image according to the first current brightness information and the first target brightness information, wherein the second preview image is the first preview image, or the second preview image is generated by a second original format image, the second original format image being acquired by the camera based on a second exposure parameter, and the second exposure parameter being obtained by updating the first exposure parameter according to the first current brightness information and the first target brightness information.
[0006] It is understandable that changes in brightness directly affect the brightness of colors. Generally speaking, higher brightness makes colors look bright, while lower brightness makes colors look dim. Therefore, according to the original format image of the preview image, different target brightness values are selected in real time according to the skin color of the face, and the exposure parameters are adjusted according to the target brightness value, so that the brightness of the original format image approaches the target brightness information, which can make the brightness of the face image match the brightness of the actual skin color, thereby improving the user experience.
[0007] It can also be understood that the exposure control is at the forefront of the image processing flow of the electronic device, and will have an impact on other modules in the subsequent image signal processing (ISP). If the brightness of the original format image obtained at the front end is appropriate, the amplitude of the subsequent ISP will be smaller, the difficulty of skin color correction will be lower, and the accuracy of skin color correction will be higher. The exposure control method provided in the present application directly adjusts the exposure parameters of the camera based on the original format image, that is, the brightness of the image is adjusted before the ISP, thereby reducing the difficulty of the ISP, improving the accuracy of skin color correction, and thus improving the user experience.
[0008] Alternatively, in a first aspect, an exposure control method is provided, comprising: detecting a user operation and acquiring a first original format image; acquiring first current brightness information of the first original format image, the first original format image including a face, the first original format image being acquired by a camera based on a first exposure parameter, and the first original format image being used to generate a first preview image; determining first target brightness information of the first original format image according to the skin color of the face; and displaying a second preview image according to the first current brightness information and the first target brightness information, wherein the second preview image is the first preview image, or the second preview image is generated by a second original format image, the second original format image being acquired by the camera based on a second exposure parameter, and the second exposure parameter being obtained by updating the first exposure parameter according to the first current brightness information and the first target brightness information.
[0009] In a possible embodiment, determining first target brightness information of a first original format image according to skin color of a face includes: determining second target brightness information of a face region in the first original format image according to the skin color of the face; and determining first target brightness information according to the second target brightness information.
[0010] It can be understood that by determining the second target brightness information based on the face, and then determining the first target brightness information of the original format image based on the second target brightness, the brightness of the entire image can be adjusted with the purpose of making the brightness of the face image as consistent as possible with the brightness of the actual skin color, thereby making the skin color of the face image as consistent as possible with the actual skin color, thereby improving the user experience.
[0011] In a possible embodiment, second target brightness information of a region of a human face in a first original format image is determined based on the skin color of the human face, including: determining a target skin color type corresponding to the skin color of the human face, the target skin color type being included in a plurality of preset skin color types, the plurality of preset skin color types including black skin, brown skin, yellow skin or white skin; and determining second target brightness information corresponding to the target skin color type based on a preset correspondence relationship, the preset correspondence relationship being used to indicate a correspondence relationship between a plurality of preset skin color types and a plurality of target brightness information, the plurality of target brightness information including the second target brightness information.
[0012] The above scheme determines the second target brightness information based on the correspondence between the preset skin color type and the target brightness information, and can more accurately determine the target brightness information corresponding to the skin color, thereby improving the user experience.
[0013] In a possible embodiment, determining the first target brightness information based on the second target brightness information includes: obtaining a first weight of a face area; obtaining a second weight of a background area in the first original format image, where the background area is an area other than the face area in the first original format image; obtaining third target brightness information of the background area; and determining the first target brightness information based on the second target brightness information, the first weight, the third target brightness information, and the second weight.
[0014] The above scheme determines the target brightness information of the first original image based on the weight of the face area and the weight of the background area, so as to adjust the influence of the target brightness of the face area on the target brightness of the first original image, thereby better controlling the brightness of the first original image according to the brightness requirements of the face image.
[0015] Exemplarily, obtaining a first weight of a face region includes: determining the first weight based on the number of pixels in the face region and the number of pixels in a first original format image; obtaining a second weight of a background region in the first original format image includes: determining a second weight based on the first weight.
[0016] In some embodiments, by adjusting the correspondence between the proportion of the face in the first original image and the first weight, the second target brightness information of the face can have a greater impact on the first target brightness information, thereby adjusting the brightness of the first original format image with the purpose of achieving the second target brightness of the face image, which can further ensure that the skin color of the face is close to the actual skin color, thereby improving the user experience.
[0017] In a possible embodiment, multiple preset skin color types correspond to multiple skin color parameter ranges respectively, and the method also includes: determining target skin color parameters of pixels in an area of the face; determining a target skin color parameter range that matches the target skin color parameters among multiple skin color parameter ranges; and determining the preset skin color type corresponding to the target skin color parameter range as the target skin color type corresponding to the skin color.
[0018] For example, the skin color parameter may include one or more parameters for characterizing color, such as hue, saturation, hue, and purity.
[0019] For another example, the skin color parameter includes an average value and a gray value of the color value of the pixel.
[0020] The above scheme determines the target skin color type based on the correspondence between the preset skin color type and the skin color parameter range, and can more accurately determine the skin color type corresponding to the skin color area, thereby improving the user experience.
[0021] In a possible embodiment, the human faces include a first human face and a second human face, and determining a target skin color type corresponding to the skin color includes: when the number of pixels included in the first human face is greater than the number of pixels included in the second human face, determining the skin color type corresponding to the first face as the target skin color type.
[0022] The above solution provides a method for determining the target skin color type for the case of multiple faces, further improving the accuracy of determining the target skin color type and improving the user experience.
[0023] In a possible embodiment, the human face includes a first human face and a second human face; according to the skin color of the human face, second target brightness information of the area of the human face in the first original format image is determined, including: determining first sub-target brightness information of the area of the first human face according to the skin color of the first human face; determining second sub-target brightness information of the area of the second human face according to the skin color of the second human face, the second target brightness information including first sub-target brightness information and second sub-target brightness information; obtaining a first weight of the area of the human face, including: obtaining a first sub-weight of the first human face and a second sub-weight of the second face, the first weight including a first sub-weight and a second sub-weight.
[0024] The above solution provides a method for determining the second target brightness information and the first weight for the case of multiple faces, further improving the accuracy of determining the first target brightness information and improving the user experience.
[0025] In one possible embodiment, determining a target skin color type corresponding to the skin color of a human face includes: identifying and distinguishing skin color areas and non-skin color areas in the human face, the non-skin color areas including accessories, eyes, mouth, teeth, and one or more of the teeth; and determining a target skin color type corresponding to the skin color areas.
[0026] The above scheme takes into account that non-skin-color areas such as eyebrows, eyes, mouth and teeth are generally quite different from skin color, and these areas are removed when recognizing skin color, which can improve the accuracy of skin color recognition.
[0027] In a possible embodiment, when the second preview image is generated by the second original format image, the second preview image is displayed according to the first current brightness information and the first target brightness information, including: when the difference between the first current brightness information and the first target brightness information is greater than a threshold, determining the second exposure parameter according to the first exposure parameter, the first current brightness information and the first target brightness information; acquiring the second original format image based on the second exposure parameter by the camera; generating the second preview image according to the second original format image; and updating the first preview image to the second preview image.
[0028] In a possible embodiment, obtaining first current brightness information of a first original format image includes: obtaining a first weight of a face area; obtaining a second weight of a background area in the first original format image, where the background area is an area other than the face area in the first original format image; obtaining second current brightness information of the face area and third current brightness information of the background area; and determining the first current brightness information based on the second current brightness information, the first weight, the third current brightness information, and the second weight.
[0029] The above scheme determines the current brightness information of the first original image based on the weight of the face area and the weight of the background area, so as to adjust the influence of the current brightness of the face area on the current brightness of the first original image, thereby better controlling the brightness of the first original image according to the brightness requirements of the face image.
[0030] Exemplarily, obtaining a first weight of a face region includes: determining the first weight based on the number of pixels in the face region and the number of pixels in a first original format image; obtaining a second weight of a background region in the first original format image includes: determining a second weight based on the first weight.
[0031] In a second aspect, the present application provides an electronic device, comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.
[0032] In a third aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions so that the electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.
[0033] In a fourth aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, causes the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.
[0034] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.
[0035] It can be understood that the electronic device provided in the second aspect, the chip system provided in the third aspect, the computer storage medium provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the method provided in the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1A and Figure 1B They are schematic diagrams of facial images of different skin colors in the preview image of the electronic device provided in the embodiments of the present application;
[0037] Figure 1C A schematic diagram of a face image of a person with actual skin color #2 in a preview image #3 of an electronic device provided in an embodiment of the present application;
[0038] Figure 2 A hardware system suitable for the device of the present application provided in the embodiment of the present application;
[0039] Figure 3 is a schematic diagram of a software system provided in an embodiment of the present application;
[0040] Figure 4 A schematic diagram of an example of an exposure control method provided in an embodiment of the present application;
[0041] Figure 5 A schematic diagram of an example of face recognition provided in an embodiment of the present application;
[0042] Figure 6 A schematic diagram of another example of the exposure control method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0044] In order to better understand the embodiments of the present application, relevant terms involved in the embodiments of the present application are introduced below.
[0045] 1. Sensor or image sensor: uses the photoelectric conversion function of a photoelectric device to convert the light image on the photosensitive surface into an electrical signal that is proportional to the light image. Alternatively, it may also be called a photosensitive element or a photosensitive device in this application.
[0046] Image sensors are mainly divided into two categories: charge coupled device camera (CCD) and complementary metal-oxide-semiconductor (CMOS) phototransistors. Exemplarily, the image sensor involved in the present application may be a CMOS phototransistor.
[0047] RAW format images (or RAW data) are the raw data that CMOS or CCD image sensors convert into digital signals from captured light source signals. They are lossless and contain the original color information of the object. RAW data format generally adopts the Bayer arrangement, which produces a color filter array through a filter. Since the human eye is more sensitive to the color of the green band, the Bayer data format contains 50% of the green information, and 25% of the red and blue information respectively. RAW data generally has RAW8, RAW10 or RAW12, which respectively means that a pixel has 8 bits, 10 bits or 12 bits of data.
[0048] 2. Exposure time (exposure time, exp): the time from the camera shutter opening to closing, the light irradiates the film or photoreceptor. The longer the exposure time, the brighter the image and the higher the contrast; conversely, the shorter the exposure time, the lower the image brightness and the lower the contrast.
[0049] 3. Exposure gain: An exposure parameter that allows the user to configure the pre-amplification of the readout circuit in the imaging sensor pixel. Exposure gain refers to the signal amplification factor of the image sensor. When other conditions (such as ambient brightness, exposure time, etc.) remain unchanged, the greater the exposure gain of the image sensor, the brighter the image, that is, the greater the exposure; conversely, the smaller the exposure gain, the smaller the image brightness, that is, the smaller the exposure.
[0050] Exposure time and exposure gain are important parameters that affect the quality of captured images.
[0051] The commonly used AEC algorithm currently uses a fixed target brightness value as the adjustment target. By counting the current picture brightness information and combining the photosensitivity characteristics of the CMOS image sensor, it linearly adjusts the exposure time and exposure gain of the front-end sensor to form a positive feedback control process. Ultimately, the current picture brightness value converges within a certain range of the set target brightness value, which is used as the stable state of AEC, thereby ensuring that the current picture brightness meets the requirements.
[0052] When capturing facial images of different skin colors, since a fixed target brightness value is used as the adjustment target, the brightness of the facial images of different skin colors after adjustment approaches the same target brightness value, resulting in a mismatch between the brightness of the facial images and the brightness of the actual skin color, causing the skin color of the facial images to be distorted.
[0053] Figure 1A and Figure 1B Schematic diagrams showing facial images of different skin colors in the preview image of the electronic device. Figure 1A As shown, the electronic device uses the target brightness value to capture the face of the actual skin color #1, and obtains the preview image #1. The brightness of the face image presented in the preview image #1 matches the brightness of the actual skin color, and the skin color #1 of the face image in the preview image #1 is not distorted. Figure 1B As shown, the electronic device uses the same target brightness value to capture a face of actual skin color #2 and obtains preview image #2. The brightness of the face image presented in preview image #2 does not match the brightness of the actual skin color. The skin color #2 of the face image in preview image #2 is obviously different from the actual skin color #2, and the skin color distortion is visible.
[0054] In view of this, the present application provides an exposure control method, which determines the target brightness information of the original format image of the preview image according to the skin color of the face, and adjusts the exposure parameters of the camera according to the target brightness information, so that the brightness of the face image matches the brightness of the actual skin color, so that the skin color of the face image in the preview image is more consistent with the skin color of the actual face, thereby improving the user experience.
[0055] It can be understood that changes in brightness directly affect the brightness of colors. Generally speaking, higher brightness makes colors look bright, while lower brightness makes colors look dim. Therefore, according to the original format image of the preview image, different target brightness values are selected in real time according to the skin color of the face, and the exposure parameters are adjusted according to the target brightness value, so that the brightness of the original format image approaches the target brightness information, and the brightness of the face image can match the brightness of the actual skin color.
[0056] Figure 1CFIG. 2 is a schematic diagram showing a face image in a face preview image #3 of the actual skin color #2 of the electronic device. Figure 1C As shown, after the exposure control method provided by the present application is processed, the skin color #3 of the face image in the preview image #3 presented by the electronic device is consistent with the actual skin color #2. It should be noted that the present application is not limited to the photo scene (photographing or photo preview), and is applicable to video preview, video recording, video live broadcast, video call and other scenes.
[0057] It can also be understood that the exposure control is at the forefront of the image processing flow of the electronic device, and will have an impact on other modules in the subsequent image signal processing (ISP). If the brightness of the original format image obtained at the forefront is appropriate, the amplitude of the subsequent ISP will be smaller, the difficulty of skin color correction will be lower, and the accuracy of skin color correction will be higher. The exposure control method provided in the present application directly adjusts the exposure parameters of the camera based on the original format image, that is, the brightness of the image is adjusted before the ISP, thereby reducing the difficulty of the ISP and improving the accuracy of skin color correction, so that the visual perception of the face image in the preview image presented to the user is better, and the visual perception of the face image obtained after the user clicks to take a photo or record a video is better.
[0058] Figure 2 A hardware system suitable for the device of the present application is shown.
[0059] The electronic device 100 can be a mobile phone, a smart screen, a tablet computer, a wearable electronic device, an in-vehicle electronic device, an augmented reality (AR) device, a virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a projector, etc. The embodiment of the present application does not impose any restrictions on the specific type of the electronic device 100.
[0060] The electronic device 100 may include at least one processor 110 , a camera 120 , and a display screen 130 .
[0061] It should be noted that Figure 2 The structure shown does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include Figure 2 More or fewer components than those shown, or the electronic device 100 may include Figure 2 Combinations of some of the components shown, or the electronic device 100 may include Figure 2Subassemblies of some of the components shown. Figure 2 The components shown may be implemented in hardware, software, or a combination of software and hardware.
[0062] The processor 110 may include one or more processing units. For example, the processor 110 may include at least one of the following processing units: 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, and a neural-network processing unit (NPU). Different processing units may be independent devices or integrated devices.
[0063] Exemplarily, in an embodiment of the present application, the processor 110 may detect an operation of a user and display a first preview image; obtain first current brightness information of a first raw format image, the first raw format image includes a face, the first raw format image is acquired by a camera based on a first exposure parameter, and the first raw format image is used to generate a first preview image; determine first target brightness information of the first raw format image according to the skin color of the face; and display a second preview image according to the first current brightness information and the first target brightness information, wherein the second preview image is the first preview image, or the second preview image is generated by a second raw format image, the second raw format image is acquired by a camera based on a second exposure parameter, and the second exposure parameter is obtained by updating the first exposure parameter according to the first current brightness information and the first target brightness information.
[0064] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0065] NPU is a neural network (NN) computing processor. It can quickly process input information by learning from the biological neural network structure, such as the transmission mode between neurons in the human brain, and can also continuously self-learn. NPU can realize applications such as intelligent cognition of electronic devices, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0066] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0067] Figure 2 The connection relationship between the modules shown is only a schematic illustration and does not constitute a limitation on the connection relationship between the modules of the electronic device 100. Optionally, the modules of the electronic device 100 may also adopt a combination of multiple connection modes in the above embodiments.
[0068] The electronic device 100 can realize the display function through the GPU, the display screen 130 and the application processor. The GPU is a microprocessor for image processing, which connects the display screen 130 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0069] The display screen 130 may be used to display images or videos.
[0070] The electronic device 100 can implement a shooting function through an ISP, a camera 120, a video codec, a GPU, a display screen 130, and an application processor.
[0071] The ISP is used to process the data fed back by the camera 120. For example, when taking a photo, the shutter is opened, and light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can perform algorithm optimization on the noise, brightness and color of the image. The ISP can also optimize the exposure and color temperature of the shooting scene and other parameters.
[0072] The camera 120 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a CCD or CMOS phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard red green blue (RGB), YUV (also known as YCrCb) format, etc. In some embodiments, the electronic device 100 may include 1 or N cameras 120, where N is a positive integer greater than 1.
[0073] Exemplarily, the digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0074] The hardware system of the electronic device 100 is described in detail above, and the software system of the electronic device 100 is introduced below.
[0075] Figure 3 It is a schematic diagram of the software system provided in the embodiment of the present application.
[0076] like Figure 3 As shown, the system architecture may include an application layer 210 , an application framework layer 220 , a hardware abstraction layer 230 , a driver layer 240 and a hardware layer 250 .
[0077] The application layer 210 may include a camera application, as well as applications such as gallery, calendar, call, map, navigation, wireless local area network (WLAN), Bluetooth, music, video, and short message.
[0078] The application framework layer 220 provides an application programming interface (API) and a programming framework for application programs of the application layer; the application framework layer may include some predefined functions.
[0079] For example, the application framework layer 220 may include a camera API and a surface view, etc. The surface view is used to display a preview screen.
[0080] The hardware abstraction layer 230 is used to abstract the hardware. For example, the hardware abstraction layer may include a camera abstraction layer and other hardware device abstraction layers; the camera hardware abstraction layer 2301 may call a camera algorithm 2302 .
[0081] For example, the hardware abstraction layer 230 includes a camera hardware abstraction layer 2301 and a camera algorithm 2302; the camera algorithm 2302 includes an AEC algorithm 23021; the hardware abstraction layer 230 also includes a face recognition module 2303 and a skin color recognition module 2304. Exemplarily, the face recognition module 2303 can implement face recognition through a neural network model, and the skin color recognition module 2304 can implement skin color recognition through a neural network model.
[0082] The driver layer 240 is used to provide drivers for different hardware devices. For example, the driver layer may include a camera driver.
[0083] The hardware layer 250 may include camera devices and other hardware devices.
[0084] For example, the hardware layer 250 includes a camera device, which includes an image sensor 2501. The hardware layer 250 also includes an image signal processor (not shown in the figure).
[0085] For example, Figure 3 As shown by the downward dotted arrow in the figure, the user opens the camera application, and the camera application calls the camera hardware abstraction layer 2301 through the camera access interface to send an instruction to start the camera device. The camera hardware abstraction layer 2301 sends the instruction to the camera device driver of the driver layer. The camera device driver can start the camera device according to the above instruction. After the camera device is turned on, the image sensor 2501 collects light signals, and the image signal processor generates a color image of the electrical signal.
[0086] For example, Figure 3 As shown by the upward dotted arrow, after the image signal processor generates a color image, the camera device sends the color image to the camera device driver, the camera device driver sends the color image to the camera hardware abstraction layer 2301, the camera hardware abstraction layer 2301 sends the color image to the surface view, and the surface view displays the color image as a preview image.
[0087] For example, Figure 3 As shown by the solid arrow, the face recognition module 2303 can perform face recognition on the image acquired by the camera device, determine whether there is a face in the image, and identify the face area if there is a face. The skin color recognition module 2304 can perform skin color recognition on the face area to determine the skin color of the face area. The camera hardware abstraction layer 2301 calls the AEC algorithm 23021 in the camera algorithm 2302. The AEC algorithm 23021 can adjust the exposure parameters of the image sensor 2501 according to the recognition results of the face recognition module 2303 and the skin color recognition module 2304. The AEC algorithm 23021 can determine the target brightness of the image according to the skin color of the face area, obtain the current brightness of the image, and adjust the exposure parameters of the image sensor 2501 according to the target brightness and the current brightness of the image. The camera hardware abstraction layer 2301 sends the adjusted exposure parameters to the image sensor 2501 through the camera device driver, and then the camera device generates an image according to the adjusted exposure parameters. Subsequently, referring to the upward dotted arrow, the surface view presents a preview image after the exposure parameters are adjusted.
[0088] Figure 4 FIG. 3 is a schematic diagram of an exposure control method 300 provided in an embodiment of the present application. The exposure control method 300 is applied to an electronic device having a camera.
[0089] S301: Detecting a user operation, and displaying a first preview image.
[0090] Exemplarily, the user's operation is to open a camera application (for example, click on the camera application icon). After detecting the operation, the electronic device enters a camera or video recording interface and displays a first preview image on the interface. The first preview image can be a preview image before the user chooses to start taking a photo or recording a video, or it can be a video screen during the video recording process after the user chooses to start recording a video. This application is mainly described by taking the preview image before starting to take a photo or shoot a video as an example.
[0091] It can be understood that the electronic device includes a camera, a display screen and a processor. The camera includes an image sensor. The image sensor converts the collected light signal into an electrical signal based on the first exposure parameter, and transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye, that is, a preview image. Before the ISP processing, the image used to generate the preview image is a RAW format image.
[0092] S302: Acquire first current brightness information of a first original format image.
[0093] The first raw format image is a RAW format image used to generate the first preview image. The first raw format image is acquired by a camera (more specifically, an image sensor) based on a first exposure parameter. For example, the first exposure parameter includes a first exposure time and a first exposure gain.
[0094] The first original format image includes a human face.
[0095] It can be understood that, in the present application, reference to an image including a face can be understood to mean that the image includes a face image.
[0096] Exemplarily, S302 may be implemented as follows.
[0097] Step a-1, obtaining a first weight of the face region.
[0098] Exemplarily, the first weight is determined according to a ratio of the number of pixels in the face region to the number of pixels in the entire first original format image.
[0099] For example, when the ratio is greater than or equal to a first threshold (such as 0.006), the first weight is 1.
[0100] For another example, when the ratio is less than or equal to a second threshold (such as 0.001), the first weight is 0.
[0101] For another example, when the ratio is greater than the second threshold (such as 0.001) and less than the first threshold (such as 0.006), the first weight changes linearly between (0, 1). For example, when the ratio is 0.003, the first weight is 0.4; when the ratio is 0.002, the first weight is 0.2.
[0102] Step a-2, obtaining a second weight of a background area in the first original format image, where the background area is an area other than a face area in the first original format image.
[0103] Exemplarily, the second weight = 1 - the first weight. For example, when the first weight is 0.4, the second weight is 0.6.
[0104] Step a-3, obtaining the second current brightness information of the face area and the third current brightness information of the background area.
[0105] Possible implementations of step a-3 will be described below.
[0106] Step a-4, determining the first current brightness information according to the second current brightness information, the first weight, the third current brightness information and the second weight.
[0107] Exemplarily, the first current brightness information=the second current brightness information*the first weight+the third current brightness information*the second weight.
[0108] It can be understood that the larger the human face is, the greater the ratio of the number of pixels in the human face area to the number of pixels in the entire first original format image is, and the greater the first weight is.
[0109] It can also be understood that the smaller the first threshold, the greater the influence of the second current brightness information of the face on the first current brightness information of the entire first original format image. Taking the first threshold of 0.006 as an example, when the proportion of the face area in the first original format image is very small, the proportion can be greater than the first threshold, so that the first weight is 1 and the second weight is 0, so that the first current brightness information is the second current brightness information.
[0110] The above scheme determines the current brightness information of the first original image based on the weight of the face area and the weight of the background area, so as to adjust the influence of the current brightness of the face area on the current brightness of the first original image, thereby better controlling the brightness of the first original image according to the brightness requirements of the face image.
[0111] Optionally, before S301, the method 300 further includes: step 1, identifying whether the first original format image includes a face.
[0112] If the first original format image includes a human face, S301 is executed; otherwise, it is not executed.
[0113] Possible implementations of step 1 are described below.
[0114] S303: Determine first target brightness information of the first original format image according to the skin color of the face.
[0115] Example 1: First, the second target brightness information of the face area in the first original format image is determined according to the skin color of the face, and then the first target brightness information is determined according to the second target brightness information.
[0116] It can be understood that by determining the second target brightness information based on the face, and then determining the first target brightness information of the original format image based on the second target brightness, the brightness of the entire image can be adjusted with the purpose of making the brightness of the face image as consistent as possible with the brightness of the actual skin color, thereby making the skin color of the face image as consistent as possible with the actual skin color.
[0117] Example 1-1, based on Example 1, the second target brightness information is determined according to the skin color of the face, which can be implemented as follows.
[0118] Step b-1, determining a target skin color type corresponding to the skin color of the face.
[0119] It is understandable that there are many ways to classify skin color. For example, from a global perspective, different races have different skin colors. Classifying skin colors according to race can include black skin, brown skin, yellow skin, and white skin. Alternatively, skin colors can be classified by other methods. For example, on the basis of classifying skin colors according to race, brown skin can be divided into dark brown skin and light brown skin according to the depth of the color scale, and yellow skin can be divided into yellow-toned one white, yellow-toned two white, yellow-toned three white, pink-toned one white, pink-toned two white, and pink-toned three white, etc. according to the hue and color scale.
[0120] Taking skin color classification according to race as an example, method 300 includes four preset skin color types, black skin, brown skin, yellow skin or white skin. Step b-1 can determine the corresponding skin color type, i.e., the target skin color type, according to the skin color of the face among the multiple preset skin color types.
[0121] Step b-2: determining the second target brightness information corresponding to the target skin color type according to a preset corresponding relationship.
[0122] The preset correspondence relationship is used to indicate the correspondence relationship between a plurality of preset skin color types and a plurality of target brightness information. The plurality of target brightness information includes the second target brightness information.
[0123] Exemplarily, the darker the color of the preset skin color type, the smaller the value of the corresponding target brightness information. For example, target Y value (white)>target Y value (yellow)>target Y value (brown)>target Y value (black).
[0124] Exemplarily, taking RAW8 as an example, the correspondence between the preset skin color type and the target brightness information may be as shown in Table 1.
[0125] Table 1
[0126] Preset skin type Target brightness information (target Y value) White skin 50 Yellow skin 45 Brown skin 40 Dark Skin 35
[0127] The above scheme determines the second target brightness information based on the correspondence between the preset skin color type and the target brightness information, and can more accurately determine the target brightness information corresponding to the skin color, thereby improving the user experience.
[0128] Example 1-2, based on Example 1, the first target brightness information is determined according to the second target brightness information, which can be implemented as follows.
[0129] Step c-1, obtaining a first weight of the face region.
[0130] For details, please refer to the description of step a-1.
[0131] Step c-2, obtaining a second weight of a background area in the first original format image, where the background area is an area other than a face area in the first original format image.
[0132] For details, please refer to the instructions of step a-2.
[0133] Step c-3, obtaining third target brightness information of the background area.
[0134] Exemplarily, the third target brightness information may be a preset brightness value.
[0135] Step c-4, determining the first target brightness information according to the second target brightness information, the first weight, the third target brightness information and the second weight.
[0136] Exemplarily, the first target brightness information=the second target brightness information*the first weight+the third target brightness information*the second weight.
[0137] The above scheme determines the target brightness information of the first original image based on the weight of the face area and the weight of the background area, so as to adjust the influence of the target brightness of the face area on the target brightness of the first original image, thereby better controlling the brightness of the first original image according to the brightness requirements of the face image.
[0138] It can be understood that the larger the human face is, the greater the ratio of the number of pixels in the human face area to the number of pixels in the entire first original format image is, and the greater the first weight is.
[0139] It can also be understood that the smaller the first threshold, the greater the impact of the second target brightness information of the face on the first target brightness information of the entire first original format image. Taking the first threshold of 0.006 as an example, when the proportion of the face area in the first original format image is very small, it can satisfy the proportion greater than the first threshold, so that the first weight is 1 and the second weight is 0, so that the first target brightness information is the second target brightness information. Therefore, the brightness of the first original format image is adjusted with the purpose of the brightness of the face image reaching the second target brightness. Therefore, it is further ensured that the skin color of the face is close to the actual skin color.
[0140] Optionally, before Example 1, Example 1-1 or Example 1-2, method 300 may further include: Step 2, identifying the skin color of the face. Step 2 may be implemented as follows, including step d-1 and step d-2.
[0141] Step d-1, based on the recognition of the face, the skin color area is recognized.
[0142] Example 2: Recognition of skin color areas through a neural network model.
[0143] The first original format image is input into the trained neural network model #1, and the output result of the model is the position of the skin color area in the first original format image, for example, it can be expressed as the coordinates of the pixels of the skin color area in the first original format image.
[0144] Example 2-1, based on Example 2, the input data #1 for training the neural network model #1 is a sample image, and the target data #1 is the position of the skin color area #1 in the sample image. The sample image includes a face image, and / or an image containing the skin color area #1. For example, the target data can be embodied as the coordinates of the skin color area #1 in the sample image.
[0145] It can be understood that the skin color area #1 in Example 2-1 includes the area of the human face displayed in the sample image, which may include the face and ears; wherein the face may include eyebrows, eyes, nose, mouth (if teeth are exposed, teeth may be included), etc., and if the human face wears accessories such as glasses, these accessories may also be included.
[0146] Considering that eyebrows, eyes, mouth, and teeth are generally quite different from skin color, removing these areas when recognizing skin color can improve the accuracy of skin color recognition. The following example 2-2 introduces another implementation method.
[0147] Example 2-2, based on Example 2, the input data #2 for training the neural network model #2 is a sample image, and the target data #2 is the position of the skin color area #2 and / or the non-skin color area in the sample image. The sample image includes a face image, and / or an image containing the skin color area #2. For example, the target data can be embodied as the coordinates of the skin color area #2 in the sample image.
[0148] It is understandable that the skin color area #2 in Example 2-1 does not include the non-skin color area in the area of the human face shown in the sample image. The non-skin color area includes eyebrows, eyes, nose, mouth (if teeth are exposed, teeth may be included), etc. If the human face is wearing accessories such as glasses, these accessories may also be included.
[0149] Step d-2, identifying the target skin color type of the skin color area.
[0150] Identifying the skin color type of the skin color area may be understood as identifying which skin color type the skin color of the skin color area belongs to among the plurality of preset skin color types.
[0151] Example 3: Each preset skin color type in multiple preset skin color types corresponds to a different skin color parameter range. For example, the skin color parameter may include one or more parameters such as hue, saturation, hue and purity for characterizing color. The skin color parameter range is the value range of the skin color parameter. For example, identifying the skin color type of a skin color area can be understood as determining a target skin color parameter of the skin color area, taking a skin color parameter range that matches the target skin color parameter in multiple skin color parameter ranges as the target skin color parameter range, and thus taking the preset skin color type corresponding to the target skin color parameter range as the target skin color type corresponding to the skin color area. Optionally, the target skin color parameter is calculated based on pixels in an area of a human face, and the pixels in an area of a human face may be all pixels in skin color area #1 or skin color area #2.
[0152] Example 3-1, based on Example 3, the skin color parameter includes an average value and a gray value of the color value of the pixel. The multiple skin color parameter ranges do not overlap with each other.
[0153] The above scheme determines the target skin color type based on the correspondence between the preset skin color type and the skin color parameter range, and can more accurately determine the skin color type corresponding to the skin color area, thereby improving the user experience.
[0154] Example 4: Skin color recognition using a neural network model.
[0155] The pixels of the skin color area in the first original format image (or the image of the skin color area) are input into the trained neural network model #3, and the output result of the model is the skin color type corresponding to the skin color area.
[0156] Example 4-1, based on Example 4, the input data #3 for training the neural network model #3 is sample pixels (or sample images), and the target data #2 is the skin color type corresponding to the sample pixels (or sample images). Each sample pixel is a pixel in the skin color area of a human face (or each sample image is an image of the skin color area of a human face).
[0157] Exemplarily, when Example 2-2 is combined with Example 1-2, the target brightness of the non-skin color area in the face area can also be used as the second target brightness information.
[0158] S304: Display a second preview image according to the first current brightness information and the first target brightness information.
[0159] In case 1, when the difference between the first current brightness information and the first target brightness information is less than or equal to the threshold #1, the first exposure parameter is not updated, and the second preview image is the first preview image.
[0160] In case 2, when the difference between the first current brightness information and the first target brightness information is greater than threshold #1, the second preview image is obtained by updating the first preview image.
[0161] Step e-1, determining a second exposure parameter according to the first exposure parameter, the first current brightness information and the first target brightness information.
[0162] For example, the second exposure parameters include a second exposure time and a second exposure gain.
[0163] Exemplarily, exposure amount=exposure time*exposure gain, wherein it can be considered that the exposure amount and the first current brightness information of the first raw format image are in a linear relationship.
[0164] First exposure amount=first exposure time*first exposure gain.
[0165] Second exposure amount=(first current brightness information*first target brightness information) / first exposure amount.
[0166] After the second exposure amount is obtained, the second exposure time and the second exposure gain can be obtained by looking up a table (eg, Table 2).
[0167] For example, the second exposure is 100, the exposure calculated in the third row of Table 2 is 40, and the exposure calculated in the fourth row of Table 2 is 120. The parameters in the fourth row can be selected as the second exposure time and the second exposure gain respectively.
[0168] Table 2
[0169]
[0170] In step e-2, the camera acquires a second original format image based on the second exposure parameter.
[0171] It can be understood that the exposure parameter of the image sensor in the camera is updated to the second exposure parameter.
[0172] Step e-3, generating a second preview image according to the second original format image.
[0173] It can be understood that the second original format image is subsequently processed by the ISP to generate a second preview image.
[0174] Step e-4: updating the first preview image to the second preview image.
[0175] In the above scheme, when the first current brightness information of the first original image does not match the first target brightness information,
[0176] It is understandable that the human faces involved in method 300 may be one or more human faces. Optionally, step 1 further includes, when a human face is recognized, determining the number of human faces according to the recognition result.
[0177] Example 5: When the human face includes at least two human faces, step d-2 may specifically be to determine the skin color type corresponding to the largest human face among the at least two human faces as the target skin color type. For example, the human face includes a first human face and a second human face, and a first skin color type of the skin color area of the first human face is identified, and a second skin color type of the skin color area of the second human face is identified. When the number of pixels included in the first human face is greater than the number of pixels included in the second human face, the skin color type corresponding to the first human face is determined as the target skin color type. Alternatively, when the number of pixels included in the first human face is equal to the number of pixels included in the second human face, the skin color type corresponding to the first human face or the second face is determined as the target skin color type.
[0178] The above solution provides a method for determining the target skin color type for the case of multiple faces, further improving the accuracy of determining the target skin color type and improving the user experience.
[0179] Example 6, when the face includes at least two faces, Example 1 can be specifically as follows: determine the sub-target brightness information of each face in the at least two faces, determine the sub-weight corresponding to each face, and then calculate the first target brightness information with reference to Example 1-2. For example, the face includes a first face and a second face, and step f-1 determines the first sub-target brightness information of the area of the first face according to the skin color of the first face. Step f-2 determines the second sub-target brightness information of the area of the second face according to the skin color of the second face, and the second target brightness information includes the first sub-target brightness information and the second sub-target brightness information. Step f-3 obtains the first sub-weight of the first face and the second sub-weight of the second face, and the first weight includes the first sub-weight and the second sub-weight. Step f-4 determines the first target brightness information according to the first sub-target brightness information, the second sub-target brightness information, the first sub-weight, the second sub-weight, the third target brightness information and the second weight. Exemplarily, the first target brightness information = the first sub-target brightness information * the first sub-weight + the second sub-target brightness information * the second sub-weight + the third target brightness information * the second weight.
[0180] The above scheme provides a method for determining the brightness information of the first target for the case of multiple faces, further improving the accuracy of determining the target skin color type and improving the user experience.
[0181] Exemplarily, when the sizes of at least two human faces are not very different (for example, the difference in the number of pixels included in each of the two human face regions is less than or equal to threshold #2), Example 5 is preferred; otherwise, Example 6 is preferred.
[0182] Exemplarily, when the skin color types of at least two faces are consistent, Example 5 is preferred; otherwise, Example 6 is preferred.
[0183] The above scheme provides a further implementation method for the case where the first original image includes multiple faces, which can further improve the matching degree between the skin color of the face image and the actual skin color.
[0184] Alternatively, in another possible implementation of method 300, the first original format image in S302 includes a naked body part other than the face (for convenience of explanation, referred to as part #1), for example Figure 1AThe exposed neck and arms of the characters, and the ankles, elbows, forearms, wrists, palms (including the back and top of the hands), ankles, calves, knees, etc. of the characters. S303 can be replaced by determining the first target brightness information of the first original format image according to the skin color of part #1. Accordingly, step 2 can be replaced by identifying the skin color of part #1. Among them, step d-1 can be replaced by identifying the skin color of part #1 based on the identification of part #1. Similarly, part #1 can be identified by a neural network. The situation involving multiple faces in Examples 5 and 6 can be replaced by the situation where part #1 includes multiple body parts.
[0185] Alternatively, in another possible implementation of method 300 , S301 and S302 may be replaced by, S301A, detecting a user operation, and acquiring a first original format image.
[0186] It is understandable that in this implementation, the first original format image is used to generate the first preview image, but the first preview image is not necessarily displayed on the interface of the electronic device. If the first target brightness information matches the first current brightness information, that is, the first preview image is the second preview image, then the first preview image will be displayed on the interface of the electronic device. If the first target brightness information does not match the first current brightness information, that is, the second preview image is an updated preview image, after the user opens the camera application, the preview image displayed is the second preview image.
[0187] The following is a detailed description of step a-3 and step 1 described above.
[0188] Step a-3, obtaining the second current brightness information of the face area and the third current brightness information of the background area.
[0189] Example 7, taking the second current brightness information of the face area as an example, the first original format image is divided into M*N regions or image blocks (regions), the brightness of each region is counted, and finally a current brightness value is obtained by weighted average, which is the second current brightness information. Taking one of the regions as an example, when the first original image is RAW8, the brightness value can be calculated according to the following formula:
[0190] Y=0.299R+0.587G+0.114B.
[0191] Among them, Y is the brightness value, R is the red component, B is the blue component, and G is the average value of the green red (GR) component and the green blue (GB) component.
[0192] Optionally, based on Example 7, image blocks with brightness higher than threshold #3 and image blocks with brightness lower than threshold #4 are deleted from the M*N image blocks to obtain valid image blocks. That is, extremely bright blocks (image blocks with brightness higher than threshold #3) and extremely dark blocks (image blocks with brightness lower than threshold #4) from the M*N image blocks can be deleted to obtain valid image blocks from the M*N image blocks. The second current brightness information is then calculated based on the valid image blocks.
[0193] It can be understood that by deleting extremely bright blocks and extremely dark blocks, the accuracy of brightness calculation can be improved, thereby further improving the similarity between the skin color of the face in the preview image and the actual skin color.
[0194] It should be noted that threshold #3 and threshold #4 can be set according to system performance and / or implementation requirements during specific implementation, and the embodiment of the present application does not limit the size of the above threshold #3 and threshold #4.
[0195] The method for acquiring the third current brightness information of the background area may refer to the description related to Example 7.
[0196] Step 1: Identify whether a first original format image includes a face.
[0197] It is understandable that the present application does not limit the specific method for detecting whether an image includes a face image. Figure 5 A schematic diagram of an example of face recognition provided in an embodiment of the present application.
[0198] See also Figure 5 The face recognition model can use a facial key point detection algorithm (such as deep blue face (Dbface), practical facial landmark detector (PFLD), face key point factory face-landmark-factory, multi-task convolutional neural network (MTCNN), center face centerface and other algorithms, not limited here) to determine the facial key points in the input image: left eye A, right eye B, nose C, left lip corner D, right lip corner E, and determine the coordinate position of each key point (such as Figure 5 Optionally, if the face is tilted, such as key points A and B are not on a horizontal line, the face image can be corrected by a face correction algorithm, and the specific process is not limited in this application. It is understandable that if the face recognition model does not detect the face key points from the input image (or does not detect all five key points), it is considered that there is no face image in the input image.
[0199] Furthermore, the face recognition model outputs a detection result. The detection result includes a face image. For example, the face recognition model can determine a rectangle with the nose C as the center, and the rectangle includes several other key points. The image intercepted by the rectangle is the face image, such as Figure 5 Optionally, the detection result also includes a left eye image. For example, a face recognition model determines a fixed-size rectangle as the center of the left eye A, and the image intercepted by the rectangle is the left eye image, as shown in (b). Figure 5 As shown in (c) in FIG. 1 ; Optionally, the detection result also includes a right eye image. For example, a face recognition model right eye B is used as the center to determine a fixed-size rectangle, and the image intercepted by the rectangle is the right eye image, such as Figure 5 As shown in (d) in .
[0200] Figure 6 A schematic diagram of an exposure control method 400 provided in an embodiment of the present application.
[0201] S401 to S403 may be understood as a possible implementation of S301.
[0202] S401, the image sensor is exposed.
[0203] As described above, a RAW format image is obtained.
[0204] S402: The AEC algorithm obtains brightness statistical information of the RAW format image.
[0205] It can be understood that the AEC algorithm acquires RAW format images in real time.
[0206] Exemplarily, the brightness statistical information may include brightness histogram statistical information, brightness mean statistical information, etc. In other application scenarios, statistics may also be performed based on the maximum or minimum value corresponding to the brightness.
[0207] S403, determining whether there is a face in the RAW format image.
[0208] If the judgment result is yes, execute S404a; otherwise, execute S404b.
[0209] It should be noted that the present application does not limit the execution order of S402 and S403.
[0210] In the branch that executes S404a after S403, S405 to S409 and S410a or S410b are also executed.
[0211] S404a can be understood as a possible implementation of step 2 above.
[0212] S404a, identifying the skin color information FaceType of the face.
[0213] This step may not be performed by the AEC algorithm, but may be performed by a skin color recognition module, for example, and the obtained FaceType is transmitted to the AEC algorithm.
[0214] S405, S406 and S408 may be understood as a possible implementation of S303 above.
[0215] S405, selecting a target brightness FaceTarget of the face according to FaceType.
[0216] For example, the face brightness weight (FaceWeight) is calculated and obtained according to the face size. The larger the face, the higher the FaceWeight. And according to the recognized face skin color information (black, white, yellow, brown), different face target brightness FaceTarget is selected. FaceTarget is generally set according to the skin color depth. The darker the skin color, the smaller the setting value. The general rule for setting the FaceTarget size is: FaceTarget_white>FaceTarget_yellow>FaceTarget_brown>FaceTarget_black.
[0217] S406, calculating FaceWeight according to the size of the face.
[0218] It should be noted that the present application does not limit the execution order of S405 and S406.
[0219] S406 and S407 may be understood as a possible implementation of S302.
[0220] S407, calculating the brightness finalCurLuma of the current frame (current RAW format image).
[0221] Exemplarily, before S407, method 400 may further include: calculating the current brightness CurLuma of the background area and the brightness FaceLuma of the face in the current frame. For example, the calculation formula is as follows:
[0222] finalCurLuma=CurLuma*(1-FaceWeight)+Faceluma*FaceWeight.
[0223] S408, calculating the target brightness finalTargetLuma according to the background area target brightness TargetLuma, FaceTarget and FaceWeight.
[0224] Exemplarily, the calculation formula is as follows:
[0225] finalTargetLuma=TargetLuma*(1-FaceWeight)+FaceTarget*FaceWeight.
[0226] Among them, the background area target brightness TargetLuma is preset.
[0227] S409, S410a and S410b may be understood as a possible implementation of S304.
[0228] S409, determining whether the current frame brightness finalCurLuma is consistent with the target brightness finalTargetLuma.
[0229] If the judgment result is yes, execute S401a; otherwise, execute S410b.
[0230] S401a, the brightness of the RAW format image is stable and the AEC algorithm ends.
[0231] S401b, adjusting exposure parameters, and then returning to S401.
[0232] In the branch that executes S404b after S403, S409 and S410a or S410b are also executed.
[0233] S404b, calculate the brightness finalCurLuma of the current frame.
[0234] It can be understood that the finalCurLuma in this step is the current brightness CurLuma of the background area in the above step. In this step, if there is no face in the RAW format image, the current brightness of the entire image is the current brightness of the background area.
[0235] Similarly, the target brightness finalTargetLuma of the entire image is the target brightness of the background area.
[0236] Then, S409 and S410a or S410b are executed. For details, please refer to the above related description.
[0237] The beneficial effects of each solution involved in method 400 can refer to the description of the corresponding solution in method 300.
[0238] The embodiment of the present application provides a chip system, which includes one or more processors for calling and running instructions stored in the memory from the memory, so that the method of the embodiment of the present application is executed. The chip system can be composed of chips, or it can include chips and other discrete devices.
[0239] Among them, the chip system may include an input circuit or interface for sending information or data, and an output circuit or interface for receiving information or data.
[0240] The present application also provides a computer program product, which, when executed by a processor, implements the method described in any method embodiment of the present application.
[0241] The computer program product can be stored in a memory, and is finally converted into an executable target file that can be executed by a processor after preprocessing, compiling, assembling and linking.
[0242] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the method described in any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.
[0243] The computer-readable storage medium may be a volatile memory or a nonvolatile memory, or may include both a volatile memory and a nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DR RAM).
[0244] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described devices and equipment and the technical effects produced can refer to the corresponding processes and technical effects in the aforementioned method embodiments, and will not be repeated here.
[0245] In several embodiments provided in the present application, the disclosed systems, devices and methods can be implemented in other ways. For example, some features of the method embodiments described above can be ignored or not performed. The device embodiments described above are merely schematic, and the division of units is only a logical function division. There may be other division methods in actual implementation, and multiple units or components may be combined or integrated into another system. In addition, the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the above coupling includes electrical, mechanical or other forms of connection.
[0246] It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0247] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0248] The terms (or numbers) "first", "second", ..., etc. that appear in the embodiments of the present application are only used for descriptive purposes, that is, only to distinguish different objects, such as different "coordinates", etc., and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first", "second", ..., etc. may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, "at least one (item)" refers to one or more. "Multiple" means two or more. "At least one of the following (items)" or similar expressions thereof refers to any combination of these items, including any combination of a single (item) or a plurality of (items).
[0249] In short, the above is only a preferred embodiment of the technical solution of this application, and is not intended to limit the protection scope of this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application should be included in the protection scope of this application.
Claims
1. An exposure control method, applied to an electronic device, wherein the electronic device has a camera, characterized in that: The method comprises: Detecting a user operation, displaying a first preview image, where the first preview image is generated based on a first original format image, where the first original format image is acquired by the camera based on a first exposure parameter; detecting that the first raw format image includes a human face, and determining first current brightness information of the first raw format image according to a first weight of a region of the human face in the first raw format image; Determine a target skin color type corresponding to the skin color of the face, wherein the target skin color type is included in a plurality of preset skin color types, and the plurality of preset skin color types include black skin, brown skin, yellow skin or white skin; Determining second target brightness information corresponding to the target skin color type according to a preset corresponding relationship, wherein the preset corresponding relationship is used to indicate a corresponding relationship between the plurality of preset skin color types and a plurality of target brightness information, wherein the plurality of target brightness information includes the second target brightness information; Determine first target brightness information according to the first weight and the second target brightness information; A second preview image is displayed according to the first current brightness information and the first target brightness information, wherein the second preview image is the first preview image, or the second preview image is generated by a second original format image, the second original format image is acquired by the camera based on second exposure parameters, and the second exposure parameters are obtained by updating the first exposure parameters according to the first current brightness information and the first target brightness information.
2. The method according to claim 1, characterized in that The determining the first target brightness information according to the first weight and the second target brightness information includes: Obtaining the first weight; Acquire a second weight of a background area in the first original format image, where the background area is an area in the first original format image excluding an area of the human face; Acquire third target brightness information of the background area; The first target brightness information is determined according to the second target brightness information, the first weight, the third target brightness information and the second weight.
3. The method according to claim 2, characterized in that The obtaining the first weight includes: Determining the first weight according to the number of pixels in the area of the human face and the number of pixels in the first original format image; The obtaining a second weight of the background area in the first original format image includes: The second weight is determined according to the first weight.
4. The method according to claim 1, characterized in that The plurality of preset skin color types correspond to a plurality of skin color parameter ranges respectively, and the method further comprises: Determining target skin color parameters of pixels in the region of the human face; Determining a target skin color parameter range that matches the target skin color parameter among the multiple skin color parameter ranges; The preset skin color type corresponding to the target skin color parameter range is determined as the target skin color type corresponding to the skin color.
5. The method according to claim 1, characterized in that The human faces include a first human face and a second human face, and determining a target skin color type corresponding to the skin color includes: When the number of pixels included in the first human face is greater than the number of pixels included in the second human face, the skin color type corresponding to the first human face is determined as the target skin color type.
6. The method according to claim 2, characterized in that The human face includes a first human face and a second human face, the second target brightness information includes first sub-target brightness information and second sub-target brightness information, and the first weight includes a first sub-weight and a second sub-weight; The determining of the target skin color type corresponding to the skin color of the face includes: determining a first skin color type corresponding to the first face; determining a second skin color type corresponding to the second face, and determining the target skin color type according to the first skin color type and the second skin color type; The determining, according to the preset corresponding relationship, the second target brightness information corresponding to the target skin color type includes: determining the first sub-target brightness information of the first face area according to the first skin color type; determining the second sub-target brightness information of the second face area according to the second skin color type; Determining the first target brightness information based on the first weight and the second target brightness information includes: determining the first target brightness information based on the first sub-weight and the first sub-target brightness information of the first face, and the second sub-weight and the second sub-target brightness information of the second face.
7. The method according to claim 1, characterized in that The determining of the target skin color type corresponding to the skin color of the face includes: Identify skin color areas and non-skin color areas in the area of the human face, the non-skin color areas including one or more of accessories, eyes, mouth, teeth, and teeth; Determine a target skin color type corresponding to the skin color area.
8. The method according to claim 1, characterized in that In a case where the second preview image is generated by a second original format image, displaying the second preview image according to the first current brightness information and the first target brightness information includes: When a difference between the first current brightness information and the first target brightness information is greater than a threshold, determining the second exposure parameter according to the first exposure parameter, the first current brightness information and the first target brightness information; The camera acquires the second original format image based on the second exposure parameter; generating the second preview image according to the second original format image; The first preview image is updated to the second preview image.
9. The method according to any one of claims 1 to 8, characterized in that The determining, according to a first weight of the region of the human face in the first raw format image, first current brightness information of the first raw format image includes: Obtaining the first weight; Acquire a second weight of a background area in the first original format image, where the background area is an area in the first original format image excluding an area of the human face; Acquire second current brightness information of the face area and third current brightness information of the background area; The first current brightness information is determined according to the second current brightness information, the first weight, the third current brightness information and the second weight.
10. An electronic device comprising a camera, a memory, and one or more processors, characterized in that: The memory is used to store a computer program; the processor is used to call the computer program so that the electronic device executes the method according to any one of claims 1 to 9.
11. A computer storage medium, characterized in that: include: Computer instructions; when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Automatic face exposure method and device, shooting equipment and storage medium
CN110691199A
Exposure parameter determination method and device, unmanned aerial vehicle and computer readable storage medium
CN111654643A
Face image exposure method and device, electronic equipment and storage medium
CN113379650A
Skin detection image acquisition method and device, equipment and storage medium
CN113411507A