Photographing method and electronic device

By implementing the manual capture function on electronic devices, using perception algorithms to identify user intentions and make wonderful frames, the shooting problems caused by reaction delay are solved, and the quality of photos and user experience are improved.

WO2024179108A9PCT designated stage expired Publication Date: 2024-11-07HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/136755
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-27
Filing Date
2023-12-06
Publication Date
2024-11-07

AI Technical Summary

Technical Problem

During the photo shooting process, due to the delay in human reaction, it is difficult for users to capture wonderful photos that meet expectations, and the photos are prone to ghosting, affecting the image quality and user experience.

Method used

Provide a method of taking pictures, by implementing the 'manual capture' function on electronic devices, using perception algorithms to identify user capture intentions, make wonderful frames based on manual capture time, and quickly feedback the capture results in the preview interface to avoid delays in response The resulting decline in the quality of the photo.

Benefits of technology

It effectively avoids the problem of difficulty in capturing wonderful photos due to reaction delays, improves the accuracy and image quality of the shooting, and optimizes the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023136755_07112024_PF_FP_ABST
    Figure CN2023136755_07112024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present application are a photographing method and an electronic device. The electronic device can recognize the photograph-capturing intention of a user, and on the basis of a manual-photograph-capturing time, determine highlight frames from among image frames captured just before and after manual photograph capturing, for example, highlight frames are determined from among image frames captured within 1 second before the manual photograph capturing and from among image frames captured within 5 seconds after the manual photograph capturing, such that a highlight photograph that meets photograph-capturing expectations of the user is provided, thereby avoiding the problem of it being hard to capture an expected highlight photograph due to the delayed reaction of a person.
Need to check novelty before this filing date? Find Prior Art

Description

Photographing method and electronic device

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on February 27, 2023, with application number 202310216832.6 and application name “A photographing method and 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 electronic technology, and in particular to a photographing method and electronic equipment. Background Art

[0003] With the development of electronic technology, mobile phones, tablet computers and other electronic devices are generally equipped with cameras, such as front cameras, rear cameras, wide-angle cameras, etc. Users can use these electronic devices with camera capabilities to record wonderful moments, touching scenes and other beautiful images.

[0004] Summary of the Invention

[0005] In a first aspect, the present application provides a photographing method, which may include: an electronic device displays a photographing preview interface, wherein the photographing preview interface displays an image captured by a camera of the electronic device and a first thumbnail; the electronic device detects that a shutter button is pressed when displaying a first image frame; the electronic device displays a thumbnail of the first image frame in the photographing preview interface; the electronic device obtains a second image frame based on image frames within a first time range, and the image frames captured by the camera within the first time range include the first image frame; the first image frame is different from the second image frame; the electronic device saves the second image frame to a gallery; the electronic device exits displaying the photographing preview interface; the electronic device displays the photographing preview interface again, and displays a thumbnail of the second image frame in the photographing preview interface.

[0006] In the first aspect, the first image frame can be a preview frame corresponding to the manual capture time, the thumbnail of the first image frame can be the first manually captured thumbnail mentioned in subsequent embodiments, the second image frame can be the manually captured highlight frame mentioned in subsequent embodiments, the first time range can be, for example, 1 second before and 0.5 seconds after the manual capture mentioned in subsequent embodiments, and the thumbnail of the second image frame can be the second manually captured thumbnail mentioned in subsequent embodiments.

[0007] In conjunction with the first aspect, in some embodiments, the method may further include: the electronic device saving a thumbnail of the second image frame to a gallery, so that the user can view the thumbnail of the second image frame in the gallery and click on the thumbnail to view a larger image of the second image frame.

[0008] In conjunction with the first aspect, in some embodiments, the method may further include: the electronic device detecting a click on the thumbnail of the first image frame in the photo preview interface and displaying a large image display interface of the gallery application, wherein the large image display interface displays the second image frame. In other words, when the user clicks the thumbnail of the first image frame that is quickly displayed in the preview interface, the user jumps to the second image frame in the gallery, and a jump in image content occurs.

[0009] In conjunction with the first aspect, in some embodiments, the electronic device may include a hardware abstraction layer HAL. The second image frame may be obtained based on the image frames within the first time range, and may include (see FIG. 6 and related embodiments):

[0010] The decision module in the HAL obtains the preview frame in the preview stream and the frame information of the preview frame from the cache frame module in the HAL; the frame information includes a timestamp and a frame evaluation;

[0011] The decision module selects a local optimal frame once in a period of time and caches the local optimal frame in a queue; the local optimal frame is a preview frame that obtains the highest image evaluation within the period of time or a preview frame whose image evaluation is higher than a first reference value;

[0012] The decision module selects the manually captured wonderful frame from the local optimal frames within the first time range of the queue cache based on the manual capture time; the manually captured wonderful frame is the preview frame with the highest image evaluation within the first time range or the preview frame with an image evaluation higher than a second reference value.

[0013] In conjunction with the first aspect, in some embodiments, the method may further include (see FIG. 6 and related embodiments):

[0014] The algorithm module in the HAL obtains a preview frame in the preview from the preview stream module in the HAL, and performs image evaluation on the preview frame to obtain a frame evaluation;

[0015] The algorithm module returns the frame evaluation of the preview frame to the cache frame module in the HAL;

[0016] The frame buffering module receives the preview frames in the preview stream transmitted by the preview stream module, and buffers the preview frames and frame information of the preview frames.

[0017] In conjunction with the first aspect, in some embodiments, the electronic device may further include: a camera framework, a camera application, and a HAL; and the electronic device saving the second image frame to a gallery may include (see FIG. 6 and related embodiments):

[0018] The decision module sends the second image frame to the data packaging module in the HAL;

[0019] The data packaging module packages the second image frame and returns the packaged second image frame to the camera framework; the packaged second image frame includes a thumbnail of the second image frame;

[0020] The camera framework then returns the packaged second image frame to the image storage module in the camera application;

[0021] The image storage module stores the packaged second image frame.

[0022] In conjunction with the first aspect, in some embodiments, the electronic device may include: a camera application, a camera framework, and a HAL; the electronic device refreshing and displaying the thumbnail of the most recently taken photo as a manually captured thumbnail may include (see FIG. 6 and related embodiments):

[0023] The decision module returns a thumbnail of the first image frame to the camera framework;

[0024] The camera framework then returns a thumbnail of the first image frame to the UI module in the camera application;

[0025] The UI module displays a thumbnail of the first image frame.

[0026] In combination with the first aspect, in some embodiments, before the electronic device detects that the shutter button is pressed when displaying the first image frame, it may also include: the electronic device turns on a wonderful capture function; turning on the wonderful capture function includes: reconfiguring the preview stream process, the reconfiguration includes initializing the algorithm of the preview stream to a re-algorithm, and configuring the zoom range supported by the preview stream from a first zoom range to a second zoom range, wherein the maximum zoom ratio included in the second zoom range is lower than the maximum zoom ratio included in the first zoom range.

[0027] In conjunction with the first aspect, in some embodiments, the electronic device includes a hardware abstraction layer HAL, a camera framework, and a camera application; the reconfiguration of the preview stream process may include (see FIG. 6 and related embodiments):

[0028] The preview stream module in the HAL initializes the preview stream algorithm to a light algorithm and changes the zoom range supported by the preview stream to a second zoom range;

[0029] The preview stream module returns the reconfigured preview stream to the camera framework;

[0030] The camera framework then returns the reconfigured preview stream to the UI module in the camera application;

[0031] The specific UI module in the camera application displays the reconfigured preview stream in the preview interface and refreshes the preview interface.

[0032] In combination with the first aspect, in some embodiments, refreshing the preview interface includes: turning off the function options supported by the heavy algorithm but not supported by the light algorithm, and refreshing the zoom range from the first zoom range to the second zoom range.

