Photographing method and electronic device
By detecting the time stamp relationship in electronic devices, the photo-taking method is optimized to avoid timing conflicts between automatic capture and manual capture, ensuring that manual capture thumbnails are displayed first, solving the problem of photo-taking timing conflicts, and improving photo quality and user experience.
Patent Information
- Application Number
- PCT/CN2023/136830
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-27
- Filing Date
- 2023-12-06
- Publication Date
- 2024-09-06
AI Technical Summary
During the photo taking process, due to human reaction delay and device jitter, the timing conflict between the automatic capture function and the manual capture function affects the photo quality and user experience, especially when the timestamp of the automatic capture thumbnail is earlier than the manual capture thumbnail. When this occurs, the automatically captured thumbnail is displayed in front, confusing the user's preview interface.
By implementing a photography method in an electronic device, when it is detected that the first timestamp is earlier than or equal to the second timestamp, only the manual capture thumbnail is refreshed and displayed, and the automatic capture thumbnail is not refreshed, ensuring that the manual capture thumbnail is displayed first. Avoid timing conflicts and save both types of thumbnails in the gallery so users can differentiate.
It effectively avoids the timing conflict problem of automatic capture thumbnails being displayed earlier than manual capture thumbnails, optimizing the user experience, ensuring that the order of photos seen by users on the preview interface and in the gallery is consistent, and improving photo quality and user satisfaction.
Smart Images

