Photographing method and device and electronic equipment
By automatically selecting the flash module in electronic devices and selecting suitable fill-light flashes according to different shooting scenes, the poor imaging effect caused by the fixed brightness and distance of the traditional flash is solved, and the filming rate is improved.
Patent Information
- Application Number
- CN202510329782.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-06-06
AI Technical Summary
The flash distance and brightness of traditional electronic devices are fixed during shooting, making it difficult to adapt to different shooting scenes, resulting in poor imaging effects and prone to problems of excessive or low brightness, reducing filming rate.
By automatically selecting the flash module in electronic devices, the appropriate fill light flashes are determined according to different shooting scenes, including flashes in the near-focus, far-focus and mid-focus range, ensuring the best fill light effect.
By automatically selecting a suitable flash, the imaging effect of shooting scenes such as stage, food, portraits, etc. can be effectively improved, avoiding the problem of inappropriate brightness and improving the filming rate.
Smart Images

Figure CN120111345A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of camera technology, and specifically relates to a camera method, device and electronic equipment. Background Art
[0002] With the development of electronic technology, the photography effects of electronic devices such as smartphones have been greatly improved. Electronic devices are gradually narrowing the gap with professional equipment in photography and becoming the main shooting tool for many people in their daily lives.
[0003] Electronic devices usually use built-in flashes for fill-in lighting when taking photos. However, the flash distance and brightness of traditional flashes are relatively fixed. When the subject is far away from the flash, the flash does not significantly improve the imaging effect, and the picture is likely to be too dark. When the subject is close to the flash, the image is likely to be overexposed, making the photo look unnatural, thereby reducing the success rate of the photo. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a photographing method, device and electronic device, which can automatically select different flash lights for shooting fill light according to different shooting scenes when shooting images, thereby helping to improve the imaging effects of shooting scenes such as stage, food, portraits, etc., avoid the situation of excessive or low brightness, and improve the success rate of filming.
[0005] In a first aspect, an embodiment of the present application provides a photographing method, comprising:
[0006] Determine the fill flash in the flash module that matches the shooting scene, and the number of the fill flash is greater than 0;
[0007] In the process of controlling the camera to capture images, the fill-in flash is controlled to perform fill-in light and output the captured images.
[0008] In a second aspect, an embodiment of the present application provides a photographing device, including:
[0009] A processing module, used for determining fill-in flashes in the flash module that match the shooting scene, wherein the number of the fill-in flashes is greater than 0;
[0010] The control module is used to control the fill-in flash to perform fill-in light and output the captured image during the process of controlling the camera to capture an image.
[0011] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0012] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0013] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0014] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0015] In the embodiment of the present application, the fill-in flash in the flash module that matches the shooting scene is determined, and the number of the fill-in flash is greater than 0; in the process of controlling the camera to shoot an image, the fill-in flash is controlled to perform fill-in light, and the shot image is output. According to this embodiment, when shooting, different flashes can be automatically selected for shooting fill-in light according to different shooting scenes, thereby assisting in improving the imaging effects of shooting scenes such as stage, food, and portraits, avoiding the situation of too high or too low brightness, and improving the filming rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a flowchart of a photographing method provided by some embodiments of the present application;
[0017] Figure 2 is a schematic diagram of a flash module provided in some embodiments of the present application;
[0018] Figure 3 is a schematic diagram of a camera interface provided by some embodiments of the present application;
[0019] Figure 4 is a schematic diagram of a preview image provided by some embodiments of the present application;
[0020] Figure 5 is a schematic diagram of a preview image provided by some embodiments of the present application;
[0021] Figure 6 is a schematic diagram of a preview image provided by some embodiments of the present application;
[0022] Figure 7 is a schematic diagram of a photographing method provided by some embodiments of the present application;
[0023] Figure 8 is a schematic diagram of a photographing method provided by some embodiments of the present application;
[0024] Fig.9A is a schematic diagram of pixel ratios provided in some embodiments of the present application;
[0025] Fig. 9B is a schematic diagram of pixel ratios provided in some embodiments of the present application;
[0026] Fig. 9C is a schematic diagram of pixel ratios provided in some embodiments of the present application;
[0027] Fig.10 is a schematic diagram of a preview image provided by some embodiments of the present application;
[0028] Fig.11 is a schematic diagram of a preview image provided by some embodiments of the present application;
[0029] Fig.12 is a schematic diagram of a preview image provided by some embodiments of the present application;
[0030] Fig.13 is a schematic diagram of a preview image provided by some embodiments of the present application;
[0031] Fig.14 is a schematic diagram of a first functional relationship provided by some embodiments of the present application;
[0032] Fig.15 is a schematic diagram of a photographing method provided by some embodiments of the present application;
[0033] Fig.16 is a schematic diagram of a photographing method provided by some embodiments of the present application;
[0034] Fig.17 is a schematic diagram of a shooting preview interface provided by some embodiments of the present application;
[0035] Fig.18 is a schematic diagram of a photographing device provided by some embodiments of the present application;
[0036] Fig.19 is a schematic diagram of an electronic device provided by some embodiments of the present application;
[0037] Fig. 20 is a schematic diagram of an electronic device provided in some embodiments of the present application. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0039] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0040] To facilitate understanding, the professional terms in the embodiments of the present application are explained below.
[0041] The shooting preview interface refers to the interface for displaying a preview image on the display screen of an electronic device when using the camera in the electronic device to shoot images or videos. The preview image displayed in the shooting preview interface is a real-time data stream taken from the image sensor. Specifically, when the camera application in the electronic device is running and entering the shooting mode, the camera of the electronic device will continuously capture the aimed scene and transmit the data to the processor of the electronic device. The processor will quickly process this data, including applying basic image processing algorithms such as denoising, color correction, and reducing resolution, and then display the processed image in real time on the screen of the electronic device.
[0042] The preview image refers to a real-time image that is captured by the camera and displayed in the shooting preview interface of the electronic device when the camera of the electronic device is used to shoot an image or video.
[0043] The subject refers to the person, object, scene or combination of them that the photographer wants to highlight, convey core information or express a specific theme in the shot.
[0044] The shooting scene refers to the specific environment and space where the shooting activity takes place, as well as the overall situation constituted by all relevant elements in the environment.
[0045] Shooting mode refers to the combination of various functions pre-set by electronic devices to meet different shooting scenes. It is designed to help users quickly adjust camera parameters according to different shooting scenes, such as adjusting shutter speed, ISO, focus, white balance and other parameters to simplify operation and optimize imaging effects.
[0046] The current value of a flash lamp refers to the current passing through its circuit when the flash lamp is working.
[0047] The focus focal length refers to the focal length of the flash used for shooting fill light when using the camera of an electronic device to capture images or videos.
[0048] A face detection frame is a rectangular frame used to identify the position and size of a detected face in an image or video. The face detection frame is generated based on the face detection algorithm and is used to clearly indicate the specific position of the face in an image or video, facilitating further analysis and processing of the face area in the image or video.
[0049] Pixel ratio refers to the ratio of the number of pixels occupied by a specific area or object in the entire image to the total number of pixels.
[0050] Offset distance: When using the camera of an electronic device to capture images or videos, the offset distance refers to the deviation of an object (such as a face detection frame or a focus frame) in the shooting preview interface relative to the center of the image.
[0051] Skin color hue mainly refers to skin color hue, which is used to describe the position of skin color on the color wheel. The color wheel is a circular color model, which is a ring in which all hues are arranged in spectral order. Skin color hue Hue uses angle measurement, ranging from 0° to 360°, so that the specific position of each color on the color wheel can be intuitively pointed out. For example, red is usually defined as 0° or 360°, green is 120°, blue is 240°, etc.
[0052] Tone is used to describe the distribution and level changes of light and shadow in the picture, as well as the overall visual effect and atmosphere produced by it. Tone is related to the brightness and contrast of the picture. The tone of the picture can be adjusted by adjusting the brightness and / or contrast of the picture. For example, increasing the overall brightness of the picture will make the tone tend to be high-key, making the picture appear bright, fresh and bright. On the contrary, reducing the overall brightness will make the tone develop in the direction of low-key, and the picture will become dark and deep. Increasing the contrast of the picture will make the bright parts of the picture brighter and the dark parts darker, and the difference between the two will be more obvious, making the tone hard and vivid, and can highlight the subject and details in the picture, while reducing the contrast of the picture will make the transition between the bright and dark parts smoother, making the tone softer and more delicate.
[0053] The following, in conjunction with the accompanying drawings, describes in detail the photographing method, device, electronic device, storage medium and program product provided by the embodiments of the present application through specific embodiments and their application scenarios.
[0054] The photographing method provided in the embodiments of the present application can be applied to the scene of photographing using electronic devices such as smart phones. For example, one specific application scenario is to use a smart phone to photograph a stage, another specific application scenario is to use a smart phone to photograph food, and another specific application scenario is to use a smart phone to photograph people. Figure 1-Figure 13 The photographing method provided in the embodiment of the present application is described in detail. It should be noted that the photographing method provided in the embodiment of the present application can be performed by an electronic device having a camera and a flash, and the electronic device includes but is not limited to a smart phone, a tablet computer, a smart wearable device, etc. In the embodiment of the present application, the photographing method provided in the embodiment of the present application is described by taking an electronic device performing the photographing method as an example.
[0055] See also Figure 1 , which is a flowchart of a photographing method provided in some embodiments of the present application, such as Figure 1 As shown, the method includes steps 110 to 130, which are described in detail below.
[0056] Step 110: Determine the fill-in flash lamps in the flash lamp module that match the shooting scene, and the number of the fill-in flash lamps is greater than zero.
[0057] In some embodiments of the present application, a flash module is a component on an electronic device for providing additional lighting when the light is insufficient or special light and shadow effects are required. The flash module includes at least one zoom flash or at least two corresponding flashes with different focal lengths. Among them, the zoom flash refers to a flash with an adjustable irradiation distance. The flash corresponding to the focal length is a flash with a fixed irradiation distance, but the irradiation distances of the flashes corresponding to different focal lengths are different. The shorter the corresponding focal length, the shorter the irradiation distance of the flash. For example, the flash module includes three flashes with different focal lengths, namely, a flash corresponding to a near focal length, a flash corresponding to a middle focal length, and a flash corresponding to a far focal length. For the sake of distinction, the flash corresponding to the near focal length is referred to as a near focal length flash, the flash corresponding to the middle focal length is referred to as a middle focal length flash, and the flash corresponding to the far focal length is referred to as a far focal length flash. Among them, the irradiation distance of the near focal length flash is in the range of 14mm-50mm, the irradiation distance of the middle focal length flash is in the range of 50mm to 100mm, and the irradiation distance of the far focal length flash is in the range of 100mm to 800mm. It can be understood that the above illumination distances are just distances, and the illumination distance of the flash corresponding to each focal length is determined by the hardware of the flash.
[0058] For ease of description, the following description is made by taking an example in which the flash module includes at least two corresponding flashes with different focal lengths.
[0059] In some embodiments of the present application, the arrangement of at least two flashlights in the flashlight module on the electronic device includes but is not limited to horizontal arrangement, vertical arrangement, matrix arrangement, coaxial arrangement, etc. For example, see Figure 2 The flash module includes a near-focus flash 210, a mid-focus flash 220 and a far-focus flash 230, and the near-focus flash 210, the mid-focus flash 220 and the far-focus flash 230 are coaxially arranged on the electronic device.
[0060] In some embodiments of the present application, before the above step 110, the shooting scene of the current shooting is first determined, so as to determine a fill flash matching the current shooting scene from the flash module based on the determined shooting scene.
[0061] In some embodiments of the present application, the shooting scene includes a plurality of scenes divided based on the type of the subject. Different types of subjects correspond to different shooting scenes. For example, if the subject is a stage, the shooting scene is a stage scene; if the subject is food, the shooting scene is a food scene; if the subject is a person, the shooting scene is a portrait scene. It should be noted that the above three shooting scenes are only for example purposes and are intended to help understand the technical solution of the present application. In practical applications, the present application is applicable to all shooting scenes and is not limited to the above three scenes listed. Based on this, before the above step 110, the type of the subject being photographed can be determined, and the scene that matches the type of the subject can be determined as the shooting scene for this shooting.
[0062] In some embodiments of the present application, when a user uses an electronic device to shoot, he opens the camera application of the electronic device and enters the shooting preview interface. The electronic device performs intelligent detection on the preview image displayed in real time in the shooting preview interface to identify the type of the subject in the preview image, and based on the preset correspondence between the subject type and the scene, determines the scene corresponding to the identified subject type, and determines the scene as the shooting scene for this shooting. For example, when the shooting preview interface displays the following Figure 3 In the case of the preview image 300 including the stage and the performers shown in the figure, the electronic device determines that the type of the subject in the preview image 300 is the stage by performing intelligent detection on the preview image 300, and then determines the stage scene corresponding to the stage as the shooting scene of this shooting. Figure 4 In the case of the preview image 400 including a bowl of noodles shown in FIG. 1 , the electronic device performs intelligent detection on the preview image 400 to determine that the type of the subject in the preview image 400 is food, and then determines the food scene corresponding to the food as the shooting scene for this shooting. Figure 5In the case of the preview image 500 including a dancer, the electronic device determines that the type of the subject in the preview image 500 is a person by performing intelligent detection on the preview image 500, and then determines the portrait scene corresponding to the person as the shooting scene for this shooting.
[0063] In other embodiments of the present application, a plurality of different shooting modes are pre-set in the camera application of the electronic device, and different shooting modes correspond to different scenes. When shooting, the user can select the shooting mode to be used according to the actual situation, and the electronic device determines the shooting scene corresponding to the shooting mode selected by the user as the shooting scene for this shooting. Exemplarily, three shooting modes, portrait, stage, and food, are pre-set in the camera application, wherein the scene corresponding to the stage mode is the stage scene, the scene corresponding to the food mode is the food scene, and the scene corresponding to the portrait mode is the portrait scene. After the user opens the camera application in the electronic device, the electronic device displays the following. Figure 6 The shooting preview interface 600 shown in the figure displays three shooting mode options of "Stage", "Food" and "Portrait". The user can select the corresponding shooting mode according to actual needs, and the electronic device will determine the shooting scene of this shooting with the scene corresponding to the shooting mode selected by the user. For example, if the user selects the stage mode, the electronic device will determine the stage scene corresponding to the stage mode as the shooting scene of this shooting. If the user selects the food mode, the electronic device will determine the food scene corresponding to the food mode as the shooting scene of this shooting. If the user selects the portrait mode, the electronic device will determine the portrait scene corresponding to the portrait mode as the shooting scene of this shooting.
[0064] As mentioned above, the flash module of the electronic device includes at least two corresponding flashes with different focal lengths. The corresponding flashes with different focal lengths have different irradiation distances and different characteristics of the light emitted. For example, the light of the close-focus flash is scattered and soft, and can provide a wider light coverage at a close distance. It is suitable for shooting subjects at a close distance, such as shooting close-ups of people, local details of food, etc., and can evenly illuminate the small area where the subject is located. The irradiation distance of the mid-focus flash is between the irradiation distance of the close-focus flash and the irradiation distance of the far-focus flash. The light coverage range is moderate, and it can better adapt to medium-distance shooting scenes, such as shooting half-length portraits, small group photos, etc., so that the subject and the surrounding environment within a certain range can be properly illuminated. The light of the far-focus flash is concentrated and bright, and the light coverage range is relatively narrow, mainly concentrated in a small area in the distance. It is suitable for shooting subjects at a long distance, such as shooting actors on the stage, etc., and can accurately project light onto distant targets. It can be seen that flashes with different focal lengths can adapt to different shooting scenes. Based on this, after determining the shooting scene of this shooting, at least one flash in the flash module that is suitable for the current shooting scene is used as a fill flash, so as to perform fill light during this shooting process through the fill flash.
[0065] Step 120. In the process of controlling the camera to capture images, control the fill-in flash to perform fill-in light and output the captured image.
[0066] In some embodiments of the present application, the electronic device may control the camera to capture an image when a capture trigger condition is met. The capture control is triggered, etc.
[0067] In some embodiments of the present application, the shooting trigger condition includes reaching a set shooting time. When a user shoots through a camera application in an electronic device, the user can turn on the timed shooting function of the corresponding application and set the shooting time. In this way, the electronic device automatically controls the camera to shoot an image when it determines that the set shooting time has arrived. For example, if the user sets the shooting time to 3 seconds after 12:15, the electronic device controls the camera to shoot an image when the time is determined to be 12:15 and 3 seconds.
[0068] In some embodiments of the present application, the shooting trigger condition includes receiving a first input, and the first input is an input for instructing the electronic device to start shooting. When the user uses the camera application of the electronic device to take pictures, the first input is used to control the electronic device to perform the shooting action, so that the electronic device controls the camera to shoot images in response to the first input. Exemplarily, the first input includes but is not limited to: the user clicks the shooting control on the shooting preview interface displayed by the electronic device through a touch device such as a finger or a stylus, or a voice command input by the user, or a specific gesture input by the user, or other feasible inputs, which can be determined according to actual usage requirements and are not limited in the embodiments of the present invention. The specific gesture in the embodiment of the present application can be any one of a single-click gesture, a sliding gesture, a drag gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double-press gesture, and a double-click gesture; the click input in the embodiment of the present application can be a single-click input, a double-click input, or any number of click inputs, etc., and can also be a long press input or a short press input. For example, the first input can be: the user clicks the shooting control on the shooting preview interface displayed by the electronic device through a finger. Figure 6 The first input may also be: a user's voice command to the electronic device to start taking a photo. The first input may also be: a specific gesture input by the user, such as an OK gesture. The first input may also be: a user's finger gesture such as Figure 6 The first input may also be: the user double-clicks the shooting preview interface 600 by touching the Figure 6 The specific track drawn on the shooting preview interface 600 is shown, for example, an S-shaped track.
[0069] In some embodiments of the present application, the electronic device turns on a fill flash while controlling the camera to shoot, so as to provide fill light through the fill flash during the shooting process, thereby obtaining and outputting a captured image after fill light.
[0070] The photographing method provided in this embodiment determines the fill-in flash in the flash module that matches the shooting scene, and the number of the fill-in flash is greater than 0; in the process of controlling the camera to shoot an image, the fill-in flash is controlled to perform fill-in light, and the shot image is output. According to this embodiment, when shooting, a fill-in flash that matches the shooting scene is used for fill-in light, and different fill-in flashes can be automatically used for fill-in light for different shooting scenes, so that the fill-in flash can adapt to the light conditions of the shooting scene, the characteristics of the subject, and the expected shooting effect, so as to achieve the best shooting quality, thereby assisting in improving the imaging effect of shooting scenes such as stage, food, and portraits, avoiding the situation of too high or too low brightness, and improving the filming rate.
[0071] In some embodiments, when the ambient light cannot meet the user's shooting needs, the flash module is used for fill light. When the ambient light is sufficient to meet the user's shooting needs, there is no need to use the flash module for fill light. Therefore, the flash module can include two states, namely, an on state and an off state. Based on this, the electronic device can execute the above step 110 when it is determined that the flash module is in the on state.
[0072] In some embodiments of the present application, the user can switch the state of the flash module according to actual needs. When the user uses an electronic device to take a photo, open the corresponding application in the electronic device and enter the state of the flash module. Figure 6 In the shooting preview interface 600 shown, when the user determines that the flash module is needed for fill light, the state of the flash module in the electronic device can be switched to the on state by clicking the first control 610 for switching the state of the flash module in the shooting preview interface 600. Similarly, when the user determines that the flash module is not needed for fill light, the state of the flash module in the electronic device can be switched to the off state by clicking the first control 610. In some embodiments, in order to include people in the captured image, the captured portrait is clearer and the portrait is prevented from being too bright or too dark. In the above step 110, the fill light flash can be determined by the following steps 111-112.
[0073] Step 111. Detect a face in the preview image displayed on the shooting preview interface to obtain a face detection result.
[0074] In some embodiments of the present application, when a user uses the camera of an electronic device to capture images or videos, the user opens the camera application in the electronic device and enters the shooting preview interface. The electronic device captures a real-time image of the current shooting scene through the image sensor of the camera, and displays the captured real-time image through the shooting preview interface. At this time, the real-time image displayed on the shooting preview interface is the preview image.
[0075] In some embodiments of the present application, each time the fill flash that matches the shooting scene is determined, the electronic device can use a face detection algorithm to detect faces in the preview image, thereby obtaining a face detection result. The face detection result is used to indicate whether the preview image includes a face, and when the preview image includes a face, the face detection result also includes relevant data of the face detected by the face detection algorithm. Here, the face detection algorithm refers to a technical method for identifying the position and size of a face in an image. Exemplarily, the face detection algorithm includes but is not limited to the classic Haar-Cascade algorithm, and deep learning-based algorithms such as SSD and YOLO. The face detection algorithm analyzes and processes the preview image, and uses various feature extraction, classifier and other technologies to determine whether there is a face in the preview image, and determines the specific position and size of each detected face, and finally outputs the face detection result. After the face detection algorithm is run, the size and position information of the detected face is usually output in the form of a face detection frame. One face corresponds to one face detection frame. For example, see Figure 7 , the preview image 700 includes 3 faces, wherein the dotted frame around each face is the face detection frame corresponding to the face. Based on this, the face-related data includes but is not limited to the number of faces, the position information of the face detection frame corresponding to each face, the size of the face detection frame corresponding to each face, the skin color tone of each face, etc. Step 112. Based on the face detection result, determine the fill flash in the flash module that matches the shooting scene.
[0076] In some embodiments of the present application, in the same shooting scene, different face detection results may lead to different fill light requirements. Therefore, in order to make the fill light effect more in line with the actual fill light requirements, the fill light flash used for this shooting is determined based on the face detection result and the shooting scene.
[0077] Through the above technical solution, the shooting scene and the face are used as the basis for selecting the fill flash, so that the fill flash finally determined can more accurately fill in the face, make the light more evenly distributed on the face surface, reduce shadows, make the character's skin color more natural, make the whole picture look more harmonious and unified, achieve better light and shadow effects, and improve the quality and beauty of the photos.
[0078] In different shooting scenes, the fill-in flash can be determined based on different face-related data and using different logics. The following describes the methods for determining the fill-in flash in stage scenes, food scenes, and portrait scenes.
[0079] In some embodiments, when the shooting scene is a stage scene and the face detection result indicates that the preview image contains a face, see Figure 8In the above step 112, the fill flash matching the stage scene is determined through the following steps 810 to 840.
[0080] Step 810. Determine the pixel ratio of each face detection frame based on the size of each face detection frame, where the pixel ratio is the ratio of the number of pixels within the face detection frame to the total number of pixels in the preview image.
[0081] As mentioned above, when it is detected in step 110 that the preview image includes a face, the face detection result includes relevant data of the face. Therefore, when the face detection result indicates that the preview image includes a face, the number of faces, the size of each face detection frame, and the position information of each face detection frame can be directly obtained from the face detection result. In some embodiments of the present application, the size of the face detection frame includes the width and height of the face detection frame, based on which, the pixel ratio of the face detection frame can be calculated based on the following formula (1):
[0082] size ratio =dx*dy / P total (1)
[0083] In the above formula (1), size ratio represents the pixel ratio of the face detection frame, dx represents the width of the face detection frame, dy represents the height of the face detection frame, and the units of dx and dy are both pixels. Therefore, dx*dy represents the number of pixels in the face detection frame. total Indicates the total number of pixels in the preview image.
[0084] size ratio It is closely related to the shooting distance. Generally, the closer the shooting distance, the smaller the size. ratio The bigger the size, the farther the shooting distance. ratio For example, Fig.9A As shown, the preview image 910 includes only one face, and the size of the face detection frame 9101 corresponding to the face is ratio is about 0.15. At this time, the preview image 910 only captures the upper body image of the person and the upper body image occupies about half of the entire preview image screen, indicating that the shooting distance is relatively close at this time; Fig. 9B As shown, the preview image 920 also includes only one face, and the size of the face detection frame 9201 corresponding to the face is ratio is about 0.1. At this time, the preview image 920 just contains the full-body image of the person, indicating that the shooting distance is moderate at this time. Fig. 9C As shown, the preview image 930 also includes only one face, and the size of the face detection frame 9301 corresponding to the face is ratioIt is about 0.05. At this time, the preview image 930 includes a full-body image of a person and the full-body image only occupies about 1 / 3 of the screen, which means that the shooting distance is far at this time.
[0085] Step 820. Determine the offset distance of each face detection frame based on the position information of each face detection frame, where the offset distance is the distance between the center point of the face detection frame and the center point of the preview image.
[0086] In some embodiments of the present application, the offset distance of the face detection frame is used to characterize the relative position of the face detection frame in the preview image. The smaller the offset distance, the closer the face detection frame is to the center of the preview image. If the offset distance is 0, it means that the face detection frame is located at the center of the preview image. The larger the offset distance, the further the face detection frame deviates from the center of the preview image, that is, the closer it is to the edge of the preview image.
[0087] In some embodiments of the present application, the position information of the face detection frame includes the image coordinates of at least one corner point in the face detection frame, based on which the center coordinates of the face detection frame can be determined according to the image coordinates of the corner point and the size of the face detection frame, and then the distance between the center of the face detection frame and the center of the preview image is determined based on the center coordinates of the face detection frame and the center coordinates of the preview image, that is, the offset distance of the face detection frame is determined. Among them, the center coordinates of the preview image are known values and can be directly obtained.
[0088] In some embodiments of the present application, taking the case where the position information of the face detection frame includes the image coordinates of the upper left corner of the face detection frame as an example, the center coordinates of the face detection frame can be calculated based on the following formulas (2) and (3):
[0089]
[0090] In the above formula (2), center x1 represents the horizontal coordinate of the center point of the face detection frame, and x represents the horizontal coordinate of the upper left corner of the face detection frame.
[0091] In the above formula (3), center y1 represents the ordinate of the center of the face detection frame, and y represents the ordinate of the upper left corner of the face detection frame.
[0092] After getting the center coordinates of the face detection frame (center x1 , center y1 ), the offset distance of the face detection frame can be calculated based on the following formula (4):
[0093]
[0094] In the above formula (4), distratio Indicates the offset distance of the face detection frame, ABS() represents the absolute value function, (center x2 , center y2 ) represents the center coordinates of the preview image.
[0095] Step 830: Determine a focus range that matches the stage scene based on at least one of the number of faces, the pixel ratio of each face detection frame, and the offset distance of each face detection frame.
[0096] Here, the focus focal length that matches the stage scene refers to the focal length corresponding to the flash light that is adapted to the current stage scene.
[0097] In some embodiments of the present application, in a stage scene, different logics are used for different numbers of faces to determine the focus range that matches the stage scene. Based on this, when determining the focus range that matches the stage scene, first determine whether the number of faces is one or more. When the number of faces is one, the focus range that matches the stage scene is determined based on the first logic. When the number of faces is greater than or equal to two, that is, when there are more than one, the focus range that matches the stage scene is determined based on the second logic. The first logic and the second logic are pre-set based on the focal range of each flash in the flash module.
[0098] The first logic and the second logic are described below by taking an example in which the flash module includes a near-focus flash corresponding to the near-focus section, a mid-focus flash corresponding to the mid-focus section, and a far-focus flash corresponding to the far-focus section.
[0099] In some embodiments of the present application, when the number of faces is one, that is, the face detection result includes only one face detection frame, the following steps are adopted based on the first logic to determine the focus segment matching the stage scene:
[0100] When the pixel ratio of the face detection frame is greater than or equal to the first ratio threshold, the near focal length is determined as the focus focal length.
[0101] Here, the value range of the first proportion threshold is (0, 1), and the specific value can be set according to actual conditions. For example, the first proportion threshold is 0.15.
[0102] When the pixel ratio of the face detection frame is greater than the first ratio threshold, it means that the face in the preview image is larger, indicating that the person being photographed is closer to the electronic device. Fig.9A As shown, the pixel ratio of face detection frame 9101 is slightly greater than 0.15. Fig.9AIt can be seen that the person being photographed is relatively close to the electronic device at this time. The person being photographed may be a friend nearby. In this scene, using a close-focus flash to fill in the light can make the supplementary light illuminate the human body surface more evenly, so that the details and texture of the human body can be clearly displayed.
[0103] When the pixel ratio of the face detection frame is less than or equal to the second ratio threshold, the telephoto segment is determined as the focus segment, wherein the second ratio threshold is less than the first ratio threshold.
[0104] In some embodiments of the present application, the value range of the second proportion threshold is (0, the first proportion threshold), and the specific value can be set according to actual conditions. For example, the second proportion threshold is 0.05.
[0105] When the pixel ratio of the face detection frame is less than the second ratio threshold, it means that the face in the preview image is very small, indicating that the person being photographed is far away from the electronic device. Fig. 9C As shown, the pixel ratio of face detection frame 9301 is slightly less than 0.05. Fig. 9C It can be seen that the person being photographed is far away from the electronic device and may be an actor on a distant stage. In this scenario, using a long-focus flash for fill light can focus the supplementary light on the human body at a distance to achieve precise fill light.
[0106] When the pixel ratio of the face detection frame is greater than the second ratio threshold and less than the first ratio threshold, the middle focal length is determined as the flash that matches the shooting scene.
[0107] When the pixel ratio of the face detection frame is between the first ratio threshold and the second ratio threshold, it means that the face in the preview image is of medium size, indicating that the distance between the photographed person and the electronic device is moderate. For example, the first ratio threshold is 0.15, the second ratio threshold is 0.05, and Fig. 9B As shown, the pixel ratio of the face detection frame 9201 is 0.10, which is between the first ratio threshold and the second ratio threshold. At this time, the person being photographed may be a friend two or three meters away from the electronic device. In this scenario, using a mid-focus flash for fill light can provide just the right light intensity. It will not cause excessive light, produce too bright spots or overexposure due to being too close like a near-focus flash, nor will it cause slightly weak light at close distances like a far-focus flash. It can make the face, body and other parts of the person get even and appropriate lighting, ensuring that the skin color is restored naturally and the details are clearly visible.
[0108] In some embodiments of the present application, when the number of faces is greater than or equal to 2, that is, when the face detection result includes at least two face detection frames, the fill flash matching the stage scene is determined based on the second logic in the following manner:
[0109] When the face detection result includes a face detection frame whose pixel ratio is greater than the third ratio threshold and whose offset distance is less than the first distance threshold, and the difference in pixel ratio between the largest face detection frame and the smallest face detection frame is greater than the first difference threshold, the near focus segment, the middle focus segment and the far focus segment are determined as focus segments that match the stage scene.
[0110] In some embodiments of the present application, the maximum face detection frame refers to the face detection frame with the largest pixel ratio in the face detection result, and the minimum face detection frame refers to the face detection frame with the smallest pixel ratio in the face detection result.
[0111] In some embodiments of the present application, the value range of the third proportion threshold, the first distance threshold and the first difference threshold is (0, 1), and the specific values can be set according to actual conditions. For example, the third proportion threshold is 0.1, the first distance threshold is 0.1, and the first difference threshold is 0.05.
[0112] If the pixel ratio of the face detection frame is greater than the third ratio threshold, it means that the face corresponding to the face detection frame in the preview image is larger, indicating that the face is closer to the electronic device. If the offset distance of the face detection frame is less than the first distance threshold, it means that the face corresponding to the face detection frame in the preview image is located in an area close to the center of the preview image. If the difference in pixel ratio between the largest face detection frame and the smallest face detection frame is greater than the first difference threshold, it means that the area difference between the largest face corresponding to the largest face detection frame and the smallest face corresponding to the smallest face detection frame in the preview image is large, and the distance difference between the smallest face and the largest face and the electronic device is large, that is, the largest face is closer to the electronic device, and the smallest face is farther from the electronic device. Based on this, when the face detection result includes a face detection frame whose pixel ratio is greater than the third ratio threshold and whose offset distance is less than the first distance threshold, and the difference in pixel ratio between the largest face detection frame and the smallest face detection frame is greater than the first difference threshold, it means that there is a larger face in the center of the preview image, and the distance difference between the largest face and the smallest face in the preview image and the electronic device is large, for example, Fig.10 As shown. At this time, you may be taking a photo of the actor in the center of the stage and the audience in the background. In this scene, three flashes corresponding to the far focal length, medium focal length, and near focal length are used together for fill light. The human body at three distances, far, medium, and near, can be filled with light at the same time, making the fill light more uniform.
[0113] When the face detection result includes a face detection frame whose pixel ratio is greater than the third ratio threshold and whose offset distance is greater than or equal to the first distance threshold, and the difference in pixel ratio between the maximum face detection frame and the minimum face detection frame is greater than the first difference threshold, the medium focal length and the far focal length are determined as the focus focal lengths that match the stage scene.
[0114] As described above, if the pixel ratio of the face detection frame is greater than the third ratio threshold, it means that the face corresponding to the face detection frame in the preview image is larger, indicating that the face is closer to the electronic device, and the difference in pixel ratio between the largest face detection frame and the smallest face detection frame is greater than the first difference threshold, indicating that the distance difference between the smallest face and the largest face and the electronic device is larger, and the offset distance of the face detection frame is greater than or equal to the first distance threshold, indicating that the face corresponding to the face detection frame in the preview image is in an area far from the center of the preview image, that is, at the edge of the preview image. Based on this, when the face detection result includes a face detection frame whose pixel ratio is greater than the third ratio threshold and whose offset distance is greater than or equal to the first distance threshold, and the difference in pixel ratio between the largest face detection frame and the smallest face detection frame is greater than the first difference threshold, it means that there is a larger face at the edge of the preview image, and the distance difference between the largest face and the smallest face in the preview image and the electronic device is larger, for example Fig.11 As shown. This may be when taking a photo of a friend two or three meters away and the audience in the background. In this scenario, two flashes corresponding to the far focal length and the medium focal length are used to fill in the light at the same time, which can fill in the light for the human body at both the far and medium distances, making the fill light more uniform.
[0115] When the face detection result includes a face detection frame whose pixel ratio is greater than the third ratio threshold, and the difference in pixel ratio between the maximum face detection frame and the minimum face detection frame is less than or equal to the first difference threshold, the middle focal length and the near focal length are determined as the focus focal lengths matching the stage scene.
[0116] As mentioned above, if the pixel ratio of the face detection frame is greater than the third ratio threshold, it means that the face corresponding to the face detection frame in the preview image is larger, indicating that the face is closer to the electronic device, and the difference in pixel ratio between the largest face detection frame and the smallest face detection frame is less than or equal to the first difference threshold, indicating that the distance difference between the smallest face and the largest face and the electronic device is small. Based on this, when the face detection result includes a face detection frame with a pixel ratio greater than the third ratio threshold, and the pixel ratio difference between the largest face detection frame and the smallest face detection frame is less than or equal to the first difference threshold, it means that there is a larger face in the preview image, and the distance difference between the largest face and the smallest face in the preview image and the electronic device is small. For example, Fig.12As shown. At this time, you may be taking a group photo of several actors. In this scenario, using two flashes corresponding to the medium focal length and the close focal length to fill in the light at the same time can make the light of the two flashes overlap, thereby increasing the brightness of the fill light.
[0117] When the face detection result does not include a face detection frame whose pixel ratio is greater than a third ratio threshold, the far focus segment and the near focus segment are determined as focus segments that match the stage scene.
[0118] If the face detection frame pixel ratio is less than or equal to the third ratio threshold, it means that the face corresponding to the face detection frame in the preview image is small and the face is far away from the electronic device. Based on this, if the face detection result does not include the face detection frame whose pixel ratio is greater than the third ratio threshold, it means that the faces in the preview image are all small, for example Fig.13 At this time, you may be taking a photo of the entire audience or multiple actors on the stage. In this scenario, using two flashes at a long focal length and a short focal length for fill light can make the light of the two flashes overlap, thereby increasing the brightness of the fill light.
[0119] In addition, in some embodiments of the present application, in a stage scene, when the face detection result indicates that the preview image does not include a face, the preset default focal length is determined as the focus focal length that matches the stage scene. The default focal length may be a medium focal length, because compared with a close focal length and a far focal length, a flash in a medium focal length can provide a more appropriate light intensity, which will not cause excessive light intensity, produce too bright spots or overexposure due to being too close to the camera like a close-focus flash, nor will it cause slightly weak light at a close distance like a far-focus flash.
[0120] Step 840: Determine the flash in the flash module that corresponds to the focus focal length as the fill flash.
[0121] In some embodiments of the present application, the focal length corresponding to each flash in the flash module is pre-set. Based on this, after determining the focus focal length, the flash corresponding to the focus focal length can be directly determined as the fill flash that matches the current shooting scene. For example, if the focus focal length includes a near focus segment, the near focus flash is determined as the fill flash, and if the focus focal length includes a far focus segment and a mid focus segment, the far focus flash and the mid focus flash are determined as the fill flash.
[0122] From the above content, it can be seen that in the stage scene, the determined focus focal length includes one or more focal lengths, so the number of fill-in flashes is one or more. When the number of fill-in flashes is multiple, in the above step 120, multiple fill-in flashes are controlled simultaneously to perform fill-in.
[0123] In some embodiments, in order to further improve the fill light effect in a stage scene, when the shooting scene is a stage scene and the preview image includes a light beam projected by the lighting equipment on the stage, in the above step 120, before controlling the fill light flash to perform fill light, the following steps may also be performed:
[0124] The number of light columns in the preview image is determined, and based on the number of light columns, a current value of the fill flash is adjusted, wherein the current value is positively correlated with the number of light columns.
[0125] In some embodiments of the present application, a light column refers to a column-like light form presented in a preview image. A light column generally extends from a lighting device in a certain direction, has a certain length and a relatively stable width, and looks like a column-like light channel. For example, in some stage shooting, a column-like light area extending vertically downward or at a certain angle from lighting devices such as follow lights and moving head lights around the stage is a light column.
[0126] In some embodiments of the present application, the number of light columns is positively correlated with the current value of the fill-in flash, that is, the larger the number of light columns, the larger the current value of the fill-in flash. A first functional relationship between the number of light columns and the current value of the flash can be set in advance based on the corresponding relationship between the number of light columns and the current value of the flash. Based on this, after determining the number of light columns, the current value of the flash can be determined based on the number of light columns and the first functional relationship, and then the current value of the fill-in flash can be adjusted based on the determined current value of the flash. The first functional relationship can be a mathematical expression, a corresponding relationship table, a graph, etc.
[0127] In some embodiments of the present application, the lower limit current value y1 and the upper limit current value y2 of the flashlight are set according to actual conditions, and the number of light columns x1 corresponding to the lower limit current value y1 and the number of light columns x2 corresponding to the upper limit current value y2 are set. Based on this, a linear function is constructed according to the above (x1, y1) and (x2, y2), and the linear function is used as the first functional relationship. In this way, based on the first functional relationship, the current value of the fill flash can be determined by linear interpolation. For example, assuming that the lower limit current value y1 of the flashlight is 100mA, the upper limit current value y2 is 500mA, the ambient brightness x1 corresponding to the lower limit current value y1 is 1, and the ambient brightness x2 corresponding to the upper limit current value y2 is 9, based on this, the following can be obtained: Fig.14 The linear function shown in FIG. 1 is used as the first functional relationship. If the number of light beams in the preview image is determined to be 5, then based on Fig.14 From the first functional relationship shown, it can be obtained that the current value of the fill flash is 300mA.
[0128] Through the above scheme, when there are more light columns in the stage scene, the current of the fill flash can be appropriately increased to balance the overall light. Although the light columns in the stage will provide a certain amount of illumination, there may be uneven illumination, resulting in dark areas in some areas. Increasing the current of the fill flash can provide stronger light through the fill flash to illuminate these dark areas, making the light of the entire scene more uniform, avoiding obvious differences in light and dark, and ensuring that all parts such as the subject and the background can be clearly seen.
[0129] In some embodiments, when the shooting scene is a food scene and the face detection result indicates that the preview image does not include a face, see Fig.15 In the above step 112, the fill flash is determined through the following steps 1510-1530.
[0130] Step 1510. Determine the number of objects in the preview image.
[0131] In some embodiments of the present application, in a food scene, the subject refers to food, a portion of food is a subject, and a portion of food can be a dish, a bowl of noodles, a set meal, or a piece of fruit, etc. For example, if the preview image only includes a bowl of noodles, the number of subjects is 1, and if the preview image includes a bowl of noodles and a dish, the number of subjects is 2.
[0132] In some embodiments of the present application, the electronic device may perform intelligent detection on the preview image to determine the number of objects contained therein. Intelligent detection may adopt a detection algorithm based on machine learning, a detection algorithm based on deep learning, etc., which is not specifically limited in this embodiment.
[0133] Step 1520. Based on the number of objects being photographed, determine a focus range that matches the food scene.
[0134] In some embodiments of the present application, the number of objects to be photographed is different, and the shooting effects desired by the user are also different. For example, when the number of objects to be photographed is 1, the user may want to shoot a partial close-up effect of a single portion of food, and when the number of objects to be photographed is greater than 1, the user may want to shoot the overall effect of the entire table of food. Therefore, in order to meet different shooting needs, flashes with different focal lengths are used for fill light for different numbers of objects to be photographed.
[0135] In some embodiments of the present application, the correspondence between the number of subjects and the focal length of the flash is preset. Thus, after the number of subjects is determined, the focal length of the flash corresponding to the number of subjects is determined as the focus focal length that matches the food scene.
[0136] In some embodiments of the present application, the flash module includes a near-focus flash, a mid-focus flash, and a far-focus flash. The correspondence between the number of pre-set subjects and the focal length of the flash is shown in Table 1 below:
[0137] Table 1
[0138] Number of objects photographed Flash focal length 1 Telephoto Greater than 1 Close and long focal lengths
[0139] Based on the above Table 1, when the number of subjects is 1, the telephoto section is determined as the focus section that matches the food scene. When the number of subjects is greater than 1, both the telephoto section and the near-focus section are determined as the focus section. Among them, when the number of subjects is 1, using a telephoto section flash for fill light can accurately illuminate the local area, because the telephoto flash can concentrate the light in a smaller area, and can accurately illuminate the local details that need to be photographed, avoiding the light from scattering to other unnecessary areas, thereby highlighting the local features of the subject and making the details of the food clearly displayed. When the number of subjects is greater than 1, using a telephoto section flash and a near-focus section flash for fill light at the same time can improve the light coverage and uniformity. Among them, the telephoto flash can provide a wide range of basic lighting, ensuring that multiple portions of food can be covered by light, avoiding the situation where some food is in the shadow, so that all food in the picture can be clearly presented, ensuring the integrity of the shooting content. The close-focus flash can provide supplementary lighting for local details of the food, such as the gloss of the soup on the dish, the texture of the food, etc., so that the details of each portion of food can be clearly displayed. The combination of the two can make the lighting of the entire table of food more even.
[0140] Step 1530: Determine the flash in the flash module that corresponds to the focus focal length as the fill flash.
[0141] In some embodiments of the present application, the focal length corresponding to each flash in the flash module is pre-set. Based on this, after determining the focus focal length, the flash corresponding to the focus focal length can be directly determined as the fill flash that matches the current shooting scene. For example, if the focus focal length includes a near focus segment, the near focus flash is determined as the fill flash, and if the focus focal length includes a far focus segment and a mid focus segment, the far focus flash and the mid focus flash are determined as the fill flash.
[0142] From the above content, it can be seen that when the preview image does not include a face, the focus focal length matching the food scene includes one or more focal lengths. Therefore, the number of fill flash lights determined at this time is one or more. When the number of fill flash lights is multiple, in the above step 120, multiple fill flash lights are controlled to turn on at the same time for fill light.
[0143] In some embodiments, when the shooting scene is a food scene and the face detection result indicates that the preview image includes a face, when determining the fill flash, the following steps may also be included:
[0144] The first flash light and the second flash light in the flash light module are determined as fill flash lights that match the shooting scene, and the focal length of the first flash light is smaller than that of the second flash light.
[0145] In some embodiments of the present application, the first flashlight and the second flashlight are flashlights with different focal lengths. For example, when the flashlight module includes a close-focus flashlight, a mid-focus flashlight, and a far-focus flashlight, the first flashlight can be a close-focus flashlight, and the second flashlight can be a mid-focus flashlight.
[0146] Accordingly, in the food scene, in the case of a face included in the preview image, after the first flash light and the second flash light are determined as fill flash lights, in the above step 120, the fill flash lights are controlled by the following steps:
[0147] In the process of controlling the camera to capture an image, controlling the first flash to perform fill light to obtain a first image;
[0148] Controlling the second flash to provide fill light, thereby obtaining a second image;
[0149] adjusting the tone of the face in the first image based on the second image;
[0150] The first image after the tone adjustment is determined as the captured image output.
[0151] Here, tone refers to the light and dark levels and the black and white gray relationship of the image in the photographic picture, as well as the overall visual effect and atmosphere produced thereby. Adjusting the tone of the face in the first image includes but is not limited to adjusting parameters such as the brightness and contrast of the face in the first image to enhance the visual effect of the face.
[0152] In some embodiments of the present application, in a food scene, if the preview image contains a human face, it means that this is a scene of a person taking a photo with food. In this scene, the electronic device first turns on the first flash with a smaller focal length for fill light in the process of controlling the camera to shoot an image, and shoots the first image. After obtaining the first image, the first flash is turned off and the second flash with a larger focal length is turned on for fill light, and the second image is shot. Then, based on the human face in the second image, the tone of the human face in the first image is adjusted, so as to obtain a captured image that combines the first image feature and the second image feature, and the captured image is output. Among them, by using the first flash with a smaller focal length for fill light, the human face and food can be filled in at a close distance, so that the facial features of the person are more three-dimensional, and the details such as facial expressions and eyes can be clearly displayed, and the details of the food, such as the soup, texture, color, etc. on the food, can be highlighted. By using the second flash with a larger focal length for fill light, a more complete human face can be illuminated, making the human face more complete and three-dimensional in the picture, avoiding the situation where only part of the face is illuminated and other parts are too dark, and making the human face more harmonious and unified. Based on this, by adjusting the tone of the face in the first image through the second image, the face in the first image can be placed in a unified and coordinated light and shadow environment, enhancing the overall sense and artistic sense of the picture and improving the visual effect of the face. In addition, since the first flash and the second flash are used for fill light from different distances, the fusion of the first image and the second image can create a rich light and shadow layer for the picture, increase the three-dimensional sense and spatial sense of the picture, and make the whole group photo more vivid and deep.
[0153] In some embodiments of the present application, when the shooting scene is a portrait scene, the preview image usually includes a human face, and the skin tone of the human face is usually affected by the surrounding light. Skin tone Hue uses angle measurement, and the value range is 0°~360°, starting from red 0°, green is 120°, blue is 240°, and so on. Generally, the normal skin tone of a human face is between 15° and 30°. When other colors of light hit the face, the skin tone will exceed this range. For example, when encountering strong blue light hitting the face, the skin tone of the face will be bluish, and the skin tone may become about 240°. Based on this, in the portrait scene, in the above step 112, the fill flash that matches the portrait scene can be determined based on the pixel ratio of the face and the skin tone. Based on this, see Fig.16 When the shooting scene is a stage scene, the fill flash is determined through the following steps 1610 to 1630.
[0154] Step 1610. Determine the pixel ratio of each face detection frame based on the size of each face detection frame.
[0155] Here, the method of determining the facial pixel ratio is consistent with the above step 810. Please refer to the relevant description in step 810. To avoid repetition, it will not be repeated here.
[0156] Step 1620. Determine a focus range that matches the portrait scene based on at least one of the skin tone of each face and the pixel ratio of each face detection frame.
[0157] In some embodiments of the present application, the flash module includes a near-focus flash, a mid-focus flash, and a far-focus flash. The focus range that matches the portrait scene can be determined in the following manner:
[0158] When the face detection result includes a face detection frame whose pixel ratio is greater than the first ratio threshold, the near focus segment is determined as the focus segment matching the portrait scene.
[0159] In some embodiments of the present application, when a face detection frame includes a pixel ratio greater than a first ratio threshold, it means that there is a person who is close to the electronic device. In this scenario, using a near-focus flash for fill light can avoid the glare of the fill light.
[0160] When the pixel proportions of all face detection frames in the face detection result are less than the second proportion threshold, the telephoto segment is determined as the focus segment matching the portrait scene.
[0161] In some embodiments of the present application, when the pixel ratio of all face detection frames is less than the second ratio threshold, it means that all the photographed persons are far away from the electronic device at this time. In this scenario, using a telefocus flash for fill light can ensure that each photographed person's face can have a flash fill light effect.
[0162] When the face detection result includes a face detection frame whose pixel ratio is greater than or equal to the second ratio threshold and less than or equal to the first ratio threshold, and the skin color tone of the face corresponding to the face detection frame is within the reference skin color range, the medium focal length is determined as the focus focal length that matches the portrait scene.
[0163] In some embodiments of the present application, the lower limit of the reference skin color range is greater than or equal to 0°, and the upper limit is less than or equal to 360°, which can be set according to actual conditions. For example, the reference skin color range is (15°, 30°). When the face detection result includes a face detection frame whose pixel ratio is greater than or equal to the second ratio threshold and less than or equal to the first ratio threshold, and the skin color hue of the face corresponding to the face detection frame exceeds the reference skin color range, the three focal lengths of the far focal length, the middle focal length, and the near focal length are all determined as the focus focal lengths that match the portrait scene.
[0164] In some embodiments of the present application, when the skin color hue of the face corresponding to the face detection frame exceeds the reference skin color range, it means that the skin color of the face is affected by the ambient light. At this time, using a long-focus flash, a mid-focus flash, and a near-focus flash simultaneously for fill light can reduce the impact of the ambient light source on the skin color of the face.
[0165] Step 1630: Determine the flash in the flash module that corresponds to the focus focal length as the fill flash.
[0166] In some embodiments of the present application, the focal length corresponding to each flash in the flash module is pre-set. Based on this, after determining the focus focal length, the flash corresponding to the focus focal length can be directly determined as the fill flash that matches the current shooting scene. For example, if the focus focal length includes a near focus segment, the near focus flash is determined as the fill flash, and if the focus focal length includes a far focus segment and a mid focus segment, the far focus flash and the mid focus flash are determined as the fill flash.
[0167] It can be seen from the above content that in the portrait scene, the focus focal length matching the portrait scene includes one or more focal lengths. Therefore, the number of fill flashes matching the portrait scene is one or more. When the number of fill flashes is multiple, in the above step 120, multiple fill flashes are controlled to turn on at the same time for fill light.
[0168] In some embodiments, the electronic device supports two flash control modes, namely, automatic flash control mode and manual flash control mode. The user can use the automatic flash control mode and the manual flash control mode according to actual needs. When the flash control mode is the automatic flash control mode, execute the above step 110.
[0169] In some embodiments of the present application, the shooting preview interface may include a focal length option, and the focal length option includes an option corresponding to each flash in the flash module, and an automatic option. When the user selects an option corresponding to any flash, the flash control mode is determined to be a flash manual control mode. When the user selects an automatic option, or the user does not select an option corresponding to any flash within a preset time, the flash control mode is determined to be a flash automatic control mode. For example, Fig.17 As shown, the shooting preview interface includes an option 1710 corresponding to a near-focus flash, an option 1720 corresponding to a mid-focus flash, an option 1730 corresponding to a far-focus flash, and an automatic option 1740.
[0170] Based on this, the above step 110 may include:
[0171] When the second input is received, or the third input is not received within a preset time period, a fill flash in the flash module that matches the shooting scene is determined.
[0172] In some embodiments of the present application, the second input is used to indicate turning on the automatic flash control mode. Exemplarily, the second input includes but is not limited to: a click input of the automatic option in the camera interface by the user through a touch device such as a finger or a stylus, or a voice command input by the user, or a specific gesture input by the user, or other feasible input, which can be determined according to actual usage requirements and is not limited by the embodiments of the present application. The specific gesture in the embodiments of the present application can be any one of a single-click gesture, a sliding gesture, a dragging gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double-press gesture, and a double-click gesture; the click input in the embodiments of the present application can be a single-click input, a double-click input, or any number of click inputs, etc., and can also be a long press input or a short press input. For example, the above-mentioned second input can be: the user clicks the automatic option in the camera interface through a finger. Fig.17 The click input of the automatic option 1740 is shown. The second input mentioned above can also be: a voice command issued by the user to the electronic device to turn on the automatic control mode of the flash.
[0173] In some embodiments of the present application, the third input is used to set the fourth focal length used for fill light. Exemplarily, the third input includes but is not limited to: a user click input on an option corresponding to any flash in the camera interface through a touch device such as a finger or a stylus, or a voice command input by the user, or a specific gesture input by the user, or other feasible inputs, which can be determined according to actual usage requirements and are not limited in the embodiments of the present application. The specific gesture in the embodiments of the present application can be any one of a single-click gesture, a sliding gesture, a dragging gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double-press gesture, and a double-click gesture; the click input in the embodiments of the present application can be a single-click input, a double-click input, or any number of click inputs, etc., and can also be a long press input or a short press input. For example, the third input mentioned above can be: the user clicks on the following options through a finger: Fig.17 The third input may also be a voice command issued by the user to the electronic device indicating that one or more of the near focus segment, the medium focus segment, and the far focus segment are selected as the focal segment for fill light. The fourth focal segment refers to the focal segment selected by the third input. For example, the third input is a user clicking on the near focus segment, the medium focus segment, and the far focus segment. Fig.17For example, if the third input is a user's voice command to the electronic device indicating that the middle focal length and the far focal length are selected as the focal lengths for fill light, the middle focal length and the far focal length are determined as the fourth focal length.
[0174] In some embodiments, the photographing method further includes:
[0175] When the third input is received within the preset time, the flash lamps in the flash lamp module corresponding to the fourth focal length are determined as designated fill-in flash lamps, and the number of the designated fill-in flash lamps is greater than 0;
[0176] In the process of controlling the camera to capture images, the designated fill-in flash is controlled to perform fill-in light and output the captured images.
[0177] Through the above scheme, users can manually select the flash for fill light, and by manually switching different flashes, the flash irradiation distance can be adjusted. Users can select a single focal length flash as the designated fill light flash, or select multiple focal length flashes as designated fill light flashes to use at the same time, such as using a close-focus flash and a far-focus flash at the same time, using a close-focus flash and a mid-focus flash at the same time, using a mid-focus flash and a far-focus flash at the same time, and using three focal length flash modules, a close-focus flash, a mid-focus flash, and a far-focus flash at the same time. In this way, the flexibility of fill light is improved, so that fill light can meet the personalized needs of users.
[0178] The photographing method provided in the embodiment of the present application can be executed by a photographing device. In the embodiment of the present application, the photographing device provided in the embodiment of the present application is described by taking the photographing method executed by the photographing device as an example.
[0179] See also Fig.14 , which is a schematic diagram of a photographing device provided in some embodiments of the present application, such as Fig.18 As shown, the device 1800 includes the following modules:
[0180] The processing module 1801 is used to determine the fill-in flash lamps in the flash lamp module that match the shooting scene, and the number of the fill-in flash lamps is greater than 0;
[0181] The control module 1802 is used to control the fill-in flash to perform fill-in light and output the captured image during the process of controlling the camera to capture an image.
[0182] In some embodiments, the processing module 1801 is specifically configured to:
[0183] Detecting a face in a preview image displayed on a shooting preview interface to obtain a face detection result;
[0184] Based on the face detection result, a fill flash in the flash module that matches the shooting scene is determined.
[0185] In some embodiments, the flash module includes at least two flashes with different focal lengths, the shooting scene is a stage scene, the face detection result indicates that the preview image includes a face, and the face detection result includes the number of faces and the size and position information of the face detection frame corresponding to each face, and the processing module 1801 is specifically used to:
[0186] Determine the pixel ratio of each face detection frame based on the size of each face detection frame, where the pixel ratio is the ratio of the number of pixels in the face detection frame to the total number of pixels in the preview image;
[0187] Based on the position information of each face detection frame, determine the offset distance of each face detection frame, where the offset distance is the distance between the center point of the face detection frame and the center point of the preview image;
[0188] Determine a focus segment that matches the stage scene based on at least one of the number of faces, the pixel ratio of each face detection frame, and the offset distance of each face detection frame;
[0189] The flash light corresponding to the focus focal length in the flash light module is determined as the fill flash light.
[0190] In some embodiments, the flash module includes a flash corresponding to the near focal length, a flash corresponding to the far focal length, and a flash corresponding to the medium focal length, and the number of faces = 1; the processing module 1801 is specifically used to:
[0191] When the pixel ratio of the face detection frame is greater than or equal to the first ratio threshold, the near focus segment is determined as the focus segment matching the stage scene;
[0192] When the pixel ratio of the face detection frame is less than or equal to the second ratio threshold, the far focal length is determined as the focus focal length matching the stage scene;
[0193] When the pixel ratio of the face detection frame is greater than the second ratio threshold and less than the first ratio threshold, the middle focal length is determined as the focus focal length matching the stage scene.
[0194] In some embodiments, the flash module includes a flash corresponding to the near focal length, a flash corresponding to the far focal length, and a flash corresponding to the medium focal length, and the number of faces is ≥2; the processing module 1801 is specifically used to:
[0195] When the face detection result includes face detection frames whose pixel ratio is greater than the third ratio threshold and whose offset distance is less than the first distance threshold, and the difference in pixel ratio between the largest face detection frame and the smallest face detection frame is greater than the first difference threshold, the near focal length, the middle focal length, and the far focal length are determined as focus segments that match the stage scene, the largest face detection frame refers to the face detection frame with the largest pixel ratio in the face detection result, and the smallest face detection frame refers to the face detection frame with the smallest pixel ratio in the face detection result;
[0196] When the face detection result includes a face detection frame whose pixel ratio is greater than the third ratio threshold and whose offset distance is greater than or equal to the first distance threshold, and the difference in pixel ratio between the largest face detection frame and the smallest face detection frame is greater than the first difference threshold, determining the medium focal length and the far focal length as the focus focal lengths matching the stage scene;
[0197] When the face detection result includes a face detection frame whose pixel ratio is greater than the third ratio threshold, and the difference in pixel ratio between the largest face detection frame and the smallest face detection frame is less than or equal to the first difference threshold, determining the middle focal length and the near focal length as the focus focal lengths matching the stage scene;
[0198] When the face detection result does not include a face detection frame whose pixel ratio is greater than a third ratio threshold, the far focus segment and the near focus segment are determined as focus segments that match the stage scene.
[0199] In some embodiments, the preview image includes a light beam projected by a lighting device in a stage scene, and the apparatus 1800 further includes: a current adjustment module, which is used to:
[0200] In the process of controlling the camera to capture an image, controlling the fill-in flash to perform fill-in lighting, and determining the number of light beams in the preview image before outputting the captured image;
[0201] Based on the number of light beams, adjust the current value of the fill flash, and the current value is positively correlated with the number of light beams.
[0202] In some embodiments, the flash module includes at least two flashes with different focal lengths, the shooting scene is a food scene, and the face detection result indicates that the preview image does not include a face; the processing module 1801 is specifically used to:
[0203] Determining the number of objects in the preview image;
[0204] Based on the number of subjects, determine the focus range that matches the food scene;
[0205] The flash light corresponding to the focus focal length in the flash light module is determined as the fill flash light.
[0206] In some embodiments, the flash module includes a flash corresponding to the near focal length, a flash corresponding to the far focal length, and a flash corresponding to the medium focal length; the processing module 1801 is specifically used to:
[0207] When the number of photographed objects is less than a first quantity threshold, determining the far focal length as a focus focal length matching the food scene;
[0208] When the number of photographed objects is greater than or equal to the first quantity threshold, the far focal length and the near focal length are determined as focus focal lengths that match the food scene.
[0209] In some embodiments, the flash module includes at least two flashes with different focal lengths, the shooting scene is a food scene, and the face detection result indicates that the preview image includes a face; the processing module 1801 is specifically used to:
[0210] The first flashlight and the second flashlight in the flashlight module are determined as fill flashlights matching the food scene, and the focal length of the first flashlight is smaller than the focal length of the second flashlight; the control module 1802 is specifically used to:
[0211] In the process of controlling the camera to capture an image, controlling the first flash to perform fill light to obtain a first image;
[0212] Controlling the second flash to provide fill light, thereby obtaining a second image;
[0213] Based on the second image, adjusting the tone of the face in the first image;
[0214] The first image after the tone adjustment is determined as the captured image output.
[0215] In some embodiments, the flash module includes at least two flashes with different focal lengths, the shooting scene is a portrait scene, the face detection result indicates that the preview image includes a face, and the face detection result includes the skin color tone of each face and the size of each face detection frame corresponding to each face; the processing module 1801 is specifically used to:
[0216] Determine the pixel ratio of each face detection frame based on the size of each face detection frame, where the pixel ratio is the ratio of the number of pixels in the face detection frame to the total number of pixels in the preview image;
[0217] Determining a focus segment that matches the portrait scene based on at least one of the skin color tone of each face and the pixel ratio of each face detection frame;
[0218] The flash light corresponding to the focus focal length in the flash light module is determined as the fill flash light.
[0219] In some embodiments, the flash module includes a flash corresponding to the near focal length, a flash corresponding to the far focal length, and a flash corresponding to the medium focal length; the processing module 1801 is specifically used to:
[0220] When the face detection result includes a face detection frame whose pixel ratio is greater than a first ratio threshold, determining the near focus segment as a focus segment matching the portrait scene;
[0221] When the pixel ratios of all face detection frames in the face detection result are less than the second ratio threshold, determining the telephoto focal length as a focus focal length that matches the portrait scene;
[0222] When the face detection result includes a face detection frame whose pixel ratio is greater than or equal to the second ratio threshold and less than or equal to the first ratio threshold, and the skin color tone of the face corresponding to the face detection frame is within the reference skin color range, the medium focal length is determined as the focus focal length that matches the portrait scene.
[0223] When the face detection result includes a face detection frame whose pixel ratio is greater than or equal to the second ratio threshold and less than or equal to the first ratio threshold, and the skin color tone of the face corresponding to the face detection frame exceeds the reference skin color range, the far focal length, medium focal length, and near focal length are determined as focus focal lengths that match the portrait scene.
[0224] The shooting device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. It can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not make specific limitations.
[0225] The shooting device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0226] The shooting device provided in the embodiment of the present application can achieve Figures 1 to 17 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0227] Alternatively, if Fig.19 As shown, an embodiment of the present application further provides an electronic device 1900, including a processor 1901 and a memory 1902, wherein the memory 1902 stores a program or instruction that can be executed on the processor 1901, and when the program or instruction is executed by the processor 1901, each step of the above-mentioned photographing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0228] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0229] Fig. 20 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0230] The electronic device 2000 includes but is not limited to: a radio frequency unit 2001, a network module 2002, an audio output unit 2003, an input unit 2004, a sensor 2005, a display unit 2006, a user input unit 2007, an interface unit 2008, a memory 2009, and a processor 2010 and other components.
[0231] Those skilled in the art will appreciate that the electronic device 2000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 2010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig. 20 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0232] The processor 210 is used to determine the fill-in flash lamps in the flash lamp module that match the shooting scene, and the number of the fill-in flash lamps is greater than 0;
[0233] The processor 2010 is also used to control the fill light flash to perform fill light and output the captured image during the process of controlling the camera to capture an image.
[0234] In some embodiments, the processor 2010 is specifically configured to:
[0235] Detecting a face in a preview image displayed on a shooting preview interface to obtain a face detection result;
[0236] Based on the face detection result, a fill flash in the flash module that matches the shooting scene is determined.
[0237] In some embodiments, the flash module includes at least two flashes with different focal lengths, the shooting scene is a stage scene, the face detection result indicates that the preview image includes a face, and the face detection result includes the number of faces and the size and position information of the face detection frame corresponding to each face, and the processor 210 is specifically used to:
[0238] Determine the pixel ratio of each face detection frame based on the size of each face detection frame, where the pixel ratio is the ratio of the number of pixels in the face detection frame to the total number of pixels in the preview image;
[0239] Based on the position information of each face detection frame, determine the offset distance of each face detection frame, where the offset distance is the distance between the center point of the face detection frame and the center point of the preview image;
[0240] Determine a focus segment that matches the stage scene based on at least one of the number of faces, the pixel ratio of each face detection frame, and the offset distance of each face detection frame;
[0241] The flash light corresponding to the focus focal length in the flash light module is determined as the fill flash light.
[0242] In some embodiments, the flash module includes a flash corresponding to the near focal length, a flash corresponding to the far focal length, and a flash corresponding to the medium focal length, and the number of faces = 1; the processor 210 is specifically configured to:
[0243] When the pixel ratio of the face detection frame is greater than or equal to the first ratio threshold, the near focus segment is determined as the focus segment matching the stage scene;
[0244] When the pixel ratio of the face detection frame is less than or equal to the second ratio threshold, the far focal length is determined as the focus focal length matching the stage scene;
[0245] When the pixel ratio of the face detection frame is greater than the second ratio threshold and less than the first ratio threshold, the middle focal length is determined as the focus focal length matching the stage scene.
[0246] In some embodiments, the flash module includes a flash corresponding to a near focal length, a flash corresponding to a far focal length, and a flash corresponding to a medium focal length, and the number of faces is ≥2; the processor 210 is specifically configured to:
[0247] When the face detection result includes face detection frames whose pixel ratio is greater than the third ratio threshold and whose offset distance is less than the first distance threshold, and the difference in pixel ratio between the largest face detection frame and the smallest face detection frame is greater than the first difference threshold, the near focal length, the middle focal length, and the far focal length are determined as focus segments that match the stage scene, the largest face detection frame refers to the face detection frame with the largest pixel ratio in the face detection result, and the smallest face detection frame refers to the face detection frame with the smallest pixel ratio in the face detection result;
[0248] When the face detection result includes a face detection frame whose pixel ratio is greater than the third ratio threshold and whose offset distance is greater than or equal to the first distance threshold, and the difference in pixel ratio between the largest face detection frame and the smallest face detection frame is greater than the first difference threshold, determining the medium focal length and the far focal length as the focus focal lengths matching the stage scene;
[0249] When the face detection result includes a face detection frame whose pixel ratio is greater than the third ratio threshold, and the difference in pixel ratio between the largest face detection frame and the smallest face detection frame is less than or equal to the first difference threshold, determining the middle focal length and the near focal length as the focus focal lengths matching the stage scene;
[0250] When the face detection result does not include a face detection frame whose pixel ratio is greater than a third ratio threshold, the far focus segment and the near focus segment are determined as focus segments that match the stage scene.
[0251] In some embodiments, the preview image includes light beams projected by lighting equipment in the stage scene, and the processor 2010 is further configured to:
[0252] In the process of controlling the camera to capture images, controlling the fill-in flash to perform fill-in lighting, and determining the number of light beams in the preview image before outputting the captured image;
[0253] Based on the number of light beams, adjust the current value of the fill flash, and the current value is positively correlated with the number of light beams.
[0254] In some embodiments, the flash module includes at least two flashes with different focal lengths, the shooting scene is a food scene, and the face detection result indicates that the preview image does not include a face; the processor 210 is specifically configured to:
[0255] Determining the number of objects in the preview image;
[0256] Based on the number of subjects, determine the focus range that matches the food scene;
[0257] The flash light corresponding to the focus focal length in the flash light module is determined as the fill flash light.
[0258] In some embodiments, the flash module includes a flash corresponding to a near focal length, a flash corresponding to a far focal length, and a flash corresponding to a medium focal length; the processor 210 is specifically configured to:
[0259] When the number of photographed objects is less than a first quantity threshold, determining the far focal length as a focus focal length matching the food scene;
[0260] When the number of photographed objects is greater than or equal to the first quantity threshold, the far focal length and the near focal length are determined as focus focal lengths that match the food scene.
[0261] In some embodiments, the flash module includes at least two flashes with different focal lengths, the shooting scene is a food scene, and the face detection result indicates that the preview image includes a face; the processor 210 is specifically configured to:
[0262] Determine a first flashlight and a second flashlight in the flashlight module as fill flashlights matching the food scene, wherein the focal length of the first flashlight is smaller than the focal length of the second flashlight;
[0263] In the process of controlling the camera to capture an image, controlling the first flash to perform fill light to obtain a first image;
[0264] Controlling the second flash to provide fill light, thereby obtaining a second image;
[0265] Based on the second image, adjusting the tone of the face in the first image;
[0266] The first image after the tone adjustment is determined as the captured image output.
[0267] In some embodiments, the flash module includes at least two flashes with different focal lengths, the shooting scene is a portrait scene, the face detection result indicates that the preview image includes a face, and the face detection result includes the skin color tone of each face and the size of each face detection frame corresponding to each face; the processor 210 is specifically used to:
[0268] Determine the pixel ratio of each face detection frame based on the size of each face detection frame, where the pixel ratio is the ratio of the number of pixels in the face detection frame to the total number of pixels in the preview image;
[0269] Determining a focus segment that matches the portrait scene based on at least one of the skin color tone of each face and the pixel ratio of each face detection frame;
[0270] The flash light corresponding to the focus focal length in the flash light module is determined as the fill flash light.
[0271] In some embodiments, the flash module includes a flash corresponding to a near focal length, a flash corresponding to a far focal length, and a flash corresponding to a medium focal length; the processor 210 is specifically configured to:
[0272] When the face detection result includes a face detection frame whose pixel ratio is greater than a first ratio threshold, determining the near focus segment as a focus segment matching the portrait scene;
[0273] When the pixel ratios of all face detection frames in the face detection result are less than the second ratio threshold, determining the telephoto focal length as a focus focal length that matches the portrait scene;
[0274] When the face detection result includes a face detection frame whose pixel ratio is greater than or equal to the second ratio threshold and less than or equal to the first ratio threshold, and the skin color tone of the face corresponding to the face detection frame is within the reference skin color range, the medium focal length is determined as the focus focal length that matches the portrait scene.
[0275] When the face detection result includes a face detection frame whose pixel ratio is greater than or equal to the second ratio threshold and less than or equal to the first ratio threshold, and the skin color tone of the face corresponding to the face detection frame exceeds the reference skin color range, the far focal length, medium focal length, and near focal length are determined as focus focal lengths that match the portrait scene.
[0276] It should be understood that in the embodiment of the present application, the input unit 2004 may include a graphics processor (Graphics Processing Unit, GPU) 20041 and a microphone 20042, and the graphics processor 20041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture scene or the image capture scene. The display unit 2006 may include a display panel 20061, and the display panel 20061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 2007 includes at least one of a touch panel 20071 and other input devices 20072. The touch panel 20071 is also called a touch screen. The touch panel 20071 may include two parts, a touch detection device and a touch controller. Other input devices 20072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0277] The memory 2009 can be used to store software programs and various data. The memory 2009 can mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area can store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 2009 can include a volatile memory or a non-volatile memory, or the memory x09 can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 2009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0278] The processor 2010 may include one or more processing units; optionally, the processor 2010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 2010.
[0279] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned photographing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0280] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0281] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned photographing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0282] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0283] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned photographing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0284] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0285] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0286] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A photographing method, characterized in that: include: Determine fill-in flashes in the flash module that match the shooting scene, where the number of the fill-in flashes is greater than 0; In the process of controlling the camera to capture images, the fill-in flash is controlled to perform fill-in light and output the captured images.
2. The method according to claim 1, characterized in that: The step of determining a fill flash in the flash module that matches the shooting scene includes: Detecting a face in a preview image displayed on a shooting preview interface to obtain a face detection result; Based on the face detection result, a fill flash in the flash module that matches the shooting scene is determined.
3. The method according to claim 2, characterized in that The flash module includes at least two flashes with different focal lengths, the shooting scene is a stage scene, the face detection result indicates that the preview image includes a face, and the face detection result includes the number of faces and the size and position information of a face detection frame corresponding to each face; The step of determining a fill flash in the flash module that matches the shooting scene based on the face detection result includes: Determine a pixel ratio of each face detection frame based on the size of each face detection frame, where the pixel ratio is a ratio of the number of pixels in the face detection frame to the total number of pixels in the preview image; Determine an offset distance of each face detection frame based on the position information of each face detection frame, where the offset distance is the distance between a center point of the face detection frame and a center point of the preview image; Determining a focus segment that matches the stage scene based on at least one of the number of faces, the pixel ratio of each face detection frame, and the offset distance of each face detection frame; The flash lamp in the flash lamp module corresponding to the focusing focal length is determined as the fill-light flash lamp.
4. The method according to claim 3, characterized in that The flash module includes a flash corresponding to a near focal length, a flash corresponding to a far focal length, and a flash corresponding to a medium focal length, and the number of faces=1; The determining of a focus segment matching the stage scene based on at least one of the number of faces, the pixel ratio of each face detection frame, and the offset distance of each face detection frame includes: When the pixel ratio of the face detection frame is greater than or equal to a first ratio threshold, determining the near focus segment as a focus segment matching the stage scene; When the pixel ratio of the face detection frame is less than or equal to a second ratio threshold, determining the far focal length as a focus focal length matching the stage scene; When the pixel ratio of the face detection frame is greater than the second ratio threshold and less than the first ratio threshold, the middle focal length is determined as the focus focal length matching the stage scene.
5. The method according to claim 3, characterized in that: The flash module includes a flash corresponding to a near focal length, a flash corresponding to a far focal length, and a flash corresponding to a medium focal length, and the number of faces is ≥2; The determining of a focus segment matching the stage scene based on at least one of the number of faces, the pixel ratio of each face detection frame, and the offset distance of each face detection frame includes: In a case where the face detection result includes a face detection frame whose pixel ratio is greater than a third ratio threshold and whose offset distance is less than a first distance threshold, and the difference in pixel ratio between the maximum face detection frame and the minimum face detection frame is greater than a first difference threshold, the near focal length, the middle focal length, and the far focal length are determined as focus focal lengths that match the stage scene, the maximum face detection frame refers to the face detection frame with the largest pixel ratio in the face detection result, and the minimum face detection frame refers to the face detection frame with the smallest pixel ratio in the face detection result; When the face detection result includes a face detection frame whose pixel ratio is greater than the third ratio threshold and whose offset distance is greater than or equal to the first distance threshold, and the difference in pixel ratio between the maximum face detection frame and the minimum face detection frame is greater than the first difference threshold, determining the medium focal length and the far focal length as focus focal lengths matching the stage scene; When the face detection result includes a face detection frame whose pixel ratio is greater than the third ratio threshold, and the difference in pixel ratio between the maximum face detection frame and the minimum face detection frame is less than or equal to the first difference threshold, determining the middle focal length and the near focal length as focus focal lengths matching the stage scene; When the face detection result does not include a face detection frame whose pixel ratio is greater than the third ratio threshold, the far focus segment and the near focus segment are determined as focus segments that match the stage scene.
6. The method according to any one of claims 3 to 5, characterized in that: The preview image includes light beams projected by lighting equipment in the stage scene; In the process of controlling the camera to capture an image, controlling the fill-in flash to perform fill-in light, and before outputting the captured image, the method further includes: Determining the number of light beams in the preview image; Based on the number of light beams, the current value of the fill-in flash lamp is adjusted, and the current value is positively correlated with the number of light beams.
7. The method according to claim 2, characterized in that The flash module includes at least two flashes with different focal lengths, the shooting scene is a food scene, and the face detection result indicates that the preview image does not include a face; The step of determining a fill flash in the flash module that matches the shooting scene based on the face detection result includes: Determining the number of objects in the preview image; Based on the number of photographed objects, determining a focus segment that matches the food scene; The flash lamp in the flash lamp module corresponding to the focusing focal length is determined as the fill-light flash lamp.
8. The method according to claim 7, characterized in that The flash module includes a flash corresponding to the near focal length, a flash corresponding to the far focal length, and a flash corresponding to the middle focal length; The determining, based on the number of photographed objects, a focus segment matching the food scene includes: When the number of the photographed objects is less than a first quantity threshold, determining the far focal length as a focus focal length matching the food scene; When the number of the photographed objects is greater than or equal to the first quantity threshold, the far focal length and the near focal length are determined as focus focal lengths that match the food scene.
9. The method according to claim 2, characterized in that: The flash module includes at least two flashes with different focal lengths, the shooting scene is a food scene; the face detection result indicates that the preview image includes a face; The step of determining a fill flash in the flash module that matches the shooting scene based on the face detection result includes: Determine a first flashlight and a second flashlight in the flashlight module as fill flashlights matching the food scene, wherein a focal length of the first flashlight is smaller than a focal length of the second flashlight; In the process of controlling the camera to capture an image, controlling the fill-in flash to perform fill-in light and outputting the captured image includes: In the process of controlling the camera to capture an image, controlling the first flash to perform fill light to obtain a first image; Controlling the second flash to perform fill light to obtain a second image; Based on the second image, the tone of the face in the first image is adjusted, and the first image after the tone adjustment is determined as a captured image output.
10. The method according to claim 2, characterized in that The flash module includes at least two flashes with different focal lengths, the shooting scene is a portrait scene, the face detection result indicates that the preview image includes a face, and the face detection result includes the skin color tone of each face and the size of each face detection frame corresponding to each face; The step of determining a fill flash in the flash module that matches the shooting scene based on the face detection result includes: Determine a pixel ratio of each face detection frame based on the size of each face detection frame, where the pixel ratio is a ratio of the number of pixels in the face detection frame to the total number of pixels in the preview image; Determining a focus segment matching the portrait scene based on at least one of the skin color tone of each face and the pixel ratio of each face detection frame; The flash lamp in the flash lamp module corresponding to the focusing focal length is determined as the fill-light flash lamp.
11. The method according to claim 9, characterized in that The flash module includes a flash corresponding to the near focal length, a flash corresponding to the far focal length, and a flash corresponding to the middle focal length; The determining of a focus segment matching the portrait scene based on at least one of the skin color tone of each face and the pixel ratio of each face detection frame includes: When the face detection result includes a face detection frame whose pixel ratio is greater than a first ratio threshold, determining the near focus segment as a focus segment matching the portrait scene; When the pixel proportions of all face detection frames in the face detection result are less than a second proportion threshold, determining the telephoto focal length to be a focus focal length that matches the portrait scene; When the face detection result includes a face detection frame whose pixel ratio is greater than or equal to the second ratio threshold and less than or equal to the first ratio threshold, and the skin color tone of the face corresponding to the face detection frame is within the reference skin color range, determining the middle focal length as the focus focal length matching the portrait scene; When the face detection result includes a face detection frame whose pixel ratio is greater than or equal to the second ratio threshold and less than or equal to the first ratio threshold, and the skin color tone of the face corresponding to the face detection frame exceeds the reference skin color range, the far focus segment, the middle focus segment and the near focus segment are determined as focus segments that match the portrait scene.
12. A photographing device, characterized in that: include: A processing module, used for determining fill-in flashes in the flash module that match the shooting scene, wherein the number of the fill-in flashes is greater than 0; The control module is used to control the fill-in flash to perform fill-in light and output the captured image during the process of controlling the camera to capture an image.
13. The device according to claim 12, characterized in that The processing module is specifically used for: Detecting a face in a preview image displayed on a shooting preview interface to obtain a face detection result; Based on the face detection result, a fill flash in the flash module that matches the shooting scene is determined.
14. The device according to claim 13, characterized in that The flash module includes at least two flashes with different focal lengths, the shooting scene is a stage scene, the face detection result indicates that the preview image includes a face, and the face detection result includes the number of faces and the size and position information of the face detection frame corresponding to each face, and the processing module is specifically used to: Determine a pixel ratio of each face detection frame based on the size of each face detection frame, where the pixel ratio is a ratio of the number of pixels in the face detection frame to the total number of pixels in the preview image; Determine an offset distance of each face detection frame based on the position information of each face detection frame, where the offset distance is the distance between a center point of the face detection frame and a center point of the preview image; Determining a focus segment that matches the stage scene based on at least one of the number of faces, the pixel ratio of each face detection frame, and the offset distance of each face detection frame; The flash lamp in the flash lamp module corresponding to the focusing focal length is determined as the fill-light flash lamp.
15. The device according to claim 14, characterized in that The flash module includes a flash corresponding to a near focal length, a flash corresponding to a far focal length, and a flash corresponding to a medium focal length, and the number of faces=1; The processing module is specifically used for: When the pixel ratio of the face detection frame is greater than or equal to a first ratio threshold, determining the near focus segment as a focus segment matching the stage scene; When the pixel ratio of the face detection frame is less than or equal to a second ratio threshold, determining the far focal length as a focus focal length matching the stage scene; When the pixel ratio of the face detection frame is greater than the second ratio threshold and less than the first ratio threshold, the middle focal length is determined as the focus focal length matching the stage scene.
16. The device according to claim 14, characterized in that The flash module includes a flash corresponding to a near focal length, a flash corresponding to a far focal length, and a flash corresponding to a medium focal length, and the number of faces is ≥2; The processing module is specifically used for: In a case where the face detection result includes a face detection frame whose pixel ratio is greater than a third ratio threshold and whose offset distance is less than a first distance threshold, and the difference in pixel ratio between the maximum face detection frame and the minimum face detection frame is greater than a first difference threshold, the near focal length, the middle focal length, and the far focal length are determined as focus focal lengths that match the stage scene, the maximum face detection frame refers to the face detection frame with the largest pixel ratio in the face detection result, and the minimum face detection frame refers to the face detection frame with the smallest pixel ratio in the face detection result; When the face detection result includes a face detection frame whose pixel ratio is greater than the third ratio threshold and whose offset distance is greater than or equal to the first distance threshold, and the difference in pixel ratio between the maximum face detection frame and the minimum face detection frame is greater than the first difference threshold, determining the medium focal length and the far focal length as focus focal lengths matching the stage scene; When the face detection result includes a face detection frame whose pixel ratio is greater than the third ratio threshold, and the difference in pixel ratio between the maximum face detection frame and the minimum face detection frame is less than or equal to the first difference threshold, determining the middle focal length and the near focal length as focus focal lengths matching the stage scene; When the face detection result does not include a face detection frame whose pixel ratio is greater than the third ratio threshold, the far focus segment and the near focus segment are determined as focus segments that match the stage scene.
17. The device according to any one of claims 14 to 16, characterized in that: The preview image includes a light column projected by a lighting device in a stage scene, and the device further includes: Current regulation module for: In the process of controlling the camera to capture an image, controlling the fill-in flash to perform fill-in light, and determining the number of light beams in the preview image before outputting the captured image; Based on the number of light beams, the current value of the fill-in flash lamp is adjusted, and the current value is positively correlated with the number of light beams.
18. The device according to claim 13, characterized in that The flash module includes at least two flashes with different focal lengths, the shooting scene is a food scene, and the face detection result indicates that the preview image does not include a face; The processing module is specifically used for: Determining the number of objects in the preview image; Based on the number of photographed objects, determining a focus segment that matches the food scene; The flash lamp in the flash lamp module corresponding to the focusing focal length is determined as the fill-light flash lamp.
19. The device according to claim 18, characterized in that The flash module includes a flash corresponding to the near focal length, a flash corresponding to the far focal length, and a flash corresponding to the middle focal length; The processing module is specifically used for: When the number of the photographed objects is less than a first quantity threshold, determining the far focal length as a focus focal length matching the food scene; When the number of the photographed objects is greater than or equal to the first quantity threshold, the far focal length and the near focal length are determined as focus focal lengths that match the food scene.
20. The device according to claim 13, characterized in that The flash module includes at least two flashes with different focal lengths, the shooting scene is a food scene, and the face detection result indicates that the preview image includes a face; The processing module is specifically used for: Determine a first flashlight and a second flashlight in the flashlight module as fill flashlights matching the food scene, wherein a focal length of the first flashlight is smaller than a focal length of the second flashlight; The control module is specifically used for: In the process of controlling the camera to capture an image, controlling the first flash to perform fill light to obtain a first image; Controlling the second flash to perform fill light to obtain a second image; Based on the second image, adjusting the tone of the face in the first image; The first image after adjusting the tone is determined as a captured image output.
21. The device according to claim 13, characterized in that The flash module includes at least two flashes with different focal lengths, the shooting scene is a portrait scene, the face detection result indicates that the preview image includes a face, and the face detection result includes the skin color tone of each face and the size of each face detection frame corresponding to each face; The processing module is specifically used for: Determine a pixel ratio of each face detection frame based on the size of each face detection frame, where the pixel ratio is a ratio of the number of pixels in the face detection frame to the total number of pixels in the preview image; Determining a focus segment matching the portrait scene based on at least one of the skin color tone of each face and the pixel ratio of each face detection frame; The flash lamp in the flash lamp module corresponding to the focusing focal length is determined as the fill-light flash lamp.
22. The device according to claim 21, characterized in that The flash module includes a flash corresponding to the near focal length, a flash corresponding to the far focal length, and a flash corresponding to the middle focal length; The processing module is specifically used for: When the face detection result includes a face detection frame whose pixel ratio is greater than a first ratio threshold, determining the near focus segment as a focus segment matching the portrait scene; When the pixel proportions of all face detection frames in the face detection result are less than a second proportion threshold, determining the telephoto focal length to be a focus focal length that matches the portrait scene; When the face detection result includes a face detection frame whose pixel ratio is greater than or equal to the second ratio threshold and less than or equal to the first ratio threshold, and the skin color tone of the face corresponding to the face detection frame is within the reference skin color range, determining the middle focal length as a focus focal length that matches the portrait scene; When the face detection result includes a face detection frame whose pixel ratio is greater than or equal to the second ratio threshold and less than or equal to the first ratio threshold, and the skin color tone of the face corresponding to the face detection frame exceeds the reference skin color range, the far focus segment, the middle focus segment, and the near focus segment are determined as focus segments that match the portrait scene.
23. An electronic device, characterized in that: It includes a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the photographing method according to any one of claims 1 to 11 are implemented.