[0033] In combination with the first aspect, in some embodiments, the second wonderful frame saved to the gallery includes marking information for marking manually captured wonderful photos.

[0034] In a second aspect, the present application provides an electronic device comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code comprises computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the method described in the first aspect and any possible implementation of the first aspect.

[0035] In a third aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions to enable the electronic device to execute the method described in the first aspect and any possible implementation method of the first aspect.

[0036] In a fourth aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.

[0037] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.

[0038] It is understandable that the electronic device provided in the second aspect, the chip system provided in the third aspect, the computer storage medium provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to perform the methods provided in this application. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] 1A to 1C exemplarily illustrate a UI for enabling “Wonderful Snapshot”;

[0040] 2A-2H exemplarily illustrate a UI for a user to manually capture a wonderful photo;

[0041] 3A-3J are schematic diagrams showing wonderful photos manually captured by an electronic device in "recording" mode;

[0042] FIG4 exemplarily shows the hardware structure of an electronic device according to an embodiment of the present application;

[0043] FIG5 exemplarily shows the software architecture of the electronic device according to an embodiment of the present application;

[0044] FIG6 shows a photographing method provided by an embodiment of the present application;

[0045] FIG7 exemplarily shows a decision-making mechanism for manually capturing wonderful frames provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application.

[0047] A wonderful photo is an image captured by an electronic device through a camera at a wonderful moment. A wonderful moment can refer to a moment within a period of time when the state or action of the photographed subject is at its best. State and action are specific to still-life photography and non-photography photography, respectively. In still-life photography, a wonderful moment is when the photographed subject is relatively still in physical space, and the camera image of the still-life subject is clear, jitter-free, and noise-free. In non-still-life photography, a wonderful moment is when the photographed subject's action in physical space is at its best, and the camera image of the still-life subject is clear, jitter-free, and noise-free.

[0048] For example, when taking photos of scenic spots and historical sites, the moment when the building is imaged completely, clearly, without shaking and noise on the electronic device through the camera is a wonderful moment, and the photo formed by the image captured by the electronic device through the camera at this wonderful moment is a wonderful photo of the scenic spot and historical site; when taking photos of a long jumper, the moment when the athlete jumps forward after taking off and the image is clear, without shaking and noise is a wonderful moment, and the photo formed by the image captured by the electronic device through the camera at this wonderful moment is a wonderful photo of the long jumper; when taking close-up photos of a portrait, the moment when the person opens his eyes and smiles and the image is clear, without shaking and noise is a wonderful moment, and the photo formed by the image captured by the electronic device through the camera at this wonderful moment is a wonderful photo of the person.

[0049] However, during the photo-taking process, due to human reaction delay, users often find it difficult to take wonderful photos as expected.

[0050] For example, at time T1, the user sees the kth frame preview image on the camera app's preview interface and intends to capture this frame. At this point, the user takes the photo. However, due to human reaction delays and the time required for the electronic device to complete the photo processing, the image ultimately presented to the user by the electronic device is an image after the kth frame, such as the k+nth frame, which often does not meet the user's expectations.

[0051] In particular, due to the uncertainty of human reaction delay and the device shaking caused by the snapshot action, the photos actually output by the electronic device to the user are prone to ghosting, which greatly affects the image quality of the final photo and affects the user's photo-taking experience.

[0052] In view of this, an embodiment of the present application provides a method for taking photos, which can avoid the problem of difficulty in capturing expected wonderful photos due to human reaction delay.

[0053] The electronic device is an electronic device that has a camera and provides photo taking and display services, such as a smart phone, a tablet computer, a large-screen device, etc. The photo taking method provided in the embodiment of the present application can be embodied as a "manual snapshot" function on the electronic device.

[0054] First, the “manual snapshot” function provided in the embodiment of the present application is described in conjunction with the user interface (UI) provided on the electronic device.

[0055] Turn on "Great Capture"

[0056] Figures 1A to 1C exemplarily illustrate the UI for opening the "Wonderful Snapshot" function.

[0057] FIG1A exemplarily shows a system desktop 111 involved in an embodiment of the present application.

[0058] As shown in Figure 1A, a page with application icons is displayed on the desktop 111, and the page includes multiple application icons (for example, a settings application icon, an application market application icon, a gallery application icon, a browser application icon, etc.). A page indicator is also displayed below the multiple application icons to indicate the positional relationship between the currently displayed page and other pages. A tray area is displayed below the page indicator. Among them, the tray area includes multiple tray icons, for example, a camera application icon, an address book application icon, a phone application icon, and a message application icon. The tray area remains displayed when the page is switched. In some embodiments, the above-mentioned page may also include multiple application icons and page indicators. The page indicator may not be part of the page and may exist independently. The above-mentioned tray icon is also optional, and the embodiments of the present application do not limit this.

[0059] The electronic device may detect a user operation of opening a camera application, such as clicking a desktop icon of the camera application. In response to the operation, the electronic device may display a user interface as shown in FIG. 1B .

[0060] FIG1B exemplarily shows a preview interface provided by an embodiment of the present application.

[0061] As shown in FIG1B , the preview interface may include a mode bar 121 , a photo option 122 , a preview box 123 , a review control 124 , a quick function area 126 , and a “wonderful capture” option 127 . Among them:

[0062] The mode bar 121 may include multiple photo mode options, such as "night scene", "portrait", "photo", "video recording", etc. Different photo modes can provide users with photo services with different effects. Users can select any of the multiple photo modes to take photos according to different needs. For example, "photo recording" may be the default photo mode, used for taking photos. "Video recording" is used to record videos. The "night scene" mode is suitable for photo scenes with low light, such as at night. The "portrait" mode is suitable for photo scenes where the subject is a person. The electronic device can detect the user operation of switching modes, such as swiping left / right in the mode bar 121, and change the currently used photo mode according to the operation. For example, when it is detected that the mode bar 121 is dragged to the left (left swiping operation) and the float stops at the "portrait" option, the electronic device can switch to the "portrait" mode. By default, the electronic device first uses the "photo recording" mode.

[0063] Photo option 122 is used to trigger a photo. The electronic device can detect whether a user action, such as a click, is performed on photo option 122. Upon detecting a user action on photo option 122, the electronic device can generate a photo instruction. Based on the photo instruction, the electronic device can obtain the image reported by the camera at the corresponding timestamp and save it as a photo.

[0064] The preview box 123 can be used to display the image reported by the camera in real time. In different shooting modes, the electronic device can process the image reported by the camera to improve the image display effect. For example, in "Portrait" mode, the electronic device can blur the background in the image reported by the camera to highlight the portrait. Here, the preview box 123 can display the image processed by the image processing algorithm corresponding to each shooting mode in real time, allowing the user to perceive the shooting effect corresponding to each shooting mode in real time.

[0065] The review control 124 can be used to browse thumbnails of photos / videos that have been taken. When a user operation acting on the review control 124 is detected, the electronic device can also display the wonderful photos corresponding to the thumbnails.

[0066] The quick function area 126 may include an HDR function option 126A, an AI function option 126B, a flash function option 126C, a color mode function option 126D, a setting function option 126E, and the like. The HDR function option 126A can be used to trigger the electronic device to use the HDR algorithm to perform image fusion processing when it is turned on. The AI ​​scene recognition option 126B can be used to trigger the electronic device to recognize the photo scene in the preview screen when it is turned on. The current AI scene recognition option 126B is in the off state. The flash option 126C can be used to trigger the electronic device to turn on or off the flash. The color mode option 126D can be used to trigger the electronic device to use a color filter to process the image captured by the camera. The setting option 126E can be used to set the electronic device's photo parameters (e.g., image size, image storage format, etc.).