Figure CN2023136830_06092024_PF_FP
Abstract
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 202310227367.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] The present application provides a photographing method and electronic device, which solves the timing conflict problem that automatic capture is earlier than manual capture but the manual capture thumbnail is displayed first.
[0006] In a first aspect, the present application provides a photographing method, which may include: an electronic device displays a preview interface, wherein the preview interface displays an image captured by a camera of the electronic device and a first thumbnail; the electronic device turns on an automatic capture function to obtain a first image frame, and the timestamp of the first image frame is the first timestamp; the electronic device detects that a shutter button is pressed when displaying a second image frame; when the first timestamp is earlier than or equal to the second timestamp, the electronic device displays a thumbnail of the second image frame in the photographing preview interface, and does not display a thumbnail of the first image frame; the second timestamp is the timestamp of the thumbnail of the second image frame; when the first timestamp is later than the second timestamp, the electronic device first displays a thumbnail of the second image frame in the photographing preview interface, and then displays a thumbnail of the first image frame.
[0007] In the first aspect, the first image frame may be the manually captured highlight frame mentioned in subsequent embodiments, the second image frame may be the preview frame corresponding to the manual capture time, the thumbnail of the second image frame may be the manually captured thumbnail mentioned in subsequent embodiments, and the thumbnail of the first image frame may be the automatically captured thumbnail mentioned in subsequent embodiments.
[0008] In the first aspect, the situation where the first timestamp is earlier than or equal to the second timestamp will cause a timing conflict problem in which the automatic capture is earlier than the manual capture but the manual capture thumbnail is displayed first. The situation where the first timestamp is later than the second timestamp can be regarded as two independent photo-taking behaviors that are unrelated.
[0009] By using this method, when the first timestamp is earlier than or equal to the second timestamp, the electronic device can refresh the thumbnail of the preview interface only for the manual snapshot, without refreshing and displaying the automatically captured thumbnail, so as to avoid the aforementioned conflict problem.
[0010] In conjunction with the first aspect, in some embodiments, the method may further include: the electronic device saving the first image frame to a gallery; and the electronic device saving a third image frame to the gallery, wherein the timestamp of the third image frame is later than the first timestamp of the first image frame. In this way, if a user triggers a manual capture while automatically capturing a wonderful photo, the electronic device can save both the automatically captured and manually captured wonderful photos.
[0011] In conjunction with the first aspect, in some embodiments, the method may further include: the electronic device saving a thumbnail of the first image frame to a gallery; and the electronic device saving a thumbnail of the third image frame to the gallery, wherein the timestamp of the thumbnail of the third image frame is later than the first timestamp of the thumbnail of the first image frame. In this way, if a user triggers a manual capture while automatically capturing a wonderful photo, the electronic device can save both the manually captured thumbnail and the automatically captured thumbnail to the gallery.
[0012] In combination with the first aspect, in some embodiments, the third image frame is obtained based on the image frames within the first time range, and the image frames captured by the camera within the first time range include the second image frame; the third image frame is different from the second image frame.
[0013] In combination with the first aspect, in some embodiments, the third image frame is obtained based on the image frames within the first time range, and the image frames captured by the camera within the first time range include the second image frame; the third image frame is different from the second image frame, and please refer to the subsequent Figure 8 embodiment for details.
[0014] In combination with the first aspect, in some embodiments, the method may further include: the electronic device exits displaying the photo preview interface; the electronic device displays the photo preview interface again, and displays a thumbnail of the third preview frame in the photo preview interface.
[0015] In combination with the first aspect, in some embodiments, the method may also include: the electronic device detects an operation of clicking on the thumbnail of the second preview frame in the photo preview interface; the electronic device displays a large image display interface of the gallery application, and the large image display interface displays the third preview frame; the electronic device detects an operation of browsing forward photos in the large image display interface; the electronic device refreshes and displays the first image frame in the large image display interface.
[0016] In combination with the first aspect, in a possible implementation, the first image frame is obtained from a preview frame after the automatic capture function is turned on. For details, please refer to the subsequent embodiment of FIG10 .
[0017] In combination with the first aspect, in a possible implementation, the method further includes: determining that the first timestamp is earlier than or equal to the second timestamp, or determining that the first timestamp is later than the second timestamp.
[0018] In combination with the first aspect, in a possible implementation, the electronic device includes a hardware abstraction layer HAL; the first image frame is obtained from the preview frame after the automatic capture function is turned on, and may include (refer to Figure 10 and related embodiments): the algorithm module in the HAL obtains the preview frame in the preview stream from the preview stream module in the HAL; the algorithm module in the HAL decides a local optimal frame once every multiple consecutive frames starting from the time when the automatic capture is turned on; the local optimal frame is the preview frame that obtains the highest image evaluation in the multiple consecutive frames or the preview frame whose image evaluation is higher than a first reference value; when a local optimal frame is found from the previous multiple consecutive frames, the algorithm module determines whether there will be a next local optimal frame in the next multiple consecutive preview frames. If so, the previous local optimal frame is replaced by the subsequent local optimal frame; if not, the previous local optimal frame is recorded as the first image frame.
[0019] In combination with the first aspect, in a possible implementation, the electronic device includes: a camera application, a camera framework, and a HAL; not displaying the thumbnail of the first image frame may include (refer to Figure 13 and related embodiments): the decision module in the HAL sends the decided first image frame to the data packaging module in the HAL; the data packaging module packages the first image frame; the data packaging module returns the packaged first image frame to the camera framework; the packaged first image frame includes a thumbnail of the first image frame; the camera framework then returns the packaged first image frame to the automatic image storage module in the camera application; the automatic image storage module extracts the thumbnail of the first image frame from the packaged first image frame; the automatic image storage module determines whether the timestamp of the first image frame is earlier than the timestamp of the thumbnail of the second image frame, and if so, determines not to refresh and display the thumbnail of the first image frame.
[0020] In combination with the first aspect, in one possible implementation, the electronic device displays a thumbnail of the second image frame, which may include (refer to Figure 13 and related embodiments): the decision module sends the second image frame to the data packaging module; the data packaging module extracts the thumbnail of the second image frame from the second image frame; the decision module returns the thumbnail of the second image frame to the camera framework; the camera framework then returns the thumbnail of the second image frame to the UI module in the camera application; and the UI module displays the thumbnail of the second image frame.
[0021] In combination with the first aspect, in a possible implementation, the electronic device includes: a camera application, a camera framework, and a HAL; the third image frame is obtained based on the image frame within the first time range (refer to Figure 8 and related embodiments), including: a 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 a period of time, and queues the local optimal frame; the local optimal frame is the preview frame with the highest image evaluation within a period of time or the preview frame with an image evaluation higher than a first reference value; the decision module selects a third image frame from the local optimal frames within the first time range of the queue cache; the third image 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.
[0022] In combination with the first aspect, in a possible implementation, the method may further include: an algorithm module in the HAL obtains a preview frame in the preview from a 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 a 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.
[0023] In conjunction with the first aspect, in a possible implementation, the electronic device saving the third image frame to a gallery may include:
[0024] The decision module sends the third image frame to the data packaging module in the HAL;
[0025] The data packaging module packages the third image frame and returns the packaged third image frame to the camera framework; the packaged third image frame includes a thumbnail of the third image frame;
[0026] The camera framework then returns the packaged third image frame to the image storage module in the camera application;
[0027] The image storage module saves the packaged third image frame.
[0028] 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.
[0029] 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.
[0030] 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.
[0031] 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.
[0032] 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
[0033] 1A to 1H exemplarily illustrate a UI for enabling “Wonderful Snapshot”;
[0034] 2A-2H exemplarily illustrate a UI for automatically capturing wonderful photos;
[0035] 3A-3F exemplarily illustrate UIs for manually capturing wonderful photos;
[0036] 4A-4J are schematic diagrams showing wonderful photos manually captured by an electronic device in a "recording" mode;
[0037] 5A-5D exemplarily illustrate UIs when both automatic snapshot and manual snapshot are triggered;
[0038] FIG6 exemplarily shows the hardware structure of an electronic device according to an embodiment of the present application;
[0039] FIG7 exemplarily shows the software architecture of the electronic device according to an embodiment of the present application;
[0040] FIG8 shows a method for manually capturing wonderful photos provided by an embodiment of the present application;
[0041] FIG9 exemplarily shows a decision mechanism for manually capturing wonderful frames provided by an embodiment of the present application;
[0042] FIG10 shows a method for automatically capturing wonderful photos provided by an embodiment of the present application;
[0043] Figures 11 and 12 exemplarily illustrate two decision-making mechanisms for automatically capturing wonderful frames provided in embodiments of the present application;
[0044] FIG13 shows a photographing method provided by an embodiment of the present application;
[0045] FIG14 exemplarily shows a frame selection strategy 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 that meet their expectations.
[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 photographing method that 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 control 122 , a preview window 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] The photo control 122 is used to trigger a photo. The electronic device can detect whether a user operation, such as a click, is applied to the photo control 122. Upon detecting a user operation on the photo control 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] Preview window 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, preview window 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 corresponding shooting effect of 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 control 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 control 126B is in the off state. The flash control 126C can be used to trigger the electronic device to turn on or off the flash. The color mode control 126D can be used to trigger the electronic device to use a color filter to process the image captured by the camera. The setting control 126E can be used to set the electronic device's photo parameters (for example, 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] Enable automatic capture
[0071] 1C-1F illustrate UI diagrams of how an electronic device turns on the “auto-snap” function.
[0072] 1C , a user operation on the setting control 126E is detected. In response to the above operation, the electronic device may display the user interface shown in FIG1D .
[0073] This interface can display multiple function option controls, such as "Photo Ratio", "Smart Photo", "Video Resolution", "Video Frame Rate" and other controls, which will not be listed here one by one. The "Photo Ratio" control can be used to set the aspect ratio of the captured photo, such as 4:3, 9:16. The "Smart Photo" control can be used to set special photo taking methods, such as voice-controlled photo taking, gesture-controlled photo taking, and automatic snapshot provided in the embodiments of the present application. The "Video Resolution" control can be used to set the resolution of the video, such as [16:9]1080p. The "Video Frame Rate" control can be used to set the frame rate of the video, such as 30fps.
[0074] As shown in Figure 1D, the electronic device may detect a user operation on the "Smart Photo" control. In response to the above operation, the electronic device may display the user interface shown in Figure 1E.
[0075] This interface can display multiple function option controls under the "Smart Photo" category, such as "Voice Control Photo," "Gesture Photo," "Smile Capture," and "Auto Capture." The "Voice Control Photo" control can be used to turn voice control photography on or off, and the "Gesture Photo" control can be used to turn gesture photography on or off. The "Smile Capture" control can be used to turn smile capture on or off. The "Auto Capture" control can be used to turn the "Auto Capture" function provided by the implementation of this application on or off.
[0076] As shown in FIG1E , the electronic device may detect a user operation to activate the “auto-snap” function, such as the user toggling or clicking the switch button 141. In response to this operation, the electronic device may activate the “auto-snap” function and may switch the state of the switch button 141 from “OFF” to “ON” as shown in FIG1F .
[0077] The method for enabling "Auto Snap" is not limited to the one shown in Figures 1C-1F . Users can also enable the "Auto Snap" function with a single click. Specifically, after detecting that the user has clicked the "Great Snap" option 127 , the electronic device may display a prompt 110 , as shown in Figure 1G , asking the user whether to enable "Auto Snap." In this way, the user simply clicks "Confirm" to enable "Auto Snap." At this point, the electronic device may display the interface shown in Figure 1H to prompt the user that "Auto Snap" has been enabled.
[0078] Automatic capture
[0079] After turning on "auto capture", the electronic device can search for automatically captured wonderful frames based on the auto capture start time to generate automatically captured wonderful photos.
[0080] Figures 2A-2H exemplify a UI for automatically capturing wonderful photos. The series of preview images shown in Figures 2A-2E illustrate the 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 chronologically 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.
[0081] 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 the photo control 122 to capture the picture.
[0082] 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.
[0083] In order to overcome this problem, in an embodiment of the present application, the electronic device can search for a local optimal frame every period of time (or multiple consecutive frames) starting from the time when the automatic capture is turned on. The local optimal frame selected in a period of time (such as 0.33 seconds) refers to the preview frame that obtains the highest image evaluation according to the perception algorithm during this period or these consecutive frames, or the preview frame whose image evaluation is higher than a specific reference value. After finding a local optimal frame from the previous consecutive frames, determine whether there will be the next local optimal frame in the next consecutive preview frames. If so, replace the previous local optimal frame with the subsequent local optimal frame, and continue in this way; if not, record the local optimal frame as the automatically captured wonderful frame.
[0084] Optionally, a time limit can be set to limit the automatic search for a highlight frame. If there are consecutive local optimal frames after automatic capture is enabled, the algorithm module can use this time limit as a constraint and record the last local optimal frame before the time limit as the automatically captured highlight frame, rather than continuously searching. This ensures that the highlight frame is returned as soon as possible. Different time limits can be used for different photo scenarios, such as a 3-second time limit for a long jump scene and a 1-second time limit for a smiling scene. The algorithm module can determine the photo scenario through image recognition.
[0085] After finding an automatically captured highlight frame, as shown in FIG2D , the electronic device may provide feedback to the user on the preview interface that an automatically captured highlight frame has been captured. For example, a thumbnail corresponding to the automatically captured highlight frame may be displayed in the review control 124 , i.e., the thumbnail in the preview interface may be refreshed to the thumbnail corresponding to the automatically captured highlight frame. To distinguish the thumbnail from the manually captured thumbnail, the electronic device may display a prompt mark 211 near the thumbnail corresponding to the automatically captured highlight frame to inform the user that the electronic device has automatically captured a highlight frame.
[0086] Subsequently, the user can view the wonderful photos through the updated thumbnails. As shown in Figure 2F, the electronic device can detect the operation of opening the automatically captured wonderful photos through the updated thumbnail, such as clicking on the updated thumbnail. In response, the interface shown in Figure 2G can be opened, which is the large picture display interface of the gallery. The interface displays the automatically captured wonderful photos and mark 222. Mark 222 is used to mark that the photo is automatically captured to distinguish it from manually taken photos. Not limited to this, the user can also first open the user interface shown in Figure 2H of the gallery, and then choose to view the automatically captured wonderful photos. The user interface shown in Figure 2H is used to display the thumbnail corresponding to the large picture in the gallery. The thumbnail is generally larger than the thumbnail displayed in the preview interface. Among them, the thumbnail corresponding to the automatically captured wonderful photo may have a mark 223 to mark that the photo is automatically captured, as distinguished from manually taken photos.
[0087] Manual capture
[0088] After turning on "Auto Snap", users can still manually capture wonderful photos.
[0089] As shown in FIG3B , 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 FIG3A , and may save the highlight frame as a manually captured highlight photo.
[0090] 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.
[0091] 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.
[0092] 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.
[0093] 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.
[0094] Moreover, as shown in FIG3C , 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.
[0095] 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).
[0096] 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 3D, 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, the interface shown in Figure 3E is opened, which is a large image display interface of the gallery, and the manually captured wonderful photos (such as a thumbnail of an athlete jumping to the highest point) are displayed in the interface.
[0097] 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 FIG3F 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.
[0098] Not limited to the above preview scene, the user can also perform the above manual snapshot in the video recording scene.
[0099] 4A-4F are schematic diagrams showing wonderful photos manually captured by an electronic device in a “video recording” mode.
[0100] As shown in Figure 4A , 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 4B . As shown in Figure 4B , 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 control 122 originally in "Photo" mode to the start video control 311 in "Video" mode.
[0101] As shown in Figure 4B, the electronic device can detect a 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 4C. 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 window 123 to indicate the length of recording. The recording interface shown in Figure 4C 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.
[0102] Figures 4C-4G illustrate a set of video recording interfaces displayed by an electronic device during a recording of a long jumper. Preview window 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.
[0103] Assume that the preview image shown in FIG4E , 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 .
[0104] 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 4F. The image shown in Figure 4F is not the image the user wants to capture.
[0105] 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.
[0106] The user can end the recording through the end recording control 312 in the recording interface shown in Figure 4G. After the recording is completed, the electronic device can display the user interface shown in Figure 4H, 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 4H, 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 4I. The user interface shown in Figure 4I shows the latest recorded video. After detecting the forward viewing switching operation in the user interface shown in Figure 4I, such as sliding to the left, the electronic device can switch the content displayed in the user interface shown in Figure 4I from the latest recorded video to the wonderful photos manually captured from the recording.
[0107] 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.
[0108] Conflict between automatic capture and manual capture
[0109] When "Auto Snap" is turned on, users are also allowed to take manual snapshots, which may lead to the following situation: manual snapshots are also triggered during the process of packaging and generating automatically captured wonderful photos.
[0110] This situation is specifically: the generation of automatically captured wonderful photos is earlier than the generation of manually captured wonderful photos, for example, 50 milliseconds earlier. However, the generation of manually captured thumbnails is earlier than the generation of automatically captured wonderful photos, because the generation of manually captured thumbnails does not need to go through data packaging processing, and can be directly extracted from the manually captured wonderful frames determined, while the generation of wonderful photos requires a more time-consuming data packaging process. Unlike manually captured thumbnails, automatically captured thumbnails are extracted from automatically captured wonderful photos, which means that the generation of automatically captured thumbnails may wait for the data packaging process. Therefore, the generation of manually captured thumbnails will also be earlier than the generation of automatically captured thumbnails. Regarding the generation and display logic of automatically captured thumbnails and the generation and display logic of manually captured thumbnails, please refer to the subsequent embodiments, which will not be expanded here.
[0111] For clarification, the timestamp of a thumbnail (manually or automatically captured) refers to the time the thumbnail was generated. As mentioned above, while the timestamp of a manually captured thumbnail is later than the timestamp of an automatically captured highlight photo, it is earlier than the timestamp of an automatically captured thumbnail because the automatically captured thumbnail is extracted from the automatically captured full image (i.e., the highlight photo) after it is generated.
[0112] In addition, the timestamp of the wonderful photos (manually captured or automatically captured) is the same as the timestamp of the wonderful frames, which is generated by the camera device.
[0113] In this case, the electronic device can determine a manually captured highlight frame based on the manual capture time and save it as a manually captured highlight photo in response to the user's manual capture. Furthermore, the electronic device can also save previously generated automatically captured highlight photos. This way, the user can see two newly saved highlight photos in the gallery, as shown in Figure 5D: photo 251 and photo 252. Photo 251 is an automatically captured highlight photo with tag 223; photo 252 is a manually captured highlight photo and is chronologically later than photo 251.
[0114] As mentioned above, automatically captured thumbnails need to wait for data packaging to be processed before they are generated. This is equivalent to data packaging delaying the display opportunity, while the manually captured thumbnails that do not need to wait for data packaging are preempted. In this regard, as shown in Figure 5A, the electronic device can only refresh and display the manually captured thumbnails that are generated first, and not refresh and display the automatically captured thumbnails that are generated later. In this way, the timing conflict problem that the timestamp of the automatically captured thumbnail is earlier than the timestamp of the manually captured thumbnail but the manually captured thumbnail is displayed first can be solved, and the user can avoid the confusion of seeing the manual thumbnail refresh first and then the automatic thumbnail refresh in the preview interface, and then seeing the automatically captured wonderful photos in the gallery before the manual wonderful photos.
[0115] The user can view the wonderful photos that he or she has manually captured through the thumbnail entrance. As shown in Figure 5A, when it is detected that the user clicks the review control 124, the thumbnails of the manually captured wonderful photos are displayed on the review control 124, and the electronic device can display the user interface for browsing recent photos of the gallery shown in Figure 5B. The user interface shown in Figure 5B displays the wonderful photos that the user has manually captured. After detecting the forward viewing switching operation in the user interface shown in Figure 5B, such as sliding to the left, the electronic device can switch the content displayed in the user interface shown in Figure 5C from the manually captured wonderful photos to the automatically captured wonderful photos.
[0116] Next, the form and software and hardware architecture of the electronic device provided in the embodiments of the present application are introduced.
[0117] 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.
[0118] Figure 6 illustrates an exemplary hardware structure of an electronic device according to an embodiment of the present application. As shown in Figure 6, 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. The 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.
[0119] 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.
[0120] 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.
[0121] 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 retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0122] 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.
[0123] 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 of the previous embodiment, and to capture wonderful frames through manual triggering operations to realize the shooting method provided by the present application.
[0124] 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.
[0125] The internal memory 126 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0126] 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.
[0127] Non-volatile memory may include disk storage devices and flash memory.
[0128] 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.
[0129] 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.
[0130] 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 .
[0131] 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.
[0132] 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.
[0133] 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.
[0134] 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.
[0135] 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.
[0136] 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 optimizations on image noise and brightness. 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.
[0137] 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.
[0138] 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.
[0139] 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.
[0140] 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.
[0141] 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.
[0142] 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.
[0143] 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.
[0144] 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.
[0145] 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.
[0146] 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.
[0147] 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.
[0148] 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 also include buttons, motors, indicators, and subscriber identification module (SIM) card interfaces, etc. For another example, the sensor module may also 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.
[0149] FIG7 exemplifies the software architecture of an electronic device according to an embodiment of the present application. As shown in FIG7 , 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:
[0150] The application layer (application) can include a series of application packages. For example, an 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, an automatic image saving module, and so on. The UI module may be the cameraUI module mentioned in other embodiments herein, and is primarily responsible for human-computer interaction with the camera application, such as controlling the preview interface and the display of the preview screen therein, and monitoring and responding to user operations occurring within the preview interface. The photo module may include a normal photo module, a highlight capture module, and an automatic capture module, providing normal photo functions, highlight capture functions, and automatic capture functions. Compared to the normal photo function, the highlight capture function can identify the user's capture intention in advance, allowing for faster subsequent capture feedback to the user on the interface, and providing highlight photos that meet the user's capture expectations. For the implementation of highlight capture, please refer to other embodiments herein and will not be further described here. The automatic capture module can be used to search for automatically captured highlight frames starting from the automatic capture start time, and provide automatically captured highlight photos to the user. The image storage module can be used to store wonderful photos manually captured by users in the file system or a specific database of the electronic device for retrieval by applications such as the gallery.
[0151] 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).
[0152] 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.
[0153] 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.
[0154] 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.
[0155] 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:
[0156] 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.
[0157] 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.
[0158] 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.
[0159] The clarity algorithm can be used to detect image clarity. An image with no jitter or noise has higher clarity.
[0160] 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.
[0161] Based on the software and hardware architecture of the above-mentioned electronic device, the following description will go into the architecture and explain the photographing method provided by each embodiment of the present application.
[0162] Figure 8 shows a method for manually capturing wonderful photos 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 levels. It can interact with the camera application through the API and interact with the HAL through HIDL. As shown in Figure 8, the method may include:
[0163] Launch the Camera app
[0164] 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".
[0165] 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 monitoring and responding to user operations occurring in the preview interface.
[0166] 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.
[0167] 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.
[0168] Here, stream configuration may include determining an initialization re-algorithm and configuring the preview stream to support a first zoom range.
[0169] 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 .
[0170] 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."
[0171] 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".
[0172] S15. After receiving the message for triggering the start of the stream distribution, the HAL may send a command to the camera device to start the camera to start capturing images.
[0173] 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.
[0174] 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.
[0175] 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.
[0176] 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.
[0177] 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.
[0178] 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.
[0179] S21. In response to a user operation to open the camera application, the CameraUI module may also activate a storage module in the camera application. The 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 access by other applications such as the gallery.
[0180] 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.
[0181] Start "Great Snap"
[0182] 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.
[0183] S23. In response to the operation of starting “wonderful capture”, the CameraUI module may start the “wonderful capture” module in the camera application.
[0184] 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.
[0185] 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.
[0186] 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.
[0187] 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.
[0188] 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.
[0189] 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.
[0190] 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.
[0191] 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.
[0192] 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.
[0193] 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.
[0194] 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.
[0195] 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, as shown in Figure 2C, turning off the HDR function option 126A and AI function option 126B shown in Figure 1B. What the user can perceive is that after clicking the "Great Snap" icon 122 in the preview interface, the HDR function option 126A and AI function option 126B in the preview box become untouchable, such as being grayed out.
[0196] S31. The CameraUI in the camera application can also use the new preview stream to refresh the preview image.
[0197] 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.
[0198] 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.
[0199] 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.
[0200] 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.
[0201] S34. The algorithm module may execute a perception algorithm to perform image evaluation on the preview frames in the preview stream.
[0202] 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.
[0203] S36. The cache frame module may receive the preview frame in the preview stream transmitted by the preview stream module.
[0204] 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.
[0205] S38: The decision module may access the preview frames and frame information cached by the cache module to select the optimal frame at intervals. 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 that 0.33 second period, or a preview frame whose image evaluation exceeds a specific reference value. The 0.33 second period is merely an example, selected from the user's optimal recognition interval. The 0.33 second period may include multiple frames, for example, 15 frames, depending on the frame rate.
[0206] S39. The decision module may cache the optimal frames with high evaluation results selected within each period of time in a queue-like manner.
[0207] 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.
[0208] 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.
[0209] Here, "in advance" may mean that the frame evaluation range based on each preview frame is started after the wonderful capture is turned on, even if a manual capture action has not been detected.
[0210] 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.
[0211] 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.
[0212] Manual capture
[0213] 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.
[0214] 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.
[0215] 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).
[0216] S42: The wonderful capture module can send a photo request to the camera framework, which also carries the timestamp of the manual capture.
[0217] 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.
[0218] 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.
[0219] The preview frame corresponding to the timestamp is the preview frame displayed in the preview box when the user presses the "shutter".
[0220] S44. Subsequently, the decision module may return thumbnail A to the camera framework.
[0221] S45. The camera framework then sends thumbnail A to the CameraUI module.
[0222] S46-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 .
[0223] 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.
[0224] 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.
[0225] 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.
[0226] 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, it 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, it can compare the best frames A and B and select the better one as the manually captured highlight frame. The best frame A can be the best frame with the highest image evaluation within 1 second before manual capture, or the best frame with an image evaluation above a specific reference value. The best frame B can be the best frame with the highest image evaluation within 0.5 seconds after manual capture, or the best frame with an image evaluation above a specific reference value.
[0227] Assume, as shown in Figure 9, 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.
[0228] 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.
[0229] 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.
[0230] S51. After deciding to manually capture wonderful frames, the decision module may send the manually captured wonderful frames to the data packaging module.
[0231] S52. The data packaging module packages the manually captured wonderful frames to generate a large image, that is, obtains the manually captured wonderful photos.
[0232] 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.
[0233] 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.
[0234] 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.
[0235] S54: The camera framework may then return the large image, including thumbnail B, to the image storage module in the camera application.
[0236] 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.
[0237] 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.
[0238] 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.
[0239] S57. The camera application may obtain thumbnail B from the file system and refresh and display thumbnail B through the CameraUI module.
[0240] 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.
[0241] 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.
[0242] At this point, for manual snapshots, the electronic device has completed the interface feedback and the acquisition of wonderful photos.
[0243] 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.
[0244] Figure 10 shows a method for automatically capturing wonderful photos provided by an embodiment of the present application. The implementation of this method can be based on the interactive 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 modules of CameraUI, wonderful capture, automatic capture, and automatic image storage in the camera application; the hardware abstraction layer mainly involves the modules of preview stream, cache frame, decision, data packaging, and algorithm; 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 of connecting the upper and lower parts, by providing an application programming interface (API) to interact with the camera application on the upper side and with the HAL on the lower side. As shown in Figure 10, the method may include:
[0245] Launch the Camera app
[0246] Steps S61 to S71 may refer to steps S11 to S21 in the method embodiment of Figure 8. That is, the automatic capture of wonderful photos and the manual capture of wonderful photos in the part of starting the camera application can be reused.
[0247] Start "Great Snap"
[0248] Steps S72 to S89 can refer to steps S22 to S39 in the method embodiment of Figure 8. That is, the automatic capture of wonderful photos and the manual capture of wonderful photos can be reused in the implementation of starting the "wonderful capture" part, and both photo taking methods must first start "wonderful capture".
[0249] Enable automatic capture
[0250] S90. The CameraUI module in the camera application can detect the user's operation of turning on "auto capture". For example, the user first clicks the setting option 126E in the preview interface to open the camera setting page, then selects the "wonderful capture" setting option to enter the "wonderful capture" setting page, and finally clicks the auto capture switch 141 to turn on the "auto capture" function.
[0251] S91. In response to the operation of starting "automatic capture", the CameraUI module can start the automatic capture module in the camera application and transmit the automatic capture start time.
[0252] Here, the automatic capture start time can be frame aligned, that is, the time during which the automatic capture start action (such as clicking the automatic capture switch 141) occurs in the preview frame, then the time indicated by the timestamp of the preview frame is the automatic capture start time.
[0253] S92: The activated automatic capture module sends a request to the camera framework to start automatic capture, and the request may carry the automatic capture start time.
[0254] S93: The camera framework can then send an algorithm execution request to the algorithm module in the HAL to trigger the algorithm module to start searching for automatically captured wonderful frames. The request can also carry the automatic capture start time.
[0255] S94. After receiving the request, the algorithm module may search for automatically captured wonderful frames based on the automatic capture start time.
[0256] Specifically, the algorithm module can search for a local optimal frame every period of time (or multiple consecutive frames) starting from the time the automatic capture is turned on. The local optimal frame selected in a period of time (such as 0.33 seconds) refers to the preview frame that obtains the highest image evaluation according to the perception algorithm within this period of time or these consecutive frames, or the preview frame whose image evaluation is higher than a specific reference value. After finding a local optimal frame from the previous consecutive frames, it is determined whether there will be the next local optimal frame in the next consecutive preview frames. If so, the next local optimal frame is used to replace the previous local optimal frame, and the process continues in this way; if not, the local optimal frame is recorded as the automatically captured wonderful frame.
[0257] For example, as shown in Figure 11, from the time automatic capture is turned on, the local optimal frame K1 is determined in window 1 (N consecutive frames), and the local optimal frame K2 is determined in window 2 (N consecutive frames). In this way, the local optimal frame K2 replaces the local optimal frame K1. Subsequently, no local optimal frame is determined in window 3 (N consecutive frames) and the value is NULL. Therefore, the search stops and the local optimal frame K2 is recorded as the automatically captured highlight frame.
[0258] Optionally, a time limit can be set to limit the automatic search for highlight frames. If local optimal frames persist after automatic capture is enabled, the algorithm module can use this time limit as a constraint and record the last local optimal frame before the time limit as the automatically captured highlight frame, rather than continuously searching. This ensures that highlight photos are returned as quickly as possible. Different time limits can be used for different photo scenarios, such as a 3-second time limit for a long jump scene and a 1-second time limit for a smiling scene. The algorithm module can determine the photo scenario through image recognition.
[0259] For example, assume that, as shown in Figure 12, from the time the automatic capture is turned on, the local optimal frame K1 is decided in window 1 (N consecutive frames), and the local optimal frame K2 is decided in window 2 (N consecutive frames). The local optimal frame K2 is the last local optimal frame before the deadline, so the local optimal frame K2 is recorded as the automatically captured wonderful frame, even if the local optimal frame can be decided in the subsequent windows, such as the local optimal frame K3 can be decided in window 3 (N consecutive frames).
[0260] In different photo-taking scenarios, the perception algorithm adopted by the algorithm module can also be different to better identify the user's intention to capture photos in different scenarios.
[0261] S95. After finding the automatically captured wonderful frame, the algorithm module can trigger the decision module to output the image and feed back the frame information of the automatically captured wonderful frame, such as the timestamp, to the decision module.
[0262] Optionally, before triggering the decision module to generate an image, HAL can also confirm whether the photo scene has not changed in the recent period (e.g., within the last 10 seconds). If the scene has not changed and the decision module has already been triggered to generate an image based on a previous automatically captured wonderful frame in the same scene, the decision module will not be triggered again to generate an image, so as to avoid generating multiple identical or similar automatically captured wonderful photos. This is because, in the same scene, the wonderful frames found by the algorithm module multiple times are generally the same.
[0263] S96. The decision module may request the cache frame module to obtain the automatically captured wonderful frames according to the timestamps of the automatically captured wonderful frames, so as to trigger the data packaging module to package the automatically captured wonderful frames.
[0264] S97. Before triggering the data packaging module to package the automatically captured wonderful frames, the decision module may also confirm that the automatic capture will not be intercepted by manual capture. For example, if no manual capture occurs within 1 second after the automatic capture of the wonderful frame (the time indicated by the timestamp), it is considered that the automatic capture will not be intercepted by manual capture, and the automatically captured wonderful frames may be packaged and saved as wonderful photos.
[0265] S98. The decision module can send automatically captured wonderful frames to the data packaging module.
[0266] S99. The data packaging module packages the automatically captured wonderful frames to generate a large image, that is, to obtain the automatically captured wonderful photos.
[0267] The data package obtained by 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. This information added in the package can be read in the attribute information of the highlight photo.
[0268] Optionally, like the frame buffering module, the data packaging module can also be coupled to the buffer area storing preview frames. In step S45, the decision module can also send only the frame number or timestamp of the automatically captured highlight frame to the data packaging module. The data packaging module can then read the automatically captured highlight frame from the buffer area based on the frame number or timestamp and package it. This can save register resources used for interface calls, parameter transmission, etc.
[0269] S100: After generating the large image, the data packaging module may return the large image to the camera framework.
[0270] S101. The camera framework may then return the large image to the automatic image storage module in the camera application.
[0271] S102: After receiving the large image, the automatic image storage module can extract a thumbnail from the large image.
[0272] S103. The image storage module may send the thumbnail to the CameraUI module to trigger the CameraUI module to refresh the thumbnail in the preview interface and update the thumbnail to the thumbnail extracted in step S49.
[0273] S104: After receiving the large image, the image storage module may also save the large image, such as saving it to a file system or a specific database.
[0274] At this point, for automatic capture, the electronic device has completed the interface feedback and automatically captured wonderful photos.
[0275] Afterwards, users can open the Gallery to view their favorite photos. For example, users can click a thumbnail on the preview screen to access the Gallery. 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 automatically captured photos.
[0276] When "Auto Snap" is turned on, users are also allowed to take manual snapshots, which may lead to the following situation: manual snapshots are also triggered during the process of packaging and generating automatically captured wonderful photos.
[0277] Specifically, this situation is as follows: the generation of automatically captured wonderful photos is slightly earlier than the generation of manually captured wonderful photos, for example, 50 milliseconds earlier. However, the generation of manually captured thumbnails is earlier than the generation of automatically captured wonderful photos, because the generation of manually captured thumbnails does not require data packaging processing and can be directly extracted from the manually captured wonderful frames, while the generation of wonderful photos requires a more time-consuming data packaging process. Unlike manually captured thumbnails, automatically captured thumbnails are extracted from automatically captured wonderful photos, which means that the generation of automatically captured thumbnails may wait for the data packaging process. Therefore, the generation of manually captured thumbnails will also be earlier than the generation of automatically captured thumbnails.
[0278] Automatically captured thumbnails are generated only after data is packaged and processed. This means that they are delayed by data packaging and preempted by manually captured thumbnails that don't need to wait for data packaging. This creates a timing conflict where automatically captured photos appear before manually captured photos, but the manually captured thumbnails appear before them. From a UI perspective, this can lead to a confusing experience: users see manual thumbnail refreshes before automatic thumbnail refreshes on the preview screen, while in the gallery, automatically captured photos appear before manually captured photos.
[0279] The following describes in detail how to handle the above conflicts in conjunction with a photographing method shown in Figure 13. Figure 13 will start from detection to enable "auto-snap". For the previous steps of enabling the camera application and enabling wonderful snapshots, please refer to the relevant contents of the embodiments of Figures 8 and 10 above.
[0280] Conflict between automatic capture and manual capture
[0281] S111. The CameraUI module in the camera application can detect that the user turns on the "auto-snap" operation.
[0282] S112: In response to the operation of starting "automatic capture", the CameraUI module may start the automatic capture module in the camera application and transmit the automatic capture start time.
[0283] S113: The activated automatic capture module sends a request to the camera framework to start automatic capture, and the request may carry the automatic capture start time.
[0284] S114: The camera framework can then send an algorithm execution request to the algorithm module in the HAL to trigger the algorithm module to start searching for automatically captured wonderful frames. The request can also carry the automatic capture start time.
[0285] S115. After receiving the request, the algorithm module finds automatically captured wonderful frames based on the automatic capture start time.
[0286] S116. After finding the automatically captured wonderful frame, the algorithm module may trigger the decision module to output a picture and feed back the frame information of the automatically captured wonderful frame, such as a timestamp, to the decision module.
[0287] S117 , the decision module may request the automatically captured wonderful frames from the cache frame module according to the timestamps of the automatically captured wonderful frames, so as to trigger the data packaging module to package the automatically captured wonderful frames.
[0288] S118. The decision module may send automatically captured wonderful frames to the data packaging module.
[0289] S119, the data packaging module packages the automatically captured wonderful frames to generate a large image, that is, the automatically captured wonderful photos.
[0290] As before, the data packaging process is time-consuming.
[0291] In the process of automatically capturing wonderful photos described in steps S111 to S119 above, manual capture is also triggered, as shown in steps S120 to S130:
[0292] S120: 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.
[0293] S121. In response to a manual capture, the CameraUI module may transmit a photo-taking request to the wonderful capture module in the camera application. The request may carry a timestamp of the manual capture.
[0294] S122. The wonderful capture module may send a photo request to the camera framework.
[0295] S123: The camera framework may then send a photo request to the decision module in the HAL to trigger manual capture.
[0296] S124: The decision module may determine manually captured wonderful frames based on the manual capture time.
[0297] Regarding how to decide to manually capture wonderful frames, you can refer to the above content and will not go into details here.
[0298] Quick response and automatic capture on the interface
[0299] S125. Subsequently, the decision module may request the cache frame module to obtain the manually captured wonderful frame according to the timestamp of the manually captured wonderful frame.
[0300] S126. The decision module may send the manually captured wonderful frames to the data packaging module to trigger the data packaging module to generate manually captured thumbnails and package the manually captured wonderful frames.
[0301] Afterwards, the data packaging module can quickly return the manually captured thumbnail to the camera application, as shown in S128-S129. Furthermore, as shown in S127, the data packaging module packages the manually captured wonderful frames to generate a large image, that is, to obtain the manually captured wonderful photos. As before, the data packaging process is relatively time-consuming.
[0302] S130: The camera application (specifically, the cameraUI module) refreshes and displays the manually captured thumbnail.
[0303] At this point, the electronic device takes the lead in providing quick feedback on the user's manual capture on the preview interface, even if the manual capture occurs later.
[0304] After that, when the packaging of the wonderful frames is completed (the packaging of the automatic capture is completed earlier), the following processing is required to avoid the conflict problem mentioned above.
[0305] Conflict Resolution
[0306] S131. After the automatically captured wonderful photos are packaged and generated, the data packaging module may return the automatically captured large image to the camera framework, that is, return the automatically captured wonderful photos.
[0307] S132: The camera framework returns the automatically captured large image to the automatic image storage module.
[0308] S133, the automatic picture saving module can save automatically captured wonderful photos to the file system.
[0309] S134. The automatic picture saving module can confirm whether the timestamp of the automatically captured wonderful photo (the same as the timestamp of the manually captured wonderful frame) is earlier than the timestamp of the latest manually captured thumbnail. If it is earlier, the automatically captured thumbnail will not be refreshed to avoid the conflict problem mentioned above.
[0310] As shown in Figure 13, the timestamp of the automatically captured highlight frame is slightly earlier than the timestamp of the manually captured highlight frame. For example, the timestamp of the automatically captured highlight frame is "2023 / 2 / 21 20:29:44:450," while the timestamp of the manually captured highlight frame is "2023 / 2 / 21 20:29:44:500," which is 50 milliseconds earlier. However, the camera app receives the manually captured thumbnail at "2023 / 2 / 21 20:29:45:000," while the automatically captured large image is received at "2023 / 2 / 21 20:29:45:100." This means that the camera app receives the automatically captured large image only after refreshing and displaying the manually captured thumbnail. If the automatically captured thumbnails are extracted from the automatically captured large pictures and then refreshed and displayed, it will cause the following confusing experience: the user sees the manual thumbnail refresh first and then the automatic thumbnail refresh on the preview interface, while in the gallery, the automatically captured wonderful photos are seen in front of the manually captured wonderful photos.
[0311] For the two-step method of displaying manual thumbnails, the most recent manually captured thumbnail can be the first manual thumbnail; of course, the most recent manually captured thumbnail can also be the second manual thumbnail. If the data packaging process of the automatic large image is relatively long, the second manual thumbnail will be returned earlier than the automatic large image.
[0312] Completed after manual capture and packaging
[0313] S135. After the manually captured wonderful photos are packaged and generated, the data packaging module may return the manually captured large image to the camera framework, that is, return the manually captured wonderful photos.
[0314] S136: The camera framework returns the manually captured large image to the automatic image storage module.
[0315] S137, the automatic picture saving module can save manually captured wonderful photos to the file system.
[0316] In addition, FIG14 shows a frame selection strategy provided by an embodiment of the present application. As shown in FIG14 , after turning on “automatic capture”, the frame selection range of automatic capture may not be continuous, but segmented and discrete, that is, the algorithm module may only decide whether there are automatically captured wonderful frames within these “automatic frame selection ranges” until the automatically captured wonderful frames are found. Moreover, the frame selection range for manual capture may be the complement of the frame selection range for automatic capture, and the manual capture wonderful frames may not be determined within a fixed time before the manual capture action (such as the first 1 second) and a fixed time after the manual capture action (such as the last 0.5 seconds). In this way, the automatically captured wonderful frames will not be the same as the manually captured wonderful frames, avoiding repeated saving of the same wonderful photos. Of course, in actual applications, the frame selection range for manual capture and the frame selection range for automatic capture may also overlap, and the embodiment of the present application does not limit this.
[0317] 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.
[0318] 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.
[0319] 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.
[0320] 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.
[0321] 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.
[0322] In one possible design, the chip system also includes a memory, which is used to store program instructions and data. The memory is located inside or outside the processor.
[0323] The chip system can be composed of chips, or can include chips and other discrete devices.
[0324] 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.
[0325] 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.
[0326] 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.
[0327] The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which enables a computer to execute the method executed by the electronic device in any of the above embodiments when the computer program is executed.
[0328] 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.
[0329] The various implementation modes of this application can be combined arbitrarily to achieve different technical effects.
[0330] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part 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, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can 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 can 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. The available medium can 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).
[0331] 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.
[0332] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.< / canvas> < / video> < / videoview> < / imgview> < / textview>
Claims
1. A photographing method, characterized in that: include: The electronic device displays a preview interface, which displays an image captured by the camera of the electronic device and a first thumbnail; The electronic device starts an automatic snapshot function to obtain a first image frame, where the timestamp of the first image frame is a first timestamp; The electronic device detects that a shutter button is pressed when displaying the second image frame; When the first timestamp is earlier than or equal to the second timestamp, the electronic device displays a thumbnail of the second image frame in the photo preview interface, and does not display a thumbnail of the first image frame; The second timestamp is the timestamp of the thumbnail of the second image frame; When the first timestamp is later than the second timestamp, the electronic device first displays the thumbnail of the second image frame in the photo preview interface, and then displays the thumbnail of the first image frame.
2. The method according to claim 1, characterized in that Also includes: The electronic device saves the first image frame to a gallery; The electronic device saves the third image frame to the gallery, and the timestamp of the third image frame is later than the first timestamp of the first image frame.
3. The method according to claim 2, characterized in that Also includes: The electronic device saves a thumbnail of the first image frame to a gallery; The electronic device saves a thumbnail of the third image frame to a gallery, and a timestamp of the thumbnail of the third image frame is later than a first timestamp of the thumbnail of the first image frame.
4. The method according to claim 2 or 3, characterized in that The third image frame is obtained based on the image frames within the first time range, and the image frames captured by the camera within the first time range include the second image frame; the third image frame is different from the second image frame.
5. The method according to any one of claims 2 to 4, characterized in that: Also includes: The electronic device exits displaying the photo preview interface; The electronic device displays the photo preview interface again, and displays the thumbnail of the third preview frame in the photo preview interface.
6. The method according to any one of claims 2 to 4, characterized in that: Also includes: The electronic device detects, in the photo preview interface, a click operation on a thumbnail of a second preview frame; The electronic device displays a large image display interface of the gallery application, where the large image display interface displays the third preview frame; The electronic device detects an operation of browsing forward photos on the large picture display interface; The electronic device refreshes and displays the first image frame on the large image display interface.
7. The method according to any one of claims 1 to 6, characterized in that The first image frame is obtained from the preview frame after the automatic capture function is turned on.
8. The method according to any one of claims 1 to 7, characterized in that Also includes: It is determined that the first timestamp is earlier than or equal to the second timestamp, or it is determined that the first timestamp is later than the second timestamp.
9. The method according to claim 7, characterized in that The electronic device includes a hardware abstraction layer HAL; the first image frame is obtained from a preview frame after the automatic capture function is turned on, including: The algorithm module in HAL obtains the preview frame in the preview stream from the preview stream module in HAL; The algorithm module in the HAL decides the local optimal frame once every multiple consecutive frames from the time when the automatic capture is turned on; the local optimal frame is the preview frame with the highest image evaluation among the multiple consecutive frames or the preview frame with an image evaluation higher than the first reference value; After finding a local optimal frame from the previous continuous multiple frames, the algorithm module determines whether there will be a next local optimal frame in the next continuous multiple preview frames. If so, the previous local optimal frame is replaced by the subsequent local optimal frame; if not, the previous local optimal frame is recorded as the first image frame.
10. The method according to any one of claims 1 to 9, characterized in that The electronic device includes: a camera application, a camera framework, and a HAL; a thumbnail of a first image frame is not displayed, including: The decision module in the HAL sends the first image frame determined by the decision to the data packaging module in the HAL; The data packaging module packages the first image frame; The data packaging module returns the packaged first image frame to the camera framework; the packaged first image frame includes a thumbnail of the first image frame; The camera framework then returns the packaged first image frame to the automatic image storage module in the camera application; The automatic image storage module extracts a thumbnail of the first image frame from the packaged first image frame; The automatic image storage module determines whether the timestamp of the first image frame is earlier than the timestamp of the thumbnail of the second image frame. If so, it determines not to refresh and display the thumbnail of the first image frame.
11. The method according to any one of claims 1 to 9, characterized in that The electronic device includes: a camera application, a camera framework, and a HAL; the electronic device displays a thumbnail of the second image frame, including: The decision module in the HAL returns a thumbnail of the second image frame to the camera framework in the HAL; The camera framework then returns a thumbnail of the second image frame to the UI module in the camera application; The UI module displays a thumbnail of the second image frame.
12. The method according to any one of claims 2 to 5, characterized in that: The electronic device includes: a camera application, a camera framework, and a HAL; the third image frame is obtained based on the image frame within the first time range, including: The decision module in HAL obtains the preview frame and frame information of the preview frame in the preview stream from the cache frame module in 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 a period of time or a preview frame whose image evaluation is higher than a first reference value; The decision module selects a third image frame from the local optimal frame within the first time range of the queue-type buffer; the third image frame The frame is a preview frame with the highest image evaluation within the first time range or a preview frame with an image evaluation higher than a second reference value.
13. The method according to claim 12, characterized in that Also includes: The algorithm module in the HAL obtains the 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 frames in the preview stream transmitted by the preview stream module, and caches the preview frames and frame information of the preview frames.
14. The method according to any one of claims 2 to 6, characterized in that: The electronic device saves the third image frame to a gallery, including: The decision module sends the third image frame to the data packaging module in the HAL; The data packaging module packages the third image frame and returns the packaged third image frame to the camera framework; the packaged third image frame includes a thumbnail of the third image frame; The camera framework then returns the packaged third image frame to the image storage module in the camera application; The image storage module stores the packaged third image frame.
15. 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, and 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 14 is executed.
16. A chip system, the chip system is applied to electronic equipment, the chip system includes 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 14.
17. 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 14 is executed.
Citation Information
Patent Citations
Photographing method and electronic equipment
CN118555470A
Snapshot method and mobile terminal
CN104580908A
Moving object photographing method and mobile terminal
CN105827951A
Photographing method, mobile terminal and computer readable storage medium
CN107302666A
Image processing method, image processor, shooting device and electronic equipment
CN110177215A
