Shooting method, electronic equipment and computer readable storage medium
By adjusting the focus position on the camera of the electronic device, the distance between the first face and the camera is located between the closest and the farthest face, the problem of unclear faces in multiple people's photography scenes is solved, and the effect of high clarity of each face taken by the photograph is achieved.
Patent Information
- Application Number
- CN202311584740.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2043-11-23
AI Technical Summary
In a multi-person photo scene, because each person's distance is different from the camera, some of the faces are unclear in the photo.
By acquiring the first image captured by the camera of the electronic device to the initial focus position, a plurality of faces in the first image are identified, and the camera focus to the second focus position is adjusted according to the position of the first face, so that the distance between the first face and the camera is located between the closest and the farthest face.
Ensure that in the second image taken when the shutter is pressed, each face has a high definition, which solves the problem of unclear faces in multiple scenes.
Smart Images

Figure CN120075595A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of terminals, and in particular, to a shooting method, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the development of technology, intelligent terminal devices, such as mobile phones and tablets, have become indispensable in people's lives. To meet people's needs to record daily life fragments through photos, general smartphones have the function of taking pictures.
[0003] However, in the scenario of taking pictures of multiple people, the distances of each person from the camera are inconsistent, and the focus point of the camera of a smart phone can generally only be fixed at one position. Therefore, there is a situation where the distance between the position of some faces and the position of the focus point is relatively far, resulting in the problem that the faces farther from the focus point are not clear in the photo. Summary of the Invention
[0004] In view of this, this application provides a shooting method, an electronic device, and a computer-readable storage medium, which can solve the problem that faces are not clear when taking pictures in a multi-person scenario.
[0005] In a first aspect, this application provides a shooting method, which is applied to an electronic device. The method includes: obtaining a first image collected by the camera of the electronic device focused on a first focus position; the first image includes multiple faces; based on the position of a first face in the first image, controlling the camera to focus on a second focus position, where the second focus position corresponds to the position of the first face in the first image, and the distance between the first face and the camera is between the face closest to the camera and the face farthest from the camera; in response to an operation of pressing the shutter, obtaining a second image; the second image is collected by the camera focused on the second focus position.
[0006] In some examples, in the scenario of taking a group photo of multiple people, in order for everyone to appear in the picture taken by the camera, an interleaved arrangement method is generally adopted. After the camera of the electronic device completes focusing, due to the relatively long distance between the face and the focus point, the faces in the first image are not clear. Therefore, the electronic device can determine a suitable second focus position based on the information in the first image, so that the camera focuses between the position of the face farthest from the camera and the position of the face closest to the camera, thereby ensuring that in the second image obtained when the shutter is pressed, the clarity of each face is relatively high.
[0007] Among them, during the focusing process of the camera, the electronic device generally selects a specific object. For example, in a portrait scenario, the face is generally selected as the specific focusing object. Another example is that in a landscape shooting scenario, objects to be photographed with obvious outlines such as trees, flowers, and stones are generally selected as the focusing objects. Therefore, when determining the second focusing position, the electronic device can determine the second focusing position based on the first face between the face closest to the camera and the face farthest from the camera in the first image, so as to ensure that after the camera completes focusing based on the second focusing position, a second image including a clearer face can be captured.
[0008] In a possible implementation manner of the first aspect, the method further includes: processing the second image to obtain a photo.
[0009] By processing the second image captured by the camera of the electronic device at the second focusing position, a photo that the user can view can be obtained. In some examples, the second image is an original image, and through the processing of the electronic device, the original image can be processed into an image that the user can view.
[0010] In a possible implementation manner of the first aspect, the first focusing position corresponds to the face closest to the camera. For example, when the electronic device can detect the distance between the camera and the face, the electronic device can directly select the first focusing position on the face closest to the camera. Another example is that when the electronic device cannot detect the distance between the camera and the face, the electronic device can judge the face closest to the camera according to the size of the face area. The face area corresponding to the face closest to the camera is the largest, and vice versa, it is smaller.
[0011] In another possible implementation manner, the first focusing position can also correspond to the face farthest from the camera.
[0012] In a possible implementation manner of the first aspect, it further includes: detecting multiple second faces in the first image and calculating the clarity of each second face; determining the first face from the multiple second faces according to the clarity of each second face.
[0013] When the first image is captured at the first focusing position, it can be determined that the clarity of the face near the first focusing position is the highest. Therefore, the positions of other faces can be inferred based on the clarity. When the first focusing position corresponds to the face closest to the camera, the electronic device can consider that the closer the face is to the camera, the clearer the face area corresponding to the face. Therefore, based on the clarity of the face, the first face can be determined, and then the second focusing position can be determined based on the first face.
[0014] In a possible implementation of the first aspect, determining a first face from multiple second faces according to the clarity of each second face includes:
[0015] Regarding a second face among the multiple second faces whose clarity meets a first condition as the first face, the first condition includes at least one of the following conditions: the clarity is within a first interval; the clarity is the clarity with a median value among the multiple clarities corresponding to the multiple second faces; the clarity is the clarity other than a first clarity and a second clarity among the multiple clarities corresponding to the multiple second faces.
[0016] When a first image is captured at a first focusing position, the electronic device can consider that the closer the distance between the face and the camera is, the clearer the face area corresponding to the face is. Therefore, the first face can be determined based on the clarity of the face, and then the second focusing position can be determined based on the first face. The above first condition can ensure that the distance between the first face determined by the electronic device and the camera is between the face closest to the camera and the face farthest from the camera, thereby ensuring that the camera can capture a second image with higher clarity.
[0017] In a possible implementation of the first aspect, processing the second image includes: processing the second image according to an image processing network model; the image processing network model is trained based on multiple third images and multiple fourth images. Each third image includes multiple faces, and the clarity of the third face in each third image is greater than a first preset threshold, and the clarity of the faces other than the third face in the third image is less than or equal to the first preset threshold, and the distance between the third face and the camera is between the face closest to the camera and the face farthest from the camera; each fourth image includes the same faces as those in the third image, and the clarity of each face in the fourth image is greater than a second preset threshold.
[0018] In a possible implementation of the first aspect, the third image is obtained by degrading the fourth image.
[0019] Among them, the clarity of each face in the fourth image is relatively high. The third image obtained by performing image degradation processing on the fourth image is similar to the second image in that the face corresponding to the focusing position is the clearest.
[0020] Image degradation refers to the decline in the quality of an image. The forms that cause image degradation generally include blurring, distortion, noise, etc. By obtaining the third image through image degradation processing of the fourth image, the second image captured by the electronic device at the second focusing position can be simulated. And the clarity of each face in the fourth image is relatively high. In this way, the image processing network model can be trained to be able to repair the blurred face in the image, thereby ensuring the clarity of the image.
[0021] In a possible implementation of the first aspect, processing the second image includes: sharpening the face in the second image.
[0022] Sharpening the face in the second image can make the details in the face more prominent, thus making the image of the face clearer.
[0023] In a possible implementation of the first aspect, sharpening the face in the second image includes: determining a fifth face in the second image, where the sharpness of the fifth face is less than a third preset threshold; and sharpening the fifth face.
[0024] In a possible implementation of the first aspect, controlling the camera to focus on a second focus position includes: looking up the second focus position in the stored mapping relationship, where the mapping relationship includes the position in the image and the focus position corresponding to the position in the corresponding image; the position in the image includes the position of the first face; and controlling the focus point of the camera to switch from the first focus position to the second focus position.
[0025] In a possible implementation of the first aspect, the camera is an autofocus (AF) camera.
[0026] In a possible implementation of the first aspect, the camera is a front camera.
[0027] In a second aspect, the present application provides an electronic device, which includes a display screen, a memory, and one or more processors; the display screen, the memory, and the processor are coupled; the display screen is used to display the image generated by the processor, the memory is used to store computer program code, and the computer program code includes computer instructions; when the processor executes the computer instructions, the electronic device is caused to perform: obtaining a first image captured by the camera of the electronic device focused on a first focus position; the first image includes multiple faces; based on the position of the first face in the first image, controlling the camera to focus on a second focus position, where the second focus position corresponds to the position of the first face in the first image, and the distance between the first face and the camera is between the face closest to the camera and the face farthest from the camera; in response to an operation of pressing the shutter, obtaining a second image; the second image is captured by the camera focused on the second focus position.
[0028] When the processor executes the computer instructions, the electronic device is further caused to perform: processing the second image to obtain a photo.
[0029] When the processor executes the computer instructions, the electronic device is further caused to perform: detecting multiple second faces in the first image, and calculating the sharpness of each second face; and determining the first face from the multiple second faces according to the sharpness of each second face.
[0030] When the processor executes computer instructions, it also causes the electronic device to perform: using a second face among multiple second faces whose clarity meets a first condition as a first face, where the first condition includes at least one of the following conditions: the clarity is within a first interval; the clarity is the clarity with a median value among the multiple clarities corresponding to the multiple second faces; the clarity is the clarity other than a first clarity and a second clarity among the multiple clarities corresponding to the multiple second faces.
[0031] When the processor executes computer instructions, it also causes the electronic device to perform: processing a second image according to an image processing network model; the image processing network model is trained based on multiple third images and multiple fourth images, each third image includes multiple human faces, and the clarity of the third human face in each third image is greater than a first preset threshold, the clarity of the human faces other than the third human face in the third image is less than or equal to the first preset threshold, and the distance between the third human face and the camera is between the human face closest to the camera and the human face farthest from the camera; each fourth image includes the same human faces as those in the third image, and the clarity of each human face in the fourth image is greater than a second preset threshold.
[0032] When the processor executes computer instructions, it also causes the electronic device to perform: sharpening the human face in the second image.
[0033] When the processor executes computer instructions, it also causes the electronic device to perform: determining a fifth human face in the second image, where the clarity of the fifth human face is less than a third preset threshold; and sharpening the fifth human face.
[0034] When the processor executes computer instructions, it also causes the electronic device to perform: searching for a second focusing position in a stored mapping relationship, where the mapping relationship includes positions in an image and corresponding focusing positions for the positions in the corresponding image; the positions in the image include the position of the first face; and controlling the focus point of the camera to switch from a first focusing position to the second focusing position.
[0035] In a third aspect, the present application provides a computer-readable storage medium, including computer instructions, which when running on an electronic device, cause the electronic device to perform the methods described in the above second aspect, third aspect, and any possible design thereof.
[0036] In a fourth aspect, the present application provides a computer program product, which when running on an electronic device, causes the electronic device to perform the methods described in the above second aspect, third aspect, and any possible design thereof.
[0037] Fifth aspect, the present application provides a device, which is included in an electronic device and has the function of implementing the behavior of the electronic device in any of the methods in the above aspects and possible implementation manners. This function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes at least one module or unit corresponding to the above function. For example, an allocation module or unit, a scanning module or unit, a recycling module or unit, a moving module or unit, a storage module or unit, etc.
[0038] Sixth aspect, an embodiment of the present application provides a chip system, which includes a processor and may further include a memory for implementing any of the methods provided in the above third aspect to fifth aspect. The chip system may be composed of chips or may include chips and other discrete devices.
[0039] It can be understood that the electronic device described in the second aspect and any of its possible design manners provided above, the computer-readable storage medium described in the third aspect, and the computer program product described in the fourth aspect are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of a group photo scene provided by an embodiment of the present application;
[0041] Figure 2 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application;
[0042] Figure 3 A schematic diagram of the software and hardware structure of an electronic device provided by an embodiment of the present application;
[0043] Figure 4 A schematic flowchart of a shooting method provided by an embodiment of the present application;
[0044] Figure 5 A schematic diagram of a shooting method provided by an embodiment of the present application;
[0045] Figure 6 A schematic diagram of the clarity range of shooting provided by an embodiment of the present application;
[0046] Figure 7 A schematic diagram of the data stream transmission of a shooting method provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] Hereinafter, the terms "first" and "second" are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of this embodiment, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, or B exists alone, where A and B may be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one (item)" or similar expressions thereof refer to any combination of these items, including any combination of single items or plural items. For example, at least one (item) of a, b, or c may represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c may be single or multiple.
[0048] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to give examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in this application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.
[0049] Before introducing the embodiments of this application, the technologies related to the embodiments of this application will be introduced in detail first.
[0050] 1. Camera, lens
[0051] A camera includes a lens and a photosensitive element. The lens is a lens structure composed of several lenses, and its main function is to focus the reflected light of the object to be photographed on the photosensitive element of the camera. After that, the photosensitive element converts the optical signal into an electrical signal, and a photo including the object to be photographed can be obtained.
[0052] 2. Focusing
[0053] The focusing process can determine the clarity of the object to be photographed in the photo. The principle of focusing is to adjust the distance between the lens and the photosensitive element in the camera so that the image plane where the object to be photographed is located coincides with the image plane of the photosensitive element, thereby achieving a clear effect.
[0054] Generally, when the object to be photographed is at the focus point, the image of the object to be photographed in the taken photo is the clearest.
[0055] 3. Depth of field
[0056] There is a range from a certain point in front of the plane where the focus point is located to a certain point behind it. The scenery within this range can form clear images, and this range is called the depth of field.
[0057] In the scenario of a group photo, the positions where each person stands are different. That is to say, the distance between each person and the camera is different. As Figure 1 shown, in the scenario where user A holds a mobile phone to take a group photo with user B and user C, the distance between user A and the camera is the closest, the distance between user B and the camera is the second closest, and the distance between user C and the camera is the farthest.
[0058] Since during the process of automatic focusing of the camera in the related art, it will automatically focus on the face closest to the lens. Therefore, after user A presses the shutter to take a photo, a photo as Figure 1 shown will be obtained. It can be seen from the photo displayed on the mobile phone display screen in Figure 1 that the portrait of user A, who is the closest to the camera, is clear, while the portraits of user B and user C are not clear.
[0059] To solve the problem of unclear portraits that occur in the scenario of a group photo, the embodiments of the present application provide a shooting method. The electronic device can determine the focusing position of the camera by analyzing the preview photo captured by the camera before taking a photo, so as to reduce the blurriness of the portraits that are far from the focus point. Then, when the user presses the shutter, the electronic device obtains the photo corresponding to the focus point and further repairs the photo to obtain a photo including multiple clear portraits. In this way, it is possible to take a photo including multiple clear portraits in the scenario of a group photo.
[0060] To better understand the embodiments of the present application, first, the electronic device provided by the embodiments of the present application will be introduced. The shooting method provided by the embodiments of the present application can be applied to an electronic device. For example, the electronic device can specifically be a smart phone, a tablet computer, a smart screen, a laptop computer, a wearable device (such as a smart watch), an ultra-mobile personal computer (UMPC), a personal digital assistant (PDA), an artificial intelligence device, etc., which are electronic devices with a shooting function. The embodiments of the present application do not limit the specific type of the electronic device and the operating system installed on it.
[0061] Next, the hardware structure of the electronic device will be introduced.
[0062] As Figure 2As shown in the figure, it is a schematic structural diagram of an electronic device provided by an embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0063] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0064] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller may generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0065] The memory set in the processor 110 is used to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use this instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0066] The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to implement the storage capacity expansion of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.
[0067] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.). In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0068] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0069] The charging management module 140 is used to receive a charging input from a charger. Among them, the charger can be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
[0070] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives inputs from the battery 142 and / or the charging management module 140 and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, the wireless communication module 160, etc. In some embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
[0071] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc. In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technologies.
[0072] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example: the antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0073] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
[0074] The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 150 may be provided in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be provided in the same device.
[0075] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), infrared (IR), etc.
[0076] The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive the signals to be sent from the processor 110, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 for radiation.
[0077] The electronic device 100 realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to execute mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change the display information.
[0078] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0079] The electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.
[0080] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light passes through the lens and is transmitted to the camera photosensitive element. The optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize parameters such as the exposure and color temperature of the shooting scene. In some embodiments, the ISP may be provided in the camera 193.
[0081] The camera 193 is used to capture static images or videos. An object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard format such as RGB or YUV. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0082] The lens in the camera 193 is equivalent to a convex lens as a whole and is essentially composed of several lenses.
[0083] The camera 193 also includes a focusing motor. The focusing motor can push the entire lens to move its position, thereby controlling the image distance to adjust the clarity of the image.
[0084] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0085] The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple coding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0086] The NPU is a neural-network (NN) computing processor. By learning from the biological neural network structure, such as learning from the transmission mode between human brain neurons, it can quickly process the input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as: image recognition, image processing, face recognition, speech recognition, text understanding, etc.
[0087] The electronic device 100 can implement audio functions through the audio module 170, speaker, receiver, microphone, headphone jack, and application processor, etc. Such as music playback, recording, etc.
[0088] The sensor module 180 may include a pressure sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc. The electronic device may collect various data through the sensor module 180.
[0089] The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys or touch keys. The motor 191 may generate a vibration prompt. The motor 191 may be used for an incoming call vibration prompt or for a touch vibration feedback. The indicator 192 may be an indicator light, which may be used to indicate a charging state, a power change, or may also be used to indicate a message, a missed call, a notification, etc. The SIM card interface 195 is used to connect a SIM card. The SIM card may be in contact with and separated from the electronic device 100 by being inserted into or removed from the SIM card interface 195. The electronic device 100 may support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. Multiple cards may be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards may be the same or different.
[0090] It can be understood that the interface connection relationship between the modules in the embodiments of the present invention is only for illustrative purposes and does not constitute a structural limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer modules than those provided in the above embodiments, and different interface connection methods or a combination of multiple interface connection methods may also be adopted between the various modules.
[0091] The software system of the above electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present invention, taking the layered architecture as an example, the software structure of the electronic device 100 is exemplarily described.
[0092] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, Figure 3 is a block diagram of the software and hardware structure of the electronic device 100 in the embodiments of the present invention. The software and hardware structure of the electronic device includes an application layer, an application framework layer, a hardware abstraction layer, a kernel layer, and a hardware layer.
[0093] It should be noted that in other operating systems, as long as the functions implemented by each functional module are similar to those in the embodiments of the present application, the solution of the present application can also be implemented.
[0094] The application layer may include a series of application program packages. Such as Figure 3As shown, the application package may include applications such as a camera, a gallery, and a call application.
[0095] The camera application can provide the function of taking photos or videos. Photos or videos taken by the camera application can be viewed through the gallery.
[0096] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions. For example, Figure 3 As shown, the application framework layer may include a camera service.
[0097] The camera service is used to provide a camera service interface for the camera application. For example, the camera application can set shooting parameters, start / stop preview, take pictures, etc. through the camera service. The camera service can isolate the applications in the application layer from the underlying implementation, thus facilitating the development and transplantation of applications and the underlying hardware. For example, when a third-party software vendor's camera software is installed in the electronic device, the shooting function can also be implemented through the camera service.
[0098] The hardware abstraction layer is used to abstract the hardware. For example, the hardware abstraction layer may include a camera abstraction layer and other hardware device abstraction layers. The camera abstraction layer may include a camera device and a camera algorithm library.
[0099] The camera device provides an interface for the camera service to call the camera driver.
[0100] The camera algorithm library may include algorithm instructions such as camera algorithms and image algorithms. The camera algorithm library can also execute the steps in the shooting method provided in the embodiments of the present application. For example, the camera algorithm library can obtain the preview photos captured by the camera and determine the focus position of the camera based on the clarity of the preview photos. Then, when the user presses the shutter, the camera algorithm library can process the photos obtained when the shutter is pressed to obtain photos including multiple clear portraits.
[0101] The kernel layer is the layer between the hardware and the software. The kernel layer at least includes a camera driver.
[0102] The camera driver can drive the photosensitive element to start converting the optical signal into an electrical signal. The camera driver can drive the focus motor to move the lens, thereby changing the position of the focus point.
[0103] Regarding each hardware module in the hardware layer, reference can be made to the relevant descriptions in the foregoing Figure 2 and will not be elaborated here.
[0104] In the software architecture of the above-mentioned electronic device, the application layer needs to call the services provided by the application framework layer, the application framework layer needs to call the functions provided by the core system library layer, and the core system library layer needs to call the services provided by the operating system kernel layer. Each part jointly provides users with a perfect experience of using the electronic device.
[0105] The following will describe the shooting method provided by the embodiments of the present application with reference to the accompanying drawings.
[0106] As Figure 4 shown, the shooting method provided by the embodiments of the present application includes the following steps:
[0107] Step S401, in response to the startup of the camera application, obtain a preview image.
[0108] After the camera application is started, the camera of the electronic device starts to capture a preview image (i.e., the aforementioned "first image") and displays the captured preview image on the display screen of the electronic device in real time for the user to preview.
[0109] In some examples, in response to the startup of the camera application and when the camera application is in the selfie mode, the electronic device obtains a preview image through the front camera.
[0110] In some embodiments, when obtaining the preview image, the electronic device may calculate the clarity of the image captured by the current camera, and when the clarity of the image captured by the current camera is greater than a preset clarity threshold, use the image captured by the current camera as the preview image.
[0111] In some examples, the electronic device may also determine the clarity of the image captured by the current camera based on the jitter amount information transmitted by the gyroscope sensor. For example, the smaller the jitter amount, the clearer the image. Therefore, when the jitter amount is less than a preset jitter amount threshold, use the image captured by the current camera as the preview image.
[0112] Step S402, determine the focus position based on the clarity of all human faces in the preview image.
[0113] In some embodiments, in the related art, since it is default in the related art that the front camera of an electronic device is only activated in the scenario of user selfies and the cost of a fixed focus (FF) camera is relatively low, the front camera of a smartphone in the related art is an FF camera. However, an FF camera cannot capture a clear image when shooting a moving object. Therefore, in order to meet the user's requirement of using the front camera to shoot a moving object, the shooting method provided by the embodiments of the present application is applied to an electronic device equipped with an auto focus (AF) camera. The electronic device equipped with an AF camera can quickly complete focusing when shooting a moving object, so that the captured photo by the electronic device includes a clear image of the moving object.
[0114] It can be understood that the moving object mentioned in the above embodiments may be an object that moves relative to the electronic device. For example, taking the ground as a reference system, when the face does not move but the mobile phone shakes, the face is also regarded as a moving object.
[0115] During the auto-focusing process of the AF camera, it will automatically focus on the face closest to the lens (i.e., the aforementioned "first focusing position"). As Figure 5 shown, since user A is the closest to the camera, in the preview stream captured by the electronic device during the selfie process, the area of the face region of user A can be detected to be the largest. Therefore, the camera will focus on the face of user A. At this time, the face region 1 corresponding to user A in the preview image is the clearest. And the distance between user B and the camera is closer than the distance between user C and the camera. Therefore, the face region 2 corresponding to user B in the preview image is clearer than the face region 3 corresponding to user C.
[0116] In some embodiments, the electronic device can first determine the positions and sharpness of multiple faces (i.e., the aforementioned "first faces") in the preview image, sort all the faces according to the sharpness, so as to obtain a face sequence. Then, the electronic device can determine the focusing position based on the position of the face at a preset position in the face sequence.
[0117] In some examples, for the group photo preview image as Figure 5 shown, when the electronic device sorts all the faces from the largest to the smallest sharpness, the following face sequence can be obtained: user A, user B, user C. The electronic device can use the face with the sharpness in the middle position (the value of the sharpness is in the middle) as the face for determining the focusing position (i.e., the aforementioned "second face").
[0118] When the preset position is the middle position, the electronic device can determine that User B is in the middle position of the face sequence. Then, the electronic device can determine the focus position (i.e., the aforementioned "second focus position") based on the face position of User B. Specifically, since the image is a two-dimensional plane, the face position of User B is the coordinate position in the image. The electronic device stores the correspondence (mapping relationship) between the focus position and the coordinate position in the image. Therefore, after learning the coordinate position in the image, the electronic device can find the focus position based on the correspondence. For example, the correspondence includes: the coordinate position (x1, y1) of the image corresponds to the focus position code1, the coordinate position (x2, y2) of the image corresponds to the focus position code3, and the coordinate position (x3, y3) of the image corresponds to the focus position code3. Then, if the coordinate position of User B in the above example is (x3, y3), the electronic device can determine that the focus position is code3.
[0119] In the above example, after determining the focus position based on the face position of User B, it can be ensured that the face of User B is the clearest in the photo. As Figure 6 shown, the clarity of the user's face at the focus position is the highest, and the farther away from the focus position, the more blurred the corresponding image. Therefore, when the face position of User B is determined as the focus point, it can be ensured that the blurriness of both User A and User C is at a relatively small level. On the contrary, when the focus point is automatically focused on the face position of User A, the blurriness of User B is at a relatively small level, while the blurriness of User C is at a relatively large level, and the blurriness of B and C increases in turn. Thus, through the above embodiments, the blurriness of the portrait farther away from the focus point can be reduced, and the clarity of all portraits can be ensured to be at a relatively high level.
[0120] In some embodiments, it is possible to select the face corresponding to the clarity whose clarity value is in the preset interval (i.e., the aforementioned "first interval") in the sequence of the clarity rankings of all faces. For example, when the clarity is sorted from large to small and the preset interval is 45% to 55%, in the case of a preview image of a group photo of four people, namely User D, User E, User F, and User G, the electronic device can sort all faces from large to small in terms of clarity to obtain the following face sequence: User D, User E, User F, and User G.
[0121] The ranking of the face clarity corresponding to User E is in the 2 / 4 = 50% position in this sequence. Therefore, the face clarity corresponding to User E is within the preset interval. Using the same method to calculate, the rankings of the face clarities of other users are not within the preset interval. Therefore, the electronic device can select the face corresponding to User E as the face for the focus position.
[0122] Among them, if there are multiple faces corresponding to the sharpness within the preset interval, for example, the electronic device determines that the sharpness of the face of user H and the sharpness of the face of user I are both within the preset interval, the electronic device can choose to determine the focusing position based on the position of the face of user H, or the electronic device can also choose to determine the focusing position based on the position of the face of user I.
[0123] In some embodiments, the sharpness is the sharpness other than the first sharpness and the second sharpness among the multiple sharpness corresponding to the multiple second faces. Among them, when the electronic device focuses on the position closest to the camera (the first focusing position), the first sharpness can be the highest value of the sharpness among the multiple second faces, and the second sharpness can be the lowest value of the sharpness among the multiple second faces. Optionally, the first sharpness can be the lowest value of the sharpness among the multiple second faces, and the second sharpness can be the highest value of the sharpness among the multiple second faces. The first sharpness and the second sharpness are respectively the sharpness with the highest value and the sharpness with the lowest value among the second faces. The specific values of the first sharpness and the second sharpness can actually be selected according to different applications, and the embodiments of the present application do not limit this.
[0124] In some embodiments, the electronic device can calculate the sharpness of the face by using the Sobel operator, the Tenengrad gradient method, the Laplacian operator, and the sum of modulus of gray difference (SMD) method. The specific calculation process can refer to the related technology and will not be elaborated here too much.
[0125] In some embodiments, the electronic device can detect the position of the face in the preview image through face detection technology to obtain Figure 5 the face area as shown. After that, the electronic device can calculate the sharpness of the image in the face area as the face sharpness.
[0126] In some embodiments, when the electronic device can measure the distance between the face and the camera, the electronic device can select, from all the faces, the faces whose focusing positions are between the face closest to the camera and the face farthest from the camera.
[0127] In some embodiments, the electronic device can also determine the distance between the face and the camera through the area size of the face. For example, the closer the face is to the camera, the larger the area of the face.
[0128] Based on the above embodiments, when the electronic device detects the position of the face in the preview image through face detection technology, it can also detect the number of faces.
[0129] In one case, when there is only one face in the preview image, the electronic device can automatically focus on that face. At this time, there is no problem of face blurring. Therefore, the electronic device can skip step S403 and directly execute step S404 and step S405.
[0130] In another case, when the electronic device detects more than one face in the preview image through face detection technology, that is, when the number of faces is greater than 1, since autofocus will focus the focus point on one of the faces, the other faces may be blurred. That is to say, there is a problem of face blurring at this time. Therefore, the electronic device can calculate the sharpness of all faces in the preview image and determine the focus position, and then continue to execute the following step S403.
[0131] Step S403: Control the camera to focus on the focus position.
[0132] As in the above example, when the electronic device determines the focus position, it can control the lens of the camera to move to the corresponding position to achieve focusing at the focus position.
[0133] In some embodiments, as Figure 5 shown, after controlling the camera to focus on the focus position, it can be seen that the face area 2 changes from blurred to clear, while the face area 1 changes from clear to blurred. Compared with using the face area 1 as the focus, using the face area 2 as the focus, the blurriness of the face area 3 is reduced.
[0134] Step S404: In response to the operation of pressing the shutter, obtain the captured image (i.e., the aforementioned "second image").
[0135] Optionally, the electronic device can also execute the following step S405:
[0136] Step S405: Input the captured image into the image processing network to obtain a photo.
[0137] In some embodiments, after controlling the camera to focus on the focus position, in response to the user pressing the shutter, the electronic device can obtain the captured image obtained by converting the optical signal into an electrical signal by the photosensitive element at this time. This captured image is the original image and is also called the digital negative. Therefore, the captured device can be input into the image processing network, and after being processed by the image processing network, a photo can be obtained.
[0138] Among them, the training data of the image processing network can be the original image and the processed image obtained by processing the original image through dead pixel correction, noise reduction, color interpolation, automatic white balance, color correction, etc. In this way, after the captured image is input into the image processing network, a processed photo can be obtained.
[0139] In some embodiments, when the captured image is the original image, after the electronic device executes step S404, the captured image can also be input to an image processor of the related art to obtain a photo that can be viewed by the user. The image processor of the related art can process the original image and perform image processing such as dead pixel correction, noise reduction, color interpolation, automatic white balance, and color correction.
[0140] In some embodiments, according to the above example, when the focus point is focused on the face of user B, if the faces of user A and user C are both within the depth of field range of the current focus point position, although the captured image obtained at this time is not the clearest, it is within the clear range visible to the human eye. Therefore, it can be considered that the portraits of user A, user B, and user C are all clear. At this time, a captured image including clear faces can be directly obtained. However, when the focus point is focused on the face of user B, and the faces of user A and user C are not within the depth of field range of the current focus point position, the captured image obtained at this time is blurred as visible to the human eye.
[0141] Therefore, in order to ensure that the image processing network can process the original image and obtain a clear output image, a group photo of multiple people with each face clear (i.e., the aforementioned "fourth image", and the "group photo of multiple people with each face clear" is "the clarity of each face in the fourth image is greater than the second preset threshold"), and a group photo of multiple people with the faces closest and farthest from the lens being the most blurred and the face at a moderate position from the lens being the clearest (i.e., the aforementioned "third image", and the "group photo of multiple people with the faces closest and farthest from the lens being the most blurred and the face at a moderate position from the lens being the clearest" is "the clarity of the third face in each third image is greater than the first preset threshold, the clarity of the faces other than the third face in the third image is less than or equal to the first preset threshold, and the distance between the third face and the camera is between the face closest to the camera and the face farthest from the camera") can be used as training data to train the image processing network.
[0142] Among them, the group photo of multiple people with each face clear can be captured by a single-lens reflex camera, and all the portraits are within the depth of field range. Therefore, the faces of all people in this group photo can be regarded as clear. The group photo of multiple people with the faces closest and farthest from the lens being the most blurred and the face at a moderate position from the lens being the clearest (an example of the third image) can be obtained by degrading the group photo of multiple people with each face clear (an example of the fourth image).
[0143] Among them, degradation refers to reducing the image quality of the original image through some means to obtain a low-quality image. The forms that cause image degradation generally include blurring, distortion, noise, etc. Therefore, the image can be degraded by increasing the blurring degree of the image, adding noise to the image, etc. There are many ways to process image degradation in related technologies, which will not be listed one by one here.
[0144] In some embodiments, the electronic device can also perform a sharpening process on a group photo captured by a single-lens reflex camera and in which all the portraits are within the depth of field, so as to highlight the details in the group photo, further improve the clarity of the group photo, and ensure the clarity of the output image of the image processing network after training.
[0145] Among them, the sharpening method can adopt the unsharp masking method, laplacian sharpening, etc. For the above sharpening methods, reference can be made to related technologies specifically, which will not be elaborated here.
[0146] In some other embodiments, when there are unclear faces in the image captured by the single-lens reflex camera, the electronic device can first process the captured image to obtain an image in which each face is clear (i.e., the aforementioned "fourth image"), and then perform an image degradation process on the clear image to obtain an image in which the faces closest to and farthest from the lens are the most blurred and the faces at a moderate position from the lens are the clearest (i.e., the aforementioned "third image").
[0147] In this way, after the captured image is processed by the image processing network, the blurred faces that may still exist in the image can be repaired to obtain a photo with higher clarity.
[0148] In some embodiments, the image processing network can be pre-trained before the electronic device leaves the factory, and the image processing network is stored in the electronic device before the electronic device leaves the factory. Optionally, the electronic device can update the image processing network by means of system update.
[0149] In some embodiments, the electronic device can also perform post-processing on the captured image obtained in step S404. For example, the captured image is sharpened so that the details in the captured image obtained in step S404 are more prominent, thereby obtaining a clearer effect.
[0150] In some examples, the electronic device can first determine the clarity of each face in the captured image, and then perform a sharpening process on the image of the face (i.e., the aforementioned "fifth face") whose clarity is less than the preset face clarity threshold to improve the clarity of the face.
[0151] In some other examples, after the electronic device determines the clarity of each face, different degrees of sharpening processing can be performed according to the clarity of each face. Among them, the relationship between the sharpening degree and the clarity of the face is an inverse proportional relationship, that is, the higher the clarity of the image, the smaller the sharpening degree, and vice versa, the lower the clarity of the image, the higher the sharpening degree.
[0152] In some embodiments, the electronic device can also perform post-processing on the photo obtained in step S405. For the specific post-processing, reference can be made to the above embodiments, which will not be elaborated here.
[0153] By using the shooting method of the above embodiments, the electronic device can determine a suitable focusing position in the scenario of a group photo of users, thereby reducing the blurriness of each face image. Then, by processing the image captured after pressing the shutter based on the image processing network, a group photo with clear faces of each person can be obtained.
[0154] The following is a schematic diagram of the data stream transmission of a shooting method provided by an embodiment of the present application.
[0155] As Figure 7 shown, the system architecture of the electronic device includes an application layer, a framework layer, a hardware abstraction layer, a kernel layer, and a hardware layer. For the specific modules included in each layer and the specific functions of each module, reference can be made to the above related Figure 3 introductions, which will not be elaborated here.
[0156] When the user clicks on the camera application installed in the electronic device, the electronic device responds to the user's click operation and starts the camera application. In the camera application, if it is detected that the user has selected the self-timer mode, the camera application will send an instruction to the camera algorithm library through the camera service, so that the camera algorithm library can start to obtain the preview image.
[0157] When the camera application is in the self-timer mode, the photosensitive element of the front camera starts to capture images. The images captured in real time by the photosensitive element are simply processed by the image signal processor and then sent to the camera application through the camera driver, the camera device, and the camera service in sequence. The camera application displays the received images in real time on the display interface of the electronic device to provide a preview screen for the user.
[0158] The camera algorithm library can obtain the image used to provide the preview screen for the user at the camera device and determine the preview image from it.
[0159] The camera algorithm library can determine the focus position based on the sharpness of all human faces in the preview image and send a focus instruction to the camera driver, so that the camera driver can drive the focus motor to move the lens to the position corresponding to the focus instruction (i.e., the aforementioned "second focus position"), thereby controlling the camera to focus on the focus position determined by the camera algorithm library.
[0160] After the user clicks the shutter displayed on the electronic device, the camera algorithm library can obtain the operation of the user clicking the shutter through the camera service. In response to the operation of the user clicking the shutter, the camera algorithm library can obtain the captured image captured by the photosensitive element through the image signal processor and the camera driver, and process the captured image captured by the photosensitive element based on a pre-set image processing network to obtain a clear photo. Then, the camera algorithm library can send the obtained clear photo to the gallery through the camera service.
[0161] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions run on the above-mentioned electronic device, the electronic device is enabled to execute each function or step in the above-mentioned method embodiment.
[0162] An embodiment of the present application also provides a computer program product, including a computer program. When the computer program runs on an electronic device, the electronic device is enabled to execute each function or step in the above-mentioned method embodiment.
[0163] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0164] In several embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.
[0165] The unit described as a separation component may or may not be physically separated. The component displayed as a unit may be a physical unit or multiple physical units, that is, it may be located in one place or distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0166] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0167] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read only memory (ROM), random access memory (RAM), magnetic disks, or optical discs and other various media that can store program codes.
[0168] The above content is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A shooting method, characterized in that, applied to an electronic device, comprising: Obtaining a first image captured by the camera of the electronic device focused on a first focus position; multiple human faces are included in the first image; Based on the position of the first human face in the first image, controlling the camera to focus on a second focus position, the second focus position corresponding to the position of the first human face in the first image, and the distance between the first human face and the camera being between the human face closest to the camera and the human face farthest from the camera; In response to the operation of pressing the shutter, obtaining a second image; the second image is captured by the camera focused on the second focus position.
2. The method according to claim 1, characterized in that, The first focus position corresponds to the human face closest to the camera.
3. The method according to claim 1 or 2, characterized in that, The method further comprises: Processing the second image to obtain a photo.
4. The method according to claim 3, characterized in that, Further comprising: Detecting multiple second human faces in the first image and calculating the clarity of each second human face; Determining the first human face from the multiple second human faces according to the clarity of each second human face.
5. The method according to claim 4, characterized in that, Determining the first human face from the multiple second human faces according to the clarity of each second human face includes: Regarding the second human face among the multiple second human faces whose clarity meets the first condition as the first human face, the first condition includes at least one of the following conditions: the clarity is within the first interval; the clarity is the clarity that is the middle value among the multiple clarities corresponding to the multiple second human faces; the clarity is the clarity other than the first clarity and the second clarity among the multiple clarities corresponding to the multiple second human faces.
6. The method according to any one of claims 3-5, characterized in that, The processing of the second image includes: Processing the second image according to an image processing network model; The image processing network model is trained based on multiple third images and multiple fourth images. Each third image includes multiple human faces, and the clarity of the third human face in each third image is greater than a first preset threshold, the clarity of the human faces other than the third human face in the third image is less than or equal to the first preset threshold, and the distance between the third human face and the camera is between the human face closest to the camera and the human face farthest from the camera; each fourth image includes the same human faces as those in the third image, and the clarity of each human face in the fourth image is greater than a second preset threshold.
7. The method according to claim 6, characterized in that, The third image is obtained by degrading the fourth image.
8. The method according to any one of claims 3-7, characterized in that, The processing of the second image includes: Sharpening the human face in the second image.
9. The method according to claim 8, characterized in that, Sharpen the human face in the second image, including: Determine a fifth human face in the second image, where the sharpness of the fifth human face is less than a third preset threshold; Sharpen the fifth human face.
10. The method according to any one of claims 1-9, wherein, The controlling the camera to focus on the second focusing position includes: Search for the second focusing position in the stored mapping relationship, where the mapping relationship includes positions in the image and corresponding focusing positions for the positions in the corresponding image; the positions in the image include the position of the first human face; Control the focus point of the camera to switch from the first focusing position to the second focusing position.
11. The method according to any one of claims 1-10, wherein, The camera is an autofocus AF camera.
12. The method according to any one of claims 1-11, wherein, The camera is a front camera.
13. An electronic device, wherein, The electronic device includes a display screen, a memory, and one or more processors; the display screen, the memory, and the processor are coupled; the display screen is used to display images generated by the processor, the memory is used to store computer program code, and the computer program code includes computer instructions; when the processor executes the computer instructions, the electronic device is caused to execute the method according to any one of claims 1 to 12.
14. A computer-readable storage medium, wherein, Includes computer instructions, and when the computer instructions are run on an electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Assistant focusing method using multiple face blocks
CN102338972A
Automatic optimal face searching method and device
CN110348366A
Photographing method and equipment
CN114079726A
Image acquisition method, electronic equipment and computer readable storage medium
CN116055872A
Photographing method and photographing apparatus
KR1020100013860A