[0067] The "Great Snap" option 127 allows the user to turn the "Great Snap" function on or off. In the preview interface shown in FIG1B , "Great Snap" is off. At this time, the electronic device supports the normal photo mode, and the preview stream supports a zoom range of 0.5x to 10x. In the preview interface shown in FIG1B , the electronic device can detect a user operation to turn on "Great Snap," such as clicking the "Great Snap" option 127. In response to this operation, the electronic device can display the preview interface shown in FIG1C .

[0068] In the preview interface shown in FIG1C , the “Great Snap” option 127 has switched display modes, such as displaying a darker color, to indicate that the “Great Snap” function of the electronic device has been turned on. In “Great Snap” mode, the zoom range supported by the preview stream becomes 0.5x to 5x. This is because, compared to ordinary photography, “Great Snap” intends to obtain great frames through image evaluation. The perception algorithm it uses requires frame screening based on more image details and higher image quality, and therefore cannot support higher zoom ratios with significant pixel loss. In addition, function options that conflict with “Great Snap” are turned off, such as the HDR function option 126A and the AI ​​function option 126B becoming untouchable, such as being grayscaled.

[0069] The method of turning on the "Great Snapshot" function of the electronic device is not limited to the method shown in Figures 1A-1C. The user can also turn on the "Great Snapshot" function of the electronic device in other ways, such as pulling down the notification bar to quickly turn on the "Great Snapshot" function.

[0070] Manual capture

[0071] Figures 2A-2H exemplify a UI for a user to manually capture a wonderful photo. The series of preview screens shown in Figures 2A-2E demonstrate that a user wants to manually capture an athlete's long jump. When the camera is aimed at an athlete in the long jump, the electronic device can sequentially display the images of the long jump captured by the camera at different times in the preview interface. For ease of subsequent explanation, the preview frames shown in Figures 2A-2E can be numbered in chronological order as frame i-2, frame i-1, frame i, frame i+1, and frame i+2. Here, frame i-1 is earlier than frame i, but is not limited to being one frame earlier.

[0072] Assume that the preview picture shown in Fig. 2 C, such as the picture of the character jumping to the highest point, is the picture that the user wants to capture. At this time, the user will click on the photo option 122 to capture this picture.

[0073] However, due to human reaction delay, when the user makes the snapshot action, the screen displayed in the preview interface of the electronic device has been updated to the screen shown in Figure 2D, such as the screen with the athlete's body in a flat position. Therefore, the electronic device detects the user's manual snapshot action only when displaying the preview frame shown in Figure 2D. The preview frame shown in Figure 2D is after the preview frame shown in Figure 2C. In other words, the time when the electronic device detects the manual snapshot action is later than the wonderful moment that the user wants to capture. In the prior art, the electronic device will save the preview frame shown in Figure 2D as the photo obtained by taking the photo. However, the preview screen shown in Figure 2D is not the screen that the user wants to capture.

[0074] In order to overcome this problem, in an embodiment of the present application, the electronic device can identify the user's intention to capture the picture, and based on the user's manual capture time, decide to manually capture the wonderful frames and save them as wonderful photos, avoiding the problem of difficulty in capturing the expected wonderful photos due to human reaction delay.

[0075] As shown in FIG2D , the electronic device may detect a manual capture action, such as clicking the shutter 122, when displaying the i-th preview image. In response, the electronic device may determine a highlight frame from the preview frames immediately before and after the manual capture based on the manual capture time, such as the i-1-th frame image shown in FIG2C , and may save the highlight frame as a manually captured highlight photo.

[0076] Here, "shortly before and after manual capture" can refer to earlier and / or later than the manual capture time but with a smaller time interval. For example, within 1 second before manual capture, and within 5 seconds after manual capture. Among them, shortly before manual capture can be defined by a time threshold, that is, it refers to before manual capture but the interval between manual capture time is less than the first time length, such as within 1 second before manual capture. Shortly after manual capture can also be defined by a time threshold, that is, it refers to after manual capture but the interval between manual capture time is less than the second time length, such as within 0.5 seconds after manual capture. The first time length can also be equal to the second time length.

[0077] The electronic device's recognition of highlight moments based on a specific intelligent algorithm (referred to herein as the perception algorithm) often coincides with or is close to highlight moments identified by the user. Therefore, the selection range of highlight frames is not too far removed from the time of manual capture. In particular, through repeated training, the algorithm becomes more closely aligned with the user's perception, and the highlight moments it identifies are more closely aligned with the user's perceived highlight moments. The following examples will detail how this algorithm is used to determine highlight frames, but will not be elaborated here.

[0078] The first and second durations can be intelligently selected based on the shooting scenario. For example, in a shooting scenario with fast-changing images, the first and second durations can be shorter, as certain exciting scenes don't last long. Conversely, for expert photographers with slow-changing images, the first and second durations can be longer, as certain exciting scenes can last longer.

[0079] In one implementation, manually captured highlight frames saved as highlight photos can be determined from preview frames taken shortly before (e.g., within 1 second before) and shortly after (e.g., within 0.5 seconds after) the manual capture. The specific implementation of this determination will be described in detail in the following embodiments and will not be expanded upon here.

[0080] Moreover, as shown in FIG2E , the electronic device may also update the thumbnail displayed on the review control 124 to provide feedback on the user's manual snapshot on the preview interface, allowing the user to feel that the snapshot has occurred.

[0081] To quickly provide users with feedback on the capture results and optimize them, thumbnail updates can be divided into two steps: first, a first manual capture thumbnail is generated based on the preview frame during manual capture, and the first manual capture thumbnail is refreshed and displayed; second, a second manual capture thumbnail is generated based on the manually captured highlight frame and added to the large image of the manually captured highlight frame. This second manual capture thumbnail is then refreshed and displayed in the preview interface after the camera app is reopened. Manually captured highlight frames are comprehensively determined from the preview frames shortly before (for example, within the first 1 second) and shortly after (for example, within the last 0.5 seconds).

