Portrait capturing method, portrait capturing apparatus, electronic device, and storage medium
By acquiring and utilizing the target face bounding box information and focus information, the problem of camera focusing failure in motion was solved, achieving high success rate and high quality portrait image capture.
Patent Information
- Application Number
- CN202311552784.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-20
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2043-11-20
AI Technical Summary
When capturing images of a moving subject, the camera may fail to focus accurately due to communication delays, resulting in image capture failure.
By acquiring the target face bounding box information in the current frame image, the image scene state is determined, and in a moving scene, the face bounding box information is used to capture the motion information of the target portrait to generate a moving portrait image; in a static scene, the focus information is combined to capture static portrait information to generate a static portrait image.
It improves the success rate and quality of capturing portrait images in both moving and stationary states, ensuring that the camera always captures the target portrait and avoiding image blurring caused by misfocusing.
Smart Images

Figure CN120075599B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a portrait capturing method, a portrait capturing device, an electronic device and a storage medium. BACKGROUND
[0002] Portrait image shooting refers to a process in which an electronic device uses a camera to capture a target portrait, obtains target portrait information, and generates a corresponding target portrait image according to the target portrait information. Portrait capturing refers to a process in which the camera focuses on a target portrait at a target portrait position to obtain target portrait information.
[0003] However, in the shooting process of portrait image shooting of a target portrait, when the target portrait is in a motion state, the camera focuses on the target portrait at a starting motion position of the target portrait captured by the camera. Due to communication delay of the electronic device, the target portrait has left the starting motion position when the camera focuses on the target portrait at the starting motion position, and the camera fails to capture the target portrait at the starting motion position, resulting in failure of portrait image shooting. SUMMARY
[0004] Therefore, the embodiments of the present application provide a portrait capturing method, a portrait capturing device, an electronic device and a storage medium to overcome the problems of the prior art.
[0005] In a first aspect, the embodiments of the present application provide a portrait capturing method, which includes: obtaining a current frame image, the current frame image including a target portrait; obtaining target face frame information of the target portrait according to the current frame image; when it is determined that the current frame image is a motion scene image, capturing target motion portrait information of the target portrait according to the target face frame information; and generating a target motion portrait image according to the target motion portrait information.
[0006] The scheme provided by the present application avoids the failure to capture a target portrait when a camera captures the target portrait at a starting motion position of the target portrait captured by the camera in the shooting process of portrait image shooting of a target portrait in a motion state. Since the target face frame information is real-time information of the target portrait, the camera always captures the target portrait, and the shooting success rate of portrait image shooting is improved.
[0007] In some optional embodiments, the portrait capturing method further includes: when it is determined that the current frame image is a still scene image, obtaining focus information of the current frame image; capturing target still portrait information of the target portrait according to the target face frame information and the focus information; and generating a target still portrait image according to the target still portrait information.
[0008] The scheme provided by the embodiment realizes portrait capturing of the target portrait according to the target face frame information and the focus information of the target portrait in the photographing process of photographing the portrait image of the target portrait in the static state. Since the target face frame information is real-time information of the target portrait, the camera always captures the target portrait, and the photographing success rate of photographing the portrait image is improved. The focusing on the target face region is ensured, and the situation that the image of the region other than the target face region image in the captured portrait image is clearer when focusing on the region other than the target face region is avoided. The target face region image in the photographed portrait image is clearer, and the photographing quality of photographing the portrait image is improved.
[0009] In some optional embodiments, the portrait capturing method further includes: when it is determined that the current frame image does not satisfy the preset condition, determining an adjustment parameter of the camera according to the focus information, the preset condition being a condition for representing that the current frame image is a clear image, and the adjustment parameter being a parameter for representing adjustment of the camera when the current frame image is adjusted to be a clear image; and controlling the camera to move according to the adjustment parameter.
[0010] The scheme provided by the embodiment realizes real-time adjustment of the camera when it is determined that the current frame image is a blurred image, and ensures that the obtained next frame image is a clear image, which is conducive to improving the image acquisition quality of the subsequent frame image.
[0011] In some optional embodiments, before determining the adjustment parameter of the camera according to the focus information when it is determined that the current frame image does not satisfy the preset condition, the portrait capturing method further includes: determining an image focal length of the current frame image according to the target face frame information; and determining that the current frame image does not satisfy the preset condition when the image focal length is not within a current lens focal length range of the camera.
[0012] The scheme provided by the embodiment realizes judgment of the image quality of the current frame image according to the image focal length of the current frame image and the current lens focal length range, and can ensure that the judgment accuracy of the image quality of the current frame image is high.
[0013] In some optional embodiments, when it is determined that the current frame image does not satisfy the preset condition, the determination of the adjustment parameter of the camera according to the focus information includes: when it is determined that the current frame image does not satisfy the preset condition, obtaining a lens resolution of the camera; and calculating the adjustment parameter of the camera according to the lens resolution and the focus information.
[0014] The scheme provided by the embodiment realizes calculation of the adjustment parameter of the camera according to the focus information and the lens resolution of the camera, and can ensure that the accuracy of the calculated adjustment parameter is high.
[0015] In some optional embodiments, the obtaining the focus information of the current frame image comprises: when it is determined that the target face corresponding to the target face frame information meets the portrait capture condition, obtaining a target face frame region according to the target face frame information; and determining the target face frame region as the focus information of the current frame image.
[0016] The scheme provided in the embodiment achieves the following: when it is determined that the current frame image is a still scene image and the target face meets the portrait capture requirement, the target face frame region corresponding to the target face frame information is determined as the focus information of the current frame image, which is beneficial to improving the capture success rate of capturing the target still portrait information.
[0017] In some optional embodiments, the obtaining the focus information of the current frame image further comprises: when it is determined that the target face corresponding to the target face frame information does not meet the portrait capture requirement, obtaining a target face frame center point corresponding to the target face frame information; and determining the target face frame center point as the focus information.
[0018] The scheme provided in the embodiment achieves the following: when it is determined that the current frame image is a still scene image and the target face does not meet the portrait capture requirement, the target face frame center point corresponding to the target face frame information is determined as the focus information of the current frame image, which ensures the center correction of the target face frame information and can compensate for the problem that the target still portrait information captured is blurred due to the target face being too small, and is beneficial to improving the capture quality of capturing the target still portrait information.
[0019] In some optional embodiments, before the obtaining the focus information of the current frame image, the portrait capture method further comprises: obtaining target face data according to the target face frame information; and when the target face data is greater than or equal to a data threshold, determining that the target face corresponding to the target face frame information meets the portrait capture requirement.
[0020] The scheme provided in the embodiment achieves the following: the portrait capture requirement of the target face is determined according to the target face data, and the determination accuracy of determining the portrait capture requirement of the target face is high.
[0021] In some optional embodiments, before the capturing the target motion portrait information of the target portrait according to the target face frame information when it is determined that the current frame image is a motion scene image, the portrait capture method further comprises: obtaining a first optical flow coordinate of a target pixel point in the current frame image; obtaining a second optical flow coordinate of the target pixel point in a next frame image of the current frame image; and determining that the current frame image is a motion scene image according to the first optical flow coordinate and the second optical flow coordinate.
[0022] The scheme provided in the embodiment realizes determining the current frame image as a motion scene image according to the optical flow coordinates of the target pixel points in the adjacent frame images, and can improve the judgment accuracy of the scene state of the current frame image.
[0023] In some optional embodiments, determining the current frame image as a motion scene image according to the first optical flow coordinates and the second optical flow coordinates comprises: calculating a coordinate difference value of the first optical flow coordinates and the second optical flow coordinates; and determining the current frame image as a motion scene image when the coordinate difference value is greater than or equal to a difference threshold value.
[0024] The scheme provided in the embodiment realizes determining the current frame image as a motion scene image according to the optical flow coordinate changes of the target pixel points in the adjacent frame images, and improves the judgment accuracy of the judgment of the scene state of the current frame image.
[0025] In some optional embodiments, obtaining the first optical flow coordinates of the target pixel points in the current frame image comprises: determining the target pixel points in the current frame image; and performing optical flow detection on the target pixel points in the current frame image to obtain the corresponding first optical flow coordinates.
[0026] In some optional embodiments, obtaining the second optical flow coordinates of the target pixel points in the next frame image comprises: obtaining the next frame image of the current frame image to obtain the next frame image; and performing optical flow detection on the target pixel points in the next frame image to obtain the corresponding second optical flow coordinates.
[0027] In some optional embodiments, before obtaining the target face frame information of the target portrait according to the current frame image, the portrait capturing method further comprises: performing region cropping on the current frame image to obtain a cropped frame image; and obtaining the target face frame information of the target portrait according to the current frame image comprises: performing face detection on the cropped frame image to obtain the target face frame information of the target portrait.
[0028] The scheme provided in the embodiment realizes face detection on the cropped frame image obtained by cropping the current frame image, ensures that the cropped frame image is more in line with the requirements of face detection, and improves the detection accuracy of face detection.
[0029] In a second aspect, the embodiment of the present application provides a portrait capturing method, which comprises: obtaining a current frame image, the current frame image comprising a target portrait; obtaining target face frame information of the target portrait according to the current frame image; when the current frame image is determined as a still scene image, obtaining focus information of the current frame image; capturing target still portrait information of the target portrait according to the target face frame information and the focus information; and generating a target still portrait image according to the target still portrait information.
[0030] The scheme provided by the embodiment realizes portrait capturing of the target portrait according to the target face frame information and the focus information of the target portrait in the photographing process of photographing the portrait image of the target portrait in the static state. Since the target face frame information is real-time information of the target portrait, the camera always captures the target portrait, and the photographing success rate of photographing the portrait image is improved. The focusing on the target face region is ensured, the region image other than the target face region image in the captured portrait image is avoided to be clearer when focusing on the region other than the target face region, the target face region image in the photographed portrait image is ensured to be clearer, and the photographing quality of photographing the portrait image is improved.
[0031] In some optional embodiments, the portrait capturing method further includes: when it is determined that the current frame image does not satisfy the preset condition, determining an adjustment parameter of the camera according to the focus information, the preset condition being a condition for representing that the current frame image is a clear image, and the adjustment parameter being a parameter for representing an adjustment of the camera when the current frame image is adjusted to be a clear image; and controlling the camera to move according to the adjustment parameter.
[0032] In some optional embodiments, before determining the adjustment parameter of the camera according to the focus information when it is determined that the current frame image does not satisfy the preset condition, the portrait capturing method further includes: determining an image focus of the current frame image according to the target face frame information; and determining that the current frame image does not satisfy the preset condition when the image focus is not within a current lens focus range of the camera.
[0033] In some optional embodiments, when it is determined that the current frame image does not satisfy the preset condition, determining the adjustment parameter of the camera according to the focus information includes: when it is determined that the current frame image does not satisfy the preset condition, obtaining a lens resolution of the camera; and calculating the adjustment parameter of the camera according to the lens resolution and the focus information.
[0034] In some optional embodiments, obtaining the focus information of the current frame image includes: when it is determined that the target face corresponding to the target face frame information satisfies the portrait capturing condition, obtaining a target face frame region according to the target face frame information; and determining the target face frame region as the focus information of the current frame image.
[0035] In some optional embodiments, obtaining the focus information of the current frame image further includes: when it is determined that the target face does not satisfy the portrait capturing requirement, obtaining a target face frame center point corresponding to the target face frame information; and determining the target face frame center point as the focus information.
[0036] In some optional embodiments, before the focus information of the current frame image is acquired, the portrait capturing method further comprises: acquiring target face data according to the target face frame information; and when the target face data is greater than or equal to a data threshold, determining that the target face corresponding to the target face frame information meets the portrait capturing requirement.
[0037] In a third aspect, the embodiments of the present application provide a portrait capturing device. The portrait capturing device comprises a first acquisition module, a second acquisition module, a moving portrait information capturing module, and a moving portrait image generating module. The first acquisition module is configured to acquire a current frame image, the current frame image comprising a target portrait. The second acquisition module is configured to acquire target face frame information of the target portrait according to the current frame image. The moving portrait information capturing module is configured to capture target moving portrait information of the target portrait according to the target face frame information when it is determined that the current frame image is a moving scene image. The moving portrait image generating module is configured to generate a corresponding target moving portrait image according to the target moving portrait information.
[0038] In a fourth aspect, the embodiments of the present application provide a portrait capturing device. The portrait capturing device comprises a first acquisition module, a second acquisition module, a third acquisition module, a still portrait information capturing module, and a still portrait image generating module. The first acquisition module is configured to acquire a current frame image, the current frame image comprising a target portrait. The second acquisition module is configured to acquire target face frame information of the target portrait according to the current frame image. The third acquisition module is configured to acquire focus information of the current frame image when it is determined that the current frame image is a still scene image. The still portrait information capturing module is configured to capture target still portrait information of the target portrait according to the target face frame information and the focus information. The still portrait image generating module is configured to generate a target still portrait image according to the target still portrait information.
[0039] In a fifth aspect, the embodiments of the present application provide an electronic device. The electronic device comprises a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, the electronic device performs the portrait capturing method provided in the first aspect or the second aspect.
[0040] In a sixth aspect, the embodiments of the present application provide a chip applied to an electronic device. The chip comprises a processor. The processor is configured to read and execute a computer program stored in a memory. When the computer program is executed by the processor, the electronic device can perform the portrait capturing method provided in the first aspect or the second aspect.
[0041] In some optional embodiments, the chip further comprises a memory, and the memory is connected to the processor through a circuit or a wire.
[0042] In some optional embodiments, the chip further comprises a communication interface.
[0043] In a seventh aspect, an embodiment of the present application provides a computer readable storage medium, which stores program codes. The program codes can be invoked by an electronic device to execute the portrait capturing method provided in the first aspect or the second aspect.
[0044] In an eighth aspect, an embodiment of the present application provides a computer program product, which, when running on an electronic device, causes the electronic device to execute the portrait capturing method provided in the first aspect or the second aspect.
[0045] It can be understood that the beneficial effects of the third aspect to the eighth aspect can be referred to the related description in the first aspect or the second aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0047] Figure 1 A scene schematic diagram of the portrait capturing method provided by the prior art is shown.
[0048] Figure 2 An application scene schematic diagram of the electronic device provided by an embodiment of the present application is shown.
[0049] Figure 3 A structure schematic diagram of a software system of the electronic device provided by an embodiment of the present application is shown.
[0050] Figure 4 A flow schematic diagram of the portrait capturing method provided by an embodiment of the present application is shown.
[0051] Figure 5 An application scene schematic diagram of capturing target moving portrait information in the portrait capturing method provided by an embodiment of the present application is shown.
[0052] Figure 6 Another flow schematic diagram of the portrait capturing method provided by an embodiment of the present application is shown.
[0053] Figure 7 A structure schematic diagram of a software system of the electronic device provided by an embodiment of the present application is shown.
[0054] Figure 8 Still another flow schematic diagram of the portrait capturing method provided by an embodiment of the present application is shown.
[0055] Figure 9 A structural block diagram of a portrait capturing device provided by an embodiment of the present application is shown.
[0056] Figure 10 Another structural block diagram of a portrait capturing device provided by an embodiment of the present application is shown.
[0057] Figure 11 A hardware structural schematic diagram of an electronic device provided by an embodiment of the present application is shown.
[0058] Figure 12 A functional block diagram of an electronic device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0059] Embodiments of the present application are described in detail below with reference to the accompanying drawings, in which like or similar elements are denoted by the same or similar reference signs throughout the drawings. The embodiments described below are examples only, and are not intended to limit the present application.
[0060] The disclosure below provides many different embodiments, or examples, for implementing different structures of the present application. For the purpose of simplicity, the elements and settings of the particular examples below are described in some detail. Of course, they are merely examples and are in no way intended to limit the present application. Furthermore, the present application can be used in various examples without departing from the scope of the present application. The reference numerals and / or letters used in the following disclosure are repeated use throughout the following description and the accompanying drawings in order to illustrate particular embodiments and / or configurations. It is to be noted that the same or similar elements and / or settings have the same or similar reference numerals and / or letters throughout the following disclosure.
[0061] Portrait image shooting refers to a process in which an electronic device captures a target portrait using a camera, obtains target portrait information, and generates a corresponding target portrait image according to the target portrait information. Portrait capturing refers to a process in which a camera focuses on a target portrait at a target portrait position to obtain target portrait information.
[0062] However, in the shooting process of portrait image shooting of a target portrait, when the target portrait is in a motion state, the camera focuses on the target portrait at a starting motion position according to the captured target portrait, and due to the communication delay of the electronic device, the target portrait has left the starting motion position when the camera focuses on the target portrait at the starting motion position. The camera does not capture the target portrait at the starting motion position, resulting in a failure of portrait image shooting.
[0063] As an example, as shown in FIG. 1, a target portrait 100 is in a motion state, and a camera 200 of an electronic device 300 captures the target portrait 100. The camera 200 focuses on the target portrait 100 at a starting motion position 101 according to the captured target portrait 100, and the target portrait 100 has left the starting motion position 101 when the camera 200 focuses on the target portrait 100 at the starting motion position 101. The camera 200 does not capture the target portrait 100 at the starting motion position 101, resulting in a failure of portrait image shooting. Figure 1As shown in FIG. 1, which shows a schematic diagram of a scene of a current portrait capture, when the electronic device captures a portrait image of a target portrait by using a camera to capture the target portrait during movement of the target portrait from a target portrait position A to a position B, the camera focuses on the target portrait at the target portrait position A according to the target portrait position A captured by the camera. However, due to the communication delay of the electronic device, the target portrait has moved to the position B when the camera focuses on the target portrait at the target portrait position A, and the camera cannot capture the target portrait at the target portrait position A, resulting in a failure of the portrait image capture.
[0064] To solve the above problem, the portrait capture method, portrait capture device, electronic device and storage medium provided in the embodiments of the present application capture a target portrait according to target face frame information of the target portrait when the current frame image is a motion scene image, and generate a target motion portrait image according to the target motion portrait information, so that the target portrait is captured according to the target face frame information of the target portrait during the portrait image capture of the target portrait in a motion state, and the target portrait cannot be captured when the target portrait is captured according to the starting motion position of the target portrait captured by the camera. Since the target face frame information is real-time information of the target portrait, the camera can always capture the target portrait, and the success rate of the portrait image capture is improved.
[0065] The technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application.
[0066] The portrait capture method provided in the embodiments of the present application can be applied to an electronic device 100. The electronic device 100 can include various terminal devices, and the terminal device can also be referred to as a terminal (Terminal), a user equipment (User equipment, UE), a mobile station (Mobile station, MS), a mobile terminal (Mobile Terminal, MT), etc. As shown in FIG. 2, which shows a schematic diagram of an application scene of the electronic device 100. Figure 2 As shown in FIG. 2, which shows a schematic diagram of an application scene of the electronic device 100.
[0067] The terminal device can be a mobile phone, a sweeping robot, a drone, a smart television, a wearable device, a personal digital assistant (PDA), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, and the like. Here, the type of the terminal device is not limited, and can be set according to actual needs.
[0068] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Embodiments of the present application take an Android system with a layered architecture as an example to exemplarily illustrate the software structure of the electronic device 100.
[0069] Please refer to Figure 3 which shows a structural schematic diagram of the software system of the electronic device 100 provided by an embodiment of the present application. The software system includes several layers, each layer has a clear role and division of labor, and the layers communicate with each other through a software interface. In some embodiments, as shown in Figure 3 , the Android system can include four layers, from top to bottom, an application (APP) layer, a framework (FWK) layer, a hardware abstraction (HAL) layer, and a driver layer, the APP layer communicates with the FWK layer through an Android interface definition language (AIDL) protocol, the FWK layer also communicates with the HAL layer through the AIDL protocol, and the HAL layer also communicates with the driver layer through the AIDL protocol.
[0070] Among them, the APP layer can include a series of application packages. In some embodiments, the APP layer can include camera, gallery, video, calendar, call, map, navigation, Bluetooth, music, and the like.
[0071] The FWK layer provides an application programming interface (API) and a programming framework for applications of the APP layer. The FWK layer can include some predefined functions. In some embodiments, the FWK layer can include a window manager, a content provider, a view system, a resource manager, and a camera service manager, etc. The window manager is used to manage window programs. The window manager can acquire a display screen size, determine whether there is a status bar, lock a screen, and capture a screen, etc. The content provider is used to store and acquire data, and make the data accessible to an application program. The data can include videos, images, audios, dialed and received calls, browsing history and bookmarks, a phone book, etc. The view system includes visual controls, such as a control for displaying text, a control for displaying pictures, etc. The view system can be used to build an application program. A display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures. The resource manager provides various resources for an application program, such as localized strings, icons, pictures, layout files, video files, etc. The camera service manager is used to manage a camera application program, and provide a camera shooting service for the camera application program.
[0072] The HAL layer defines an interface of a hardware "driver", for example, a camera HAL module, to reduce the coupling degree of the Android operating system and the hardware.
[0073] The Driver layer is used to provide a driver for different hardware devices. For example, the Driver layer can include a camera driver. The camera driver is used to manage a camera chip, for example, initialization, control, parameter configuration, monitoring, data interaction, etc.
[0074] It should be noted that although the embodiments of the present application are described by taking the Android system as an example, the basic principles are also applicable to electronic devices 100 based on iOS, Windows, and other operating systems.
[0075] Please refer to Figure 4 , which shows a flowchart of a portrait capturing method according to an embodiment of the present application. In specific embodiments, the portrait capturing method can be applied to the electronic device 100. In the following, the flowchart shown in Figure 4 will be described in detail, and the portrait capturing method can include the following steps S110 to S140.
[0076] Step S110: Acquire a current frame image.
[0077] In the embodiments of the present application, the electronic device can include a camera. When a user needs to take a portrait image, a shooting instruction can be sent to the electronic device. The electronic device receives and responds to the shooting instruction, controls the camera to take a picture, and obtains a current frame image.
[0078] The current frame image includes a target portrait, and the target portrait can be one or more. The camera can be any one of a white light camera, an infrared camera, a laser camera, etc. The type of camera is not limited here and can be set according to actual needs.
[0079] In some embodiments, the electronic device can include an input panel. When a user needs to take a portrait image, a shooting instruction can be input on the input panel of the electronic device. The electronic device receives the shooting instruction through the input panel.
[0080] In some embodiments, the electronic device can include a voice recognition module. When a user needs to take a portrait image, voice information carrying a shooting instruction can be issued in the voice collection range of the voice recognition module. The electronic device collects and voice recognizes the voice information through the voice recognition module to obtain the shooting instruction.
[0081] In some embodiments, a client is connected to the electronic device through a network and performs data interaction with the electronic device through the network. When a user needs to take a portrait image, a shooting instruction can be sent to the client. The client receives and responds to the shooting instruction, forwards the shooting instruction to the electronic device through the network, and the electronic device receives the shooting instruction forwarded by the client.
[0082] The client can be any one of a mobile client (for example, any one of a mobile phone client, a personal digital assistant (PDA) client, a tablet personal computer (Tablet PC) client, a notebook computer client, a smart watch client, a smart bracelet client, or a wearable client, etc.) or a fixed client (for example, a desktop computer client, a smart panel client, etc.). The type of client is not limited here and can be set according to actual needs.
[0083] The network can be any one of a ZigBee network, a Bluetooth (BT) network, a Wireless Fidelity (Wi-Fi) network, a Thread network, a Long Range Radio (LoRa) network, a Low-Power Wide-Area Network (LPWAN), an infrared network, a Narrow Band Internet of Things (NB-IoT), a Controller Area Network (CAN), a Digital Living Network Alliance (DLNA) network, a Wide Area Network (WAN), a Local Area Network (LAN), a Metropolitan Area Network (MAN), or a Wireless Personal Area Network (WPAN), etc., and the type of the network is not limited herein and can be set according to actual needs.
[0084] Step S120: Obtain target face frame information of the target portrait according to the current frame image.
[0085] In the embodiments of the present application, after the electronic device obtains the current frame image, the electronic device can obtain target face frame information of the target portrait according to the current frame image.
[0086] Specifically, after the electronic device obtains the current frame image, the electronic device can perform face detection on the target portrait in the current frame image to obtain target face frame information of the target portrait.
[0087] In some embodiments, after the electronic device obtains the current frame image, the electronic device can perform face feature extraction on the target portrait in the current frame image to obtain target face features, and generate corresponding target face frame information according to the face features.
[0088] In some embodiments, the electronic device pre-stores a face detection model, and after the electronic device obtains the current frame image, the electronic device can input the current frame image to the face detection model. The face detection model receives and responds to the current frame image, performs face detection on the target portrait in the current frame image to obtain corresponding target face frame information, and outputs the target face frame information to the electronic device. The electronic device receives the target face frame information output by the face detection model.
[0089] The face detection model can be trained according to historical frame images labeled with historical face frame information. The face detection model can be a Convolutional Neural Networks (CNN) model, a Deep Belief Networks (DBN) model, a Stacked Auto Encoder Networks (SAE) model, a Recurrent Neural Networks (RNN) model, a Deep Neural Networks (DNN) model, a Long Short-Term Memory (LSTM) network model, or a Gated Recurring Units (GRU) model, etc. The type of the face detection model is not limited herein and can be set according to actual needs.
[0090] In some embodiments, after obtaining the current frame image, the electronic device can perform face detection on the target portrait in the current frame image to obtain unique face frame information, and determine the unique face frame information as the target face frame information.
[0091] In some embodiments, after obtaining the current frame image, the electronic device can perform face detection on the target portrait in the current frame image to obtain multiple face frame information, and when receiving a selection operation of a user on any face frame information in the multiple face frame information, determine the any face frame information as the target face frame information.
[0092] In some embodiments, after obtaining the current frame image, the electronic device can perform region cropping on the current frame image to obtain a cropped frame image, and perform face detection on the cropped frame image to obtain the target face frame information of the target portrait, which can ensure that the cropped frame image is more in line with the face detection requirements and improve the detection accuracy of face detection.
[0093] The electronic device performs edge cropping on the current frame image according to the criterion of always retaining the target portrait in the current frame image to obtain a cropped frame image.
[0094] In some embodiments, after obtaining the target face frame information of the target portrait according to the current frame image, the electronic device can obtain a first optical flow coordinate of a target pixel point in the current frame image, obtain a second optical flow coordinate of the target pixel point in a next frame image of the current frame image, and determine whether the current frame image is a motion scene image according to the first optical flow coordinate and the second optical flow coordinate. This way, the current frame image is determined to be a motion scene image according to the optical flow coordinates of the target pixel point in adjacent frame images, which can improve the accuracy of determining the scene state of the current frame image.
[0095] Specifically, the electronic device can determine a target pixel point in the current frame image and perform optical flow detection on the target pixel point in the current frame image to obtain a corresponding first optical flow coordinate.
[0096] The target pixel point can be a pixel point selected by the user in the current frame image, a pixel point selected by the electronic device in the current frame image, a reference pixel point set by the user, or the like. The selection method of the target pixel point is not limited here and can be set according to actual needs.
[0097] The electronic device can obtain a next frame image of the current frame image to obtain a next frame image, and perform optical flow detection on the target pixel point in the next frame image to obtain a corresponding second optical flow coordinate.
[0098] The electronic device can calculate the coordinate difference between the first optical flow coordinate and the second optical flow coordinate, and determine whether the current frame image is a motion scene image according to the coordinate difference and a difference threshold. When the coordinate difference is greater than or equal to the difference threshold, the current frame image is determined to be a motion scene image; when the coordinate difference is less than the difference threshold, the current frame image is determined to be a still scene image. This way, whether the current frame image is a motion scene image is determined according to the change of the optical flow coordinates of the target pixel point in adjacent frame images, which improves the accuracy of determining the scene state of the current frame image.
[0099] The difference threshold can be used to represent the minimum coordinate difference when the current frame image is a motion scene image. The difference threshold can be a coordinate difference set by the user, a coordinate difference automatically generated by the electronic device according to multiple portrait image shooting processes, or the like. The setting method of the difference threshold is not limited here and can be set according to actual needs.
[0100] Step S130: When the current frame image is determined to be a motion scene image, the target motion portrait information of the target portrait is captured according to the target face frame information.
[0101] In the embodiments of the present application, after the electronic device obtains the target face frame information of the target person image according to the current frame image, when it is determined that the current frame image is a motion scene image, the target motion person image information of the target person image can be captured according to the target face frame information. As shown in FIG. 25, it shows an application scenario diagram of capturing target motion person image information. Figure 5
[0102] Specifically, after the electronic device obtains the target face frame information of the target person image according to the current frame image, the first optical flow coordinates of the target pixel points in the current frame image can be obtained, and the second optical flow coordinates of the target pixel points in the next frame image can be obtained, and whether the current frame image is a motion scene image can be determined according to the first optical flow coordinates and the second optical flow coordinates, and when it is determined that the current frame image is a motion scene image, the target motion person image information of the target person image can be captured according to the target face frame information. This implementation realizes that when it is determined that the current frame image is a motion scene image, the target motion person image information of the target person image is captured according to the target face frame information, which can ensure that the camera always captures the target person image, and is conducive to improving the shooting success rate of the person image shooting.
[0103] In some embodiments, after the electronic device obtains the target face frame information of the target person image according to the current frame image, and when it is determined that the current frame image is a motion scene image, the current frame image can be focused according to the target face frame information, the target motion person image pixel information of the target person image is obtained, and the target motion person image pixel information is determined as the target motion person image information. This implementation realizes that during the person image shooting process, when it is determined that the current frame image is a motion scene image, the target motion person image information of the target person image is captured according to the target face frame information of the target person image in the current frame image, which ensures that the camera always captures the target person image, and is conducive to improving the shooting success rate of the person image shooting.
[0104] In some embodiments, after the electronic device obtains the target face frame information of the target person image according to the current frame image, and when it is determined that the current frame image is a motion scene image, the current frame image can be focused according to the target face frame information, the target motion person image pixel information of the target person image is obtained, and the target motion person image pixel information is respectively subjected to person image blurring processing, beautifying processing and filter processing to obtain the target motion person image information. This implementation realizes that during the person image shooting process, when it is determined that the current frame image is a motion scene image, the target motion person image information of the target person image is captured according to the target face frame information of the target person image in the current frame image, which ensures that the camera always captures the target person image, and is conducive to improving the shooting success rate of the person image shooting. Further, by respectively subjecting the target motion person image pixel information to person image blurring processing, beautifying processing and filter processing, it is conducive to improving the image quality of the person image shot.
[0105] Step S140: generating a target motion portrait image according to the target motion portrait information.
[0106] In the embodiment of the present application, when the electronic device determines that the current frame image is a motion scene image, after capturing the target motion portrait information of the target portrait according to the target face frame information, the target motion portrait image can be generated according to the target motion portrait information, which realizes portrait capturing of the target portrait according to the target face frame information of the target portrait in the process of portrait image shooting of the target portrait in a motion state, avoids the failure to capture the target portrait when portrait capturing is performed according to the starting motion position of the target portrait captured by the camera, ensures that the camera always captures the target portrait since the target face frame information is real-time information of the target portrait, and improves the shooting success rate of portrait image shooting.
[0107] In some embodiments, after the electronic device generates the target motion portrait image according to the target motion portrait information, the target motion portrait image can be decoded into a first target portrait image matched with the camera client, and the first target portrait image is displayed on the camera client, which realizes the display of the first target portrait image converted from the target motion portrait image on the camera client, so as to facilitate the user to view the captured portrait image, and improves the shooting experience of the user in portrait image shooting.
[0108] The scheme provided in the embodiment realizes portrait capturing of the target portrait according to the target face frame information of the target portrait in the process of portrait image shooting of the target portrait in a motion state, avoids the failure to capture the target portrait when portrait capturing is performed according to the starting motion position of the target portrait captured by the camera, ensures that the camera always captures the target portrait since the target face frame information is real-time information of the target portrait, and improves the shooting success rate of portrait image shooting.
[0109] Please refer to Figure 6 which shows a flowchart of a portrait capturing method provided in another embodiment of the present application. In a specific embodiment, the portrait capturing method can be applied to the electronic device 100, and the portrait capturing method will be described in detail below with the electronic device 100 as an example. Figure 6 The portrait capturing method can include the following steps S210 to S270.
[0110] Step S210: Obtain a current frame image.
[0111] Step S220: Obtain target face frame information of a target portrait according to the current frame image.
[0112] Step S230: When it is determined that the current frame image is a moving scene image, capture target moving portrait information of the target portrait according to the target face frame information.
[0113] Step S240: Generate a target moving portrait image according to the target moving portrait information.
[0114] In the embodiment, steps S210, S220, S230 and S240 can refer to the contents of the corresponding steps in the foregoing embodiments, which will not be described here again.
[0115] Step S250: When it is determined that the current frame image is a still scene image, obtain focus information of the current frame image.
[0116] In the embodiment, after the electronic device obtains the target face frame information of the target portrait according to the current frame image, when it is determined that the current frame image is a still scene image, the focus information of the current frame image can be obtained.
[0117] The focus information can be a target face frame region or a target face frame center point, etc. The focus information can be used to represent a focusing manner of the camera focusing on the current frame image. The focusing manner can include region focusing corresponding to the target face frame region and center focusing corresponding to the target face frame center point, which is not limited here.
[0118] In some embodiments, after the electronic device obtains the target face frame information of the target portrait according to the current frame image, when it is determined that the current frame image is a still scene image, it can be determined whether the target face corresponding to the target face frame information meets the portrait capture requirement, and when it is determined that the target face corresponding to the target face frame information meets the portrait capture requirement, the target face frame region corresponding to the target face frame information is obtained, and the target face frame region is determined as the focus information of the current frame image. When it is determined that the current frame image is a still scene image and the target face meets the portrait capture requirement, the target face frame region corresponding to the target face frame information is determined as the focus information of the current frame image, which is beneficial to improve the capture success rate of capturing the target still portrait information.
[0119] The electronic device can acquire target face data according to the target face frame information, and determine whether the target face corresponding to the target face frame information meets the portrait capture requirement according to the target face data and the data threshold, so as to realize judging the portrait capture requirement of the target face according to the target face data, and ensure that the judgment accuracy of the portrait capture requirement judgment of the target face is high.
[0120] When the target face data is greater than or equal to the data threshold, it is determined that the target face corresponding to the target face frame information meets the portrait capture requirement; when the target face data is less than the data threshold, it is determined that the target face corresponding to the target face frame information does not meet the portrait capture requirement.
[0121] The data threshold can be used to represent the minimum face data that meets the portrait capture requirement of the target face. The data threshold can be face data pre-set by the user, or face data automatically generated by the electronic device according to multiple portrait image shooting processes, etc. The setting method of the data threshold is not limited here, and can be set according to actual needs.
[0122] In some embodiments, after the electronic device acquires the target face frame information of the target portrait according to the current frame image, when it is determined that the current frame image is a still scene image, it can be determined whether the target face corresponding to the target face frame information meets the portrait capture requirement, and when it is determined that the target face does not meet the portrait capture requirement, the center point of the target face frame corresponding to the target face frame information is acquired, and the center point of the target face frame is determined as the focus information, so as to realize that when the current frame image is determined to be a still scene image and the target face does not meet the portrait capture requirement, the center point of the target face frame corresponding to the target face frame information is determined as the focus information of the current frame image, which ensures the center correction of the target face frame information, and can compensate for the problem that the target still portrait information captured is blurred due to the small size of the target face, and is conducive to improving the capture quality of the target still portrait information.
[0123] Step S260: capturing target still portrait information of the target portrait according to the target face frame information and the focus information.
[0124] In this embodiment, after the electronic device determines that the current frame image is a still scene image and acquires the focus information of the current frame image, it can capture the target still portrait information of the target portrait according to the target face frame information and the focus information.
[0125] Specifically, when the electronic device determines that the current frame image is a still scene image, after obtaining the focus information of the current frame image, the current frame image can be focused according to the target face frame information and the focus information, the target still portrait pixel information of the target portrait is obtained, and the target still portrait pixel information is determined as the target still portrait information, which realizes that when it is determined that the current frame image is a still scene image in the portrait image shooting process, the target still portrait information of the target portrait is captured according to the target face frame information and the focus information of the target portrait in the current frame image, and it is ensured that the camera always captures the target portrait, and the shooting success rate of shooting the portrait image is improved. And it is ensured that the target face area is focused, which avoids the case that the area outside the target face area is focused, resulting in that the area image outside the target face area image in the captured portrait image is clearer, which is beneficial to shoot the portrait image with clearer face area image, and is beneficial to improve the shooting quality of shooting the portrait image.
[0126] In some embodiments, the focus information is a target face frame area, when the electronic device determines that the current frame image is a still scene image, after obtaining the target face frame area of the current frame image, the current frame image can be focused according to the target face frame information and the target face frame area, the target still portrait pixel information of the target portrait is obtained, and the target still portrait pixel information is determined as the target still portrait information.
[0127] In some embodiments, the focus information is a target face frame center point, when the electronic device determines that the current frame image is a still scene image, after obtaining the target face frame center point of the current frame image, the current frame image can be focused according to the target face frame information and the target face frame center point, the target still portrait pixel information of the target portrait is obtained, and the target still portrait pixel information is determined as the target still portrait information.
[0128] In some embodiments, when the electronic device determines that the current frame image is a still scene image, after obtaining the focus information of the current frame image, the current frame image can be focused according to the target face frame information and the focus information, the target still portrait pixel information of the target portrait is obtained, and the target still portrait pixel information is respectively subjected to portrait blur processing, beautification processing and filter processing to obtain the target still portrait information. When it is determined that the current frame image is a still scene image during portrait image shooting, the corresponding target still portrait information is captured according to the target face frame information and the focus information corresponding to the current frame image, the focusing on the target face area is ensured, and the region image outside the target face area image in the captured portrait image is avoided to be clearer, which is beneficial to shooting the portrait image with clearer face area image and improving the shooting quality of the portrait image.
[0129] Step S270: generating a target still portrait image according to the target still portrait information.
[0130] In the embodiment, after the electronic device captures the target still portrait information of the target portrait according to the target face frame information and the focus information, the target still portrait image can be generated according to the target still portrait information, which realizes that the target portrait is captured according to the target face frame information and the focus information of the target portrait during the shooting process of the portrait image of the target portrait in a still state. Since the target face frame information is real-time information of the target portrait, the camera always captures the target portrait, and the shooting success rate of the portrait image is improved. The focusing on the target face area is ensured, and the region image outside the target face area image in the captured portrait image is avoided to be clearer, which ensures that the target face area image of the captured portrait image is clearer and improves the shooting quality of the portrait image.
[0131] In some embodiments, when the electronic device determines that the current frame image is a still scene image, after obtaining the focus information of the current frame image, it can be determined whether the current frame image satisfies a preset condition, and when it is determined that the current frame image does not satisfy the preset condition, the adjustment parameter of the camera is determined according to the focus information, and the camera is controlled to move according to the adjustment parameter, which realizes that the camera is adjusted in real time when it is determined that the current frame image is a blurred image, and ensures that the obtained next frame image is a clear image, which is beneficial to improving the image acquisition quality of the subsequent frame image.
[0132] The preset condition can be used to represent a condition for determining that the current frame image is a clear image, and the adjustment parameter can be used to represent a parameter for adjusting the camera when the current frame image is adjusted to be a clear image. The adjustment parameter can be any one of an adjustment of a Hall current or an adjustment of a Hall voltage, which is not limited here.
[0133] The electronic device can determine the image focal length of the current frame image according to the target face frame information, and determine whether the current frame image satisfies the preset condition according to the image focal length and the current lens focal length range of the camera corresponding to the current frame image. This implementation determines the image quality of the current frame image according to the image focal length of the current frame image and the current lens focal length range, and can ensure that the determination accuracy of the image quality of the current frame image is high.
[0134] When the image focal length is within the current lens focal length range, it is determined that the current frame image satisfies the preset condition. When the image focal length is not within the current lens focal length range, it is determined that the current frame image does not satisfy the preset condition.
[0135] When the electronic device determines that the current frame image does not satisfy the preset condition, the lens resolution of the camera can be obtained, and the adjustment parameter of the camera can be calculated according to the lens resolution and the focusing information. This implementation calculates the adjustment parameter of the camera according to the focusing information and the lens resolution of the camera, and can ensure that the accuracy of the calculated adjustment parameter is high.
[0136] In some embodiments, after the electronic device generates the target still portrait image according to the target still portrait information, the electronic device can decode the target still portrait image into a second target portrait image matched with the camera client, and display the second target portrait image on the camera client. This implementation displays the second target portrait image converted from the target still portrait image on the camera client, so that the user can view the captured portrait image, and improves the shooting experience of the user in portrait image shooting.
[0137] In an application scenario, as shown in Figure 7 The software system of the electronic device can include an APP layer, an FWK layer, an HAL layer, and a Driver layer. The APP layer includes a Camera Android Application Package (Camera APK), the FWK layer includes a Camera Service, the HAL layer can include a pre-processing module, a Face Detect module, an Auto Focus module, a portrait capture module, and a post-processing module, and the Driver layer can include a lens sensor (Sensor) frame output sequence module and a module driving sequence module.
[0138] The pre-processing module, the Face Detect module, the Auto Focus module, the portrait capturing module, and the post-processing module are combined as a camera HAL module, and the Sensor out-frame sequence module and the module driving sequence module are combined as a camera driving module.
[0139] When a user captures a portrait image of a target portrait by using an electronic device, the user can click a camera application in the electronic device, and the camera application responds to the click operation of the user. The Camera APK sends a Capture Event instruction to the Camera Service based on the AIDL protocol. The Camera Service receives and responds to the Capture Event instruction, transmits preset image capture parameters to the pre-processing module based on the AIDL protocol, the pre-processing module receives and responds to the preset image capture parameters, converts the preset image capture parameters into an obtained image resolution, and sends the obtained image resolution to the Sensor out-frame sequence module based on the AIDL protocol. The Sensor out-frame sequence module receives and responds to the obtained image resolution, obtains a current frame image according to the obtained image resolution, and returns the current frame image to the pre-processing module based on the AIDL protocol. The pre-processing module receives and responds to the current frame image, performs region cropping on the current frame image to obtain a cropped frame image, and sends the cropped frame image to the Face Detect module. The Face Detect module receives and responds to the cropped frame image, performs face detection on the cropped frame image to obtain target face frame information, and performs optical flow detection on the current frame image to obtain a first optical flow detection result for indicating that the current frame image is a moving scene image and a second optical flow detection result for indicating that the current frame image is a still scene image.
[0140] When the Face Detect module obtains the first optical flow detection result, the target face frame information is sent to the portrait capturing module. The portrait capturing module receives and responds to the target face frame information, captures a target portrait according to the target face frame information to obtain target moving portrait information, and sends the target moving portrait information to the post-processing module. The post-processing module receives and responds to the target moving portrait information, generates a target moving portrait image, converts the target moving portrait image into a first target portrait image matched with the Camera APK, and sends the first target portrait image to the Camera Service based on the AIDL protocol. The Camera Service receives and responds to the first target portrait image, transmits the first target portrait image to the Camera APK, the Camera APK receives and responds to the first target portrait image, and displays the first target portrait image.
[0141] When the Face Detect module obtains the second optical flow detection result, the target face frame information is sent to the Auto Focus module and the portrait capture module respectively, the Auto Focus module receives and responds to the target face frame information, obtains the focusing information of the current frame image according to the target face frame information, and sends the focusing information to the portrait capture module, the portrait capture module receives and responds to the target face frame information and the focusing information, captures the target portrait according to the target face frame information and the focusing information, obtains the target still portrait information, and sends the target still portrait information to the post-processing module, the post-processing module receives and responds to the target still portrait information, generates the target still portrait image, converts the target still portrait image into a second target portrait image matched with the Camera APK, and sends the second target portrait image to the Camera Service based on the AIDL protocol, the Camera Service receives and responds to the second target portrait image, transmits the second target portrait image to the Camera APK, the Camera APK receives and responds to the second target portrait image, and displays the second target portrait image.
[0142] In the method, when the Auto Focus module receives the target face frame information, the Auto Focus module can also determine the image focal length of the current frame image according to the target face frame information, determine whether the current frame image meets the preset condition according to the image focal length and the current lens focal length range of the camera corresponding to the current frame image, and when it is determined that the current frame image does not meet the preset condition, determine the adjustment parameter of the camera according to the focusing information, and send the adjustment parameter to the module driving sequence module based on the AIDL protocol.
[0143] The scheme provided in this embodiment comprises the following steps: acquiring a current frame image, acquiring target face frame information of a target person image according to the current frame image, capturing target moving person image information of the target person image according to the target face frame information when it is determined that the current frame image is a moving scene image, generating a target moving person image according to the target moving person image information, acquiring focus information of the current frame image when it is determined that the current frame image is a still scene image, capturing target still person image information of the target person image according to the target face frame information and the focus information, and generating a target still person image according to the target still person image information. In the process of photographing the target person image in a still state, the target person image is captured according to the target face frame information and the focus information of the target person image, the target face frame information is real-time information of the target person image, so that the camera can always capture the target person image, the success rate of photographing the person image is improved, the target face region is focused, the region image other than the target face region image in the captured person image is clearer when the region other than the target face region is focused, the target face region image in the photographed person image is clearer, and the photographing quality of the person image is improved.
[0144] Referring to Figure 8 , a flowchart of a person image capturing method is shown. In specific embodiments, the person image capturing method can be applied to the electronic device 100. In the following, the person image capturing method is described in detail with reference to the flowchart shown in Figure 8 , the person image capturing method can comprise the following steps S310 to S350.
[0145] Step S310: acquiring a current frame image.
[0146] Step S320: acquiring target face frame information of a target person image according to the current frame image.
[0147] Step S330: acquiring focus information of the current frame image when it is determined that the current frame image is a still scene image.
[0148] Step S340: capturing target still person image information of the target person image according to the target face frame information and the focus information.
[0149] Step S350: generating a target still person image according to the target still person image information.
[0150] In this embodiment, the steps S310, S320, S330, S340 and S350 can refer to the content of the corresponding steps in the foregoing embodiments, which will not be described here.
[0151] The scheme provided by the embodiment comprises the following steps: acquiring a current frame image, acquiring target face frame information of a target portrait according to the current frame image, acquiring focus information of the current frame image when it is determined that the current frame image is a still scene image, capturing target still portrait information of the target portrait according to the target face frame information and the focus information, and generating a target still portrait image according to the target still portrait information. In the process of photographing the portrait image of the target portrait in a still state, the target portrait is captured according to the target face frame information and the focus information of the target portrait. Since the target face frame information is real-time information of the target portrait, the camera can always capture the target portrait, and the success rate of photographing the portrait image is improved. In addition, the target face region is focused, so that the region image other than the target face region image in the captured portrait image is not clear, the target face region image in the photographed portrait image is clear, and the photographing quality of the portrait image is improved.
[0152] Please refer to Figure 9 which shows a portrait capturing device 300 provided by an embodiment of the application. The portrait capturing device 300 can be applied to the electronic device 100. In the following, the portrait capturing device 300 shown in FIG. 3 is described in detail by taking the electronic device 100 as an example. The portrait capturing device 300 can comprise a first acquisition module 310, a second acquisition module 320, a moving portrait information capturing module 330, and a moving portrait image generating module 340. Figure 9
[0153] The first acquisition module 310 can be used to acquire a current frame image, and the current frame image comprises a target portrait. The second acquisition module 320 can be used to acquire target face frame information of the target portrait according to the current frame image. The moving portrait information capturing module 330 can be used to capture target moving portrait information of the target portrait according to the target face frame information when it is determined that the current frame image is a moving scene image. The moving portrait image generating module 340 can be used to generate a target moving portrait image according to the target moving portrait information.
[0154] In some embodiments, the portrait capturing device 300 can further comprise a third acquisition module, a still portrait information capturing module, and a still portrait image generating module.
[0155] The third acquisition module can be used to acquire focus information of the current frame image when it is determined that the current frame image is a still scene image. The still portrait information capturing module can be used to capture target still portrait information of the target portrait according to the target face frame information and the focus information. The still portrait image generating module can be used to generate a target still portrait image according to the target still portrait information.
[0156] In some embodiments, the portrait capturing apparatus 300 can further include a first determining module and a control module.
[0157] The first determining module can be configured to determine an adjustment parameter of the camera according to the focus information when it is determined that the current frame image does not satisfy the preset condition, the preset condition can be configured to represent a condition for the current frame image to be a clear image, and the adjustment parameter can be configured to represent a parameter for adjusting the camera when the current frame image is adjusted to be a clear image; and the control module can be configured to control the camera to move according to the adjustment parameter.
[0158] In some embodiments, the portrait capturing apparatus 300 can further include a second determining module and a third determining module.
[0159] The second determining module can be configured to determine an image focus of the current frame image according to the target face frame information before the first determining module determines the adjustment parameter of the camera according to the focus information when it is determined that the current frame image does not satisfy the preset condition; and the third determining module can be configured to determine that the current frame image does not satisfy the preset condition when the image focus is not within a current lens focus range of the camera.
[0160] In some embodiments, the first determining module can include a first obtaining unit and a first calculating unit.
[0161] The first obtaining unit can be configured to obtain a lens resolution of the camera when it is determined that the current frame image does not satisfy the preset condition; and the first calculating unit can be configured to calculate the adjustment parameter of the camera according to the lens resolution and the focus information.
[0162] In some embodiments, the third obtaining module can include a second obtaining unit and a first determining unit.
[0163] The second obtaining unit can be configured to obtain a target face frame region according to the target face frame information when it is determined that a target face corresponding to the target face frame information satisfies a portrait capturing condition; and the first determining unit can be configured to determine the target face frame region as the focus information of the current frame image.
[0164] In some embodiments, the third obtaining module can further include a third obtaining unit and a second determining unit.
[0165] The third obtaining unit can be configured to obtain a target face frame center point corresponding to the target face frame information when it is determined that a target face corresponding to the target face frame information does not satisfy a portrait capturing requirement; and the second determining unit can be configured to determine the target face frame center point as the focus information.
[0166] In some embodiments, the portrait capturing apparatus 300 can further include a fourth obtaining module and a fourth determining module.
[0167] The fourth acquisition module can be configured to acquire target face data according to the target face frame information before the third acquisition module determines the focus information of the current frame image when the current frame image is a still scene image; and the fourth determination module can be configured to determine that the target face corresponding to the target face frame information meets the portrait capture requirement when the target face data is greater than or equal to a data threshold.
[0168] In some embodiments, the portrait capture device 300 can further include a fifth acquisition module, a sixth acquisition module, and a fifth determination module.
[0169] The fifth acquisition module can be configured to acquire first optical flow coordinates of a target pixel point in the current frame image before the motion portrait information capture module 330 captures target motion portrait information of a target portrait according to the target face frame information when the current frame image is a motion scene image; the sixth acquisition module can be configured to acquire second optical flow coordinates of the target pixel point in a next frame image of the current frame image; and the fifth determination module can be configured to determine that the current frame image is a motion scene image according to the first optical flow coordinates and the second optical flow coordinates.
[0170] In some embodiments, the fifth determination module can include a second calculation unit and a third determination unit.
[0171] The second calculation unit can be configured to calculate a coordinate difference value of the first optical flow coordinates and the second optical flow coordinates; and the third determination unit can be configured to determine that the current frame image is a motion scene image when the coordinate difference value is greater than or equal to a difference value threshold.
[0172] In some embodiments, the fifth acquisition module can include a fourth determination unit and a first detection unit.
[0173] The fourth determination unit can be configured to determine the target pixel point in the current frame image; and the first detection unit can be configured to perform optical flow detection on the target pixel point in the current frame image to obtain the corresponding first optical flow coordinates.
[0174] In some embodiments, the sixth acquisition module can include a fourth acquisition unit and a second detection unit.
[0175] The fourth acquisition unit can be configured to acquire a next frame image of the current frame image to obtain the next frame image; and the second detection unit can be configured to perform optical flow detection on the target pixel point in the next frame image to obtain the corresponding second optical flow coordinates.
[0176] In some embodiments, the portrait capture device 300 can further include a cropping module.
[0177] The cropping module can be configured to perform regional cropping on the current frame image to obtain a cropped frame image before the second acquisition module 320 acquires the target face frame information of the target portrait from the current frame image.
[0178] In some embodiments, the second acquisition module 320 can include a third detection unit.
[0179] The third detection unit can be configured to perform face detection on the cropped frame image to obtain the target face frame information of the target portrait.
[0180] The scheme provided in this embodiment achieves portrait capturing of a target portrait according to target face frame information of the target portrait in a photographing process of photographing a portrait image of a target portrait in a moving state, avoids failure to capture a target portrait when capturing a portrait according to a starting moving position of a target portrait captured by a camera, ensures that a camera always captures a target portrait because the target face frame information is real-time information of the target portrait, and improves photographing success rate of photographing a portrait image.
[0181] Please refer to Figure 10 which shows a portrait capturing apparatus 500 provided in an embodiment of the present application. The portrait capturing apparatus 500 can be applied to the electronic device 100. In the following, the portrait capturing apparatus 500 shown in FIG. 5 will be described in detail with the electronic device 100 as an example. The portrait capturing apparatus 500 can include a first acquisition module 310, a second acquisition module 320, a third acquisition module 510, a still portrait information capturing module 520, and a still portrait image generating module 530. Figure 10
[0182] The first acquisition module 310 can be configured to acquire a current frame image, the current frame image including a target portrait; the second acquisition module 320 can be configured to acquire target face frame information of the target portrait from the current frame image; the third acquisition module 510 can be configured to acquire focus information of the current frame image when it is determined that the current frame image is a still scene image; the still portrait information capturing module 520 can be configured to capture target still portrait information of the target portrait according to the target face frame information and the focus information; and the still portrait image generating module 530 can be configured to generate a target still portrait image according to the target still portrait information.
[0183] In some embodiments, the portrait capturing apparatus 500 can further include a first determination module and a control module.
[0184] The first determining module can be configured to determine the adjustment parameter of the camera according to the focus information when it is determined that the current frame image does not satisfy the preset condition, the preset condition can be configured to represent a condition for the current frame image to be a clear image, and the adjustment parameter can be configured to represent a parameter for adjusting the camera when the current frame image is adjusted to be a clear image.
[0185] In some embodiments, the portrait capturing apparatus 300 can further include a second determining module and a third determining module.
[0186] The second determining module can be configured to determine the image focus of the current frame image according to the target face frame information before the first determining module determines the adjustment parameter of the camera according to the focus information when it is determined that the current frame image does not satisfy the preset condition, and the third determining module can be configured to determine that the current frame image does not satisfy the preset condition when the image focus is not within the current lens focus range of the camera.
[0187] In some embodiments, the first determining module can include a first obtaining unit and a first calculating unit.
[0188] The first obtaining unit can be configured to obtain the lens resolution of the camera when it is determined that the current frame image does not satisfy the preset condition, and the first calculating unit can be configured to calculate the adjustment parameter of the camera according to the lens resolution and the focus information.
[0189] In some embodiments, the third obtaining module can include a second obtaining unit and a first determining unit.
[0190] The second obtaining unit can be configured to obtain the target face frame region according to the target face frame information when it is determined that the target face corresponding to the target face frame information satisfies the portrait capturing condition, and the first determining unit can be configured to determine the target face frame region as the focus information of the current frame image.
[0191] In some embodiments, the third obtaining module can further include a third obtaining unit and a second determining unit.
[0192] The third obtaining unit can be configured to obtain the target face frame center point corresponding to the target face frame information when it is determined that the target face corresponding to the target face frame information does not satisfy the portrait capturing requirement, and the second determining unit can be configured to determine the target face frame center point as the focus information.
[0193] In some embodiments, the portrait capturing apparatus 300 can further include a fourth obtaining module and a fourth determining module.
[0194] The fourth acquisition module can be configured to acquire target face data according to the target face frame information before the third acquisition module determines that the current frame image is a still scene image and acquires the focus information of the current frame image.
[0195] The scheme provided by the embodiment acquires a current frame image, acquires target face frame information of a target portrait according to the current frame image, acquires focus information of the current frame image when it is determined that the current frame image is a still scene image, acquires target still portrait information of the target portrait according to the target face frame information and the focus information, and generates a target still portrait image according to the target still portrait information. In the process of photographing the portrait image of the target portrait in a still state, the target portrait is captured according to the target face frame information and the focus information of the target portrait. Since the target face frame information is real-time information of the target portrait, the camera can always capture the target portrait, the success rate of photographing the portrait image is improved. The focusing is performed on the target face region, and when the focusing is performed on a region other than the target face region, the region image other than the target face region image in the captured portrait image is clearer, the target face region image in the captured portrait image is clearer, and the photographing quality of the portrait image is improved.
[0196] It should be noted that each embodiment in the specification adopts a progressive manner for description, and each embodiment focuses on the difference from other embodiments. The same and similar parts of each embodiment can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant part can be referred to the part of the method embodiment. Any processing manner described in the method embodiment can be realized by a corresponding processing module in the device embodiment, and the device embodiment will not be described again.
[0197] In addition, each functional module in each embodiment of the present application can be integrated in one processing module, or each module can exist physically, or two or more modules can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software functional module.
[0198] Please refer to Figure 11 which shows a hardware structure schematic diagram of the electronic device 100 provided by an embodiment of the present application. As shown in Figure 11As shown, the electronic device 100 can 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 speaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, 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. Among them, the sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0199] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0200] Exemplarily, Figure 11 The processor 110 shown can include one or more processing units, for example: the processor 110 can 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 can be independent devices, or can be integrated in one or more processors.
[0201] Among them, the controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals to complete the control of fetching instructions and executing instructions.
[0202] The processor 110 can also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can hold instructions or data that the processor 110 has just used or is using repeatedly. If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thus improving the efficiency of the system.
[0203] 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.
[0204] In some embodiments, the I2C interface is a bidirectional synchronous serial bus that includes a Serial Data Line (SDA) and a Derail Clock Line (SCL). The processor 110 can include multiple sets of I2C buses. The processor 110 can be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example, the processor 110 can be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface, realizing the touch function of the electronic device 100.
[0205] In some embodiments, the I2S interface can be used for audio communication. The processor 110 can include multiple sets of I2S buses. The processor 110 can be coupled to the audio module 170 through the I2S bus, realizing the communication between the processor 110 and the audio module 170.
[0206] In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through an I2S interface, enabling the function of answering a phone call through a Bluetooth headset.
[0207] In some embodiments, the PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. The audio module 170 and the wireless communication module 160 can be coupled through a PCM bus interface.
[0208] In some embodiments, the audio module 170 can also deliver audio signals to the wireless communication module 160 through a PCM interface, enabling the function of answering a phone call through a Bluetooth headset. It should be understood that both the I2S interface and the PCM interface can be used for audio communication.
[0209] In some embodiments, the UART interface is a universal serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts data to be transmitted between serial communication and parallel communication. The UART interface is usually used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface, enabling Bluetooth functionality. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the UART interface, enabling the function of playing music through a Bluetooth headset.
[0210] In some embodiments, the MIPI interface can be used to connect the processor 110 and peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes the camera serial interface (CSI), the display screen serial interface (DSI), etc. The processor 110 and the camera 193 communicate through the CSI interface, enabling the camera function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface, enabling the display function of the electronic device 100.
[0211] In some embodiments, the GPIO interface can be configured through software. The GPIO interface can be configured as a control signal or as a data signal. The GPIO interface can be used to connect the processor 110 and the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0212] Exemplarily, the USB interface 130 is an interface conforming to the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and a peripheral device. It can also be used to connect a headset to play audio through the headset. The interface can also be used to connect other electronic devices, such as an AR device, and the like.
[0213] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device 100. In other embodiments of the present application, the electronic device 100 can also use different interface connection modes or combinations of multiple interface connection modes in the above embodiments.
[0214] The charging management module 140 is configured to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 can charge the battery 142 while also supplying power to the electronic device through the power management module 141.
[0215] The power management module 141 can be configured to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to supply power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160, and the like. The power management module 141 can also be configured to monitor parameters such as battery capacity, battery cycle count, battery health status (leakage, impedance), and the like. In other embodiments, the power management module 141 can also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.
[0216] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, and the like.
[0217] The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each of the antennas in the electronic device 100 can be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.
[0218] The mobile communication module 150 can provide a solution for wireless communication applied to the electronic device 100, such as at least one of the following solutions: a second generation (2th Generation, 2G) mobile communication solution, a third generation (3th Generation, 3G) mobile communication solution, a fourth generation (4th Generation, 4G) mobile communication solution, a fifth generation (5th Generation, 5G) mobile communication solution. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform filtering and amplification, etc. on the received electromagnetic waves, and then transmit to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor, and the amplified signals are converted into electromagnetic waves by the antenna 1 and radiated. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be arranged in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be arranged in the same device as at least part of the modules of the processor 110.
[0219] The modem processor can include a modulator and a demodulator. The modulator is used to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to a loudspeaker 170A, a receiver 170B, etc.), or displays images or videos through a display screen 194. In some embodiments, the modem processor can be an independent device. In some other embodiments, the modem processor can be independent of the processor 110, and arranged in the same device as the mobile communication module 150 or other functional modules.
[0220] The wireless communication module 160 can provide a solution for wireless communication including Wireless Local Area Networks (WLAN) (e.g., Wireless Fidelity (Wi-Fi) network), Blue Tooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), etc. applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrated with at least one communication processing module. The wireless communication module 160 receives an electromagnetic wave via the antenna 2, frequency-modulates and filters the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, frequency-modulate it, amplify it, and radiate it as an electromagnetic wave via the antenna 2.
[0221] In some embodiments, the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 of the electronic device 100 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with a network and other electronic devices through wireless communication technology. The wireless communication technology can include at least one of the following communication technologies: Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wide-band Code Division Multiple Access (WCDMA), Time-division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, IR technology. The GNSS can include at least one of the following positioning technologies: Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), Beidou Navigation Satellite System (BDS), Quasi-zenith Satellite System (QZSS), Satellite Based Augmentation Systems (SBAS).
[0222] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, and the GPU is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.
[0223] The display screen 194 is configured to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can be a Liquid Crystal Display (LCD), an Organic Light Emitting Diode (OLED), an Active-matrix Organic Light Emitting Diode (AMOLED), a Flex Light Emitting Diode (FLED), a Mini-LED, a Micro-LED, a Micro-OLED, a Quantum Dot Light Emitting Diodes (QLED), or the like. In some embodiments, the electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1.
[0224] The electronic device 100 can implement the photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, and the like.
[0225] The ISP is configured to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing to convert it into an image visible to the naked eye. The ISP can also optimize the algorithm for noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature, and other parameters of the shooting scene. In some embodiments, the ISP can be disposed in the camera 193.
[0226] The camera 193 is configured to capture still images or videos. An object generates an optical image through a lens and projects it onto a 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 light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into a standard RGB, YUV, or the like format image signal. In some embodiments, the electronic device 100 can include one or N cameras 193, where N is a positive integer greater than 1.
[0227] The digital signal processor is used to process digital signals, in addition to being able to process 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.
[0228] The video codec is used to compress or decompress digital video. 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 encoding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.
[0229] The NPU is a neural network (Neural Network, NN) calculation processor, which learns from the structure of biological neural networks, such as learning from the transmission mode between human brain neurons, and can quickly process input information and continuously self-learn. Through the NPU, the electronic device 100 can realize intelligent cognition and other applications, such as: image recognition, face recognition, voice recognition, text understanding, etc.
[0230] The external memory interface 120 can be used to connect an external memory card, such as a Secure Digital (SD) card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize data storage functions. For example, music, video, etc. Files are saved in the external memory card.
[0231] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various function 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. The program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phonebook, etc.), 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 magnetic disk storage device, a flash memory device, a Universal Flash Storage (UFS), etc.
[0232] The electronic device 100 can realize audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. For example, music playing, recording, etc.
[0233] The audio module 170 can be configured to convert digital audio information into an analog audio signal output, and can be configured to convert an analog audio input into a digital audio signal. The audio module 170 can also be configured to encode and decode an audio signal. In some embodiments, the audio module 170 can be disposed in the processor 110, or some of the functions of the audio module 170 can be disposed in the processor 110.
[0234] The speaker 170A, also referred to as a "loudspeaker", is configured to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0235] The receiver 170B, also referred to as a "earpiece", is configured to convert an audio electrical signal into a sound signal. When the electronic device 100 receives a call or a voice message, the user can listen to the voice by holding the receiver 170B close to the ear.
[0236] The microphone 170C, also referred to as a "microphone" or "microphone", is configured to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can speak into the microphone 170C by holding the microphone 170C close to the mouth, and input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, in addition to collecting sound signals, it can also achieve noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, which can achieve the functions of collecting sound signals, noise reduction, identifying sound sources, realizing directional recording, etc.
[0237] The earphone interface 170D is configured to connect a wired earphone. The earphone interface 170D can be a USB interface 130, or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.
[0238] The pressure sensor 180A is configured to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. The pressure sensor 180A can be of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, etc. The capacitive pressure sensor can include at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with a touch operation intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view a short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.
[0239] The gyroscope sensor 180B can be configured to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake photography. Illustratively, when the shutter is pressed, the gyroscope sensor 180B detects the angle of shaking of the electronic device 100, and calculates the distance that the lens module needs to compensate based on the angle, so that the lens counteracts the shaking of the electronic device 100 by reverse movement, thereby achieving anti-shake. The gyroscope sensor 180B can also be used for navigation and motion sensing game scenarios.
[0240] The barometric pressure sensor 180C is configured to measure air pressure. In some embodiments, the electronic device 100 calculates altitude, assists positioning and navigation based on the air pressure value measured by the barometric pressure sensor 180C.
[0241] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can detect the opening and closing of a flip cover by using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D, and set features such as automatic unlocking of the flip cover based on the detected opening and closing state of the cover or the opening and closing state of the flip cover.
[0242] The acceleration sensor 180E can detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). When the electronic device 100 is stationary, the acceleration sensor 180E can detect the magnitude and direction of gravity. The acceleration sensor 180E can also be used to identify the attitude of the electronic device, and can be applied to landscape / portrait screen switching, pedometers, etc.
[0243] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance by infrared or laser. In some embodiments, the electronic device 100 can take a scene and use the distance sensor 180F to measure distance to achieve fast focus.
[0244] The proximity light sensor 180G can include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode can be an infrared light emitting diode. The electronic device 100 emits infrared light outwardly through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using the photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that a user is holding the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to achieve the purpose of power saving. The proximity light sensor 180G can also be used for automatic unlocking and locking of the skin case mode and the pocket mode.
[0245] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application lock, fingerprint photographing, fingerprint answering a call, and the like.
[0246] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to implement a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold value, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by low temperature. In other embodiments, when the temperature is lower than yet another threshold value, the electronic device 100 performs voltage boosting on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0247] Touch sensor 180K, also called "touch panel". Touch sensor 180K can be disposed on display screen 194, and touch sensor 180K and display screen 194 together form a touch screen, also called "touch panel". Touch sensor 180K is used to detect touch operation applied on or near it. Touch sensor 180K can transmit detected touch operation to application processor 110 to determine touch event type. Visual output related to touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K can also be disposed on the surface of electronic device 100, in a position different from that of display screen 194.
[0248] Ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust display screen 194 brightness according to sensed ambient light brightness. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touch.
[0249] Bone conduction sensor 180M can obtain vibration signal. In some embodiments, bone conduction sensor 180M can obtain vibration signal of human body sound part vibration bone block. Bone conduction sensor 180M can also contact human body pulse to receive blood pressure pulsation signal. In some embodiments, bone conduction sensor 180M can also be disposed in earphone to form bone conduction earphone. Audio module 170 can parse voice signal based on vibration signal of human body sound part vibration bone block obtained by bone conduction sensor 180M to realize voice function. Application processor 110 can parse heart rate information based on blood pressure pulsation signal obtained by bone conduction sensor 180M to realize heart rate detection function.
[0250] Keys 190 include power on key, volume key, etc. Keys 190 can be mechanical keys. They can also be touch keys. Electronic device 100 can receive key input to generate key signal input related to user settings and function control of electronic device 100.
[0251] Motor 191 can generate vibration prompt. Motor 191 can be used for incoming call vibration prompt, and also can be used for touch vibration feedback. For example, touch operation applied to different applications (such as taking photos, audio playing, etc.) can correspond to different vibration feedback effects. Touch operation applied to different regions of display screen 194 can also correspond to different vibration feedback effects. Different application scenarios (such as time reminder, receiving information, alarm, game, etc.) can also correspond to different vibration feedback effects. Touch vibration feedback effect can also support customization.
[0252] Indicator 192 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0253] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces 195, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0254] Please see Figure 12 This illustrates a functional block diagram of an electronic device 100 according to an embodiment of this application. Figure 12 As shown, the electronic device 100 includes: at least one processor 110 ( Figure 12 The diagram shows only one processor), memory 196, and a computer program 197 stored in memory 196 and executable on at least one processor 110. When processor 110 executes computer program 197, it causes the electronic device 100 to perform the steps in any of the above methods.
[0255] Those skilled in the art will understand that Figure 12 This is merely an example of electronic device 100 and does not constitute a limitation on electronic device 100. In practice, electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0256] The processor 110 can be a central processing unit (CPU), other general purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0257] The memory 196 can be an internal storage unit of the electronic device 100, such as a hard disk or a memory of the electronic device 100, in some embodiments. The memory 196 can also be an external storage device of the electronic device 100, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 100, in other embodiments. Alternatively, the memory 196 can include both an internal storage unit and an external storage device of the electronic device 100. The memory 196 is used to store an operating system, application programs, a boot loader, data, and other programs, such as program codes of computer programs, etc. The memory 196 can also be used to temporarily store data that has been output or will be output.
[0258] It should be noted that the information interaction, execution process, etc. between the above apparatuses / units, since based on the same concept as the method embodiments of the present application, the specific functions and the technical effects brought by them can be referred to the method embodiments part, and will not be described here in detail.
[0259] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is exemplified, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the above device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or software functional unit. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the unit and module in the above system can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0260] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program. When the computer program is called by an electronic device, the method described in each of the above method embodiments can be implemented.
[0261] The embodiment of the present application further provides a computer program product, which stores a program code. When the computer program product is run on an electronic device, the electronic device executes the above related steps to implement the method described in each of the above method embodiments.
[0262] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, all or part of the processes in the above embodiment methods can be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. The computer program can be executed by a processor to implement the steps of each of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms. The computer readable medium at least includes any entity or device capable of carrying the computer program code to the photographing device / electronic device, recording medium, computer memory, read only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer readable medium cannot be an electrical carrier signal and a telecommunication signal.
[0263] In the above embodiments, the description of each embodiment is focused on, and the parts not described or recorded in a certain embodiment can be referred to the relevant description of other embodiments.
[0264] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0265] In the embodiments provided in the present application, it should be understood that the disclosed apparatuses / devices and methods can be implemented in other ways. For example, the above-described apparatus / device embodiments are only schematic. The division of the modules or units is only a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between the units can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.
[0266] The units described as separate components above can or can not be physically separate, and the components shown as units can or can not be physical units, i.e. they can be located in one place, or distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0267] It should be understood that when used in the specification and the appended claims of the present application, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or sets thereof.
[0268] It should also be understood that the term "and / or" used in the specification and the appended claims of the present application means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0269] In addition, in the description of the specification and the appended claims of the present application, the terms "first", "second", "third" and the like are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0270] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in still other embodiments" appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0271] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for capturing human images, characterized in that, The portrait capture method includes: Acquire the current frame image, which includes the target human image; Based on the current frame image, obtain the target face bounding box information of the target portrait; Obtain the first optical flow coordinates of the target pixel in the current frame image; Obtain the second optical flow coordinates of the target pixel in the next frame image, where the next frame image is the image following the current frame image; Calculate the coordinate difference between the first optical flow coordinate and the second optical flow coordinate; When the coordinate difference is greater than or equal to the difference threshold, the current frame image is determined to be a moving scene image; When the coordinate difference is less than the difference threshold, the current frame image is determined to be a still scene image; When the current frame image is determined to be a moving scene image, the target moving portrait information of the target portrait is captured based on the target face bounding box information; Generate a target moving portrait image based on the target moving portrait information; When it is determined that the current frame image is a still scene image, it is determined whether the target face corresponding to the target face bounding box information meets the portrait capture requirements; When it is determined that the target face corresponding to the target face bounding box information meets the portrait capture requirements, the target face bounding box region is obtained according to the target face bounding box information, and the target face bounding box region is determined as the focus information of the current frame image; When it is determined that the target face corresponding to the target face frame information does not meet the portrait capture requirements, the center point of the target face frame corresponding to the target face frame information is obtained, and the center point of the target face frame is determined as the focus information; Capture the target still image information of the target person based on the target face bounding box information and the focus information; Generate a target still image based on the target still image information.
2. The human image capture method according to claim 1, characterized in that, The portrait capture method also includes: When it is determined that the current frame image does not meet the preset conditions, the adjustment parameters of the camera are determined according to the focus information. The preset conditions are used to characterize the conditions under which the current frame image is a clear image, and the adjustment parameters are used to characterize the parameters for adjusting the camera when the current frame image is adjusted to the clear image. The camera is moved according to the adjustment parameters.
3. The human image capture method according to claim 2, characterized in that, Before determining the camera adjustment parameters based on the focus information when it is determined that the current frame image does not meet the preset conditions, the portrait capture method further includes: Based on the target face bounding box information, determine the image focal length of the current frame image; When the focal length of the image is not within the current lens focal length range of the camera, it is determined that the current frame image does not meet the preset conditions.
4. The human image capture method according to claim 2, characterized in that, When it is determined that the current frame image does not meet the preset conditions, the adjustment parameters of the camera are determined based on the focus information, including: When it is determined that the current frame image does not meet the preset conditions, the lens resolution of the camera is obtained; The adjustment parameters of the camera are calculated based on the lens resolution and the focus information.
5. The portrait capture method according to any one of claims 1 to 4, characterized in that, The step of determining that the target face corresponding to the target face bounding box information meets the portrait capture requirements includes: Obtain target face data based on the target face bounding box information; When the target face data is greater than or equal to the data threshold, it is determined that the target face corresponding to the target face bounding box information meets the portrait capture requirements.
6. The portrait capture method according to any one of claims 1 to 4, characterized in that, The step of obtaining the first optical flow coordinates of the target pixel in the current frame image includes: Determine the target pixel in the current frame image; Optical flow detection is performed on the target pixel in the current frame image to obtain the corresponding first optical flow coordinates.
7. The portrait capture method according to any one of claims 1 to 4, characterized in that, The step of obtaining the second optical flow coordinates of the target pixel in the next frame image includes: Obtain the next frame image of the current frame image to get the next frame image; Optical flow detection is performed on the target pixel in the next frame image to obtain the corresponding second optical flow coordinates.
8. The human image capture method according to any one of claims 1 to 4, characterized in that, Before obtaining the target face bounding box information of the target portrait based on the current frame image, the portrait capture method further includes: The current frame image is cropped to obtain a cropped frame image; The step of obtaining the target face bounding box information of the target portrait based on the current frame image includes: Face detection is performed on the cropped frame image to obtain the target face bounding box information of the target portrait.
9. A method for capturing human images, characterized in that, The portrait capture method includes: Acquire the current frame image, which includes the target human image; Based on the current frame image, obtain the target face bounding box information of the target portrait; When it is determined that the current frame image is a still scene image, it is determined whether the target face corresponding to the target face bounding box information meets the portrait capture requirements; When it is determined that the target face corresponding to the target face bounding box information meets the portrait capture requirements, the target face bounding box region is obtained according to the target face bounding box information, and the target face bounding box region is determined as the focus information of the current frame image; When it is determined that the target face corresponding to the target face frame information does not meet the portrait capture requirements, the center point of the target face frame corresponding to the target face frame information is obtained, and the center point of the target face frame is determined as the focus information; Capture the target still image information of the target person based on the target face bounding box information and the focus information; Generate a target still image based on the target still image information.
10. The portrait capture method according to claim 9, characterized in that, The portrait capture method also includes: When it is determined that the current frame image does not meet the preset conditions, the adjustment parameters of the camera are determined according to the focus information. The preset conditions are used to characterize the conditions under which the current frame image is a clear image, and the adjustment parameters are used to characterize the parameters for adjusting the camera when the current frame image is adjusted to the clear image. The camera is moved according to the adjustment parameters.
11. The human image capture method according to claim 10, characterized in that, Before determining the camera adjustment parameters based on the focus information when it is determined that the current frame image does not meet the preset conditions, the portrait capture method further includes: Based on the target face bounding box information, determine the image focal length of the current frame image; When the focal length of the image is not within the current lens focal length range of the camera, it is determined that the current frame image does not meet the preset conditions.
12. The portrait capture method according to claim 10, characterized in that, When it is determined that the current frame image does not meet the preset conditions, the adjustment parameters of the camera are determined based on the focus information, including: When it is determined that the current frame image does not meet the preset conditions, the lens resolution of the camera is obtained; The adjustment parameters of the camera are calculated based on the lens resolution and the focus information.
13. The portrait capture method according to any one of claims 9 to 12, characterized in that, The step of determining that the target face corresponding to the target face bounding box information meets the portrait capture requirements includes: Obtain target face data based on the target face bounding box information; When the target face data is greater than or equal to the data threshold, it is determined that the target face corresponding to the target face bounding box information meets the portrait capture requirements.
14. A human image capture device, characterized in that, The human image capture device includes: The first acquisition module is used to acquire the current frame image, the current frame image including the target human image; The second acquisition module is used to acquire the target face bounding box information of the target portrait based on the current frame image; The fifth acquisition module is used to acquire the first optical flow coordinates of the target pixel in the current frame image; The sixth acquisition module is used to acquire the second optical flow coordinates of the target pixel in the next frame image, wherein the next frame image is the next frame image after the current frame image; The second calculation unit is used to calculate the coordinate difference between the first optical flow coordinate and the second optical flow coordinate; The third determining unit is configured to determine the current frame image as a moving scene image when the coordinate difference is greater than or equal to the difference threshold; and to determine the current frame image as a static scene image when the coordinate difference is less than the difference threshold. The motion portrait information capture module is used to capture the target motion portrait information of the target portrait based on the target face bounding box information when the current frame image is determined to be a motion scene image. A moving human image generation module is used to generate a target moving human image based on the target moving human image information; The third acquisition module is used to determine whether the target face corresponding to the target face bounding box information meets the portrait capture requirements when the current frame image is determined to be a still scene image; and to obtain the target face bounding box region according to the target face bounding box information and determine the target face bounding box region as the focus information of the current frame image when the target face bounding box information meets the portrait capture requirements; and to obtain the center point of the target face bounding box information and determine the center point of the target face bounding box as the focus information when the target face corresponding to the target face bounding box information does not meet the portrait capture requirements. A still portrait information capture module is used to capture the still portrait information of the target portrait based on the target face frame information and the focus information; A still portrait image generation module is used to generate a target still portrait image based on the target still portrait information.
15. A human image capture device, characterized in that, The human image capture device includes: The first acquisition module is used to acquire the current frame image, the current frame image including the target human image; The second acquisition module is used to acquire the target face bounding box information of the target portrait based on the current frame image; The third acquisition module is used to determine whether the target face corresponding to the target face bounding box information meets the portrait capture requirements when the current frame image is determined to be a still scene image; and to obtain the target face bounding box region according to the target face bounding box information and determine the target face bounding box region as the focus information of the current frame image when the target face bounding box information meets the portrait capture requirements; and to obtain the center point of the target face bounding box information and determine the center point of the target face bounding box as the focus information when the target face corresponding to the target face bounding box information does not meet the portrait capture requirements. A still portrait information capture module is used to capture the still portrait information of the target portrait based on the target face frame information and the focus information; A still portrait image generation module is used to generate a target still portrait image based on the target still portrait information.
16. An electronic device, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it causes the electronic device to perform the human image capture method as claimed in any one of claims 1 to 8 or any one of claims 9 to 13.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by an electronic device to execute the portrait capture method as described in any one of claims 1 to 8 or any one of claims 9 to 13.
Citation Information
Patent Citations
Adjustingmethod and adjusting device of human face focusing definition
CN105872363A