Automatic exposure control method, device and storage medium
By using facial recognition algorithms to determine the region of interest and adjust exposure parameters, the problem of inaccurate skin tone output in group photos of multiple skin tones is solved, achieving stable image brightness and realistic skin tone representation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-12-04
- Publication Date
- 2026-06-05
AI Technical Summary
In group photos of people with different skin tones, smart electronic devices cannot accurately output the true skin tones of each face in the current photo scene.
The number, size, and skin color information of face bounding boxes are obtained through face recognition algorithms to determine the region of interest, and exposure parameters are adjusted accordingly to generate an image, ensuring image brightness stability.
It improves the brightness stability of images in multi-skin tone group photos, ensuring that the skin tone output is close to the real color.
Smart Images

Figure CN122160632A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal equipment, and more particularly to an automatic exposure control method, device and storage medium. Background Technology
[0002] Taking photos and videos generally refers to the process of exposing a photosensitive medium to light reflected from an object. With the widespread use of smart electronic devices, it has become increasingly popular to use them to capture everyday moments in life.
[0003] However, in some photography scenarios, when users take photos of multiple people with different skin tones using smart electronic devices, the smart electronic devices cannot accurately output skin tones that match the current photography scene. Summary of the Invention
[0004] This application provides an automatic exposure control method, device, and storage medium, which aims to accurately output the true skin tone of each face in the current shooting scene in multi-skin color face photography scenarios.
[0005] In a first aspect, embodiments of this application provide an automatic exposure control method applied to an electronic device equipped with a camera. The method includes: in response to a first user operation, acquiring a first original image, the first operation instructing the electronic device to activate the camera to capture and generate the first original image, the first original image containing multiple faces of different skin tones; performing face recognition on the first original image to obtain multiple face information, the multiple face information including the number of face frames, the size of each face frame, and the skin tone information of each face frame; determining a region of interest (ROI) of the first original image based on the number of face frames, the size of each face frame, and the skin tone information of each face frame; updating exposure parameters based on the ROI, and generating a first image based on the exposure parameters, the exposure parameters being used to instruct the camera to perform exposure.
[0006] For example, the first operation described above could be the user opening the camera function of an electronic device and activating the camera. An illustration of this can be found in [link to example]. Figure 1 The user interface shown in (2) is shown in the middle.
[0007] Understandably, after the user turns on the camera, the camera estimates an initial exposure parameter based on the brightness of the current scene, and captures the first frame image based on the exposure parameter, which is the first original image mentioned above.
[0008] Optionally, the aforementioned multiple faces with different skin tones can include white faces, yellow faces, brown faces, and / or black faces. Specifically, white and yellow faces can be set as light-skinned faces, while brown and black faces can be set as dark-skinned faces.
[0009] For example, the face recognition of the first original image described above can be based on a preset face recognition algorithm, which includes, but is not limited to, facial landmark detection algorithms, multi-task convolutional neural networks, and centerface algorithms. After performing face recognition on the first original image using this preset face recognition algorithm, the information of each face can be obtained.
[0010] Optionally, if no facial information is obtained after performing facial recognition on the first original image using a preset facial recognition algorithm, the current round of automatic exposure control is terminated directly, and then the next round of automatic exposure control begins.
[0011] For example, the aforementioned region of interest is used by the statistical module (Stat3A) in the image signal processor to obtain statistical information for the image frame. The automatic exposure control algorithm then generates a target brightness based on the statistical information, calculates the next exposure parameter based on the target brightness, and sends the next exposure parameter to the image sensor, so that the image sensor can acquire an image based on the exposure parameter and output a first image.
[0012] Therefore, this embodiment of the application achieves isolation of exposure parameters by combining the number and size of face bounding boxes in the image. In scenarios where faces of different skin tones are photographed together, by adjusting the region of interest of the automatic exposure control algorithm, the brightness of the output image is made more in line with the needs of the current group photo scenario, thus improving the stability of image brightness.
[0013] According to the first aspect, the skin color type of the face includes dark skin color and light skin color; the plurality of face information further includes a first face frame, a second face frame and a third face frame, wherein the first face frame is used to indicate the largest face frame among the plurality of face information, the second face frame is used to indicate the largest dark skin face frame among the plurality of face information, and the third face frame is used to indicate the largest light skin face frame among the plurality of face information.
[0014] For example, the skin color type of the aforementioned face may specifically include a white skin face, a yellow skin face, a brown skin face, and / or a black skin face. Among them, white skin faces and yellow skin faces can be set as light skin faces, and brown skin faces and black skin faces can be set as dark skin faces.
[0015] According to the first aspect, or any implementation of the first aspect above, determining the region of interest of the first original image based on the number of face frames, the size of each face frame, and the skin color information of each face frame includes: when the number of face frames is less than a first preset number threshold, calculating a first ratio between the second face frame and the first face frame; when the first ratio is greater than a first preset ratio threshold, setting the region corresponding to the second face frame as the region of interest of the first original image.
[0016] For example, the first ratio mentioned above = second face frame / first face frame.
[0017] For example, the first preset ratio threshold mentioned above is also the first preset ratio threshold and the second threshold in the following embodiments, which can usually be set to 40%.
[0018] For example, the exposure parameters generated based on the region of interest corresponding to the second face bounding box, and the illustration of outputting an image based on these exposure parameters, can be found in [reference needed]. Figure 6 Interface 30a is shown in the figure.
[0019] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the first ratio is less than a second preset ratio threshold, setting the region corresponding to the first face frame as the region of interest of the first original image.
[0020] For example, the second preset ratio threshold mentioned above is also the second preset ratio threshold and the first threshold in the following embodiments, and can usually be set to 20%.
[0021] For example, the exposure parameters generated based on the region of interest corresponding to the first face bounding box, and the illustration of outputting an image based on these exposure parameters, can be found in [reference needed]. Figure 7 Interface 30b is shown in the figure.
[0022] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the first ratio is greater than or equal to the second preset ratio threshold and less than or equal to the first preset ratio threshold, obtaining the region of interest of the previous frame of the first original image and setting it as the region of interest of the first original image.
[0023] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the first original image is a first frame image, setting the region corresponding to the first face frame as the region of interest of the first original image.
[0024] For example, the exposure parameters generated based on the region of interest of the first frame image, and the illustration of outputting an image based on these exposure parameters, can be found in [reference needed]. Figure 8 Interface 30c is shown in the figure.
[0025] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the number of face frames is greater than or equal to the first preset number threshold, calculating a second ratio between the third face frame and the first face frame; when the second ratio is greater than the first preset ratio threshold, setting the region corresponding to the third face frame as the region of interest of the first original image.
[0026] For example, the exposure parameters generated based on the region of interest corresponding to the aforementioned third face bounding box, and the illustration of outputting an image based on these exposure parameters, can be found in [reference needed]. Figure 9 The interface shown is 30d.
[0027] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the second ratio is less than the second preset ratio threshold, setting the region corresponding to the first face frame as the region of interest of the first original image.
[0028] For example, the exposure parameters generated based on the region of interest corresponding to the first face bounding box, and the illustration of outputting an image based on these exposure parameters, can be found in [reference needed]. Figure 10 Interface 30e is shown in the image.
[0029] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the second ratio is greater than or equal to the second preset ratio threshold and less than or equal to the first preset ratio threshold, obtaining the region of interest of the previous frame of the first original image and setting it as the region of interest of the first original image.
[0030] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the first original image is a first frame image, setting the region corresponding to the first face frame as the region of interest of the first original image.
[0031] For example, the exposure parameters generated based on the region of interest of the first frame image, and the illustration of outputting an image based on these exposure parameters, can be found in [reference needed]. Figure 11 The interface shown is 30f.
[0032] Secondly, embodiments of this application provide an electronic device. The electronic device includes: a memory and a processor, the memory and the processor being coupled; the memory stores program instructions, which, when executed by the processor, cause the electronic device to perform the methods of the first aspect or any possible implementation thereof.
[0033] Thirdly, embodiments of this application provide a computer-readable medium for storing a computer program, the computer program including instructions for performing the method in the first aspect or any possible implementation of the first aspect.
[0034] Fourthly, embodiments of this application provide a computer program including instructions for performing the method in the first aspect or any possible implementation thereof.
[0035] Fifthly, embodiments of this application provide a chip including a processing circuit and transceiver pins. The transceiver pins and the processing circuit communicate with each other via an internal connection path. The processing circuit executes the method in the first aspect or any possible implementation of the first aspect to control the receiving pin to receive signals and to control the transmitting pin to transmit signals. Attached Figure Description
[0036] Figure 1 This is an example illustration of the user interface for accessing the camera.
[0037] Figure 2 This is an illustrative diagram of a camera preview interface;
[0038] Figure 3 This is a schematic diagram illustrating the automatic exposure control algorithm processing flow as an example.
[0039] Figure 4 This is an illustrative diagram of a face bounding box recognition scenario;
[0040] Figure 5 This is a schematic flowchart illustrating an automatic exposure control method as an example.
[0041] Figure 6 This is an illustrative diagram of a group photo scene;
[0042] Figure 7 This is an illustrative diagram illustrating yet another group photo scenario.
[0043] Figure 8 This is an illustrative diagram illustrating yet another group photo scenario.
[0044] Figure 9 This is an illustrative diagram illustrating yet another group photo scenario.
[0045] Figure 10 This is an illustrative diagram illustrating yet another group photo scenario.
[0046] Figure 11 This is an illustrative diagram illustrating yet another group photo scenario.
[0047] Figure 12 This is a schematic diagram illustrating another automatic exposure control method as an example.
[0048] Figure 13 A schematic diagram of the hardware structure of an electronic device as an example;
[0049] Figure 14 This is a schematic diagram of the software structure of an electronic device as an example. Detailed Implementation
[0050] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0051] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0052] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects. For example, "first target object" and "second target object," etc., are used to distinguish different target objects, not to describe a specific order of target objects.
[0053] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0054] In the description of the embodiments in this application, unless otherwise stated, "multiple" means two or more. For example, multiple processing units means two or more processing units; multiple systems means two or more systems.
[0055] To facilitate understanding, the relevant terms involved in the embodiments of this application will be introduced below.
[0056] camera
[0057] Typically, a camera consists of a lens, an image sensor, a digital signal processing chip (DSP), and software algorithms.
[0058] The system consists of a lens that collects and adjusts light to create a clear image on the image sensor; an image sensor that converts light into electrical signals, which are then processed to generate a digital image; a digital signal processing chip that processes the digital image, including noise reduction, sharpening, and color correction; and software algorithms that determine exposure control. Specifically, software algorithms include, but are not limited to, automatic exposure control algorithms.
[0059] Automatic exposure control algorithm
[0060] Automatic exposure control algorithms are used to automatically adjust camera exposure parameters, primarily to achieve optimal exposure results under different lighting conditions. Typically, automatic exposure algorithms achieve this by adjusting parameters such as the camera's aperture, shutter speed, and ISO.
[0061] Typically, automatic exposure control calculations use the camera's built-in light-sensitive elements and image sensor to evaluate the brightness of the scene, and then adjust the exposure parameters based on this brightness information to achieve automatic exposure control.
[0062] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment, and is not intended as the only limitation on this embodiment.
[0063] Taking photos and videos generally refers to the process of exposing a photosensitive medium to light reflected from an object. With the widespread use of smart electronic devices, it has become increasingly popular to use them to capture everyday moments. For example, users may use smart electronic devices to photograph and record memorable scenes around them.
[0064] However, in some photography scenarios, when users take photos of multiple people with different skin tones using smart electronic devices, the smart electronic devices cannot accurately output skin tones that match the current photography scene.
[0065] For example, see Figure 1 , Figure 1 This illustrates a scenario where a user uses a smart electronic device to take photos of faces with different skin tones. Among them, Figure 1(1) shows the subjects of the photograph as face 10a-1 and face 10a-2. Specifically, the actual skin color of face 10a-1 is a light-skinned face (white or yellow), and the actual skin color of face 10a-2 is a dark-skinned face (black).
[0066] Optionally, face 10a-1 and face 10a-2 may have the same skin color, but face 10a-2 may appear significantly darker than face 10a-1 due to various external factors, including but not limited to sun exposure and makeup.
[0067] Figure 1 Figure (2) shows the user's access interface 10a for the camera of the electronic device. The interface 10a displays icons for multiple applications, such as: camera 10a-3, contacts, phone, messages, clock, calendar, gallery, memo, file manager, email, music, calculator, video, recorder, weather, browser, settings, etc.
[0068] It should be noted that in some implementation methods, Figure 1 The interface 10a shown in (2) can be called the main interface. When the user clicks on icon 10a-3 in this interface 10a, they can use the camera's functions such as taking pictures and recording videos.
[0069] See also Figure 1 In example (2), when a user clicks the camera application icon 10a-3, the electronic device responds to the user's action by recognizing the kernel layer call corresponding to the user's click operation to start the camera driver and acquire an image stream (which can be called a preview stream) through the camera driver. At this time, the phone displays the corresponding interface of the camera application, for example... Figure 2 Interface 10b shown in (1) or Figure 2 Interface 10c is shown in (2).
[0070] For example, see Figure 2 Middle (1), Figure 2 Figure (1) shows a camera interface 10b of an electronic device. In this interface 10b, the interface is divided into a top toolbar, an image preview area, and a bottom operation bar. The icon preview area displays the preview stream image captured by the current camera, and the bottom operation bar area includes multiple shooting modes, a gallery shortcut button, a photo button, and a camera flip button; the above shooting modes include aperture, night scene, portrait, photo, video, and smile.
[0071] See also Figure 2 In interface 10b, the preview stream image displayed in the image preview area is the image of the camera pointing at the camera. Figure 1 Image (1) shows faces of different skin tones. Among them, Figure 1 The face 10a-1 in (1) corresponds to Figure 2 The face in (1) is 10b-1. Figure 1 The face 10a-2 in (1) corresponds to Figure 2 Face 10b-2 in (1).
[0072] It should be noted that, Figure 2 In the face image output from the image preview area in (1), face 10b-2 and... Figure 1 The faces in (1) are similar in color to 10a-2, and the overall image is darker.
[0073] Optionally, in the above Figure 2 In the case of the overall dark color of the image (1), the face 10b-1 will also appear darker than the face 10a-1, resulting in a deviation between the skin color of the face 10b-1 and the real face.
[0074] For example, see Figure 2 (2) Figure 2 Figure (2) shows the camera interface 10c of another electronic device. In this interface 10c, the interface is divided into a top toolbar, an image preview area and a bottom operation bar.
[0075] See also Figure 2 In section (2), in this interface 10c, the preview stream image displayed in the image preview area is the image of the camera pointing at the camera. Figure 1 Image (1) shows faces of different skin tones. Among them, Figure 1 The face 10a-1 in (1) corresponds to Figure 2 The face of the person in the middle (2) 10c-1, Figure 1 The face 10a-2 in (1) corresponds to Figure 2 The face of the person in (2) 10c-2.
[0076] It should be noted that, Figure 2 In the face image output from the image preview area in (2), face 10b-1 and... Figure 1 The faces in (1) are similar in color to 10a-1, and the overall image is lighter in color.
[0077] Optionally, in the above Figure 2 In the case of the overall light color of the image (2), the color of face 10c-2 will be brighter than that of face 10a-2, resulting in a deviation between the skin color of face 10c-2 and the real face.
[0078] Therefore, when a user takes a photo of a face with multiple skin tones using an electronic device, due to factors such as camera exposure, the skin tone information of the face in the image output by the electronic device may not be able to match the skin tone of the face in the current scene.
[0079] The camera's exposure is controlled by the AE algorithm. For example, see... Figure 3 , Figure 3 The working principle of the AE algorithm is illustrated. Figure 3 In this process, the sensor (i.e., the image sensor mentioned above) first acquires the ambient light intensity and estimates an initial exposure parameter based on the light intensity. Based on this initial exposure parameter, an image frame is generated. The statistics module (Stat3A) in the image signal processor collects statistical information from this image frame, including but not limited to the average brightness, brightness histogram, and brightness region statistics. The statistics module sends this statistical information to the AE algorithm module. The AE algorithm module calculates the target brightness (targetLuma) of the current scene based on the statistical information and adjusts the exposure parameter based on this target brightness until an image matching the target brightness is output.
[0080] See also Figure 3 It is known that since the sensor sends image frames of the current scene to the statistics module for brightness statistics, in single-person portrait scenes, the statistics module can generate different target brightness based on different skin tones, ensuring that all skin tones receive appropriate exposure brightness. However, in group photos with different skin tones, the AE algorithm cannot generate appropriate target brightness based on the statistical information output by the statistics module, resulting in unstable facial effects in such group photos. In other words, for... Figure 1 The different skin tones of the faces shown in (1) may appear... Figure 2 The two images (1) and (2) may even cause the camera's image preview area to switch back and forth between the two images.
[0081] In view of this, the present application provides an exposure control method that, when taking photos of faces with different skin tones, identifies the skin tone of the face that matches the current scene based on the size of the face frame in the image. This allows the AE algorithm to output a target brightness that matches the current scene while taking into account the effects of faces with different skin tones, thereby improving the stability of image brightness.
[0082] Using the same example of a group photo of people with different skin tones, we will perform facial recognition and analysis within the scene. For example, see [link to example]. Figure 4 , Figure 4 The diagram illustrates an interface 20a for an electronic device to detect faces in the aforementioned group photo scenario. In this interface 20a, the electronic device uses a face recognition model to obtain information about each face in the group photo scenario, resulting in face bounding boxes 20a-1 and 20a-2.
[0083] For example, the above-mentioned face recognition model includes, but is not limited to, facial landmark detection algorithms, multi-task convolutional neural networks, centerface algorithms, etc. The above-mentioned face recognition model determines the facial landmarks in the acquired image frame, determines the coordinate positions of each landmark, and outputs the face image information in that image frame.
[0084] Optionally, the step of outputting facial image information by the coordinates of key points can be achieved by defining a rectangle centered on one of the facial key points, such that the rectangle encompasses the other key points. The image captured by this rectangle is the facial image, and this rectangle is also the aforementioned face bounding box 20a-1 or face bounding box 20a-2. Simultaneously, by analyzing the facial image, the skin color information corresponding to the facial image can be obtained.
[0085] In other words, the aforementioned facial image information includes, but is not limited to, the size of the face frame and skin color information.
[0086] Then, by comparing the size of the face bounding boxes, the main element (i.e., the region of interest (ROI)) in the group photo scene can be determined. This allows the automatic exposure algorithm to generate the target brightness of the image based on the skin color information of the main element, and control the exposure according to the target brightness to output the image.
[0087] It's important to note that different skin tones correspond to different target brightness (Y-values). Darker skin tones, under proper exposure, exhibit a smaller Y-value, while lighter skin tones, under proper exposure, exhibit a larger Y-value. Therefore, the target brightness can be set based on the skin tone information of the subject, thus isolating the exposure parameters for different skin tones and ensuring that the camera outputs an image with appropriate brightness for different skin tones.
[0088] For example, the order of skin color (Y value) is: white skin color (Y value) > yellow skin color (Y value) > brown skin color (Y value) > black skin color (Y value). The After Effects (AE) algorithm calculates the target brightness by assessing the skin color of the subject element. Taking RAW8 image data as an example, the calculated target Y value for white skin might be 50, for yellow skin it might be 45, for brown skin it might be 40, and for black skin it might be 35.
[0089] Optionally, white and yellow skin tones can be set as light-skinned faces; brown and black skin tones can be set as dark-skinned faces.
[0090] For example, when face frame 20a-1 is greater than or equal to face frame 20a-2, face 10a-1 corresponding to face frame 20a-1 can be set as the main element in the group photo scene described above, and face 10a-2 corresponding to face frame 20a-2 becomes the secondary element, so that the camera's image preview interface outputs as shown in the image. Figure 2 The interface 10c shown in (2) is as follows. When the face frame 20a-1 is smaller than the face frame 20a-2, the face 10a-2 corresponding to the face frame 20a-2 can be set as the main element of the group photo, so that the camera's image preview interface outputs as shown in the figure. Figure 2 Interface 10b is shown in (1).
[0091] Therefore, the main elements in a group photo scene can be determined by the size of the face frame, and the exposure parameters can be set according to the skin color information of the main elements. In group photo scenes with different skin colors, the overall brightness of the image is not affected by the inconsistent target brightness calculated multiple times by the AE algorithm, which leads to fluctuations and improves the user experience.
[0092] However, while this application's implementation uses the size of the face frame to determine the main elements in a group photo, improving the stability of the overall image brightness, in some scenarios, the size of the face frame still cannot determine the main elements in the group photo scene. For example, when the number of faces in a group photo scene exceeds a certain preset value, all the face frames tend to be the same size, the face weight becomes smaller, and in this scenario, it is impossible to determine the main subject using the face frame.
[0093] Therefore, in some implementations, this application also provides an automatic exposure control method, which, when taking photos of faces with different skin tones, identifies the skin tone of the face that matches the current scene by combining the size and number of face frames, and generates exposure parameters based on the skin tone, thereby improving the stability of image brightness.
[0094] For example, in this embodiment of the application, a preset number threshold is set and used as the basis for judging the number of faces in the current image. When the number of faces in the image is greater than or equal to the preset number threshold, the face bounding box is generally smaller, and the face weight becomes smaller. Therefore, when the size of a light-skinned face meets certain conditions, it can be set as the main element, thereby improving the overall brightness of the image. When the number of faces in the image is less than the preset threshold, the face bounding box is generally larger, and the face weight becomes larger. Therefore, when the size of a dark-skinned face meets certain conditions, it can be set as the main element, making the camera output an image that is closer to the real scene.
[0095] Optionally, the preset threshold for the number of face frames can be set based on a comprehensive consideration of information such as historical products, public opinion feedback, and user voices. Typically, it can be set to 4 or 5.
[0096] In some implementations, see Figure 5 The automatic exposure control method provided in this application includes the following steps:
[0097] Step S101: In response to the user's first operation, acquire a first original image. The first operation is used to instruct the electronic device to turn on the camera and acquire the first original image. The first original image contains multiple faces with different skin tones.
[0098] For example, the first operation described above could be the user opening the camera function of an electronic device and activating the camera. An illustration of this can be found in [link to example]. Figure 1 The user interface shown in (2) is shown in the middle.
[0099] Understandably, after the user turns on the camera, the camera estimates an initial exposure parameter based on the brightness of the current scene, and captures the first frame image based on the exposure parameter, which is the first original image mentioned above.
[0100] Optionally, the first frame image can be an image containing multiple faces of different skin tones. After acquiring the first frame image, the electronic device can continue to process it to output a first frame preview image.
[0101] Optionally, after acquiring the first frame preview image, the electronic device can also use it to regenerate the exposure parameters. After completing the exposure parameter update, the first frame preview image is not output using this image, thereby avoiding a large difference in brightness between the first frame preview image and subsequent images, which would reduce the user experience.
[0102] Optionally, the aforementioned multiple faces with different skin tones can include white faces, yellow faces, brown faces, and / or black faces. Specifically, white and yellow faces can be set as light-skinned faces, while brown and black faces can be set as dark-skinned faces.
[0103] Step S102: Perform face recognition on the first original image based on a preset face recognition algorithm to obtain face information. The face information includes the number of face frames, the size of each face frame, the size of the largest face frame, the skin color information of each face frame, and the size of the largest face frame for dark skin and the size of the largest face frame for light skin.
[0104] Understandably, the aforementioned preset face recognition algorithm includes, but is not limited to, facial landmark detection algorithms, multi-task convolutional neural networks, and centerface algorithms. After performing face recognition on the first original image using this preset face recognition algorithm, information about each face can be obtained.
[0105] Optionally, if no facial information is obtained after performing facial recognition on the first original image using a preset facial recognition algorithm, the current round of automatic exposure control is terminated directly, and then the next round of automatic exposure control begins.
[0106] Optionally, the automatic exposure control algorithm provided in this application embodiment can be set separately in the camera's "portrait" mode, or it can be set in all photo / video modes of the camera. This application embodiment does not limit this.
[0107] Optionally, after detecting facial information using a preset facial recognition algorithm, the facial information is collected.
[0108] For example, the facial information includes, but is not limited to, the number of all face frames on the image, the size of each face frame, and the skin color information corresponding to each face frame.
[0109] Optionally, after obtaining the size of each person's face frame, the size of each person's face frame can be compared, and the largest face frame among all face frames, the largest face frame among dark skin tones, and the largest face frame among light skin tones can be calculated.
[0110] Furthermore, it is possible to calculate the largest face bounding box for each skin color, such as the largest face bounding box for white skin, yellow skin, brown skin, and black skin.
[0111] Optionally, when collecting facial information, a unique number can be assigned to each face, and the facial information (including but not limited to the size of the face frame and skin color information) can be bound to this unique number to establish a correspondence between the face frame and skin color.
[0112] Step S103: Based on the number of face frames, the size of each face frame, and the skin color information of each face frame, determine the region of interest of the first original image.
[0113] Step S104: Regenerate exposure parameters based on the region of interest, the exposure parameters being used to instruct the electronic device to generate a first image based on the exposure parameters.
[0114] Specifically, after obtaining the aforementioned region of interest, this embodiment of the application sends it to, for example... Figure 3 The statistical module shown in the figure calculates the target brightness based on the region of interest, calculates the next exposure parameter based on the target brightness, and sends the next exposure parameter to the image sensor, so that the image sensor can acquire an image based on the exposure parameter and output a first image.
[0115] Optionally, the first image can be a preview image or the final image entered into the gallery.
[0116] In one implementation, when the number of face bounding boxes is less than the preset threshold, a first ratio is calculated between the largest dark-skinned face bounding box and the largest face bounding box among all face bounding boxes, i.e., dark-skinned face bounding box / largest face bounding box among all face bounding boxes. If this first ratio is greater than a first preset ratio threshold (typically set to 40%), the largest dark-skinned face bounding box is set as the region of interest in the first original image.
[0117] For example, see Figure 6 , Figure 6 An exemplary user interface 30a for group photos is shown. In interface 30a, the number of faces is 3, which is less than the aforementioned preset threshold of 4. The largest face in interface 30a is face 30a-1, and the largest dark face is face 30a-2. Obviously, the ratio of face 30a-2 to face 30a-1 is greater than 40%, therefore the region of interest is the portion of face 30a-2. The exposure parameters are generated based on face 30a-2, so the overall image brightness is darker, and the skin tone of face 30a-2 in the output image is close to the real skin tone.
[0118] Optionally, the final output brightness of a light-skinned face in the image (such as face 30a-1) will be darker than the actual brightness.
[0119] In one implementation, if the first ratio is less than a first preset ratio threshold (which can usually be set to 20%), the largest face bounding box in all face bounding boxes is set as the region of interest of the first original image.
[0120] For example, see Figure 7 , Figure 7 An example user interface 30b for group photos is shown. In interface 30b, the number of faces is 3, which is less than the aforementioned preset threshold of 4. The largest face in interface 30b is face 30b-1, and the largest dark face is face 30b-2. Obviously, the ratio of face 30b-2 to face 30b-1 is less than 20%, so the largest face 30b-1 is set as the region of interest. Exposure parameters are generated based on face 30b-1, so the overall image brightness is brighter, and the skin tone of face 30b-1 in the output image is close to the real skin tone.
[0121] Optionally, the final output brightness of dark-skinned faces in the image (such as face 30b-2) will also be brighter than the actual brightness.
[0122] In one implementation, when the first ratio is greater than or equal to a second preset ratio threshold and less than or equal to a first preset ratio threshold, the region of interest of the previous frame's original image is set as the region of interest of the first original image.
[0123] In one implementation, when the first original image is the first frame of the current photo / video capture, the largest face frame among all face frames is set as the region of interest of the first original image.
[0124] For example, see Figure 8 , Figure 8 A user interface 30c for group photos is shown. In interface 30c, the number of faces is 3, which is less than the aforementioned preset threshold of 4. The largest face in interface 30c is face 30c-1, the largest dark face is face 30c-2, and the ratio of face 30c-2 to face 30c-1 is between 20% and 40%. At this point, the first original image is the first frame image, so the largest face 30c-1 is set as the region of interest. Exposure parameters are generated based on face 30c-1, so the overall image brightness is brighter, and the skin tone of face 30c-1 in the output image is close to the real skin tone.
[0125] Optionally, the final output brightness of dark-skinned faces in the image (such as face 30c-2) will also be brighter than the actual brightness.
[0126] Therefore, in this embodiment of the application, by setting the region of interest of two adjacent frames to the same value when the first ratio is less than the second preset ratio threshold, the brightness of the two adjacent frames will not change abruptly, thus improving the stability of the image brightness.
[0127] In one implementation, if the number of face bounding boxes is less than the preset threshold, all light-skinned face bounding boxes can be removed from the first original image, thereby reducing the risk of erroneous calculations during the face bounding box ratio calculation process.
[0128] In one implementation, when the number of face bounding boxes is greater than or equal to the preset threshold, a second ratio is calculated between the largest light-skinned face bounding box and the largest face bounding box among all face bounding boxes, i.e., light-skinned face bounding box / largest face bounding box among all face bounding boxes. If this second ratio is greater than a first preset ratio threshold (typically set to 40%), the largest light-skinned face bounding box is set as the region of interest in the first original image.
[0129] For example, see Figure 9 , Figure 9 A user interface 30d for group photos is shown. In interface 30d, the number of faces is 5, which is greater than the preset threshold of 4. The largest face in interface 30d is face 30d-2, and the largest light-colored face is face 30d-1. Obviously, the ratio of face 30d-1 to face 30d-2 is greater than 40%, so the region of interest is the portion of face 30d-1. The exposure parameters are generated based on face 30d-1, so the overall image brightness is brighter, and the skin tone of face 30d-1 in the output image is close to the real skin tone.
[0130] Optionally, the final output brightness of dark-skinned faces in the image (such as Face 30d-2) will be brighter than the actual brightness.
[0131] In one implementation, if the second ratio is less than or equal to the first preset ratio threshold (which can usually be set to 20%), the largest face frame in all face frames is set as the region of interest of the first original image.
[0132] For example, see Figure 10 , Figure 10 A user interface 30e for group photos is shown. In this interface 30e, the number of faces is 5, which is greater than the aforementioned preset threshold of 4. The largest face in interface 30e is face 30e-2, and the largest light-colored face is face 30e-1. Obviously, the ratio of face 30e-1 to face 30e-2 is less than 20%, so the largest face 30e-2 is set as the region of interest. The exposure parameters are generated based on face 30e-2, so the overall image brightness is darker, and the skin tone of face 30e-2 in the output image is close to the real skin tone.
[0133] Optionally, the final output brightness of light-skinned faces in the image (such as face 30e-1) will be darker than the actual brightness.
[0134] In one implementation, when the second ratio is greater than or equal to a second preset ratio threshold and less than or equal to a first preset ratio threshold, the region of interest of the previous frame's original image is set as the region of interest of the first original image.
[0135] In one implementation, if the first original image is the first frame of the current photograph, the largest face frame among all face frames is set as the region of interest of the first original image.
[0136] For example, see Figure 11 , Figure 11 A user interface 30f for group photos is shown. In interface 30f, the number of faces is 5, which is greater than the aforementioned preset threshold of 4. The largest face in interface 30f is face 30f-2, the largest light-colored face is face 30f-1, and the ratio of face 30f-1 to face 30f-2 is between 20% and 40%. At this point, the first original image is the first frame image, so the largest face 30f-2 is set as the region of interest. Exposure parameters are generated based on face 30f-2, so the overall image brightness is darker, and the skin tone of face 30f-2 in the output image is close to the real skin tone.
[0137] Optionally, the final output brightness of light-skinned faces in the image (such as face 30f-1) will be darker than the actual brightness.
[0138] Therefore, in this embodiment of the application, by setting the region of interest of two adjacent frames to the same value when the ratio is less than the second preset ratio threshold, the brightness of the two adjacent frames will not change abruptly, thus improving the stability of the image brightness.
[0139] In one implementation, if the number of face bounding boxes is less than the preset threshold, all dark-skinned face bounding boxes can be removed from the first original image, thereby reducing the risk of erroneous calculations during the face bounding box ratio calculation process.
[0140] Therefore, this embodiment of the application achieves isolation of exposure parameters by combining the number and size of face bounding boxes in the image. In scenarios where faces of different skin tones are photographed together, the region of interest of the AE algorithm is adjusted to make the brightness of the output image more suitable for the needs of the current group photo scenario, thereby improving the stability of image brightness.
[0141] In some implementations, see Figure 12 The automatic exposure control method provided in this application embodiment further includes the following steps:
[0142] Step S201: Obtain the current frame image and perform recognition on the current frame image.
[0143] Understandably, the aforementioned recognition of the current frame image can be based on a preset face recognition algorithm, which includes, but is not limited to, facial landmark detection algorithms, multi-task convolutional neural networks, and centerface algorithms. After performing face recognition on the first original image using this preset face recognition algorithm, the information of each face can be obtained.
[0144] Step S202: Identify whether a face exists in the identification result.
[0145] Step S203: If a face exists, acquire the size and skin color information of each face in the image; if no face exists, exit the current exposure control.
[0146] Step S204: Calculate the maximum face bounding box.
[0147] Optionally, the aforementioned maximum face bounding box may include the largest face bounding box among all faces, the largest face bounding box among dark skin tones, and the largest face bounding box among light skin tones.
[0148] Step S205: Does the total number of faces exceed the preset face threshold?
[0149] Understandably, the aforementioned preset face threshold can be the aforementioned preset quantity threshold, which can be set based on a comprehensive consideration of information such as historical products, public opinion feedback, and user source voices. Under normal circumstances, it can be set to 4 or 5.
[0150] Step S206: If the total number of faces is less than the preset face threshold, calculate the ratio of the largest dark skin face bounding box to the largest face bounding box to obtain the first ratio.
[0151] That is, calculate the value of the maximum dark skin face bounding box / the maximum face bounding box, and set the resulting value as the first ratio.
[0152] Step S207: Determine whether the first ratio is less than the first threshold.
[0153] Understandably, the first threshold can be set according to actual needs, and the first threshold can be the second preset ratio threshold, which can usually be set to 20%.
[0154] Step S208: If the first ratio is less than the first threshold, then the maximum face bounding box is set as the region of interest of the current frame image.
[0155] Step S209: If the first ratio is greater than or equal to the first threshold, then determine whether the first ratio is less than or equal to the second threshold.
[0156] Understandably, the second threshold can be set according to actual needs, and the second threshold can be the first preset ratio threshold, which can usually be set to 40%.
[0157] Step S210: If the first ratio is less than or equal to the second threshold, then determine whether the current frame image is the first frame image.
[0158] Step S211: If the current frame image is not the first frame image, set the region of interest of the previous frame image as the region of interest; if the current frame image is the first frame image, set the maximum face bounding box as the region of interest of the current frame image.
[0159] Step S212: If the first ratio is not less than or equal to the second threshold, then check whether the first ratio is greater than the second threshold.
[0160] Step S213: Set the maximum dark skin face bounding box as the region of interest of the current frame image.
[0161] Step S214: If the total number of faces is greater than or equal to the preset face threshold, calculate the ratio of the largest light-skinned face bounding box to the largest face bounding box to obtain the second ratio.
[0162] That is, calculate the value of the maximum light-skinned face bounding box / the maximum face bounding box, and set the resulting value as the second ratio.
[0163] Step S215: Determine whether the second ratio is less than the first threshold.
[0164] Step S208': If the second ratio is less than the first threshold, then the maximum face bounding box is set as the region of interest of the current frame image.
[0165] Step S216: If the second ratio is not less than the first threshold, determine whether the second ratio is less than or equal to the second threshold.
[0166] Step S210': If the second ratio is less than or equal to the second threshold, then determine whether the current frame image is the first frame image.
[0167] In step S211', if the current frame image is not the first frame image, the region of interest of the previous frame image is set as the region of interest; if the current frame image is the first frame image, the maximum face bounding box is set as the region of interest of the current frame image.
[0168] Step S217: If the second ratio is not less than or equal to the second threshold, determine whether the second ratio is greater than the second threshold.
[0169] Step S218: Set the largest light-skinned face bounding box as the region of interest of the current frame image.
[0170] Therefore, this embodiment of the application achieves isolation of exposure parameters by combining the number and size of face bounding boxes in the image. In scenarios where faces of different skin tones are photographed together, the region of interest of the AE algorithm is adjusted to make the brightness of the output image more suitable for the needs of the current group photo scenario, thereby improving the stability of image brightness.
[0171] To better understand the technical solutions provided in the embodiments of this application, the hardware structure of the terminal devices (e.g., mobile phones, tablets, touch-screen PCs, etc.) to which the embodiments of this application are applicable will be described here with reference to the accompanying drawings. For ease of explanation, Figure 13 Let's take a mobile phone as an example.
[0172] See Figure 13 The mobile phone 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, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, 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.
[0173] The processor 110 may include one or more processing units, such as an application processor (AP), a modem, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU), etc., which will not be listed here and this application does not limit them.
[0174] The controller mentioned above, which serves as the processing unit, can be the central nervous system and command center of the mobile phone 100. In practical applications, the controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.
[0175] The aforementioned application processor is used to output sound signals through audio devices (not limited to speaker 170A, receiver 170B, etc.) or to display images or videos through display screen 194.
[0176] The digital signal processor mentioned above is used to process digital signals. Specifically, in addition to processing digital image signals, digital signal processors can also process other digital signals.
[0177] The aforementioned video codecs are used for compressing or decompressing digital video. For example, mobile phone 100 may support one or more video codecs. Thus, mobile phone 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.
[0178] The aforementioned ISP (Image Signal Processor) is used to output digital image signals to the DSP (Digital Signal Processor) for processing. Specifically, the ISP processes data fed back from the camera 193. For example, when taking a photo or recording video, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into a visible image. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some implementations, the ISP can be integrated into the camera 193.
[0179] The DSP mentioned above is used to convert digital image signals into standard RGB, YUV, and other image signal formats.
[0180] Furthermore, it should be noted that, regarding the processor 110 including the aforementioned processing units, in some implementations, the different processing units can be independent devices. That is, each processing unit can be considered as a processor. In other implementations, the different processing units can also be integrated into one or more processors. For example, in some implementations, the modem processor can be an independent device. In other implementations, the modem processor can be independent of the processor 110 and housed in the same device as the mobile communication module 150 or other functional modules.
[0181] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment, and is not intended as the only limitation on this embodiment.
[0182] In addition, the processor 110 may also 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., which will not be listed here, and this application does not impose any limitations on them.
[0183] In addition, processor 110 may also include memory for storing instructions and data. In some implementations, the memory in processor 110 is a cache memory. This memory can store instructions or data that processor 110 has just used or is recurring. If processor 110 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of processor 110, and thus improves system efficiency.
[0184] See also Figure 13The external storage interface 120 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external storage 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 storage card.
[0185] See also Figure 13 The internal memory 121 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running the instructions stored in the internal memory 121.
[0186] See also Figure 13 The charging management module 140 is used to receive charging input from the charger. The charger can be a wireless charger or a wired charger.
[0187] See also Figure 13 The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc.
[0188] See also Figure 13 The wireless communication function of mobile phone 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0189] See also Figure 13 The audio module 170 may include a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, etc. For example, the mobile phone 100 can implement audio functions through the application processor and the speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, etc. in the audio module 170. Examples include recording and video recording functions.
[0190] See also Figure 13 The sensor module 180 may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, bone conduction sensors, etc., which will not be listed here, and this application does not limit them.
[0191] See also Figure 13The buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. The mobile phone 100 can receive button input and generate button signal inputs related to the user settings and function control of the mobile phone 100.
[0192] See also Figure 13 Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback.
[0193] See also Figure 13 The indicator 192 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0194] See also Figure 13 The camera 193 is used to capture still images or videos. The mobile phone 100 can achieve shooting functions through an ISP, camera 193, video codec, GPU, display 194, and application processor. Specifically, an object generates an optical image through a lens and projects it onto a photosensitive element. The photosensitive element (i.e., the image sensor in this embodiment) can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some implementations, the mobile phone 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0195] See also Figure 13 The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some implementations, the mobile phone 100 may include one or N displays 194, where N is a positive integer greater than 1. The mobile phone 100 can implement display functions through a GPU, the display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0196] That concludes the introduction to the hardware structure of the Mobile 100. It should be understood that... Figure 13The mobile phone 100 shown is just an example. In a specific implementation, the mobile phone 100 may have more or fewer components than shown in the figure, may combine two or more components, or may have different component configurations. Figure 13 The various components shown can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0197] To better understand Figure 13 The software structure of the mobile phone 100 shown is described below. Before describing the software structure of the mobile phone 100, the possible architectures for the software system of the mobile phone 100 will be explained first.
[0198] Specifically, in practical applications, the software system of Mobile 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture.
[0199] Furthermore, it is understood that the software systems used by mainstream terminal devices currently include, but are not limited to, Windows, Android, and iOS systems. For ease of explanation, this application embodiment uses the layered architecture of the Android system as an example to exemplify the software structure of the terminal device 100.
[0200] Furthermore, the automatic exposure control scheme provided in the embodiments of this application is also applicable to other systems in specific implementations.
[0201] See Figure 14 This is a software structure block diagram of the mobile phone 100 according to an embodiment of this application.
[0202] like Figure 14 As shown, the layered architecture of the mobile phone 100 divides the software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some implementations, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0203] The application layer can include a series of application packages. For example... Figure 14 As shown, the application package may include applications such as app stores, video, shopping, permission management, Bluetooth, Wi-Fi, and settings, which will not be listed here, and this application does not impose any restrictions on them.
[0204] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications within the application layer. In some implementations, these APIs and frameworks can be described as functions. For example... Figure 14 As shown, the application framework layer may include functions such as camera service, view system, content provider, image recognition module, wake word / command word detection module, scene recognition module, voice data fusion module, voice activity detection module, voiceprint verification module, and wake word voiceprint template management module, etc., which will not be listed here, and this application does not impose any restrictions on them.
[0205] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment, and is not intended as the only limitation on this embodiment.
[0206] Furthermore, it is understood that the above division of functional modules is merely an example provided to better understand the technical solution of this embodiment, and is not intended to be the sole limitation of this embodiment. In practical applications, the above functions can also be integrated into a single functional module, and this embodiment does not impose any restrictions on this.
[0207] Furthermore, in practical applications, the aforementioned functional modules can also be represented as services or frameworks. For example, the image recognition module can be represented as an image recognition service or an image recognition framework. This embodiment does not impose any restrictions on this.
[0208] In addition, it should be noted that the window manager, located in the application framework layer, is used to manage window applications. The window manager can obtain the screen size, determine whether there is a status bar, lock the screen, and capture the screen, etc.
[0209] Furthermore, it should be noted that the content provider located in the application framework layer is used to store and retrieve data, and to make this data accessible to the application. The data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc., which will not be listed here, and this application does not impose any limitations on this.
[0210] Furthermore, it should be noted that the view system described above, located in the application framework layer, includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0211] Furthermore, it should be noted that the phone manager located in the application framework layer is used to provide communication functions for mobile phone 100, such as call status management (including call connection, call termination, etc.).
[0212] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, etc., which will not be listed here, and this application does not impose any restrictions on them.
[0213] In addition, it should be noted that the notification manager located in the application framework layer allows the application to display notification information in the status bar. It can be used to convey informational messages and can disappear automatically after a short time without user interaction.
[0214] The Android Runtime consists of core libraries and a virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system.
[0215] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0216] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0217] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0218] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0219] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0220] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0221] Understandably, the 2D graphics engine mentioned above is a 2D drawing engine.
[0222] Furthermore, it is understandable that the kernel layer in the Android system is the layer between hardware and software. The kernel layer includes at least display drivers, camera drivers, audio drivers, sensor drivers, etc. For example, a sensor driver can be used to output detection signals from sensors (such as touch sensors) to the view system, so that the view system responds to the detection signals and displays the corresponding application interface.
[0223] This concludes the introduction to the software architecture of terminal device 100. It is understandable that... Figure 14 The layers in the illustrated software structure and the components contained in each layer do not constitute a specific limitation on the mobile phone 100. In other embodiments of this application, the mobile phone 100 may include more or fewer layers than illustrated, and each layer may include more or fewer components; this application does not impose any limitations.
[0224] Furthermore, it is understood that, in order to achieve the aforementioned functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. Based on the algorithmic steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in a hardware-driven or software-driven manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.
[0225] Furthermore, it should be noted that, in practical application scenarios, the automatic exposure control methods provided in the above embodiments, implemented by electronic devices, can also be executed by a chip system included in the electronic device. This chip system may include a processor. The chip system can be coupled to a memory, enabling it to call computer programs stored in the memory during runtime to implement the steps executed by the electronic device. The processor in the chip system can be an application processor or a non-application processor.
[0226] In addition, this application embodiment also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the above-mentioned related method steps to implement the automatic exposure control method in the above embodiment.
[0227] In addition, this application also provides a computer program product that, when run on an electronic device, causes the electronic device to perform the above-mentioned related steps to realize the automatic exposure control method in the above embodiments.
[0228] In addition, embodiments of this application also provide a chip (which may also be a component or module), the chip may include one or more processing circuits and one or more transceiver pins; wherein, the transceiver pins and the processing circuits communicate with each other through internal connection paths, and the processing circuits execute the above-mentioned related method steps to implement the automatic exposure control method in the above embodiments, so as to control the receiving pin to receive signals and control the transmitting pin to transmit signals.
[0229] Furthermore, as can be seen from the above description, the electronic devices, computer-readable storage media, computer program products, or chips provided in the embodiments of this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0230] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. An automatic exposure control method, characterized in that, Applied to an electronic device equipped with a camera, the method includes: In response to a user’s first operation, a first raw image is acquired. The first operation is used to instruct the electronic device to turn on the camera to capture and generate the first raw image, which contains multiple faces with different skin tones. Face recognition is performed on the first original image to obtain multiple face information, including the number of face frames, the size of each face frame, and the skin color information of each face frame; Based on the number of face frames, the size of each face frame, and the skin color information of each face frame, the region of interest of the first original image is determined; The exposure parameters are updated based on the region of interest, and a first image is generated based on the exposure parameters, which are used to instruct the camera to perform exposure.
2. The method according to claim 1, characterized in that, The skin color type of the face includes dark skin and light skin; the multiple face information also includes a first face frame, a second face frame and a third face frame, wherein the first face frame is used to indicate the largest face frame among the multiple face information, the second face frame is used to indicate the largest dark skin face frame among the multiple face information, and the third face frame is used to indicate the largest light skin face frame among the multiple face information.
3. The method according to claim 2, characterized in that, The step of determining the region of interest (ROI) of the first original image based on the number of face bounding boxes, the size of each face bounding box, and the skin color information of each face bounding box includes: If the number of face frames is less than a first preset threshold, calculate a first ratio between the second face frame and the first face frame. If the first ratio is greater than the first preset ratio threshold, the region corresponding to the second face frame is set as the region of interest of the first original image.
4. The method according to claim 3, characterized in that, The method further includes: If the first ratio is less than the second preset ratio threshold, the region corresponding to the first face frame is set as the region of interest of the first original image.
5. The method according to claim 3, characterized in that, The method further includes: If the first ratio is greater than or equal to the second preset ratio threshold and less than or equal to the first preset ratio threshold, the region of interest of the previous frame of the first original image is obtained and set as the region of interest of the first original image.
6. The method according to claim 5, characterized in that, The method further includes: When the first original image is the first frame image, the region corresponding to the first face frame is set as the region of interest of the first original image.
7. The method according to claim 2, characterized in that, The method further includes: If the number of face frames is greater than or equal to the first preset number threshold, calculate the second ratio between the third face frame and the first face frame; If the second ratio is greater than the first preset ratio threshold, the region corresponding to the third face frame is set as the region of interest of the first original image.
8. The method according to claim 7, characterized in that, The method further includes: If the second ratio is less than the second preset ratio threshold, the region corresponding to the first face frame is set as the region of interest of the first original image.
9. The method according to claim 7, characterized in that, The method further includes: If the second ratio is greater than or equal to the second preset ratio threshold and less than or equal to the first preset ratio threshold, the region of interest of the previous frame of the first original image is obtained and set as the region of interest of the first original image.
10. The method according to claim 9, characterized in that, The method further includes: When the first original image is the first frame image, the region corresponding to the first face frame is set as the region of interest of the first original image.
11. An electronic device, characterized in that, The electronic device includes: a memory and a processor, the memory and the processor being coupled; the memory stores program instructions, which, when executed by the processor, cause the electronic device to perform the automatic exposure control method as described in any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that, The method includes a computer program that, when run on an electronic device, causes the electronic device to perform the automatic exposure control method as described in any one of claims 1 to 10.