[0082] Subsequently, the user can jump to the gallery to view manually captured wonderful photos through the first manually captured thumbnail. The user can jump from the first manually captured thumbnail to the manually captured wonderful photos, and the user can feel the jump in image content. As shown in Figure 2F, the electronic device can detect that the user clicks on the first manually captured thumbnail (such as a thumbnail of an athlete's body in a flat position). In response, it can open the interface shown in Figure 2G, which is a large image display interface of the gallery, displaying the manually captured wonderful photos (such as a thumbnail of an athlete jumping to the highest point).

[0083] In addition, after the user exits the camera application and reopens the camera application, the electronic device may display the second manually captured thumbnail in the preview interface instead of the first manually captured thumbnail. Without limitation, the user may first open the user interface shown in the example of FIG2H of the gallery, where the thumbnail displayed is the second manually captured thumbnail instead of the first manually captured thumbnail. The thumbnails in the gallery are extracted from the large images in the gallery.

[0084] Not limited to the above preview scene, the user can also perform the above manual snapshot in the video recording scene.

[0085] 3A-3F are schematic diagrams showing wonderful photos manually captured by an electronic device in the “recording” mode.

[0086] As shown in Figure 3A , the electronic device can detect a left swipe operation on the mode bar 121. In response to this operation, the electronic device can switch from "Photo" mode to "Video" mode, as shown in Figure 3B . As shown in Figure 3B , after entering "Video" mode, the electronic device can switch the preview interface originally corresponding to "Photo" mode to the preview interface corresponding to "Video" mode. Specifically, the electronic device can switch the photo option 122 originally in "Photo" mode to the start video control 311 in "Video" mode.

[0087] As shown in Figure 3B, the electronic device can detect the user operation acting on the start recording control 311. In response to the above operation, the electronic device can start recording the video. Correspondingly, the electronic device can display the recording interface shown in Figure 3C. The electronic device can switch the original start recording control 311 to the end recording control 312. At the same time, the electronic device can display a timestamp control 313 in the preview box 123 to indicate the length of recording. The recording interface shown in Figure 3C can also include a "Great Snap" option 127 and a control 315, wherein the "Great Snap" option 127 can be used by the user to choose to turn on / off the "Great Snap" function, and the control 315 can be used to receive the user's photo operation during the recording process to trigger manual capture.

[0088] Figures 3C and 3G illustrate a set of video recording interfaces displayed by an electronic device during the recording of a long jumper. Preview box 123 sequentially displays the athlete's motion state as captured by the camera at different moments during the long jump. Timestamp control 313 updates as the recording duration increases.

[0089] Assume that the preview image shown in FIG3E , such as the image of a person jumping to the highest point, is a image that the user wants to capture. In this case, the user clicks the photo control 315 to capture the image during the video recording. Previously, the user has enabled the "Great Capture" function using the "Great Capture" option 127 .

[0090] However, due to human reaction delay, the electronic device detects the manual snapshot action later than the wonderful moment the user wants to capture. Therefore, the electronic device detects the user's manual snapshot action only when displaying the preview frame shown in Figure 3F. The image shown in Figure 3F is not the image the user wants to capture.

[0091] To this end, when recording, the electronic device can also identify the user's intention to capture a photo. This way, after the manual capture occurs, it can provide a wonderful photo that meets the user's expectations. The solution for manually capturing wonderful photos in the recording scene can refer to the solution for manually capturing wonderful photos in the preview scene mentioned above, and will not be repeated here.

[0092] The user can end the recording through the end recording control 312 in the recording interface shown in Figure 3G. After the recording is completed, the electronic device can display the user interface shown in Figure 3H, that is, exit the recording interface, and redisplay the preview interface, including redisplaying the start recording control 311 to replace the end recording control 312, and redisplaying the start review control 124 to replace the control 315. Among them, the review control 124 supports users to view recorded videos and wonderful photos manually captured in the recording. As shown in Figure 3H, the electronic device can detect the user operation of clicking the review control 124, and in response to the operation, it can display the user interface shown in Figure 3I. The user interface shown in Figure 3I shows the latest recorded video. After detecting the forward viewing switching operation in the user interface shown in Figure 3I, such as sliding to the left, the electronic device can switch the content displayed in the user interface shown in Figure 3I from the latest recorded video to the wonderful photos manually captured from the recording.

[0093] The user is not limited to viewing wonderful photos through the review control 124. The user can also first open the user interface of the gallery as shown in Figure 2H, and then choose to view wonderful photos manually captured in the video.

[0094] Next, the form and software and hardware architecture of the electronic device provided in the embodiments of the present application are introduced.

[0095] Electronic equipment can be equipped or portable terminal devices with other operating systems, such as mobile phones, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices and / or smart city devices, etc.

[0096] Figure 4 illustrates an exemplary hardware structure of an electronic device according to an embodiment of the present application. As shown in Figure 4, electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 126, a camera 130, a display 140, an audio module 150, a speaker 150A, a receiver 150B, a microphone 150C, an earphone interface 150D, and a sensor module 160. Sensor module 160 may include a pressure sensor 160A, a distance sensor 160F, a proximity light sensor 160G, a touch sensor 160K, an ambient light sensor 160L, and the like.

[0097] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0098] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals based on instruction operation codes and timing signals to complete the control of instruction fetching and execution.

[0099] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0100] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0101] In an embodiment of the present application, the processor 110 can be used to run a camera application, and the processor 110 is used to control each module in the camera application to execute the wonderful capture function described in the embodiments of Figures 1A-1C, 2A-2F, and 3A-3J above, and to implement a method flow of capturing wonderful frames through manual triggering operations to realize the shooting method provided by the present application.

[0102] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only for illustrative purposes and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0103] The internal memory 126 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0104] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation of DDR SDRAM is generally referred to as DDR5 SDRAM), etc.

[0105] Non-volatile memory may include disk storage devices and flash memory.

[0106] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage cell potential level; universal flash storage (UFS) and embedded multi media card (eMMC) can be divided into UFS and eMMC according to the storage specification.

[0107] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.

[0108] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .

[0109] The external memory interface 120 can be used to connect to an external non-volatile memory device to expand the storage capacity of the electronic device. The external non-volatile memory device communicates with the processor 110 via the external memory interface 120 to implement data storage. For example, files such as music and videos can be stored in the external non-volatile memory device.

[0110] In an embodiment of the present application, the computer program code corresponding to the highlight capture function may be stored in NVM. After the highlight capture function is enabled, the corresponding program code may be loaded into RAM. The processor 110 may directly read the program code in RAM to implement the highlight capture function. In addition, the highlight frames (also called highlight images) obtained by the highlight capture function and their corresponding thumbnail images and other image files may be written to NVM for storage and viewing by the user.

[0111] The electronic device implements its display functionality through a GPU, display screen 140, and an application processor. The GPU is a microprocessor for image processing that connects display screen 140 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0112] The display screen 140 is used to display images, videos, etc. The display screen 140 includes a display panel. The display panel can be a liquid crystal display (LCD). The display screen panel can also be made of an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or 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. In some embodiments, the electronic device can include one or N display screens 140, where N is a positive integer greater than one.

[0113] The electronic device can implement a shooting function through an ISP, a camera 130 , a video codec, a GPU, a display screen 140 , and an application processor.

[0114] The ISP processes data fed back by the camera 130. 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, which is then passed to the ISP for processing and transformed into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and other factors. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within the camera 130.

[0115] The camera 130 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 for conversion 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 130, where N is a positive integer greater than 1.

[0116] In the embodiment of the present application, the camera 130 may be a telephoto camera, a main camera, a wide-angle camera, or the like.

[0117] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency, the DSP performs a Fourier transform on the frequency energy.

[0118] Video codecs are used to compress or decompress digital video. Electronic devices may support one or more video codecs. This allows them to play or record videos in a variety of encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0119] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU enables intelligent cognitive applications in electronic devices, such as image recognition, face recognition, speech recognition, and text comprehension. Image recognition, for example, includes identifying people, animals, and actions, and is used to determine whether the conditions for automatically capturing a scene are met.

[0120] The electronic device can implement audio functions such as music playback and recording through the audio module 150, the speaker 150A, the receiver 150B, the microphone 150C, the headphone jack 150D, and the application processor.

[0121] The audio module 150 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 150 can also be used to encode and decode audio signals. In some embodiments, the audio module 150 can be provided in the processor 110, or some functional modules of the audio module 150 can be provided in the processor 110.

[0122] The speaker 150A, also called a "speaker," is used to convert audio electrical signals into sound signals. The electronic device can listen to music or make hands-free calls through the speaker 150A.

[0123] The receiver 150B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device receives a call or voice message, the user can place the receiver 150B close to the ear to hear the voice.

[0124] Microphone 150C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 150C to input the sound signal into the microphone 150C. The electronic device can be provided with at least one microphone 150C. In other embodiments, the electronic device can be provided with two microphones 150C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device can also be provided with three, four or more microphones 150C to realize sound signal collection, noise reduction, and identification of sound sources, and realize directional recording function, etc.

[0125] The headphone jack 150D is used to connect a wired headphone and can be a USB interface, or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0126] The structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components can be implemented in hardware, software, or a combination of software and hardware. For example, the electronic device may further include buttons, motors, indicators, and subscriber identification module (SIM) card interfaces, etc. For another example, the sensor module may further include: a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a fingerprint sensor, a temperature sensor, a bone conduction sensor, and the like.

[0127] FIG5 exemplarily illustrates the software architecture of an electronic device according to an embodiment of the present application. As shown in FIG5 , the layered architecture divides the system 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 system is divided into five layers, namely, the application layer, the application framework layer (framework), the hardware abstraction layer (HAL), the driver layer, and the hardware layer, from top to bottom. Among them:

[0128] The application layer (application) can include a series of application packages. For example, the application package can include a camera application, as well as applications such as a gallery (not shown). The camera application may include, but is not limited to, a UI module, a photo module, a picture storage module, and the like. Among them, the UI module can be the cameraUI module mentioned in other embodiments of this document, which is mainly responsible for the human-computer interaction of the camera application, such as controlling the display of the preview interface and the preview screen therein, and responding to user operations occurring in the preview interface. The photo module may include a normal photo module and a wonderful capture module to provide normal photo functions, wonderful capture functions, etc. Compared to the normal photo function, the wonderful capture function can identify the user's capture intention in advance, support subsequent faster output of capture feedback to the user on the interface, and support the provision of wonderful photos that meet the user's capture expectations. Regarding the implementation of wonderful capture, please refer to other embodiments of this document and will not be repeated here. The picture storage module can be used to store wonderful photos manually captured by the user in the file system or a specific database of the electronic device for retrieval by applications such as the gallery.

[0129] The application framework layer (framework) may mainly involve the camera framework, and may include camera access interfaces such as camera management and camera devices, playing a role of connecting the upper and lower levels. It can interact with the camera application through the application program interface (API) and interact with the HAL through the HAL interface definition language (HIDL).

[0130] The Hardware Abstraction Layer (HAL) is an interface layer between the application framework layer and the driver layer, providing a virtual hardware platform for the operating system. The HAL can include modules for preview streaming, frame caching, decision making, data packaging, and algorithms. For the specific implementation of these modules, please refer to other embodiments in this document and will not be detailed here.

[0131] The driver layer is the layer between hardware and software. It includes drivers for various hardware components. These drivers include camera drivers, digital signal processor drivers, and image processor drivers. The camera driver drives the image sensors of one or more cameras in the camera module to capture images and the image signal processor to pre-process them. The digital signal processor driver drives the digital signal processor to process images. The image processor driver drives the graphics processor to process images.

[0132] The hardware layer may include a camera module, an image signal processor, a digital signal processor, and an image processor. The camera module may include one or more camera image sensors (e.g., image sensor 1, image sensor 2, etc.). Optionally, the camera module may also include a time of flight (TOF) sensor, a multispectral sensor, and the like.

[0133] In addition, the algorithm module in the embodiment of the present application can be coupled to a camera algorithm library, which can include the image evaluation algorithms mentioned elsewhere in this document. Image evaluation algorithms include, but are not limited to: subject detection algorithm, face attribute algorithm, action evaluation algorithm, face evaluation algorithm, and clarity algorithm. Among them:

[0134] Subject detection algorithms can be used to detect specific subjects in an image, such as people, cats, dogs, and so on, and also to capture parts of these subjects, such as human faces, cat faces, and dog faces. After detecting a specific subject, the algorithm module can mark the size and position of the subject in the image and evaluate the image based on its size and position. For example, the larger the subject's space and the more centrally located it is, the higher the score for that subject in the image.

[0135] The facial attribute algorithm can be used to identify facial information in an image, such as whether the eyes are open or smiling, and further determine the facial expression based on this facial information, outputting a facial expression score that reflects the facial expression in the image. For example, a higher facial expression score corresponds to an open eye, and a higher facial expression score corresponds to a smile.

[0136] The motion evaluation algorithm can be used to identify the subject's movements, such as jumping, looking back, throwing objects, playing a ball, running, splashing water, playing Frisbee, and so on. It then determines the degree of completion of the movement in the current image based on the optimal completion point of each behavior, and then outputs a motion score for the image. Images with higher motion completion levels correspond to higher motion scores. For example, taking jumping as an example, the motion state where the subject reaches its highest point after leaving the ground can be called the optimal completion point for the jump. When the subject in the i-th frame is in the motion state where the subject leaves the ground and reaches its highest point, the motion evaluation algorithm can output a motion score of 1 (the highest score) for the image. When the subject in the image does not leave the ground, or leaves the ground but does not reach its highest point, the motion evaluation algorithm can output a motion score of 0.3 or 0.5, or a value less than 1. Specifically, the motion evaluation algorithm can determine the motion score for different moments when the subject leaves the ground but does not reach its highest point based on the distance from the highest point. Determining the optimal completion point for the movement requires determining the subject's trajectory over a period of time. Therefore, after receiving multiple frames of images within a period of time, the motion evaluation algorithm can first determine the optimal completion point in these multiple frames of images, and then evaluate the motion state of each frame of images in these multiple frames based on the optimal completion point, and output the motion score of each frame of images.

[0137] The clarity algorithm can be used to detect image clarity. An image with no jitter or noise has higher clarity.

[0138] The algorithm module can determine the image rating for each frame by integrating the results obtained by each algorithm. Specifically, the algorithm module can set different image rating calculation methods based on the type of subject in the image. For example, when the subject detection algorithm identifies a person in the image, the decision module can combine the output results of the subject detection algorithm, motion evaluation algorithm, facial attribute algorithm, and clarity algorithm, as well as the shooting parameters reported by the camera and / or other sensors to determine the image rating for the image. When the subject detection algorithm identifies no person in the image, for example, when the subject is a cat or dog, the output result of the facial attribute algorithm is null. In this case, the decision module can determine the image rating for the image based solely on the output results of the subject detection algorithm, motion evaluation algorithm, clarity algorithm, and the shooting parameters reported by the camera and / or other sensors, thereby preventing null values ​​from the face detection algorithm and facial attribute algorithm from lowering the image rating. Furthermore, when no specific subject is identified, the output results of the subject detection algorithm, motion evaluation algorithm, and facial attribute algorithm are all null. In this case, the decision module can determine the image rating for the frame based solely on the clarity output of the clarity algorithm and the data reported by the camera and / or other sensors.

[0139] Based on the hardware and software architecture of the above-mentioned electronic device, the following describes the photographing method of the embodiment of the present application in depth.

[0140] Figure 6 shows a method for taking pictures provided by an embodiment of the present application. The implementation of this method can be based on the interaction and cooperation between the application layer (such as the camera application), the framework layer (framework), and the hardware abstraction layer (HAL) in the electronic device, wherein the application layer mainly involves the CameraUI, wonderful capture, and image storage modules in the camera application; the hardware abstraction layer mainly involves the preview stream, cache frame, decision-making, data packaging, and algorithm modules; the framework layer mainly involves the camera framework, which may include camera access interfaces such as camera management and camera devices, and play a role in connecting the upper and lower parts. It can interact with the camera application through the API and interact with the HAL through HIDL. As shown in Figure 6, the method may include:

[0141] Launch the Camera app

[0142] S11. The system desktop can detect a user's operation of opening a camera application, for example, the user clicks a desktop icon of "Camera".

[0143] S12. In response to the user's operation of opening the camera application, the system may activate the CameraUI module and display a preview interface, which may include a preview box 123 and a "Great Snap" icon 127, as shown in FIG1B . The CameraUI module may be responsible for human-computer interaction with the camera application, such as controlling the display of the preview interface and its interface elements and responding to user operations occurring in the preview interface.

[0144] S13. The CameraUI module also sends a trigger message to the camera framework. The message may carry parameters such as the re-algorithm and the first zoom range to trigger the HAL to start the camera streaming.

[0145] S14. The camera framework further transmits a message to start streaming to the HAL, specifically, transmits the message to the preview stream module in the HAL.

[0146] Here, stream configuration may include determining an initialization re-algorithm and configuring the preview stream to support a first zoom range.

[0147] The re-algorithm is the algorithm supported by the preview stream, which may include an artificial intelligence recognition algorithm, a high dynamic range (HDR) algorithm, etc. After receiving the preview stream, the CameraUI may display the function options corresponding to the algorithm in the preview box, such as the HDR function option 126A and the AI ​​function option 126B shown in FIG. 1B .

