Image capture method and electronic device
By collecting and analyzing the yaw angle of the human face in electronic devices to determine the end moment of looking back, it solves the problem of difficulty in accurately capturing wonderful moments in manual shooting and achieves accurate capture of wonderful frames of looking back.
Patent Information
- Application Number
- PCT/CN2023/133484
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-22
- Filing Date
- 2023-11-22
- Publication Date
- 2024-08-29
AI Technical Summary
In existing electronic equipment, it is difficult to accurately capture wonderful moments by manually controlling the shooting timing, especially the ending moment of looking back, and the error rate is high.
Collect preview images through the camera to obtain the yaw angle of the human face, determine the end moment of looking back according to preset conditions, and store the corresponding preview images as highlight frames. The specific method includes detecting the moment when the yaw angle of the human face decreases from a larger value to a smaller value, and confirming it as the end moment of looking back after reaching the minimum value to improve the accuracy of the capture.
It is possible to accurately capture the wonderful frames you look back on during the preview process, improving the accuracy of capturing wonderful moments and reducing the error rate.
Smart Images

Figure CN2023133484_29082024_PF_FP_ABST
Abstract
Description
Image capture method and electronic equipment
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 22, 2023, with application number 202310190142.8 and invention name “A method for capturing images and an electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of image technology, and in particular to an image capture method and electronic equipment. Background Art
[0003] Currently, electronic devices such as mobile phones and tablets often include camera apps. These apps allow users to capture photos or videos. However, if users want to capture a unique moment, such as the end of a glance, they typically have to manually control the timing of the shot.
[0004] However, the inventors discovered during the implementation of the embodiments of the present application that it is usually difficult to accurately capture wonderful moments by manually controlling the shooting timing, and the error rate is extremely high.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide an image capture method and an electronic device, which can accurately capture wonderful frames of looking back.
[0007] In a first aspect, embodiments of the present application provide an image capture method applicable to electronic devices including cameras, such as mobile phones and tablets. The electronic device can capture preview images through the camera and obtain a facial yaw angle for each preview image. The facial yaw angle is the left-right rotation angle of a first user's face relative to a first line, where the first user is the user being photographed by the camera and the first line is the line connecting the camera and the first user's head.
[0008] If the yaw angle of the human face decreases from a larger value to a smaller value as of the currently captured k-th preview image, it can be determined that a look back has occurred. At this time, the electronic device can store the preview image in which the yaw angle of the human face decreases to a smaller value as a wonderful frame of looking back. Specifically, if the yaw angle of the human face from the i-th preview image to the k-th preview image meets the preset conditions, the j-th preview image is stored as a wonderful frame of looking back. Among them, the k-th preview image is the preview image currently captured by the camera, 1≤i<j≤k, i, j and k are all integers. The preset conditions include: the yaw angle of the human face of the i-th frame image is greater than the first angle threshold, the yaw angle of the human face from the i-th frame image to the j-th preview image shows a decreasing trend, and the yaw angle of the human face of the j-th preview image is less than the second angle threshold.
[0009] In summary, in the embodiment of the present application, the electronic device can determine the end moment of a head turn when the human face yaw angle decreases from a relatively large value to a relatively small value, and store the preview image corresponding to this moment, that is, the wonderful frame of the head turn. In this way, the electronic device can accurately capture the wonderful frame of the head turn during the preview process.
[0010] To be precise, the end moment of the head turn should be the moment when the human face yaw angle changes from a relatively large value to a relatively small value and reaches the minimum value. Based on this, in a possible design manner of the first aspect, the k-th frame image is a preview image after the j-th preview image, that is, j < k. And, in this design manner, the moment when the human face yaw angle changes from a relatively large value to a relatively small value and reaches the minimum value is determined as the end moment of the head turn. Specifically, in this implementation manner, the preset condition further includes: the human face yaw angle of the j-th preview image is the minimum value of the human face yaw angles of the j-th preview image to the k-th preview image.
[0011] Taking the second angle threshold as 30° as an example, the changes in the face angle are 70°, 65°, 62°... 31°, 28°, 25°, 23°, 24°, 24°, 26°. Although the face angle already meets the condition of being less than the second angle threshold when it is 28°, after 28°, the face angle continues to decrease, such as decreasing to 25° and 23° in sequence. In fact, the head turn has not ended yet. It is not difficult to find that after the face angle decreases to 23°, it gradually increases, such as increasing to 24° and 26° in sequence. That is, after the face angle decreases to the minimum value of 23°, it gradually increases. Using this design manner, in this example, the preview image corresponding to 23° can be stored as the wonderful frame of the head turn.
[0012] Using this design manner, the moment when it decreases to the minimum value is determined as the end moment of the head turn, and the preview image corresponding to this moment is stored. In this way, the real end moment of the head turn can be determined, improving the accuracy of capture.
[0013] At the end moment of the head turn, the human face usually pauses for a period of time. During this period, the face angle will only change by a very small amount, such as the change range is within 3°. Based on this, in another possible design manner of the first aspect, after determining that it has decreased to the minimum value, the change range of the human face yaw angle after this minimum value can be further detected, and when the detected change range is small, the moment when the minimum value is reached is determined as the end moment of the head turn, and the preview image at this moment is stored as the wonderful frame of the head turn. Specifically, in this implementation manner, the preset condition further includes: the absolute difference between the human face yaw angle of the j-th preview image and the human face yaw angles of the m preview images after the j-th preview image is less than the first difference threshold, 1 ≤ m, j + m ≤ k, and m is an integer.
[0014] By adopting this design, when it is determined that the yaw angle of the human face has only changed slightly after decreasing to the minimum value, the moment of the minimum value can be determined as the end moment of the look back, thereby improving the accuracy of the capture.
[0015] Experience shows that for side faces with relatively large angles, deviations are likely to occur when detecting their facial yaw angles. For example, 90° is detected as 25°, 30°, etc. In this scenario, the detected facial angle will jump, such as increasing or decreasing significantly. In practice, the change in the facial yaw angle is a relatively smooth process and usually does not jump. Based on this, in another possible design method of the first aspect, after determining that it has been reduced to a minimum value, the difference between the minimum value and its adjacent facial yaw angles can be further detected, and when the absolute value of the difference (i.e., the absolute difference) is detected to be small, the moment of reaching the minimum value is determined to be the end moment of the look back, and the preview image of the moment is stored as a wonderful frame of the look back. Specifically, in this design method, the preset condition also includes: the absolute difference between the facial yaw angle of the j-th frame preview image and the facial yaw angle of the first user in the j-1-th frame preview image and the j+1-th frame preview image is less than the second difference threshold.
[0016] By adopting this design, the moment when the face angle reaches the minimum value can be determined as the moment of looking back only when it is determined that the minimum value to which the face angle is reduced is not a jump value, thereby improving the accuracy of the determined wonderful frame.
[0017] In another possible design of the first aspect, the electronic device may store the human face yaw angle in a preset storage space, and the preset storage space only stores a fixed number (e.g., n) of human face yaw angles. For example, the preset storage space is a cache, and after the fixed number of human face yaw angles stored therein is reached, a human face yaw angle is output as a human face yaw angle is entered.
[0018] Specifically, in this design, after obtaining the facial yaw angle of the k-th preview image (the currently captured preview image), the method further includes: if the number of facial yaw angles in the preset storage space is less than n, storing the facial yaw angle of the k-th preview image in the preset storage space, where 1≤n, and n is an integer. If the number of facial yaw angles in the preset storage space is greater than or equal to n, removing the facial yaw angle of the kn-th preview image from the preset storage space and then storing the facial yaw angle of the k-th preview image in the preset storage space.
[0019] By adopting this design, the yaw angles of the n most recent human faces stored in the preset storage space can be detected each time.
[0020] In another possible design of the first aspect, after storing the facial yaw angle of the k-th preview image in the preset storage space, the method further includes: if the number of facial yaw angles in the preset storage space is greater than or equal to n, but the first tag does not exist in the electronic device, detecting whether the facial yaw angle of the k-n+1-th preview image in the preset storage space is greater than a first angle threshold, and detecting a changing trend of the facial yaw angle from the k-n+1-th preview image to the k-th preview image in the preset storage space. The first tag may indicate that the facial yaw angle has been detected to be gradually decreasing from a larger value.
[0021] That is to say, if before the k-th preview image, it is not detected that the human face yaw angle is gradually decreasing from a larger value, then after the human face yaw angle of the k-th preview image is stored this time, it is first detected whether the human face yaw angles from the k-n+1-th preview image to the k-th preview image currently stored in the preset storage space are gradually decreasing from a larger value.
[0022] If the facial yaw angle of the preview image (k-n+1) is greater than the first angle threshold, and the facial yaw angle decreases from the preview image (k-n+1) to the preview image (k), a first label is recorded. This allows the facial yaw angle of a new preview image to be subsequently obtained, indicating that the facial yaw angle has gradually decreased from a larger value.
[0023] By adopting this design method and timely detecting that the yaw angle of the human face gradually decreases from a large value, the beginning of looking back is detected.
[0024] In another possible design of the first aspect, after the facial yaw angle of the kth preview image is stored in the preset storage space, the above method also includes: if the number of facial yaw angles in the preset storage space is greater than or equal to n, and there is a first tag in the electronic device, then determining that the facial yaw angle of the first user in the i-th frame image is greater than the first angle threshold, and the facial yaw angle of the first user in the i-th frame image to the j-th preview frame image shows a decreasing trend.
[0025] With this design, if the first tag already exists, it can be determined that the look back has begun.
[0026] In another possible design of the first aspect, the facial yaw angle of the j-th frame image is the facial yaw angle of the k-n+1-th frame preview image in the preset storage space. Accordingly, in the preset conditions, the facial yaw angle of the j-th frame preview image is less than the second angle threshold, the facial yaw angle of the j-th frame preview image is the minimum of the facial yaw angles from the j-th frame preview image to the k-th frame preview image, and the absolute difference between the facial yaw angle of the j-th frame preview image and the facial yaw angle of the m-frame preview image after the j-th frame preview image is less than the first difference threshold. The j-th frame preview image in the preset conditions refers to the k-n+1-th frame preview image. In this way, the j-th frame preview image can be accurately locked and the preset conditions can be detected.
[0027] In another possible design of the first aspect, the method further includes: if the absolute difference between the face yaw angle of the preview image of the k-n+1th frame in the preset storage space and the face yaw angle of the first preview image in the preset storage space is greater than a first difference threshold, deleting the first label. The first preview image is any preview image from the preview image of the k-n+2th frame to the preview image of the k-n+m+1th frame.
[0028] That is, if the j-th preview image and the subsequent m consecutive preview images have a large change in the face yaw angle, the first tag is deleted. After deleting the first tag, the next time the detection is performed, the detection of whether the look back has started will be restarted.
[0029] In another possible design manner of the first aspect, the method further includes: if the absolute difference between the face yaw angle of the person in the preview image of the k-n+1th frame and the face yaw angle of the person in the second preview image in the preset storage space is greater than a second difference threshold, deleting the first label. The second preview image is the preview image of the knth frame or the preview image of the k-n+2th frame.
[0030] That is, if the difference between the face yaw angle of the j-th frame preview image and its adjacent preview images is large, the first tag will also be deleted. After deleting the first tag, the next time the detection is repeated, the detection of whether the look back has started will be restarted.
[0031] In another possible design of the first aspect, if the kth preview image frame does not include the first user's face, the facial yaw angle in the preset storage space is deleted. Subsequently, the electronic device cannot use the deleted facial yaw angle to determine a highlight frame of the look back. This prevents the use of facial yaw angles of discontinuous faces in determining a highlight frame of the look back, thereby improving the accuracy of determining a highlight frame of the look back.
[0032] In another possible design of the first aspect, before storing the jth preview image, the method further includes: displaying the jth preview image or a thumbnail of the jth preview image. Receiving a first operation from the user confirming storage of the jth preview image. Accordingly, storing the jth preview image includes: storing the jth preview image in response to the first operation. This avoids storing images that the user is dissatisfied with.
[0033] In another possible design of the first aspect, there are multiple first users, and the facial yaw angle includes the facial yaw angle of each first user. In this way, a highlight frame of a look back can be detected for each user separately. For example, the facial yaw angles of different first users can be stored in different preset storage spaces, thereby enabling separate detection.
[0034] In a second aspect, embodiments of the present application further provide an electronic device comprising a display screen, a memory, and one or more processors. The display screen, the memory, and the processor are coupled. The memory is configured to store computer program code, the computer program code comprising computer instructions that, when executed by the processor, cause the electronic device to perform the method of the first aspect and any possible design thereof.
[0035] In a third aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device including a display screen and a memory; the chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected by lines; the interface circuit is used to receive a signal from the memory of the electronic device and send the signal to the processor, the signal including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device executes the method described in the first aspect and any possible design method thereof.
[0036] In a fourth aspect, the present application provides a computer storage medium comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect and any possible design thereof.
[0037] In a fifth aspect, the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method described in the first aspect and any possible design thereof.
[0038] It can be understood that the beneficial effects that can be achieved by the electronic device described in the second aspect, the chip system described in the third aspect, the computer storage medium described in the fourth aspect, and the computer program product described in the fifth aspect provided above can refer to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] FIG1 is a schematic diagram of a mobile phone interface according to an embodiment of the present application;
[0040] FIG2 is a schematic diagram of a facial angle provided by an embodiment of the present application;
[0041] FIG3 is a schematic diagram of key points of a face provided in an embodiment of the present application;
[0042] FIG4 is a schematic diagram of the principle of image capture provided by an embodiment of the present application;
[0043] FIG5 is a hardware structure diagram of an electronic device provided in an embodiment of the present application;
[0044] FIG6 is a software architecture diagram of an electronic device provided in an embodiment of the present application;
[0045] FIG7 is a second schematic diagram of a mobile phone interface provided in an embodiment of the present application;
[0046] FIG8 is a third schematic diagram of a mobile phone interface provided in an embodiment of the present application;
[0047] FIG9 is a flow chart of an image capture method according to an embodiment of the present application;
[0048] FIG10 is a second schematic diagram of the principle of image capture provided by an embodiment of the present application;
[0049] Figure 11 is a schematic diagram of a non-looking-back motion;
[0050] FIG12 is a third schematic diagram of the principle of image capture provided by an embodiment of the present application;
[0051] FIG13 is a fourth schematic diagram of a mobile phone interface provided in an embodiment of the present application;
[0052] FIG14 is a fourth schematic diagram of the principle of image capture provided by an embodiment of the present application;
[0053] FIG15 is a second flow chart of the image capture method provided in an embodiment of the present application;
[0054] FIG16 is a fifth schematic diagram of the principle of image capture provided by an embodiment of the present application;
[0055] Figure 17 is a schematic diagram of a non-looking-back motion;
[0056] FIG18 is a third flow chart of the image capture method provided in an embodiment of the present application;
[0057] FIG19 is a fourth flow chart of the image capture method provided in an embodiment of the present application;
[0058] FIG20 is a fifth schematic diagram of a mobile phone interface provided in an embodiment of the present application;
[0059] Figure 21 is a structural diagram of the chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The technical solutions in the embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0061] References to "one embodiment" or "some embodiments" etc. described in this specification mean that the specific features, structures or characteristics described in conjunction with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in another way. The term "connected" includes direct and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
[0062] In the embodiments of this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.
[0063] Before describing the solutions of the embodiments of the present application, the relevant terms involved in the present application are first introduced here.
[0064] 1. Preview the image.
[0065] A preview image is an image used for user preview. The preview image includes the image displayed on the viewfinder interface of a camera application on an electronic device such as a mobile phone or tablet.
[0066] Taking a mobile phone as an example, the mobile phone can display the viewfinder interface 101 before taking a photo as shown in Figure 1. The viewfinder interface 101 includes an image captured by a camera, which is used for user preview. Therefore, the image displayed in the viewfinder interface 101 is a preview image.
[0067] Still taking a mobile phone as an example, the mobile phone can display the viewfinder interface 102 in the recorded video shown in Figure 1. The viewfinder interface 101 also includes the image captured by the camera, which is used for user preview. Therefore, the image displayed in the viewfinder interface 102 is also a preview image.
[0068] 2. Face angle (also known as face yaw angle).
[0069] The face angle is the left-right rotation angle of the subject's face relative to the line connecting the camera and the subject's head (also called the first line). Assuming the head is bilaterally symmetrical, we can take a point on the head's bisector and connect it to the camera line.
[0070] For example, referring to Figure 2, L is the line connecting the camera and the head of the person being photographed. As the face rotates leftward from frontal, the angle between the face's orientation and L changes from 0° to 180°, and accordingly, the orientation of the face in the preview image captured by the camera also changes. As the face rotates rightward from frontal, the angle between the face's orientation and L changes from 0° to 180°, and accordingly, the orientation of the face in the preview image captured by the camera also changes.
[0071] 3. Facial key points.
[0072] Facial key points include the eyebrows, eyes, nose, mouth, and facial contour areas. For example, the facial feature points can be 81 points, numbered 0-80, as shown in Figure 3. It should be understood that in actual implementation, the number of feature points can be more or less than the 81 points shown in Figure 3.
[0073] As shown in Figure 2, the number and relative positions of facial key points in the preview image captured by the camera vary as the face angle changes. For example, at a 0° face angle, the preview image captures a relatively comprehensive set of facial key points. However, at a 90° face angle, the number of facial key points in the preview image is only about half of that at 0°. This means that the facial key points in the preview image are related to the angle of the subject's face.
[0074] Based on this, in some embodiments, the facial angle can be calculated by detecting facial key points in the preview image.
[0075] Of course, the method for calculating facial angles is not limited to this. In actual implementation, those skilled in the art can flexibly select the method based on actual needs. For example, the face in the preview image can be first converted into a three-dimensional portrait, and then the facial angle is determined based on the three-dimensional portrait. The following mainly uses the method of detecting facial key points as an example to illustrate.
[0076] 4. Look back.
[0077] Glancing back refers to the process of turning from the back or side to the front, for example, from a face angle of 135° or 90° to the left or right to a face angle of 0° in FIG2 .
[0078] The image capture method provided in the embodiment of the present application can be used to capture the wonderful frames when the look back is completed (referred to as the wonderful frames of the look back for short).
[0079] 5. Artificial Intelligence (AI) snapshot function.
[0080] The AI capture function is an intelligent capture function provided by the camera application. It is different from the manual capture method and can capture without manual operation by the user. The AI capture function can capture wonderful frames, for example, the image frame of a successful shot, the image frame of a jump to the highest point, the wonderful frame when the look back action is completed, and the image frame of a specific photographed object such as a rainbow / sunset. The embodiment of the present application does not make specific limitations on this. In the embodiment of the present application, the specific implementation of using the AI capture function to capture the wonderful frame of looking back is mainly described.
[0081] The image capture method provided in the embodiment of the present application can be applied to scenarios where a camera application is used in electronic devices such as mobile phones and tablets, and in such scenarios, a wonderful frame of looking back can be captured.
[0082] Exemplarily, by using the image capture method provided in the embodiment of the present application, while the mobile phone displays the viewfinder interface 101 shown in Figure 1 (that is, before taking a photo or before recording a video), the wonderful frames of the look back can be determined from the preview image and stored.
[0083] As another example, by using the image capture method provided in the embodiment of the present application, while the mobile phone displays the viewfinder interface 102 shown in Figure 1 (i.e., during video recording), the wonderful frames of the look back can be determined from the preview image and stored.
[0084] The following is an introduction to this application plan:
[0085] In the above scenario, using the image capture method provided by the embodiment of the present application, the electronic device can collect the first frame preview image, the second frame preview image... in real time through the camera, and after each frame preview image is collected, the face angle in the frame preview image is obtained. Since the face angle changes during the process of looking back, the electronic device can detect the wonderful frame of looking back based on the face angles in the currently collected preview image (which can be called the kth frame preview image) and the previous multiple consecutive frames of preview images. If a wonderful frame of looking back is detected, the wonderful frame of looking back is stored. If there is no wonderful frame of looking back, continue to obtain the face angle of the new preview image and continue to detect.
[0086] Exemplarily, referring to FIG4 , as the camera captures preview images, such as capturing the 33rd (i.e., k=33) frame preview image, the electronic device can obtain the facial angles in the 1st to 33rd frame preview images, such as y1, y2, y3…y33 in sequence. At this time, the electronic device can detect the wonderful frame of looking back based on the facial angle y33 in the 33rd frame preview image and the facial angles in the multiple consecutive frames of preview images before the 33rd frame preview image. For example, from the 11th to the 33rd frame preview image, the facial angle (i.e., y11, y12, y13…y33) decreases from a larger facial angle of 70° to a smaller facial angle of 23°, then the 33rd frame preview image can be detected as a wonderful frame of looking back. At this time, the electronic device can store the 33rd frame preview image.
[0087] The electronic devices may include smartphones, personal digital assistants (PDAs), tablet computers, laptop computers, video cameras, video recorders, still cameras, smart watches, smart wristbands, cellular phones, car computers, and other devices with camera applications. The embodiments of the present application do not impose any particular restrictions on the specific form of the electronic devices.
[0088] Referring to Figure 5, which is a hardware structure diagram of an electronic device provided in an embodiment of the present application, as shown in Figure 5, taking the electronic device as a mobile phone as an example, the electronic device may include: a processor 410, an external memory interface 420, an internal memory 421, a universal serial bus (USB) interface 430, a charging management module 440, a power management module 441, a battery 442, an antenna 1, an antenna 2, a mobile communication module 450, a wireless communication module 460, an audio module 470, a speaker 470A, a receiver 470B, a microphone 470C, an earphone interface 470D, a sensor module 480, a button 490, a motor 491, an indicator 492, a camera 493, a display screen 494, and a subscriber identification module (SIM) card interface 495, etc.
[0089] It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown, or may combine or separate certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0090] The processor 410 may include one or more processing units. For example, the processor 410 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0091] In some embodiments, the processor 410 can complete the relevant processing of AI capture, determine and store the wonderful frames of the look back.
[0092] The charging management module 440 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. The power management module 441 is configured to connect the battery 442, the charging management module 440, and the processor 410. The power management module 441 receives input from the battery 442 and / or the charging management module 440 to power the processor 410, the internal memory 421, the external memory, the display 494, the camera 493, and the wireless communication module 460.
[0093] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 450, wireless communication module 460, modem processor and baseband processor.
[0094] The mobile communication module 450 can provide wireless communication solutions for electronic devices, including 2G / 3G / 4G / 5G, etc. The mobile communication module 450 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.
[0095] The wireless communication module 460 can provide wireless communication solutions for electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc.
[0096] The electronic device implements display functionality through a GPU, display screen 494, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 494 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 410 may include one or more GPUs that execute program instructions to generate or modify display information.
[0097] Display screen 494 is used to display images, videos, etc. For example, the display screen can display the viewfinder interface 101 and the viewfinder interface 102 shown in FIG1 . Display screen 494 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 flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc.
[0098] The electronic device can implement shooting functions through an ISP, camera 493, video codec, GPU, display 494, and application processor. The ISP is used to process data fed back by the camera 493. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing and converting it into an image visible to the naked eye. The ISP can also perform algorithmic optimization on image noise and brightness. The ISP can also optimize parameters such as exposure and color temperature. In some embodiments, the ISP can be set in the camera 493.
[0099] The camera 493 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a 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 passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device may include 1 or N cameras 493, where N is a positive integer greater than 1.
[0100] External memory interface 420 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with processor 410 via external memory interface 420 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0101] The internal memory 421 can be used to store computer executable program codes, which include instructions. The processor 410 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 421. For example, the processor 410 can display different content on the display screen 484 in response to the user's operation of unfolding the display screen 494 by executing the instructions stored in the internal memory 421. The internal memory 421 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 421 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0102] The electronic device can implement audio functions such as music playback and recording through the audio module 470, the speaker 470A, the receiver 470B, the microphone 470C, the headphone jack 470D, and the application processor.
[0103] The buttons 490 include a power button, a volume button, etc. The buttons 490 can be mechanical buttons. They can also be touch buttons. The electronic device can receive button inputs and generate key signal inputs related to the user settings and function controls of the electronic device. The motor 491 can generate vibration prompts. The motor 491 can be used for incoming call vibration prompts, or for touch vibration feedback. The indicator 492 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 495 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 495, or pulled out from the SIM card interface 495 to achieve contact and separation with the electronic device. The electronic device can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
[0104] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to illustrate the software structure of the electronic device.
[0105] Referring to Figure 6, a software structure block diagram of an electronic device provided in an embodiment of the present application is shown. As shown in Figure 6, the layered architecture can divide the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer (referred to as the application layer), the application framework layer (referred to as the framework layer), the hardware abstract layer (HAL) layer, and the kernel layer (also known as the driver layer).
[0106] The application layer may include a series of application packages, such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message applications.
[0107] In the embodiment of the present application, the application layer may include a system camera application (also referred to as a camera application). The camera application can provide functions such as taking pictures, recording videos, and AI snapshots.
[0108] The camera application can be used to display the preview image reported by the bottom layer in the viewfinder interface (such as the viewfinder interface 101 and the viewfinder interface 102 in Figure 1). Among them, the electronic device can include multiple cameras, each of which can be used to capture the preview image.
[0109] The framework layer provides the application programming interface (API) and programming framework for the application layer. The framework layer includes some predefined functions. As shown in Figure 6, the framework layer can provide camera services.
[0110] The camera service can be used to transmit requests from the application layer to the lower layer (such as the HAL layer), such as requests to end shooting, switch cameras, and adjust focus. The camera service can also be used to process the preview frame data reported by the lower layer (such as the HAL layer) and upload it to the upper layer application.
[0111] The HAL layer is an abstract structure between the kernel layer and the Android runtime. The HAL layer can be a package of hardware drivers, providing a unified interface for upper-layer applications to call.
[0112] As shown in Figure 6, the HAL layer includes the Camera Hardware Abstraction Layer (Camera Provider). The Camera Hardware Abstraction Layer maintains normal communication with the upper layer (such as the Camera Service) by providing a standard Hardware Abstraction Layer Interface Definition Language (HAL interface definition language) interface. Furthermore, the Camera Hardware Abstraction Layer controls the kernel layer through a standard HAL interface, such as HAL 3.0, obtains preview frame data reported by the kernel layer, and then reports it to the upper layer (such as the Camera Service).
[0113] The core layer includes a camera driver, an ISP, and a camera device. The camera device may include multiple cameras, each of which includes a camera lens and an image sensor. The ISP may be provided separately from the camera (e.g., the camera device). In some embodiments, the ISP may be provided within the camera (e.g., the camera device).
[0114] The ISP and camera components are the primary devices for capturing video or images. Light signals reflected from the viewing environment pass through the camera lens and illuminate the image sensor, where they are converted into electrical signals. These signals are processed by the ISP and transmitted to the upper layer by the camera driver as a raw parameter stream (i.e., a video stream). Furthermore, the camera driver receives notifications from the upper layer (such as those instructing to turn a camera on or off). Based on these notifications, it sends a function processing parameter stream to the camera component to turn the corresponding camera on or off.
[0115] The image capture method provided in the embodiment of the present application can be implemented in an electronic device having the above-mentioned software and hardware structure.
[0116] Specifically, the image capture method provided in the embodiment of the present application includes the following three stages: Stage 1, starting AI capture. Stage 2, capturing the wonderful frame of looking back. Stage 3, ending AI capture. The following will be explained one by one:
[0117] Phase 1: Start AI capture.
[0118] In some embodiments, the application settings interface of the camera application of the electronic device includes a control a. The electronic device can receive a user operation a on control a (such as a click, long press, or slide, etc., and the click operation is used as an example below). In response to the user operation a on control a, the electronic device can enable the AI snapshot function. The following mainly uses the click operation as an example.
[0119] Taking a mobile phone as an example, the electronic device may display the pre-shooting framing interface 701 shown in Figure 7 . Interface 701 includes a settings button 702. In response to a user clicking settings button 702, the mobile phone may display interface 703 shown in Figure 7 . Interface 703 is the application settings interface of the camera application, and includes a "Smart Photo" option. In response to a user clicking the "Smart Photo" option in interface 703, the mobile phone may display interface 704 shown in Figure 7 . Interface 704 is the "Smart Photo" settings interface (also part of the application settings interface of the camera application), and includes an "Auto Snap" setting item 705. "Auto Snap" setting item 705 includes a switch 706. In interface 704, switch 706 is in the off state, representing control a. In response to a user clicking switch 706 in interface 704, the electronic device may enable the AI Snap function. For example, in response to the user clicking the switch 706 in the interface 704, the electronic device may display the interface 707 shown in FIG7 , which also includes the switch 706, and the state of the switch 706 in the interface 707 is on.
[0120] In this embodiment, after the AI snapshot function is turned on, in response to a preset event that triggers the display of the framing interface, the electronic device can start AI snapshot to capture wonderful frames of looking back.
[0121] For example, after the AI snapshot function is enabled, the electronic device may display interface 707 shown in Figure 7. In response to the user returning to interface 707, the mobile phone may display interface 703 shown in Figure 7. In response to the user returning to interface 703, the mobile phone may display viewfinder interface 701 shown in Figure 7. At this point, the electronic device begins AI snapshot. In other words, the preset event is the user performing a return operation on interface 703.
[0122] As another example, after the AI snapshot function is enabled, in response to a user clicking the camera application icon on the phone's desktop, the phone may display a pre-photographing framing interface (framing interface 101 as shown in FIG1 ). At this point, the electronic device begins AI snapshot. That is, the preset event is the user clicking the camera application icon on the phone's desktop.
[0123] In other embodiments, the viewfinder interface of the camera application of the electronic device includes a preset control b for enabling the AI snapshot function. The electronic device can receive a user operation b on the control b (such as a click, long press, or slide, etc., with a click operation being used as an example below). In response to the user operation b on the control b, the electronic device can enable the AI snapshot function and simultaneously start AI snapshot to capture a wonderful frame of the look back.
[0124] Still assuming that the electronic device is a mobile phone and control b is icon 802 in viewfinder interface 801 shown in FIG8 , the mobile phone may display viewfinder interface 801 before taking a photo as shown in FIG8 . Interface 801 includes icon 802. The mobile phone may receive a user click on icon 802. In response to the user click on icon 802, the mobile phone may enable the AI snapshot function and simultaneously start AI snapshot.
[0125] Stage 2: Capture the wonderful frame of looking back.
[0126] As shown in Figure 9, the process of using the AI snapshot function to capture a wonderful frame of a glance back includes:
[0127] S901. Capture a preview image through a camera.
[0128] During the process of displaying the viewfinder interface, the camera application in the electronic device will continuously request new preview images from the camera. Correspondingly, the camera will continuously collect preview images and report them upward, and finally transmit the preview images to the camera application, which will display the preview images in the viewfinder interface.
[0129] For example, after starting AI capture, the electronic device may sequentially capture the first preview image, the second preview image, the third preview image, and so on. For ease of explanation, the currently captured preview image may be referred to as the kth preview image. It should be understood that as the framing interface continues to be displayed, k will continue to increase.
[0130] In some cases, the preview image may not include a face. However, during the process of looking back, the preview image should include a face, and it is usually not possible for the preview image to not include a face during the process of looking back. For example, referring to Figure 10, the preview image of the k-2 frame and the preview image of the k-1 frame both include a face, but the preview image of the k-th frame does not include a face. Therefore, the preview image of the k-th frame is definitely not related to looking back. Therefore, after obtaining the preview image of the k-th frame, the electronic device first needs to execute the following S902 to find preview images that are not related to looking back.
[0131] S902: Detect whether the preview image contains a face. If yes, execute S903; if not, execute S906.
[0132] It should be understood that during the process of reporting the preview image from the camera upward, the camera service, the camera hardware abstraction layer, etc. can obtain the preview image. In some embodiments, the module that can obtain the preview image during the reporting process of the camera service, the camera hardware abstraction layer, etc. can, after obtaining the preview image, transmit the preview image upward and detect whether the preview image contains a human face. In other embodiments, the aforementioned modules that can obtain the preview image can, after obtaining the preview image, transmit the preview image upward and send the preview image to a specific detection module to detect whether the preview image contains a human face.
[0133] For example, the electronic device may detect a face using template matching technology, deep learning algorithms (such as convolutional neural networks (CNN)), etc. This embodiment of the present application does not specifically limit this.
[0134] If the preview image is detected to include a face, then the preview image is likely captured during the look-back process. In this case, the electronic device executes S903 to further identify the highlight frames of the look-back process. Conversely, if the preview image is detected to include no face, then the preview image is unlikely to have been captured during the look-back process. In this case, the electronic device skips S903 and instead executes S906 to prevent the absence of a face in the preview image from interfering with the detection.
[0135] S903: Detect and record the face angle in the preview image.
[0136] In some embodiments, the electronic device can calculate the facial angle using facial key points. Specifically, the electronic device detects the facial key points in the preview image, matches the facial key points with key point models for each facial angle, determines a target model corresponding to the facial key points, and determines the facial angle of the target model as the facial angle in the preview image.
[0137] After detecting the face angle, the electronic device also records the face angle for subsequent use in determining the highlight frame of the look back based on the face angle. Still using Figure 10 as an example, after the electronic device detects that the face angle in the preview image of frame k-2 is y(k-2), it records y(k-2). Then, after the electronic device detects that the face angle in the preview image of frame k-1 is y(k-1), it records y(k-1).
[0138] Subsequently, the electronic device needs to detect whether there is any wonderful frame of looking back in the preview image up to the kth frame.
[0139] A look back occurs when a person turns from their back or side to the front, and the angle of their face changes from wide to narrow. For example, if the angle of their face decreases from wide to narrow, in the order of 70°, 65°, 62°, 60°, and finally 25°, then a look back is confirmed.
[0140] At the same time, head movements other than looking back can also cause the face angle to change from wide to narrow. For example, if the head turns from 45° to the left to face forward (i.e., 0°), the preview image captured by the camera may be as shown in Figure 11, showing the face angle decreasing from 45° to 0°. However, it is clear that the movement shown in Figure 11 is not looking back.
[0141] What is different from the movement similar to Figure 11 is that looking back is a process of changing from a larger facial angle to a smaller facial angle. In other words, the change in facial angle from large to small is relatively large. Therefore, the electronic device can distinguish looking back from other movements based on the starting value and ending value from large to small. If the starting value is greater than the first angle threshold and the ending value is less than the second angle threshold, it is determined to be looking back. The first angle threshold is greater than the second angle threshold. If the starting value is less than or equal to the first angle threshold, and / or the ending value is greater than or equal to the second angle threshold, it is determined not to be a process of looking back.
[0142] For example, if the first angle threshold is 65° and the second angle threshold is 30°, the facial angle decreases from 70°, 65°, 62°, 60°, and so on to 25°. The starting value is 70° > 65°, and the ending value is 25° < 30°. Therefore, the movement of 70°, 65°, 62°, 60°, and so on to 25° can be determined as a look back. However, if, as shown in Figure 11, the starting value for the facial angle decreases from 45°, which is less than the first angle threshold, it is not a look back.
[0143] In summary, the face angle at the beginning of the look back is greater than the first angle threshold, and the face angle at the end of the look back is less than the second angle threshold. Moreover, the face angle changes from large to small during the process of the look back.
[0144] Based on this, in an embodiment of the present application, for the k-th preview image, after executing the above S901-S903, the electronic device can use the following S904 or S905 to detect whether there is a wonderful frame to look back at as of the k-th preview image.
[0145] Normally, the action of looking back takes a certain amount of time and is not completed instantly. Therefore, after starting AI capture, when only a small number of preview images are collected, such as the time period of collecting 2 frames, 3 frames, or 5 frames of preview images, the look back is usually not completed. Therefore, in some embodiments, before executing S903 or S904, the electronic device also needs to determine that k is greater than a preset value, such as 2, 3, 5, etc. Conversely, if k is less than or equal to the preset number, the electronic device does not need to execute S904 or S905.
[0146] In other embodiments, the electronic device may execute S904 or S905 once every x (x≥2, x is an integer) facial angles recorded to reduce power consumption of the electronic device.
[0147] S904. If the face angles in the preview image from the i-th (i≥1, i is an integer) frame to the k-th (i<k, k is an integer) frame do not meet the preset conditions, determine that there is no wonderful frame with a look back as of the k-th preview image, and continue to execute S901 and its subsequent steps.
[0148] The preset condition includes: the facial angle in the preview image from the i-th frame to the j-th frame (j≤k, where j is an integer) shows a decreasing trend, and the facial angle in the i-th frame is greater than a first angle threshold, and the facial angle in the j-th frame is less than a second angle threshold. In other words, if no movement from a larger facial angle to a smaller facial angle occurs by the k-th frame, then the preset condition is determined to be unsatisfied.
[0149] Taking the first angle threshold of 65°, the second angle threshold of 30°, and the facial angles of 70°, 65°, 62°, 60°, 55°, 52° and 48° as an example, although the facial angle has been decreasing and 70° is greater than the first angle threshold, 48° is not less than the second angle threshold, and therefore does not meet the preset conditions.
[0150] Taking the first angle threshold of 65°, the second angle threshold of 30°, and the facial angles of 40°, 43°, 45°, 42°, 39°, 35°, 32° and 28° as an example, although there is a process of decreasing from 45° to 28°, and 28° is less than the second angle threshold, 40° is not greater than the first angle threshold, so the preset condition is not met.
[0151] It should be noted that the decreasing trend of the facial angles from the i-th preview image to the j-th preview image (j≤k, where j is an integer) can be achieved by: the facial angle in any preview image from the i-th preview image to the j-1-th preview image is greater than the facial angle in the subsequent preview image. For example, if the facial angles from the i-th preview image to the j-th preview image are 70°, 65°, 62°, and 60°, respectively, where 70°>65°, 65°>62°, and 62°>60°, then the decreasing trend of the facial angles from the i-th preview image to the j-th preview image is satisfied.
[0152] In practice, when looking back, the face angle may not absolutely become smaller. For example, when looking back, the face pauses for a moment, then, during the process of looking back, the face angles in some frames of preview images may remain unchanged. For example, the face angles recorded by the electronic device are: 70°, 65°, 62°, 60°, 55°, 52°, 48°, 44°, 44°, 41°, 38°, 33°, 30°, 28° and 25°, of which two consecutive frames are both 44°. For another example, when looking back, the electronic device deviates from the face angle recognition, then, the face angles in some frames of preview images may become larger. For example, the electronic device recognizes a face angle of 41° as 43°. The face angles recorded by the electronic device may be: 70°, 65°, 62°, 60°, 55°, 52°, 48°, 44°, 42°, 43°, 38°, 33°, 30°, 28° and 25°, among which 43° is an incorrect face angle, which is larger than the face angle (42°) in the previous frame preview image.
[0153] Based on this, the facial angles from the i-th preview image to the j-th (j≤k, where j is an integer) preview image may show a decreasing trend. Alternatively, the facial angles from the i-th preview image to the j-th preview image may show an overall decreasing trend. The overall decreasing trend includes the facial angles of a small number of preview images from the i-th preview image to the j-1-th preview image being slightly greater than or equal to the facial angles of the subsequent preview image. This prevents a very small number of facial angles from increasing or remaining unchanged, which could affect the accuracy of the identification of the highlight frames of the look-back sequence.
[0154] In the embodiments of the present application, the specific implementation of determining the decreasing trend is not limited. In practice, those skilled in the art can flexibly select a corresponding method to implement it based on actual needs. The following is only an example of a specific implementation:
[0155] The electronic device can select the facial angle through the window, detect the changing trend of the facial angle in the window and / or the size relationship between the first facial angle and other facial angles in the window, and change the selected facial angle by sliding the window to obtain more changing trends of facial angles.
[0156] The electronic device can calculate the difference between the average value of the face angles of the last n / 2 (n>2, n is an integer) people in the window and the average value of the face angles of the first n / 2 people. Then based on the difference Get the changing trend of the face angle in the window.
[0157] Among them, the difference The calculation formula is as follows:
[0158] In the above formula, q is the ordinal number of the face angle in the window, yaw q is the angle of the qth face in the window.
[0159] If the difference If the difference is less than 0, it is determined that the angles of n faces in the window are decreasing; if If the difference is greater than 0, it is determined that the angles of n faces in the window are increasing; if If it is equal to 0, it is determined that the angles of the n faces in the window have no trend of increasing or decreasing.
[0160] Taking n=6 as an example, refer to the moment t1 in Figure 12. The angles of the face currently selected in the window are 70°, 65°, 62°, 60°, 55°, and 52°. The electronic device calculates the average of the angles of the last three faces as (60°+55°+52°) / 3=55.67°, and the average of the angles of the first three faces as (70°+65°+62°) / 3=65.67°. Obviously, the difference If it is less than 0, it can be determined that 70°, 65°, 62°, 60°, 55°, and 52° show a decreasing trend.
[0161] Furthermore, the electronic device may compare the angle of the first face with the angles of the other faces to obtain a size relationship between the angle of the first face and the angles of the other faces in the window. The size relationship includes: the angle of the first face is smaller than the angles of the other faces, or other situations except that the angle of the first face is smaller than the angles of the other faces.
[0162] Continuing with Figure 12, after sliding the window at time t2, the window selects face angles of 65°, 62°, 60°, 55°, 52°, and 48°. The first face angle is 65°, while the others are 62°, 60°, 55°, 52°, and 48°. Clearly, the first face angle is larger than the others.
[0163] If the electronic device detects that the angle of the face in the window is showing a decreasing trend at time te, then after each sliding of the window, the electronic device detects the size relationship between the angle of the first face in the window and the angles of other faces, until it detects that the angle of the first face in the window is smaller than the angles of other faces at time tf, then it is determined that the angle of the first face selected in the window at time te to the angle of the first face selected in the window at time tf all show a decreasing trend.
[0164] Continuing with Figure 12, at time t1, the angles of the face selected in the window are detected to be decreasing, at 70°, 65°, 62°, 60°, 55°, and 52°, i.e., te = t1. Subsequently, after each sliding of the window, the electronic device detects the relationship between the angle of the first face in the window and the angles of the other faces, until at time t30, the angles of the face selected in the window are 25°, 27°, 28°, 30°, 31°, and 32°, at which point it is detected that the angle of the first face in the window is smaller than the angles of the other faces, i.e., tf = t30. The electronic device can then determine that the angle of the first face selected in the window at time t1, 70°, to the angle of the first face selected in the window at time t30, 25°, has been decreasing.
[0165] In actual implementation, the window in this implementation can be a cache (also known as a preset storage space), which can be used to store a fixed number (such as n) of facial angles. Accordingly, the sliding window can be: as new facial angles are stored in the cache, the facial angles first stored in the cache will be squeezed out, that is, the storage follows the first-in-first-out principle. Still taking the aforementioned Figure 12 as an example, the t1-t2 sliding window in Figure 12 can be: after the new facial angle 48° is stored in the cache, the facial angle 70° first stored in the cache will be squeezed out; and the t29-t30 sliding window in Figure 12 can be: after the new facial angle 44° is stored in the cache, the facial angle 65° first stored in the cache will be squeezed out.
[0166] S905 . If the face angles in the preview image of the i-th (i≥1, i is an integer) frame to the preview image of the k-th (i<k, k is an integer) frame meet a preset condition, then store the preview image of the j-th frame.
[0167] If the face angles in the preview images of the i-th frame to the k-th frame meet the preset conditions, it means that the face angle changes from the larger face angle in the preview image of the i-th frame to the smaller face angle in the preview image of the j-th frame, and it is determined that a look back has occurred. In this case, the electronic device can store the preview image of the j-th frame as a wonderful frame of the look back.
[0168] In a recorded video, each preview image is stored. That is, the kth preview image and its previous preview image (such as the jth preview image) are all stored. Therefore, if the AI snapshot function is used in a recorded video, the electronic device can obtain the jth preview image and store it, such as in a media storage database, after determining that the preset conditions are met. In this way, users can view the wonderful frames of the review in the gallery.
[0169] However, unlike recording a video, typically, each preview image is not stored before taking a photo or recording a video. Therefore, when the electronic device has captured the kth preview image, the preview image before the kth preview image (such as the jth preview image) usually no longer exists. Therefore, when using the AI snapshot function before taking a photo or recording a video, the electronic device can capture and store the kth preview image.
[0170] Of course, in some embodiments, to truly capture the ending moment of the look back, when using the AI snapshot function before taking a photo or recording a video, the electronic device can cache several recently captured preview images, for example, caching preview images from frames k-3 to k. Then, after determining that a preset condition is met, the electronic device can obtain and store the jth preview image from the cached preview images.
[0171] In some embodiments, before storing the jth preview image, the electronic device may first display the jth preview image or a thumbnail of the jth preview image. Then, in response to a user's operation to save the jth preview image, the electronic device saves the jth preview image. In response to a user's operation to delete the jth preview image, the electronic device deletes the jth preview image. This avoids storing images that the user is dissatisfied with.
[0172] Exemplarily, before storing the j-th preview image, the mobile phone displays interface 1301 shown in FIG13 . In response to generating the captured image, the electronic device may display interface 1302 shown in FIG13 , which includes a thumbnail 1303 of the captured image. In response to the user clicking on thumbnail 1303, the mobile phone may display interface 1304 shown in FIG13 , which includes a “Save” button 1305 and a “Delete” button 1306. In response to the user clicking on “Save” button 1305, the mobile phone may save the captured image. That is, the save operation is the user clicking on “Save” button 1305. Alternatively, in response to the user clicking on “Delete” button 1306, the mobile phone will delete the captured image.
[0173] In S905 above, after determining that the jth preview image is a highlight frame of a look back, the jth preview image is directly stored. However, in practice, after determining that the jth preview image is a highlight frame of a look back, the electronic device may first generate a captured image by fusing the jth preview image with at least one of its preceding and following preview images, and then store the captured image. This prevents the jth preview image from having poor quality and affecting the capture effect.
[0174] S906: Delete the recorded facial angles, and continue to execute S901 and subsequent steps.
[0175] In some embodiments, if the preview image does not include a face, the electronic device deletes the recorded facial angles. In subsequent processes, the electronic device cannot use the deleted facial angles to determine highlight frames for the look back. This prevents the use of facial angles of discontinuous faces in determining highlight frames for the look back, thereby improving the accuracy of determining highlight frames for the look back.
[0176] For example, referring to FIG14 , after recording the face angle y(k-2) of the k-2 preview frame and the face angle y(k-1) of the k-1 preview frame, if the electronic device detects that the k-th preview frame does not include a face, the electronic device may delete both y(k-2) and y(k-1) according to the "deletion scheme" in FIG14 . Subsequently, y(k-2) and y(k-1) will not be used in conjunction with the face angle detected after the k-th preview frame to determine the highlight frame of the look back.
[0177] Of course, for situations where no human face is included, the electronic device can also adopt other methods to avoid using the facial angles of faces that do not appear in the continuous preview images together with the electronic device to determine the wonderful frames of looking back. For example, if the preview image does not include a human face, the electronic device can record indication information indicating that there is no face as shown in the "marking scheme" in Figure 14, such as recording NULL, false as shown in Figure 14, etc., to indicate that no face is included. Then, in the subsequent process, the electronic device can only use the facial angles after the preset mark to determine whether there is a look back. This article mainly explains the implementation method of deleting facial angles.
[0178] To be precise, the wonderful frame of looking back (i.e., the end moment of looking back) should be an image in which the face angle changes from a larger face angle to a smaller face angle and reaches the minimum value.
[0179] Taking the second angle threshold of 30° as an example, the changes in the facial angle are 70°, 65°, 62°... 31°, 28°, 25°, 23°, 24°, 24°, 26°. Although the facial angle of 28° has met the condition of being less than the second angle threshold, after 28°, the facial angle continues to decrease, such as decreasing to 25° and 23° in sequence, which means that the look back has not ended yet. It is not difficult to find that after decreasing to 23°, the facial angle gradually increases, such as increasing to 24°, 24°, and 26° in sequence. That is, the facial angle gradually increases after decreasing to the minimum value of 23°. In this example, the preview image corresponding to 23° is the wonderful frame of the look back.
[0180] Based on this, in some embodiments, based on the aforementioned preset conditions, the preset conditions also include: the face angle in the j-th frame preview image is the minimum value of the face angles in the j-th frame preview image to the k-th frame preview image.
[0181] In other words, in this embodiment, satisfying the preset conditions indicates that the face angle changes from a larger angle in the i-th preview image to a smaller angle in the j-th preview image, and that the face angle begins to increase from the smaller angle in the j-th preview image. In this case, the electronic device can determine that the j-th preview image is a highlight frame of a look back.
[0182] The following takes the preset conditions in this embodiment as an example, and adopts a sliding window method similar to that shown in Figure 12 (the window can be a cache) to further explain in detail a specific implementation of AI capture.
[0183] Referring to FIG. 15 , S903 specifically includes:
[0184] S903a: Detect and record the face angle in the preview image in a cache.
[0185] The cache may store n face angles in sequence according to the order of the preview images from front to back.
[0186] If the number of face angles stored in the cache does not reach n, in S903a, the electronic device can directly store the face angles in the currently captured preview image (i.e., the k-th preview image) in the cache. Taking n=6 as an example, referring to FIG16 , at time t1, the face angle y(k) of the k-th preview image is detected. At this time, the face angles stored in the cache include y(k-2) and y(k-1), and the total number of face angles is not yet 6. In this case, the electronic device can directly store y(k) after y(k-1).
[0187] When the number of face angles stored in the cache reaches n, S903a, the electronic device may remove the face angle of the kn-th preview image, and move the face angles of the k-n+1-th to k-1-th preview images sequentially to the storage location of the face angle of the previous preview image, and finally store the k-th preview image after the face angle of the moved k-1-th preview image. Continuing with FIG6 , at time t2, the face angle y(k) of the k-th preview image is detected. At this time, the cache stores 6 face angles, y(k-6) to y(k-1), i.e., the cache is already full of 6 face angles. The electronic device may then remove y(k-6) from the cache, and sequentially shift y(k-5) to y(k-1) to the left by one position, and finally store y(k) after y(k-1).
[0188] Before S904 or S905, it is necessary to detect whether the face angles in the preview image of the i-th frame to the preview image of the k-th frame meet the preset conditions. Specifically, as shown in S1501-S1505 in Figure 15:
[0189] S1501: Check whether the number of face angles in the cache reaches n. If yes, execute S1502; if not, continue to execute S901 and subsequent steps.
[0190] After storing the face angles of the k-th preview image, if the number of face angles in the buffer has not reached n, that is, the buffer is not full, the electronic device continues to execute S901 and subsequent steps.
[0191] After storing the face angles of the k-th frame preview image, if the number of face angles in the buffer reaches n, that is, the buffer is full, the electronic device executes S1502 to further detect the preset conditions.
[0192] Taking time t2 in FIG. 16 as an example, after the face angle y(k) of the k-th frame preview image is stored in the cache, the cache is full of 6 face angles. In this case, S1502 can be executed.
[0193] Before introducing S1502, it is important to note that in this specific implementation, upon detecting that the n facial angles stored in the cache show a decreasing trend, and that the first facial angle among the n facial angles is greater than a first angle threshold, the electronic device will record a first tag (see S1503-S1505 below for details). In other words, the first tag may indicate that the facial angle has decreased from a larger value. In other words, this indicates that the start condition for a look-back has been met before the kth frame.
[0194] Based on this, in this specific implementation, the following S1502 is executed to determine whether the starting condition for looking back has been met.
[0195] S1502: Check whether the first tag exists. If not, execute S1503. If yes, execute S1505.
[0196] If the first tag exists, it indicates that the start condition of looking back has been met. In this case, S1505 is executed to further detect whether the face angle is reduced to a minimum value and the minimum value is less than the second angle threshold, that is, to detect whether the end condition of looking back has been met.
[0197] If the first tag does not exist, it indicates that the start condition of looking back has not been met. In this case, S1503 is executed to further detect whether the start condition of looking back is met by the kth frame.
[0198] S1503: Check whether the face angles in the cache show a decreasing trend and whether the first face angle is greater than a first angle threshold. If so, execute S1504. If not, execute S904a.
[0199] The first face angle refers to the face angle first stored in the cache, that is, the face angle of the preview image of the k-n+1th frame, such as y(k-5) in Figure 16.
[0200] For example, the electronic device may calculate the difference between the average value of the last n / 2 face angles in the cache and the average value of the first n / 2 face angles. If the difference If the angle of the first face in the cache is less than 0, it is determined that the angle of the face in the cache is decreasing. The electronic device compares the angle of the first face in the cache with the first angle threshold to determine whether the angle of the first face is greater than the first angle threshold.
[0201] If the facial angles in the cache are detected to be decreasing and the first facial angle is greater than the first angle threshold, the start conditions for a look-back are met. In this case, step S1504 is executed to indicate that the start conditions for a look-back have been met. If the facial angles in the cache are detected to be not decreasing and / or the first facial angle is less than or equal to the first angle threshold, the start conditions for a look-back are not met. In this case, step S904a is executed to determine that no highlight frames for a look-back have been detected.
[0202] S1504: Record the first tag.
[0203] After recording the first tag, when the aforementioned S1502 is executed in the next round, the existence of the first tag will be detected, and S1505 and subsequent steps will be executed to detect whether the end condition of the review is met.
[0204] Furthermore, if the facial angles in the cache are detected to be decreasing and the first facial angle is greater than the first angle threshold, only the initial conditions for a look-back are determined to be met; no highlight frame of the look-back has yet been detected. In this case, the electronic device also needs to execute S904a. It should be understood that S904a can be executed after S1504 (as shown in FIG15 ), before S1504, or simultaneously with S1504.
[0205] S1505: Detect whether the angle of the first face in the cache is smaller than a second angle threshold and is the minimum angle in the cache.
[0206] The electronic device compares the first face angle in the cache with the second angle threshold to determine whether the first face angle is greater than the first angle threshold. Furthermore, the electronic device compares the first face angle in the cache with other face angles in the cache to determine whether the first face angle is the minimum angle in the cache.
[0207] If the angle of the first face in the cache is less than the second angle threshold and is the minimum angle in the cache, the end condition for the look-back sequence is met. In this case, step S905a is executed to store the highlight frame of the look-back sequence. If the angle of the first face in the cache is greater than or equal to the second angle threshold and / or is not the minimum angle in the cache, the end condition is not met. In this case, step S904a is executed to determine that no highlight frame of the look-back sequence has been detected.
[0208] Continuing to refer to FIG. 15 , S904 further includes:
[0209] S904a: If the first tag does not exist, or if the first tag exists but the first face angle in the cache is greater than or equal to the second angle threshold and / or is not the minimum angle in the cache, determine the preview image ending at the kth frame and the wonderful frame without looking back.
[0210] Furthermore, after executing S904a, the electronic device will continue to execute S901 and subsequent steps to detect the next frame of preview image.
[0211] And, S905 further includes:
[0212] S905a: If the first tag exists, the first face angle in the cache is smaller than the second preset angle, and the first face angle is the minimum angle in the cache, then the preview image corresponding to the first face angle is stored.
[0213] The preview image corresponding to the first face angle is the preview image of the k-n+1th frame.
[0214] S906a: Clear the cache and the first tag.
[0215] If there is no face in the k-th preview image, the electronic device does not need to detect the wonderful frame of the look back for the k-th preview image. In this case, on the one hand, the electronic device needs to clear the cache, that is, delete the facial angle. In this way, the facial angle in the preview image where the face is not continuously present will not be used to detect the wonderful frame of the look back. On the other hand, the electronic device needs to delete the first label. In this way, it will be necessary to re-check whether the starting conditions for the look back are met, and the first label obtained for the preview image where the face is not continuously present will not be used for subsequent detection of the wonderful frame of the look back.
[0216] Using the specific implementation shown in FIG15 , the electronic device can determine the moment when the facial angle reaches its minimum value during a look-back process in which the facial angle decreases from greater than a first angle threshold to less than a second angle threshold as the moment of the look-back. To facilitate understanding of this effect, the following illustrates the two sets of facial angle sequences (in degrees) shown in Table 1:
[0217] Table 1
[0218] Among them, None means there is no face.
[0219] Taking n=6, the first angle threshold being 65°, and the second angle threshold being 30° as an example, for the first group of face angle sequences and the second group of face angle sequences, the processing flow of FIG. 15 is as follows:
[0220] Group 1:
[0221] When k=1, 2, 3, 4, or 5, when step S1501 is executed, it is detected that the number of face angles in the cache does not reach n.
[0222] When k=6, after executing S903a, the face angles stored in the cache are 70°, 65°, 62°, 60°, 55° and 52°. When executing S1501, it will be detected that the number of face angles in the cache has reached n; continue to execute S1502, at this time it will be detected that there is no first label; continue to execute S1503, at this time it will be detected that the face angles in the cache are showing a decreasing trend, and the first face angle (70°) is greater than the first angle threshold; continue to execute S1504, the first label will be recorded; continue to execute S904a, and determine that the preview image ends at the 6th frame and there is no wonderful frame with looking back.
[0223] When k=7, after executing S903a, the face angles stored in the cache are 65°, 62°, 60°, 55°, 52° and 48°. When executing S1501, it will be detected that the number of face angles in the cache has reached n; continue to execute S1502, at this time it will be detected that there is a first tag (recorded when k=6); continue to execute S1505, at this time it will be detected that the first face angle (65°) in the cache is greater than the second angle threshold and is not the minimum angle in the cache; continue to execute S904a, and determine that the preview image ends at the 7th frame and there is no wonderful frame looking back.
[0224] When k=8, 9, 10...18, the execution process is the same as when k=7, and will not be described in detail here.
[0225] When k=19, after executing S903a, the facial angles stored in the cache are 28°, 25°, 27°, 29°, 33° and 34°. When executing S1501, it will be detected that the number of facial angles in the cache has reached n; continue to execute S1502, at this time it will be detected that there is a first tag (recorded when k=6); continue to execute S1505, at this time it will be detected that the first facial angle (28°) in the cache is less than the second angle threshold, but not the minimum angle in the cache; continue to execute S904a, and determine that the preview image ends at the 19th frame and there is no wonderful frame looking back.
[0226] When k=20, after executing S903a, the face angles stored in the cache are 25°, 27°, 29°, 33°, 34° and 34°. When executing S1501, it will be detected that the number of face angles in the cache has reached n; continue to execute S1502, at this time it will be detected that there is a first tag (recorded when k=6); continue to execute S1505, at this time it will be detected that the first face angle (25°) in the cache is less than the second angle threshold and is the minimum angle in the cache, that is, it is determined that the first face angle in the cache is the minimum value from large to small; continue to execute S905a, and store the 20-6+1 (i.e. 15°) frame preview image or the 20th frame preview image.
[0227] Group 2:
[0228] When k=1, after executing S903a, the face angle stored in the cache is 70°. At this time, when executing S1501, it is detected that the number of face angles in the cache does not reach n.
[0229] When k=2 or 3, since there is no face, the cache will be cleared when executing S906a, such as clearing the face angle 70°.
[0230] When k=4, 5, 6, ..., 8, after executing S903a, executing S1501 will detect that the number of face angles in the cache does not reach n.
[0231] When k=9, after executing S903a, the face angles stored in the cache sequence are 40°, 38°, 37°, 34°, 30° and 25°. When executing S1501, it will be detected that the number of face angles in the cache has reached n; continuing to execute S1502, it will be detected that there is no first label; continuing to execute S1503, it will be detected that the face angles in the cache are decreasing, but the first face angle (40°) is less than the first angle threshold; continuing to execute S904a, it is determined that as of the 9th frame preview image, there is no wonderful frame with a look back.
[0232] When k=10, 11, 12...20, the execution process is the same as when k=9, that is, no wonderful frame of looking back will be determined.
[0233] It can be seen that when the process of Figure 15 is used in the second group of face angle sequences, even if the face angle is indeed decreasing and then increasing, it will not be recognized as a process of looking back because it does not start from a larger angle.
[0234] In some scenarios, head movements other than looking back may also cause the face angle to change from a larger angle to a smaller angle, and then from a smaller angle to a larger angle. For example, a face may glance around, such as from the left rear to the right side of the body as shown in Figure 17. In this case, the face angle may change from 135° to 0°, and then from 0° to 90°. However, it is clear that the facial movement shown in Figure 17 is not a look back.
[0235] Unlike the motion process in Figure 17, at the end of the look back, the face usually pauses for a while. During this time, the face angle changes only slightly, for example, within 3°.
[0236] Based on this, in some embodiments, the preset condition also includes: the absolute difference θ between the facial angle in the j-th preview image and the facial angle in the subsequent m consecutive (m ≥ 1, m is an integer) preview images is less than a preset difference 1 (also referred to as a first difference threshold). Here, m can be a small value such as 1, 2, or 3, and the preset difference 1 is a value close to 0, such as 1°, 2°, 3°, 5°, or 10°. In this way, after reducing the facial angle to the minimum value, cases with large changes can be eliminated. This allows for more accurate determination of the wonderful frames of the look back. For ease of explanation, any one of the m preview images can be referred to as the first preview image.
[0237] Among them, the absolute difference θ is less than the preset difference 1, including at least one of the following: the absolute difference θ between the face angle in the j-th preview image and the face angle in the m-frame preview image is less than the preset difference 1; the sum of the absolute difference θ between the face angle in the j-th preview image and the face angle in the m-frame preview image is less than the preset difference 1; the average value of the absolute difference θ between the face angle in the j-th preview image and the face angle in the m preview images is less than the preset difference 1; and the maximum value of the absolute difference θ between the face angle in the j-th preview image and the face angle in the m preview images is less than the preset difference 1.
[0238] In a specific implementation, referring to FIG. 18 , after S1505 , the following steps are further included:
[0239] S1801: Check whether the absolute difference θ between the first face angle in the cache and the angles of the m subsequent faces is less than a preset difference. If so, execute S905a. If not, execute S1802.
[0240] The m face angles correspond to the m preset frames one by one. For example, if the m preset frames are the 50th, 51st, and 52nd frames, then the m face angles are the face angle y(50) of the preview image of the 50th frame, the face angle y(51) of the preview image of the 51st frame, and the face angle y(52) of the preview image of the 52nd frame.
[0241] Continuing with the example of the first facial angle sequence in Table 1 above, and taking m = 2 and the preset difference 1 of 5° as an example, when k = 20, the facial angles stored in the cache are 25°, 27°, 29°, 33°, 34°, and 34°. The result detected at S1505 is: the first facial angle in the cache (25°) is less than the second angle threshold and is the minimum angle in the cache. Continuing with S1801, it is detected that the absolute differences θ between the first facial angle in the cache (25°) and the two facial angles following it (i.e., 27° and 29°) are 2 and 4, respectively, both less than the preset difference 1 (i.e., 5°). In other words, the absolute difference θ between the first facial angle in the cache and the m facial angles following it is less than the preset difference.
[0242] If the absolute difference θ between the first face angle in the buffer and the face angles of the m subsequent faces is less than the preset difference 1, it indicates that the face angle has only changed slightly after decreasing to the minimum value. In this case, the electronic device executes S905a to store the wonderful frame of the look back.
[0243] If the absolute difference θ between the first face angle in the cache and the angles of the m subsequent faces is greater than or equal to a preset difference value of 1, this indicates that the face angle has been changing significantly after decreasing to its minimum value. In this case, the electronic device deems it not a look-back event and executes S1802 to subsequently re-detect the start conditions for a look-back event.
[0244] S1802: Delete the first tag and continue executing S901.
[0245] After deleting the first tag, the electronic device will detect that the first tag does not exist the next time it executes S1502, and will then execute S1503 to re-detect whether the start condition of looking back is met.
[0246] Using the specific implementation shown in Figure 18, based on Figure 15, it is possible to determine that only a small change occurs after the face angle is reduced to the minimum value, and then determine the moment when the face angle is the minimum value as the end moment of the look back, thereby improving the accuracy of the determined wonderful frame.
[0247] In some scenarios, electronic devices may have deviations when detecting face angles. Experience shows that a typical deviation is that deviations are prone to occur for side faces with larger angles. For example, 90° is detected as 25°, 30°, etc. In this scenario, the detected face angle may jump, such as increasing or decreasing significantly. For example, the comparison between the actual value of the face angle change and the face angle detected by the electronic device (referred to as the detection value) is shown in Table 2 below:
[0248] Table 2
[0249] Table 2 above shows that the electronic device detects the face angle of 90° in the third preview image as 30°, and the face angle of 89° in the fourth preview image as 31°. Thus, based on the detection results, the face angle jumps from 90° in the second preview image to 30° in the third preview image, and from 31° in the fourth preview image to 85° in the fifth preview image.
[0250] In reality, the change of face angle is a relatively smooth process and usually no sudden changes occur.
[0251] Based on this, in some embodiments, the preset condition also includes: the absolute difference λ between the facial angle in the j-th frame preview image and the facial angle in the preview images before and after it is less than the preset difference 2 (also called the second difference threshold). The preset difference 2 is a relatively large value, such as 45°, 50°, 60°, etc. In this way, the facial angle can be reduced to the minimum value, but the situation where it jumps at the minimum value is eliminated. This allows for more accurate determination of the wonderful frame of the look back. For ease of explanation, any preview image in the preview images before and after the j-th frame preview image can be referred to as the second preview image, that is, the second preview image is the j-1-th frame preview image or the j+1-th frame preview image.
[0252] In a specific implementation, referring to FIG. 19 , after S1306 , the following steps are further included:
[0253] S1901: Check whether the absolute difference λ between the first face angle in the cache and the face angles in the preview images before and after it is less than a preset difference 2. If so, execute S905a. If not, execute S1902.
[0254] The second face angle in the cache is the face angle in the preview image that is adjacent to the first face angle.
[0255] Furthermore, the facial angle removed from the cache during the most recent execution of S903a is the facial angle in the preview image immediately preceding the first facial angle. To facilitate obtaining the facial angle in the preview image immediately preceding the first facial angle in the cache in S1901, the electronic device may temporarily store the facial angle removed from the cache during S903a until processing of the kth frame is complete. For example, after executing S904a or S905a, the temporarily stored facial angle is deleted.
[0256] Taking the temporarily stored face angle as the face angle in the second preview image in Table 2 (i.e., 90°), and the face angles in the cache as the face angles in the third to eighth preview images in Table 2, i.e., the stored face angles are 30°, 31°, 85°, 82°, 82°, and 78°, respectively, as an example, the result of executing S1505 is that the first face angle in the cache (30°) is less than the second angle threshold (e.g., 35°) and is the minimum angle in the cache. Continuing with S1901, it is detected that the absolute difference between the first face angle (30°) and the second face angle in the cache is 1, which is less than a preset difference of 2 (e.g., 50°); and it is detected that the absolute difference between the first face angle in the cache (30°) and the temporarily stored face angle (90°) is 60°, which is greater than a preset difference of 2 (e.g., 50°). That is, the absolute differences λ between the first face angle in the cache and the face angles in the preview images before and after it are not all smaller than the preset difference 2.
[0257] If the absolute difference λ between the first face angle in the cache and the face angles in the preview images before and after it is less than the preset difference 2, it indicates that the face angle has decreased to a minimum value, not a jump value. In this case, the electronic device executes S905a to store the wonderful frame of the look back.
[0258] If the absolute difference λ between the first face angle in the cache and the face angles in the preview images before and after it is not less than the preset difference value 2, it indicates that the face angle has decreased to the minimum value, which is the value reached by the jump. In this case, the electronic device determines that it is not a look-back process and executes S1902 to subsequently re-detect the start conditions of the look-back.
[0259] S1902: Delete the first tag and continue executing S901.
[0260] After deleting the first tag, the electronic device will detect that the first tag does not exist the next time it executes S1502, and will then execute S1503 to re-detect whether the start condition of looking back is met.
[0261] Using the specific implementation shown in Figure 19, based on Figure 15, the moment when the face angle is the minimum value can be determined as the moment of looking back only when it is determined that the minimum value to which the face angle is reduced is not a jump value, thereby improving the accuracy of the determined wonderful frame.
[0262] Of course, the aforementioned embodiments excluding the case where the face angle decreases to the minimum value and then changes significantly, and the embodiments excluding the case where the face angle decreases to the minimum value but then changes sharply at the minimum value, can be used in combination. For example, Figures 18 and 19 can be used in combination.
[0263] It should be noted that the aforementioned AI capture process only describes the capture of a single, captivating frame. In practice, after AI capture begins, the subject may look back multiple times, resulting in multiple, captivating frames.
[0264] Based on this, in some embodiments, after detecting a highlight frame of a glance back, the electronic device may continue to detect. For example, after storing the jth preview image or the kth preview image in S905 shown in FIG. 9 , the electronic device may continue to execute S901 and subsequent steps. For another example, after storing the jth preview image or the kth preview image in S905a shown in FIG. 16 or FIG. 17 , the electronic device may first delete the first tag and then continue to execute S901 and subsequent steps.
[0265] In addition, the preview image may include multiple faces. In an embodiment of the present application, a highlight frame of a look back can be detected for each face. Exemplarily, for each face, the face angle is stored and detected separately. For example, the face angles are stored in different buffers.
[0266] Phase three: End of AI capture.
[0267] During the AI capture process, the electronic device can end the capture in response to an end event.
[0268] In some embodiments, the end event is an event of exiting a preset interface during the capture process. The preset interface is a framing interface for previewing a scene or a framing interface for recording a scene. For example, during the AI capture process, in response to a user swiping up on the framing interface 2001 shown in FIG. 20 , the mobile phone may display the desktop 2002 shown in FIG. 20 , at which point the preset interface is exited, and the AI capture is terminated.
[0269] In other embodiments, the capture event may be an event in which the user turns off the AI capture function during the AI capture process.
[0270] An embodiment of the present application further provides an electronic device, which may include a memory and one or more processors. The memory and the processors are coupled. The memory is configured to store computer program code, which includes computer instructions. When the processors execute the computer instructions, the electronic device may perform the functions or steps described in the above method embodiments.
[0271] An embodiment of the present application also provides a chip system, as shown in Figure 21, the chip system 2100 includes at least one processor 2101 and at least one interface circuit 2102. The processor 2101 and the interface circuit 2102 can be interconnected via lines. For example, the interface circuit 2102 can be used to receive signals from other devices (such as the memory of an electronic device). For another example, the interface circuit 2102 can be used to send signals to other devices (such as the processor 2101). Exemplarily, the interface circuit 2102 can read instructions stored in the memory and send the instructions to the processor 2101. When the instructions are executed by the processor 2101, the electronic device can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, and the embodiment of the present application does not specifically limit this.
[0272] This embodiment further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes each function or step in the above method embodiment.
[0273] This embodiment also provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute each function or step in the above method embodiment.
[0274] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to perform the various functions or steps in the above-mentioned method embodiments.
[0275] Among them, the electronic device, communication system, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0276] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0277] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0278] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0279] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0280] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0281] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit the present application. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application.
Claims
1. An image capture method, It is characterized in that Applied to an electronic device, the electronic device includes a camera, and the method includes: Collecting preview images through the camera, and obtaining a face yaw angle of each frame of the preview image, where the face yaw angle is a left-right rotation angle of a first user's face relative to a first connecting line, where the first user is a user photographed by the camera, and the first connecting line is a connecting line between the camera and the head of the first user; If the face yaw angles of the i-th preview image to the k-th preview image meet a preset condition, the j-th preview image is stored, the k-th preview image is the preview image currently captured by the camera, 1≤i<j≤k, i, j and k are all integers; Among them, the preset conditions include: the yaw angle of the human face in the i-th frame preview image is greater than a first angle threshold, the yaw angle of the human face from the i-th frame image to the j-th frame preview image shows a decreasing trend, and the yaw angle of the human face in the j-th frame preview image is less than a second angle threshold.
2. The method according to claim 1, It is characterized in that j<k, the preset condition also includes: The human face yaw angle of the j-th preview image is a minimum value of the human face yaw angles of the j-th preview image to the k-th preview image.
3. The method according to claim 2, It is characterized in that The preset conditions also include: The absolute differences between the human face yaw angle of the j-th preview image and the human face yaw angle of the m-frame preview image after the j-th preview image are both less than a first difference threshold, 1≤m, j+m≤k, and m is an integer.
4. The method according to claim 2 or 3, It is characterized in that The preset conditions also include: The absolute differences between the human face yaw angle of the j-th preview image and the human face yaw angles of the j-1-th preview image and the j+1-th preview image are all less than a second difference threshold.
5. The method according to any one of claims 1 to 4, It is characterized in that After acquiring the human face yaw angle of the k-th frame preview image, the method further includes: If the number of human face yaw angles in the preset storage space is less than n, storing the human face yaw angle of the k-th preview image in the preset storage space, 2≤n, where n is an integer; If the number of human face yaw angles in the preset storage space is greater than or equal to n, after removing the human face yaw angle of the kn-th frame preview image from the preset storage space, the human face yaw angle of the k-th frame preview image is stored in the preset storage space.
6. The method according to claim 5, It is characterized in that After storing the human face yaw angle of the k-th preview image in the preset storage space, the method further includes: If the number of human face yaw angles in the preset storage space is greater than or equal to n, but the first tag does not exist in the electronic device, detecting whether the human face yaw angle of the k-n+1th frame preview image in the preset storage space is greater than the first angle threshold, and detecting a change trend of the human face yaw angle from the k-n+1th frame preview image to the kth frame preview image in the preset storage space; If the yaw angle of the human face in the k-n+1th preview image is greater than the first angle threshold, and the yaw angle of the human face from the k-n+1th preview image to the kth preview image shows a decreasing trend, the first label is recorded.
7. The method according to claim 5, It is characterized in that After storing the human face yaw angle of the k-th preview image in the preset storage space, the method further includes: If the number of human face yaw angles in the preset storage space is greater than or equal to n, and there is a first tag in the electronic device, it is determined that the human face yaw angle of the i-th frame image is greater than a first angle threshold, and the human face yaw angle of the first user in the i-th frame image to the j-th frame preview image shows a decreasing trend.
8. The method according to claim 7, It is characterized in that The human face yaw angle of the j-th frame preview image is the human face yaw angle of the k-n+1-th frame preview image in the preset storage space.
9. The method according to claim 7 or 8, It is characterized in that The method further comprises: If the absolute difference between the yaw angle of the human face in the preview image of the k-n+1th frame in the preset storage space and the yaw angle of the human face in the first preview image in the preset storage space is greater than a first difference threshold, deleting the first label; The first preview image is any preview image from the k-n+2th frame preview image to the k-n+m+1th frame preview image.
10. The method according to any one of claims 7 to 9, It is characterized in that The method further comprises: If the absolute difference between the yaw angle of the human face in the preview image of the k-n+1th frame in the preset storage space and the yaw angle of the human face in the second preview image is greater than a second difference threshold, deleting the first label; The second preview image is the kn-th frame preview image or the k-n+2-th frame preview image.
11. The method according to any one of claims 5 to 10, It is characterized in that If the k-th preview image frame does not include the face of the first user, the face yaw angle in the preset storage space is deleted.
12. The method according to any one of claims 1 to 11, It is characterized in that Before storing the j-th preview image, the method further includes: Displaying the j-th preview image or a thumbnail of the j-th preview image; Receive a first operation of confirming to store the j-th preview image from the user; The storing of the j-th frame preview image comprises: In response to the first operation, the j-th frame preview image is stored.
13. The method according to any one of claims 1 to 12, It is characterized in that There are multiple first users, and the human face yaw angle includes the human face yaw angle of each of the first users.
14. An electronic device, It is characterized in that The electronic device includes a display screen, a first speaker, a screen sounder, a memory and a processor, and the display screen, the first speaker, the screen sounder, the memory and the processor are coupled; wherein the memory stores computer program code, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1-13.
15. A computer-readable storage medium, It is characterized in that The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 13.
16. A chip system, It is characterized in that The chip system is applied to an electronic device including a processor and a memory. The chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected through lines. The interface circuit is used to receive a signal from the memory of the electronic device and send the signal to the processor. The signal includes computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device executes the method described in any one of claims 1 to 13.
Citation Information
Patent Citations
Image capturing method and electronic equipment
CN117135443A
A screen control and voice control method and electronic equipment
CN109710080A
Method for judging human body turn-back behavior based on video gridding
CN111414789A
Method for selecting images based on continuous shooting and electronic device
CN112425156A
Face recognition method, electronic equipment and readable medium
CN113051978A