[0148] This can meet various user image processing needs. At this point, the "Highlight Snap" feature is not yet enabled; the camera app is only using standard photo capture. The loaded algorithm is more complex than the algorithm loaded after "Highlight Snap" is enabled. Therefore, the algorithm at this point can be referred to as the "heavy algorithm," while the subsequent algorithms are referred to as the "light algorithm."

[0149] The zoom range supported by the preview stream can be adapted to the supported algorithms to achieve better algorithm execution. For example, compared to ordinary photography, "Great Snap" aims to obtain great frames through image evaluation. The perception algorithm it uses needs to screen frames based on more image details and higher image quality, and therefore cannot support higher zoom ratios that result in significant pixel loss. This can also be seen by comparing the user interfaces shown in Figures 1B and 1C. As shown in Figure 1B, the zoom range supported by the preview stream for ordinary photography is 0.5x to 10x, while as shown in Figure 1C, the zoom range supported by the preview stream for "Great Snap" is 0.5x to 5x. Compared to 5x, 10x will result in greater loss of image details and is less suitable for the algorithm used by "Great Snap".

[0150] S15. After receiving the message triggering the start of the stream distribution, the HAL may send a command to the camera device (shown as "Sensor" in the figure) to start the camera to start capturing images.

[0151] S16. After the camera is started, the HAL may receive an image stream from the camera. At this time, the image stream may be referred to as a raw image stream.

[0152] S17: The HAL may process and compress the original image stream from the camera to obtain a preview stream. The HAL may also initialize a re-algorithm and configure the preview stream to support the first zoom range.

[0153] S18. The HAL may return a preview stream to the camera framework. In this case, the preview stream is configured with a zoom range of the first zoom range.

[0154] S19. After receiving the preview stream from the HAL, the camera framework may pass the preview stream to the CameraUI in the camera application to trigger the CameraUI to display the preview image in the preview box.

[0155] S20. The CameraUI in the camera application uses the preview stream to display the preview image in the preview interface. The preview image in the preview box can be continuously refreshed with the preview stream.

[0156] At this point, in response to the user's operation of opening the "camera", the electronic device has completed the display of the preview interface and the preview image therein.

[0157] S21. In response to a user operation to open the camera application, the CameraUI module may also activate a picture storage module in the camera application. The picture storage module may be used to save pictures manually or automatically captured by the user to the file system or a specific database of the electronic device for other applications such as the gallery to access the pictures.

[0158] The following describes what the electronic device does after the "Great Snap" function is turned on, that is, how the application layer, framework layer, HAL and camera device in the electronic device cooperate to implement the "Great Snap" function.

[0159] Start "Great Snap"

[0160] S22. The CameraUI module in the camera application can detect the user's operation of turning on "Wonderful Snapshot", for example, the user clicks the "Wonderful Snapshot" icon in the preview interface.

[0161] S23. In response to the operation of starting “wonderful capture”, the CameraUI module may start the “wonderful capture” module in the camera application.

[0162] S24. The activated "wonderful capture" module may send a trigger message to the camera framework to trigger the HAL to restart the camera stream distribution.

[0163] S25. The camera framework further transmits a message to start streaming to the HAL, specifically, transmits the message to the preview stream module in the HAL.

[0164] Here, reconfiguring the stream may include initializing the light algorithm and configuring the preview stream to support the second zoom range, which will be expanded in the following step S28.

[0165] S26. After receiving the message triggering the start of stream re-distribution, the HAL may send a command to the camera device to start the camera to start capturing images.

[0166] S27. The HAL may continue to receive the image stream from the camera. At this time, the image stream may be referred to as a raw image stream.

[0167] S28. The HAL may process and compress the raw image stream from the camera to obtain a preview stream. The HAL may also initialize the light algorithm and configure the preview stream to support a second zoom range.

[0168] Light algorithms primarily refer to the perception algorithms mentioned in this article, and can include subject detection, motion assessment, face detection, facial attribute, and clarity algorithms. These algorithms can be used to determine image content, while clarity algorithms can be used to determine image clarity. Image quality evaluation metrics, in addition to clarity, can also include other parameters such as exposure. These parameters can be directly derived from data reported by cameras and / or other sensors.

[0169] The maximum zoom ratio included in the second zoom range may be lower than the maximum zoom ratio included in the first zoom range, so that the preview frames in the preview stream under "Great Snap" have more image details, so that the perception algorithm of "Great Snap" can perform image evaluation.

[0170] For the description of the initialization algorithm and the configuration of the zoom range supported by the preview stream, please refer to the previous step S17 and will not be repeated here.

[0171] In step S29, the HAL returns a preview stream to the camera framework. This preview stream initializes the light algorithm and configures the zoom range to the second zoom range. This preview stream, unlike the preview stream returned to the camera framework in step S18, is called a new preview stream.

[0172] S30. After receiving the new preview stream from the HAL, the camera framework may pass the new preview stream to the CameraUI in the camera application to trigger the CameraUI to refresh the preview image in the preview frame.

[0173] After receiving the preview stream, CameraUI can understand that the algorithm corresponding to the preview stream is a light algorithm, not a heavy algorithm, and can then turn off the function options corresponding to the heavy algorithm in the preview box, for example, turning off the HDR function option 126A and the AI ​​function option 126B shown in FIG1B as shown in FIG2C . What the user can perceive is that after clicking the "Great Snap" icon 122 in the preview interface, the HDR function option 126A and the AI ​​function option 126B in the preview box become untouchable, such as being grayed out.

[0174] S31. The CameraUI in the camera application can also use the new preview stream to refresh the preview image.

[0175] At this point, in response to the user's activation of the "Great Snap" operation, the electronic device has completed relevant updates in the preview interface, and these updates can be perceived by the user.

[0176] In addition, in response to the user turning on "Wonderful Snap", the electronic device can also execute the following steps S33 to S39 to identify the user's snapshot intention in advance, support subsequent faster snapshot feedback, and support providing wonderful photos that meet the user's snapshot expectations.

[0177] S32. After receiving the trigger message for starting the re-distribution of streams from the "wonderful capture" module, the camera framework may also send a start message to the algorithm module in the HAL to start the algorithm module.

[0178] S33: The activated algorithm module can obtain the preview stream from the preview stream module. The preview stream module can be coupled to a buffer area for storing the preview stream and can read the preview stream buffered therein.

[0179] S34. The algorithm module may execute a perception algorithm to perform image evaluation on the preview frames in the preview stream.

[0180] S35: After evaluation, the algorithm module can feed back frame information to the cache frame module. The frame information may include frame number, timestamp, evaluation result, etc.

[0181] S36. The cache frame module may receive the preview frame in the preview stream transmitted by the preview stream module.

[0182] S37: The cache frame module may cache the preview frames in the preview stream and the frame information of each preview frame fed back by the cache module.

[0183] S38. The decision module may access the preview frames and frame information cached by the cache module to select the optimal frame every period of time. For example, the optimal frame may be selected every 0.33 seconds. The optimal frame may be the preview frame that receives the highest image evaluation according to the perception algorithm within the 0.33 seconds, or the preview frame whose image evaluation exceeds a specific reference value (which may be referred to as a first reference value). 0.33 seconds is merely an example, selected from the user's optimal recognition interval. 0.33 seconds may include multiple frames, for example, 15 frames, depending on the frame rate.

[0184] S39. The decision module may cache the optimal frames with high evaluation results selected within each period of time in a queue-like manner.

[0185] Here, queue caching means that the best frames are stored in a first-in, first-out manner. Of course, there may be cases where the best frame cannot be selected in one or some 0.33 seconds. This means that the image frames in that 0.33 seconds do not receive a high evaluation according to the perception algorithm, and the evaluation is below a certain threshold. In this case, no best frame will be saved in the queue within that 0.33 second. Alternatively, the preview frame with the best evaluation result in the 0.33 second can be recorded as the best frame in that 0.33 second. In this way, the best frame can be evaluated in every 0.33 second.

[0186] Because the perception algorithm's evaluation results are high, the optimal frames stored in the queue are likely to be the shots the user wants to capture. Once the user's capture action is detected, the electronic device can quickly provide the user with feedback based on the optimal frames stored in the queue, such as updating the thumbnail in the preview interface. This avoids the problem of human reaction delays that prevent the user from capturing the desired wonderful photo.

[0187] Here, "in advance" may mean that the frame evaluation range based on each preview frame starts after the wonderful capture is turned on, even if the manual capture action has not been detected.

[0188] Each optimal frame in the queue carries a timestamp, which can be generated by the camera device. This timestamp allows the decision module to understand the capture time of each optimal frame in the queue. In case of manual capture, the decision module can determine which optimal frame is the highlight frame based on the manual capture time.

[0189] Steps S33 through S39 above are continuously executed when "Highlight Snap" is enabled. As time passes, the locally optimal frames in the queue are continuously updated, even if no manual snapshot action has been detected. This is equivalent to "pre-identifying" the optimal frames that best meet the user's snapshot expectations, enabling early recognition of the user's snapshot intent and enabling faster subsequent decisions to manually capture highlight frames. Optionally, steps S38 and S39 above can also be executed after manual snapshot is triggered.

[0190] Manual capture

[0191] S40: The CameraUI module in the camera application can detect the user's photo-taking operation, such as the user pressing the "shutter" button in the preview interface. The user pressing the "shutter" triggers the photo-taking, which is called manual capture.

[0192] S41. In response to a manual capture, the CameraUI module may transmit a photo request to the wonderful capture module in the camera application. The request may carry a timestamp of the manual capture.

[0193] Here, the manual capture time can be frame aligned, that is, the time during which the manual capture action occurs in the preview frame, then the time indicated by the timestamp of the preview frame is the manual capture time, which facilitates the subsequent measurement of the time interval between the manual capture and the cached frame (cached by the cache frame module).

[0194] S42: The wonderful capture module can send a photo request to the camera framework, which also carries the timestamp of the manual capture.

[0195] S43: The camera framework may then send a photo request to the decision module in the HAL to trigger manual capture. The request may carry a timestamp of the manual capture.

[0196] S44. After receiving the photo request, the decision module can obtain the thumbnail A of the preview frame corresponding to the timestamp according to the timestamp in the request, that is, the manually captured thumbnail.

[0197] The preview frame corresponding to the timestamp is the preview frame displayed in the preview box when the user presses the "shutter".

[0198] S45. Subsequently, the decision module may return thumbnail A to the camera framework.

[0199] S46. The camera framework then sends thumbnail A to the CameraUI module.

[0200] S47. After receiving thumbnail A, the CameraUI module may display thumbnail A, for example, updating the thumbnail displayed on the review control 124 to thumbnail A in the preview interface shown in FIG2E .

[0201] At this point, the electronic device uses the first wonderful frame cached before the manual capture to quickly feedback the user's manual capture: the thumbnail is refreshed and thumbnail A is displayed.

[0202] In addition, the electronic device further performs the following steps S50 to S57 to determine the wonderful frames for generating the large image, so that the user can obtain the wonderful photos that meet expectations.

[0203] S50: After receiving the photo request, the decision module may determine manually captured wonderful frames from the optimal frames within a period of time before and after the manual capture. The manually captured wonderful frames will eventually be saved as wonderful photos provided to the user.

[0204] For example, the decision module can compare the best frames within 1 second before manual capture and the best frames within 0.5 seconds after manual capture. Specifically, the decision module can select the best frame A from the best frames within 1 second before manual capture and the best frame B from the best frames within 0.5 seconds after manual capture. Then, the decision module can compare the best frames A and B and select the better one as the manually captured highlight frame. The manually captured highlight frame can be the local best frame with the highest image evaluation within 1 second before manual capture and 0.5 seconds after manual capture, or the frame with an image evaluation higher than a specific reference value (second reference value).

[0205] Assume, as shown in Figure 7, that within 1 second before manual capture, there are optimal frames K1, K2, and K3, and within 0.5 seconds after manual capture, there is an optimal frame K4. These are obtained by selecting the optimal frames every 0.33 seconds after the start of the highlight capture. Among K1, K2, and K3, K3 has the highest image rating, and its image rating is higher than that of K4. Therefore, K4 is determined to be a highlight frame within 0.5 seconds after the manual capture. From the optimal frames K1, K2, and K3, K3 is determined to be a highlight frame within 1 second before the manual capture. K3 is then compared with K4, and K3 is ultimately determined to be the manually captured highlight frame, i.e., the manually captured highlight frame described above.

[0206] According to the manual capture time, further decisions are made on manually captured wonderful frames from the optimal frames before and after it. This not only provides users with manual capture of wonderful photos that are more in line with their expectations, but also reflects the user's initiative in manual capture.

[0207] In this article, 0.5 seconds and 1 second are examples only; in practice, these values ​​can be set as needed. As mentioned above, the decision module selects the best frame every 0.33 seconds and stores it in a queue. This way, up to three best frames are stored in the queue within the first second of a manual capture. The period after a manual capture can be set to be shorter than the period before the capture to ensure that optimal manually captured frames are captured as soon as possible.

[0208] S51. After deciding to manually capture wonderful frames, the decision module may send the manually captured wonderful frames to the data packaging module.

[0209] S52, the data packaging module packages the manually captured wonderful frames to generate a large image, that is, obtains the manually captured wonderful photos.

[0210] Packaging may include adding thumbnail B corresponding to the large image, that is, the manually captured large image includes thumbnail B. The data package obtained after packaging the highlight frames can be an exchangeable image file (Exif), which includes but is not limited to the following information: highlight frame, shooting time of the highlight frame, shooting parameters, etc.

[0211] Optionally, like the frame buffering module, the data packaging module can also be coupled to the buffer area storing the optimal frame. In step S49, the decision module can also send only the frame number of the manually captured highlight frame to the data packaging module. The data packaging module can then retrieve the manually captured highlight frame from the buffer area storing the optimal frame based on the frame number and package it. This can save computer resources.

[0212] S53: After generating the large image, the data packaging module may return the large image to the camera framework. The large image includes thumbnail B.

[0213] S54: The camera framework may then return the large image, including thumbnail B, to the image storage module in the camera application.

[0214] S55. After receiving the large image, the image storage module saves the large image, such as saving it to a file system or a specific database.

[0215] Later, when the user exits the camera app and reopens it, he or she will see that the thumbnail in the preview interface has been updated to thumbnail B.

[0216] S56: The electronic device exits the camera application and exits the preview interface; then, the electronic device reopens the camera application and reopens the preview interface.

[0217] S57. The camera application may obtain thumbnail B from the file system and refresh and display thumbnail B through the CameraUI module.

[0218] That is, the thumbnail can be updated after a manually captured highlight is identified. This means that thumbnail updates in the preview interface are performed in two steps: first, thumbnail A is immediately fed back based on the preview frame at the time of the manual capture; second, thumbnail B is fed back based on a comprehensive evaluation of highlight frames from the period before and after the manual capture. This allows for both immediate feedback (thumbnail A) and further optimized feedback (thumbnail B) for manually captured images in the preview interface.

[0219] The user is not limited to exiting the camera and then re-entering the camera. The user can also open the gallery by clicking the desktop icon of the gallery and see the thumbnails B of the manually captured wonderful frames in the gallery.

[0220] At this point, for manual snapshots, the electronic device has completed the interface feedback and the acquisition of wonderful photos.

[0221] Afterward, users can open the Gallery to view their favorite photos. For example, on the reopened preview screen, users can click a thumbnail to access the Gallery and view manually captured photos. Alternatively, users can access the Gallery from the desktop. The Gallery can load saved large images from the file system or a specific database to display manually captured photos.

[0222] The term "user interface (UI)" in the specification, claims and drawings of this application refers to the media interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface of an application is a source code written in a specific computer language such as Java and Extensible Markup Language (XML). The interface source code is parsed and rendered on the terminal device, and finally presented as content that the user can recognize, such as pictures, text, buttons and other controls. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, scroll bars, pictures and text. The properties and contents of controls in the interface are defined by tags or nodes, such as XML through <textview> 、 <imgview> 、 <videoview>The controls contained in the interface are specified by nodes such as <head> and <body>. A node corresponds to a control or attribute in the interface, and the node is presented as user-visible content after parsing and rendering. In addition, many applications, such as hybrid applications, usually also contain web pages in their interfaces. A web page, also known as a page, can be understood as a special control embedded in the application interface. A web page is a source code written in a specific computer language, such as hypertext markup language (HTML), cascading style sheets (CSS), JavaScript (JS), etc. The web page source code can be loaded and displayed as user-recognizable content by a browser or a web page display component with similar functions to a browser. The specific content contained in a web page is also defined by tags or nodes in the web page source code, such as HTML through <body>. 、 、 <video> 、 <canvas>To define the elements and attributes of a web page.

[0223] A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operations that uses graphics. It can be an icon, window, control, or other interface element displayed on the display of an electronic device. Controls can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, and other visual interface elements.

[0224] It should be understood that each step in the above method embodiments provided herein can be implemented by hardware integrated logic circuits in a processor or by software instructions. The method steps disclosed in the embodiments of this application can be directly implemented as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.

[0225] The present application also provides an electronic device, which may include: a memory and a processor, wherein the memory may be used to store a computer program; and the processor may be used to call the computer program in the memory so that the electronic device executes the method in any one of the above embodiments.

[0226] The present application also provides a chip system, which includes at least one processor for implementing the functions involved in the method executed by the electronic device in any of the above embodiments.

[0227] In one possible design, the chip system further includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.

[0228] The chip system can be composed of chips, or can include chips and other discrete devices.

[0229] Optionally, there may be one or more processors in the chip system. The processor may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

[0230] Optionally, the memory in the chip system may be one or more. The memory may be integrated with the processor or may be provided separately from the processor, which is not limited in the embodiments of the present application. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or provided on different chips. The embodiments of the present application do not specifically limit the type of memory or the configuration of the memory and the processor.

[0231] Exemplarily, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0232] The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which, when executed, enables a computer to execute the method executed by the electronic device in any of the above embodiments.

[0233] The present application also provides a computer-readable storage medium storing a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the method executed by the electronic device in any of the above embodiments.

[0234] The various implementation modes of this application can be combined arbitrarily to achieve different technical effects.

[0235] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described herein are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive).

[0236] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0237] In short, the above description is only an embodiment of the technical solution of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made based on the disclosure of the present invention should be included in the scope of protection of the present invention.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. A photographing method, characterized in that: include: The electronic device displays a photo preview interface, wherein the photo preview interface displays an image captured by the camera of the electronic device and a first thumbnail; The electronic device detects that a shutter button is pressed when displaying the first image frame; The electronic device displays a thumbnail of the first image frame in the photo preview interface; The electronic device obtains a second image frame based on image frames within a first time range, and the image frames captured by the camera within the first time range include the first image frame; The first image frame is different from the second image frame; The electronic device saves the second image frame to a gallery; The electronic device exits displaying the photo preview interface; The electronic device displays the photo preview interface again, and displays a thumbnail of the second image frame in the photo preview interface.

2. The method according to claim 1, characterized in that Also includes: A thumbnail of the second image frame is saved to the gallery.

3. The method according to claim 1 or 2, characterized in that Also includes: The electronic device detects, in the photo preview interface, an operation of clicking on a thumbnail of the first image frame; The electronic device displays a large image display interface of a gallery application, and the large image display interface displays the second image frame.

4. The method according to any one of claims 1 to 3, characterized in that The electronic device includes a hardware abstraction layer HAL; the second image frame is obtained based on the image frame within the first time range, including: The decision module in the HAL obtains the preview frame in the preview stream and the frame information of the preview frame from the cache frame module in the HAL; the frame information includes a timestamp and a frame evaluation; The decision module selects a local optimal frame once in a period of time and caches the local optimal frame in a queue; the local optimal frame is a preview frame that obtains the highest image evaluation within the period of time or a preview frame whose image evaluation is higher than a first reference value; The decision module selects the second image frame from the local optimal frames in the first time range cached in a queue manner; the second image frame is a preview frame with the highest image evaluation in the first time range or a preview frame with an image evaluation higher than a second reference value.

5. The method according to claim 4, characterized in that Also includes: The algorithm module in the HAL obtains a preview frame in the preview from the preview stream module in the HAL, and performs image evaluation on the preview frame to obtain a frame evaluation; The algorithm module returns the frame evaluation of the preview frame to the cache frame module in the HAL; The cache frame module receives the preview frame in the preview stream transmitted by the preview stream module, and caches the preview frame and frame information of the preview frame.

6. The method according to any one of claims 1 to 5, characterized in that The electronic device further includes: a camera framework, a camera application, and a HAL; the electronic device saves the second image frame to a gallery, including: The decision module sends the second image frame to the data packaging module in the HAL; The data packaging module performs packaging processing on the second image frame and returns the packaged second image frame to the camera framework; the packaged second image frame includes a thumbnail of the second image frame; The camera framework then returns the packaged second image frame to the image storage module in the camera application; The image storage module stores the packaged second image frame.

7. The method according to any one of claims 1 to 6, characterized in that The electronic device includes: a camera application, a camera framework, and a HAL; the electronic device displays a thumbnail of the first image frame in the photo preview interface, including: The decision module returns a thumbnail of the first image frame to the camera framework; The camera framework then returns a thumbnail of the first image frame to the UI module in the camera application; The UI module displays a thumbnail of the first image frame.

8. The method according to any one of claims 1 to 7, characterized in that Before the electronic device detects that the shutter button is pressed when displaying the first image frame, it also includes: the electronic device turns on a wonderful capture function; turning on the wonderful capture function includes: reconfiguring the preview stream process, the reconfiguration includes initializing the algorithm of the preview stream to a re-algorithm, and configuring the zoom range supported by the preview stream from a first zoom range to a second zoom range, wherein the maximum zoom ratio included in the second zoom range is lower than the maximum zoom ratio included in the first zoom range.

9. The method according to claim 8, characterized in that The electronic device includes a hardware abstraction layer HAL, a camera framework, and a camera application; and the reconfiguration of the preview stream process includes: The preview stream module in the HAL initializes the algorithm of the preview stream to a light algorithm, and changes the zoom range supported by the preview stream to a second zoom range; The preview stream module returns the reconfigured preview stream to the camera framework; The camera framework then returns the reconfigured preview stream to the UI module in the camera application; The camera application determines a UI module to display the reconfigured preview stream in the preview interface and refresh the preview interface.

10. The method according to claim 9, characterized in that The refreshing of the preview interface includes: turning off the function options supported by the heavy algorithm but not supported by the light algorithm, and refreshing the zoom range from the first zoom range to the second zoom range.

11. The method according to any one of claims 1 to 10, characterized in that The second wonderful frame saved in the gallery includes marking information for marking manually captured wonderful photos.

12. An electronic device, characterized in that: The method comprises one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program codes, wherein the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the method as described in any one of claims 1 to 11 is executed.

13. A chip system, the chip system is applied to electronic equipment, the chip system comprises one or more processors, characterized in that: The processor is configured to call computer instructions so as to execute the method according to any one of claims 1 to 11.

14. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the method according to any one of claims 1 to 11 is executed.