Image generation method and electronic device

By generating images with different resolutions and clarity, the problem of electronic devices lagging when processing image data is solved, ensuring that high-quality image generation does not affect the shooting experience and improving user interaction efficiency.

WO2026086368A1PCT designated stage Publication Date: 2026-04-30HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2025-08-11
Publication Date
2026-04-30

AI Technical Summary

Technical Problem

Existing electronic devices are prone to lag when using complex algorithms to process image data, which affects the user's shooting experience.

Method used

By generating images of different resolutions and sharpness, processing RAW image data using image processing algorithms at different time points, a high-resolution first image and a low-resolution first thumbnail are generated, and a high-resolution second image is generated when the user operates, thus avoiding stuttering during shooting.

Benefits of technology

It enables the generation of high-quality images without affecting the shooting experience, meets diverse user needs, reduces reshoot rate, and improves human-computer interaction efficiency during shooting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025113879_30042026_PF_FP_ABST
    Figure CN2025113879_30042026_PF_FP_ABST
Patent Text Reader

Abstract

The embodiments of the present application relate to the technical field of terminals. Provided are an image generation method and an electronic device, which are used for avoiding the occurrence of lagging during photographing while ensuring the quality of captured image data. The specific solution is: in response to a first operation for indicating photographing, generating a first thumbnail and a first image corresponding to the first thumbnail, wherein the resolution of the first image is higher than the resolution of the first thumbnail; in response to an operation acting on the first thumbnail, displaying a first interface, wherein the first interface comprises the first image, and the first interface does not include an aggregation control; after the first interface is displayed, displaying a second interface, wherein the second interface includes a second image and the aggregation control, and the definition of the second image is higher than the definition of the first image; and upon receiving an operation acting on the aggregation control, displaying a third interface, wherein the third interface comprises the first image and the second image.
Need to check novelty before this filing date? Find Prior Art

Description

An image generation method and electronic device

[0001] This application claims priority to Chinese Patent Application No. 202411496806.4, filed on October 23, 2024, entitled "An Image Generation Method and Electronic Device", the entire contents of which are incorporated herein by reference.

[0002] This application claims priority to Chinese Patent Application No. 202411751161.4, filed with the State Intellectual Property Office of China on November 30, 2024, entitled “An Image Generation Method and Electronic Device”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to the field of terminal technology, and in particular to an image generation method and an electronic device. Background Technology

[0004] Taking photos is a way for users to record their lives. With technological advancements, users have increasingly higher demands for the quality of image data captured by electronic devices (such as mobile phones). Currently, electronic devices utilize image processing algorithms to improve the quality of captured images. However, using complex algorithms to process captured image data can easily lead to lag and affect the user's shooting experience. Summary of the Invention

[0005] This application provides an image generation method and an electronic device to ensure the quality of the captured image data while avoiding stuttering during the shooting process.

[0006] In a first aspect, embodiments of this application provide an image generation method applied to an electronic device that supports a camera function. The electronic device has various applications with camera functions installed, such as camera applications. When the application with camera function is running in the foreground, in response to a first operation instructing the user to take a picture, a first thumbnail and a first image corresponding to the first thumbnail are generated.

[0007] In the first example, the first thumbnail can refer to a thumbnail obtained by downsampling a RAW image captured by the camera sensor in response to the first operation. The first image can be a large image generated based on the RAW image captured by the camera sensor in response to the first operation. In this example, the RAW images used to generate the first thumbnail and the first image can be different RAW images. Of course, all RAW images used are related to the shooting command generated by the application triggered by the first operation. In addition, in this example, the first thumbnail is generated earlier than the first image.

[0008] In the second example, the first thumbnail mentioned above can be a thumbnail obtained by downsampling the first image. In this example, the first image is generated earlier than the first thumbnail.

[0009] In both examples above, the resolution of the generated first image is higher than that of the first thumbnail.

[0010] Subsequently, in response to an operation applied to the first thumbnail, the electronic device displays a first interface, which includes the first image but does not contain aggregation controls. After displaying the first interface, the electronic device can switch to displaying a second interface. This second interface includes a second image and aggregation controls. The second image has higher resolution than the first image. For example, the second image has higher contrast and more accurate contour features.

[0011] While the second interface is displayed, the electronic device receives an operation on the aggregation control, and displays a third interface. This third interface simultaneously displays the first and second images.

[0012] In the above embodiment, at the end of a single shot, a first image and a first thumbnail are generated without using a complex algorithm to enhance image sharpness. Upon detecting user interaction with the first thumbnail, a complex algorithm to enhance image sharpness is triggered, generating and displaying a second image that is sharper than the first image. This not only avoids shooting lag but also yields an image of better quality.

[0013] Furthermore, during the aforementioned process, each photo capture outputs at least two large images, such as a first image and a second image with different resolutions. This satisfies diverse user photography needs, reduces retake rates, and improves the efficiency of human-computer interaction in photography. By simultaneously displaying large images of different qualities, users can easily compare and select images, further meeting diverse needs and enhancing the efficiency of human-computer interaction in shooting.

[0014] In some embodiments, the application with shooting functionality may be a camera application. In response to an instruction to open the camera application, the electronic device displays a shooting preview interface of the camera application, which includes shooting controls. In response to a first operation applied to the shooting controls, the electronic device may generate a first thumbnail based on a RAW image acquired by the camera sensor, i.e., the first thumbnail in the first example. After generating the first thumbnail, it is displayed on the shooting preview interface. In response to an operation applied to the first thumbnail on the shooting preview interface, a first interface is displayed first, followed by a second interface.

[0015] In the above embodiments, after shooting is completed, the first image can be displayed and the second image can be generated from the shooting preview interface, thereby improving the human-computer interaction efficiency of viewing the second image.

[0016] In some embodiments, after generating the first thumbnail, the electronic device, in response to an instruction to open the gallery application, displays a grid preview interface of the gallery application. The grid preview interface includes the first thumbnail, which includes a first aggregate icon to indicate that the first thumbnail corresponds to multiple large images of different image qualities, facilitating user differentiation from other images. In response to an operation applied to the first thumbnail on the grid preview interface, a first interface is displayed first, followed by a second interface.

[0017] In the above embodiments, after the shooting is completed, the first image can be displayed and the second image can be generated from the grid preview interface, thereby improving the human-computer interaction efficiency of viewing the second image.

[0018] In some embodiments, a first thumbnail is displayed at a first position in the grid preview interface. After the second interface has been displayed, when the electronic device responds to a second operation and displays the grid preview interface again, the first thumbnail is not included in the grid preview interface. A second thumbnail generated based on the second image is displayed at the first position in the grid preview interface. The second thumbnail includes a second aggregate icon, thereby updating the thumbnails to be displayed in real time and improving the display effect of the actually displayed thumbnails.

[0019] In the above embodiments, in response to an operation on the second thumbnail in the grid preview interface, the electronic device can directly display a second interface containing the second image and aggregation controls. That is, if the second image has already been generated, in response to an operation instructing the user to view the second image, the process of displaying the first image can be skipped, shortening the time it takes for the user to view the second image.

[0020] In some embodiments, when a user triggers the display of a third interface on an electronic device via an aggregation control in the second interface, after detecting an operation performed on a saved control in the third interface, the electronic device can respond to receiving the third operation and re-display the grid preview interface. The re-displayed grid preview interface includes both a second thumbnail and a first thumbnail, neither of which includes the aggregation icon.

[0021] In this scenario, in response to an operation on the second thumbnail, a fourth interface is displayed, which includes the second image but does not include the aggregation control.

[0022] Similarly, in this scenario, in response to an operation on the first thumbnail, a fifth interface is displayed, which includes the first image but does not include the aggregation control.

[0023] In the above embodiments, the user can trigger the simultaneous storage of multiple large-frame images obtained from a single photo using the save-as-a-photo control, thereby improving the human-computer interaction efficiency of storing multiple large-frame images obtained from a single photo.

[0024] In some embodiments, in response to an operation applied to the first thumbnail, before displaying the second interface, the electronic device may further determine whether the first name of the second image includes target information. The target information may be a special field (e.g., an enhance field). The second interface containing the aggregation control will only be displayed if the first name includes target information.

[0025] Only when the second interface is displayed can the display of the third interface be triggered by manipulating the aggregation control, and the multi-frame large image displayed in the third interface can be saved. As one implementation, after receiving an operation on the save control, the name information of the second image is changed from the first name to the second name, and the name information of the first image is changed from the third name to the fourth name. The second name does not contain the target information, the third name includes the target information, and the fourth name does not contain the target information. Thus, in the grid preview interface, the name information corresponding to both the second and first thumbnails displayed simultaneously does not contain the target information. In response to an operation on either the second or first thumbnail, the displayed interface also does not contain the aggregation control.

[0026] In the above embodiments, different types of image data are distinguished by whether the name information contains target information. Different display and processing methods are applied to different types of images. The processing logic is simple and the effect is more stable.

[0027] In some embodiments, the third interface includes a first delete control and a second delete control, the first delete control corresponding to the first image and the second delete control corresponding to the second image. During the display of the third interface, the user can directly trigger the deletion of an unsatisfactory image. For example, in response to an operation on the first delete control, a fourth interface is displayed, which includes the second image but does not include an aggregation control. After deleting the first image, when displaying the second image, the aggregation control or aggregation icon is no longer displayed, reinforcing the user's perception that the second image is a standalone image, unrelated to other images.

[0028] Optionally, after receiving an operation applied to the first delete control, the electronic device, in response to the operation, may delete the first image and modify the name information of the second image from the first name to a second name, wherein the second name does not contain the target information. Subsequently, in response to an instruction to view the second image, the displayed interface does not contain the aggregation control.

[0029] In some embodiments, the third interface includes a first region and a second region. A first image is displayed in the first region, and a second image is displayed in the second region. Exemplarily, the first region is located below the second region. Exemplarily, the first region is located above the second region. Exemplarily, the first region is located to the left of the second region. Exemplarily, the first region is located to the right of the second region. This application does not specifically limit the scope of the embodiments described herein.

[0030] In addition, the third interface also includes synchronization controls.

[0031] When the synchronization control is locked, in response to a magnification operation applied to the first or second region, a first magnified partial view of the first image is displayed in the first region and a second magnified partial view of the second image is displayed in the second region. The magnification factor of the first magnified partial view relative to the first image and the magnification factor of the second magnified partial view relative to the second image are the same.

[0032] When the synchronization control is locked, in response to a sliding operation applied to the first or second region, a third magnified view of the first image is displayed in the first region and a fourth magnified view of the second image is displayed in the second region. The sliding distance of the third magnified view relative to the first magnified view and the sliding distance of the fourth magnified view relative to the second magnified view are the same.

[0033] In the above embodiments, users can simultaneously operate the first and second images in the third interface, improving the efficiency of human-computer interaction in comparing two images.

[0034] When the synchronization control is in the unlocked state, in response to the zoom operation applied to the first region, a first partial magnified view of the first image is displayed in the first region, and the second image is kept displayed in the second region.

[0035] When the synchronization control is unlocked, in response to a zoom operation applied to the second region, a second partial magnified view of the second image is displayed in the second region, and the first image is kept displayed in the first region.

[0036] In the above embodiments, users can manipulate single-frame images in the third interface to meet specific comparison needs and improve the human-computer interaction efficiency of image comparison.

[0037] Understandably, the display effects of the synchronization control in the locked state and the synchronization control in the unlocked state are different, and users can distinguish them by the display effects.

[0038] In some embodiments, in response to an operation applied to the first thumbnail, if the electronic device determines that a second image has not yet been generated, system resources can be allocated to immediately generate the second image. After the second image is generated, a second interface containing the second image can be displayed. This quickly responds to the user's need to view the image, improving the efficiency of human-computer interaction in image viewing.

[0039] In some embodiments, in response to an instruction to open a camera application, the electronic device displays a shooting preview interface of the camera application, which includes a first function icon. The first function icon is a function enable control. After detecting a selection operation on the first function icon, if the electronic device meets a target condition, in response to the first operation, a first image can be generated. If a user instruction to view the first image is detected, a second image is then generated and displayed. Additionally, when displaying a second interface including the second image, in response to an operation on an aggregation control, the electronic device can simultaneously display both the first and second images.

[0040] For example, the target conditions may include one or more of the following conditions: the ambient light brightness value of the space where the electronic device is located is not less than a preset brightness threshold, the number of faces in the field of view of the electronic device is greater than 0 and less than a preset number, and the area occupied by the faces in the field of view of the electronic device is not less than a preset size.

[0041] In other embodiments, before the first operation is detected, in response to an operation instructing the opening of the camera application, a shooting preview interface of the camera application is displayed, which includes a first function icon. After detecting a selection operation on the first function icon on the shooting preview interface, if it is determined that the electronic device does not meet the target conditions, a first prompt message is displayed on the shooting preview interface. While displaying the first prompt message, in response to receiving a fourth operation instructing to take a picture, a third thumbnail and a third image corresponding to the third thumbnail are generated, the third image having a higher resolution than the third thumbnail. In response to an operation applied to the third thumbnail, the third image is displayed. The interface used to display the third image does not contain aggregation controls, indicating that the third image is a single-frame image and is unrelated to other images in the electronic device. In this scenario, multi-frame large images are not generated in response to the fourth operation.

[0042] In the above embodiments, after the user selects to enable the image enhancement function, multiple large images can be generated from a single shot if the function is effective. If the function is ineffective, only one large image is generated from a single shot. This avoids unnecessarily consuming system resources and producing large images that do not meet expectations.

[0043] In some embodiments, after receiving the first operation, the electronic device receives an operation instructing the user to exit a shooting application (such as a camera application). In response to the operation instructing the user to exit the camera application, the generation of a second image may begin. Subsequently, in response to an operation applied to the first thumbnail, the first interface may be displayed first, followed by the second interface.

[0044] In some embodiments, the electronic device includes a camera sensor. In response to an operation instructing the opening of a camera application, the camera sensor begins acquiring RAW images, and stores each frame of RAW image acquired by the camera sensor in a first queue. After detecting the first operation, a first RAW image corresponding to the first operation is obtained based on the RAW images already stored in the first queue. The first RAW image is an image obtained by fusing multiple frames of RAW images. The first RAW images are stored in a second queue and a third queue, respectively. Generating a first image corresponding to a first thumbnail includes generating the first image based on the first RAW image in the second queue. Before displaying the second interface, in response to an operation applied to the first thumbnail, one or more image processing operations are performed on the first RAW image in the third queue to generate the second image; wherein the one or more image processing operations include operations to enhance image features.

[0045] In the above embodiments, by generating image data of different image qualities at different times, it ensures the acquisition of multiple types of high-quality large images while avoiding stuttering during the shooting process, thus improving the quality of the shooting service. Optionally, transfer storage technology can be used to delay the generation of a second image with higher clarity, avoiding any impact on the user's subsequent shooting during the generation of the second image.

[0046] As one implementation, when the camera application is running in the foreground, after detecting the first operation, in response to the first operation, the camera application sends a photo-taking command to the camera HAL. The photo-taking command includes a third name of the first image and a first name of the second image. Generating the first thumbnail includes: obtaining a reference RAW image corresponding to the photo-taking command from a first queue; generating a first thumbnail corresponding to the reference RAW image; the first thumbnail includes extended information, including a first name, a third name, and a first identifier, where the first identifier corresponds to the first name, indicating that the first RAW image used to generate the second image is stored in a third queue.

[0047] As one implementation, the electronic device also includes a media database and a gallery database. After generating the first thumbnail, the camera HAL sends the first thumbnail to the camera application. In response to receiving the first thumbnail containing extended information, the camera application stores the first thumbnail in a target storage area and writes target name information to the media database, wherein the target name information is either a first name or the third name. In response to receiving the target name information, the media database generates a first database record and notifies the gallery database to create a second database record corresponding to the target name information.

[0048] In one implementation, the electronic device also includes a storage service process. After generating the first image, the camera HAL sends the first image to the storage service process. In response to receiving the first image, the storage service process sends the image information of the first image to a media database. The media database associates the image information of the first image with a first database record and sends a first data synchronization notification to a gallery database. In response to receiving the first data synchronization notification, the gallery database associates the image information of the first image with a second database record.

[0049] In one implementation, after generating the second image, the camera HAL sends the second image to the storage service process. In response to receiving the second image, the storage service process sends the image information of the second image to the media database. The media database associates the image information of the second image with a first database record and sends a second data synchronization notification to the gallery database. In response to receiving the second data synchronization notification, the gallery database associates the image information of the second image with a second database record.

[0050] In some embodiments, after the storage service process receives the first image, it stores the first image. After the storage service process receives the second image, it stores the second image.

[0051] In the above embodiments, the first and second images are stored by the storage service to avoid image loss if the application performing the shooting is accidentally closed.

[0052] In some embodiments, after receiving a photo capture command, the camera HAL sends return information corresponding to the photo capture command to the camera application. The return information includes the image size of the first image and the image size of the second image.

[0053] In response to receiving the returned information, the camera application generates a first watermark information corresponding to the first image and a second watermark information corresponding to the second image.

[0054] For example, the first watermark information includes the first watermark image and text, the first watermark insertion location, and the first watermark size. The second watermark information includes the second watermark image and text, the second watermark insertion location, and the second watermark size.

[0055] The camera application can send the first and second watermark information to the camera HAL. After generating the first image, the first watermark information is added to the first image. After generating the second image, the second watermark information is added to the second image.

[0056] In the above embodiments, it is possible to add appropriate watermarks to the first image and the second image respectively, so as to ensure that the image after the watermark is added is reasonable.

[0057] In some embodiments, the resolution of the second image is higher than that of the first image. For example, in a scenario where the camera application uses portrait mode for shooting, the generated second image has a higher resolution than the first image.

[0058] In a second aspect, embodiments of this application provide an electronic device including a camera sensor, a memory, and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the camera sensor is used to acquire RAW images, the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the method described in the first aspect and any implementation thereof.

[0059] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect and any of its implementations.

[0060] Fourthly, embodiments of this application provide a computer program product, the computer program product including a computer program or instructions, which, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect and any of its implementations.

[0061] It should be understood that the second to fourth aspects of the embodiments of this application correspond to the technical solutions of the first aspect of the embodiments of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be described again. Attached Figure Description

[0062] Figure 1 is a scene example diagram of enabling AI enhancement function in portrait mode provided in the embodiment of this application;

[0063] Figure 2 is a scenario example diagram of enabling the one-shot-multiple-captures-function provided in an embodiment of this application;

[0064] Figure 3 is an example of a scene where the AI ​​enhancement function is enabled for taking a photo, as provided in an embodiment of this application.

[0065] Figure 4 is one of the scene examples of viewing images captured under AI enhancement function provided in the embodiments of this application;

[0066] Figure 5 is a second example of a scene for viewing images captured under AI enhancement functions, provided in an embodiment of this application.

[0067] Figure 6 is the third example of a scene for viewing images captured under AI enhancement functions, provided in an embodiment of this application.

[0068] Figure 7 is a scene example diagram of the saved image provided in the embodiments of this application;

[0069] Figure 8 is an example of a scenario for deleting an image provided in an embodiment of this application;

[0070] Figure 9 is an example of a scene showing the captured images after multiple images are captured following the AI ​​enhancement function is enabled, according to an embodiment of this application.

[0071] Figure 10 is the fourth example of a scene for viewing images captured under AI enhancement functions, provided in an embodiment of this application.

[0072] Figure 11A is an example diagram of the software architecture of the electronic device provided in the embodiments of this application;

[0073] Figure 11B is a schematic diagram illustrating the principle of the electronic device performing image capture according to an embodiment of this application;

[0074] Figure 12 is one of the signaling interaction diagrams of the image generation method provided in the embodiments of this application;

[0075] Figure 13 is a second signaling interaction diagram of the image generation method provided in the embodiments of this application;

[0076] Figure 14 is the third signaling interaction diagram of the image generation method provided in the embodiments of this application;

[0077] Figure 15 is the fourth signaling interaction diagram of the image generation method provided in the embodiments of this application;

[0078] Figure 16 is the fifth signaling interaction diagram of the image generation method provided in the embodiments of this application. Detailed Implementation

[0079] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "a plurality of" means two or more.

[0080] This application provides an image generation method applied to electronic devices that support image enhancement functions. Image enhancement (or image feature enhancement) refers to processing image features (such as contours, edges, contrast, etc.) in acquired image data, for example, highlighting some image features and compressing some image features to improve image clarity and enhance the visual effect of the image.

[0081] For example, the image enhancement function described above may include AI enhancement function implemented based on generative artificial intelligence (AIGC) algorithms. Of course, the image enhancement function described above may also include functions implemented based on other image enhancement algorithms. This application embodiment does not specifically limit this, and in the following embodiments, AI enhancement function is mainly used as an example.

[0082] When AI enhancement is enabled, the electronic device detects a user-triggered photo capture command and can generate at least two large image frames corresponding to that command. These at least two large image frames can include images obtained by processing the same raw image data (RAW image) using different image processing algorithms at different times.

[0083] For example, at least two frames of large image data include: one frame of large image data without AI enhancement. This unenhanced large image data can be an image generated immediately after a photo-taking command is detected. As another example, at least two frames of large image data also include: one frame of large image data with AI enhancement. This AI-enhanced large image data can be an image generated after a photo-taking command is detected and the system is determined to be idle. This ensures high-quality image data (e.g., AI-enhanced large images) while avoiding lag.

[0084] Understandably, system idle is an operating state of an electronic device. In an idle state, the available system resources (memory, computing resources, etc.) are sufficient and real-time power consumption is low. For example, system idle can be determined after the electronic device exits an application used for shooting (e.g., a camera app). Another example is system idle when no user interaction with the camera app is detected for an extended period. Yet another example is system idle when the detected real-time available system resources (memory, computing resources, etc.) are higher than a corresponding standard threshold or power consumption is lower than a preset power consumption threshold.

[0085] For ease of distinction, in subsequent embodiments, the large image data without AI enhancement will be referred to as the original image, and the large image data with AI enhancement will be referred to as the AI-enhanced image. Both the AI-enhanced image and the original image can be images with overlaid beautification effects, overlaid filter effects, high spatial resolution, and high spectral resolution. In addition, compared with the original image, the AI-enhanced image has more prominent and clearer local features (such as contours, edges, etc.) and higher contrast.

[0086] In some embodiments, when an application with shooting capabilities (e.g., a camera app) is running in the foreground of an electronic device, the user may be recommended to use AI enhancement features. In other embodiments, when a camera app is running in the foreground of an electronic device and a specified camera mode is enabled, the user may be recommended to use AI enhancement features.

[0087] Understandably, camera applications include various camera modes, such as portrait mode, still mode, video mode, and night mode. Different camera modes correspond to different shooting functions. In different camera modes, electronic devices can respond to user operations and capture different types of image data with different visual effects, such as photos, videos, moving images, night scene images, portrait images, and panoramic images.

[0088] For example, the camera modes specified above can be camera modes adapted to AI enhancement features. For instance, portrait mode is a camera mode adapted to AI enhancement features. Understandably, when using portrait mode to photograph people, AI enhancement features can enhance the facial features captured, thereby improving the display effect of the image containing people. As another example, using a telephoto lens in shooting mode is also a camera mode adapted to AI enhancement features. Understandably, when using a telephoto lens in shooting mode to photograph distant objects, AI enhancement features can enhance the outline features and contrast of the captured objects, thereby improving the display effect of the image containing distant scenery.

[0089] As an example, the camera mode specified above can also be any camera mode.

[0090] The following, with reference to the accompanying diagrams, illustrates the recommended AI enhancement feature for electronic devices and the details of the image generation method executed after enabling the AI ​​enhancement feature:

[0091] In some embodiments, when a camera application is running in the foreground on an electronic device, and an operation instructing the user to enable a specified camera mode (e.g., portrait mode) is detected, a function icon corresponding to the AI ​​enhancement function can be displayed. By displaying the function icon, the user is reminded that AI enhancement can be enabled in the current camera mode. Correspondingly, the user can also trigger the electronic device to enable or disable AI enhancement by operating the function icon.

[0092] As one implementation method, the function icon corresponding to the AI ​​enhancement function can be a single icon. For example, when the electronic device first displays the AI ​​enhancement function icon in a specified camera mode (e.g., portrait mode), the icon is unselected, indicating that the AI ​​enhancement function is not currently enabled. In response to a user's action on the icon, it can be set to a selected state, indicating that the AI ​​enhancement function is enabled. After the electronic device exits portrait mode, if it re-enables portrait mode, the displayed AI enhancement function icon can be in a selected state. Conversely, if the electronic device receives a user instruction to disable the AI ​​enhancement function before exiting portrait mode, the displayed AI enhancement function icon can be unselected when the electronic device re-enables portrait mode. As yet another example, each time the electronic device enables a specified portrait mode, the displayed AI enhancement function icon is always unselected (or selected by default).

[0093] As another implementation, as shown in Figure 1(a), the electronic device displays a shooting preview interface 101 provided by the camera application. This shooting preview interface 101 can be a shooting preview interface in portrait mode. The shooting preview interface 101 includes a portrait icon 102 indicating portrait mode. In response to a user's action on the portrait icon 102, as shown in Figure 1(b), the electronic device displays a shooting preview interface 103 corresponding to portrait mode. This shooting preview interface 103 includes a function icon 104 (first function icon) indicating that AI enhancement is enabled, and a function icon 105 indicating that AI enhancement is disabled. For example, AI enhancement is disabled by default each time portrait mode is enabled. Accordingly, as shown in Figure 1(b), the function icon 105 indicating that AI enhancement is disabled is selected, and the function icon 104 indicating that AI enhancement is enabled is unselected.

[0094] Understandably, the operations performed on the portrait icon 102 described above can include touch-based operations such as clicking and swiping. Touch-based operations refer to operations that involve direct contact with the display screen of the electronic device. The operations performed on the portrait icon 102 can also include detecting a voice command to operate the portrait icon 102, such as detecting a user saying "open portrait mode." The same principle applies to operations performed on other controls in subsequent embodiments.

[0095] For example, AI enhancement can be enabled by default each time portrait mode is enabled. Accordingly, as shown in Figure 1(c), a portrait mode shooting preview interface 108 is displayed. In the shooting preview interface 108, the function icon 105 indicating that AI enhancement is not enabled is in an unselected state, and the function icon 104 indicating that AI enhancement is enabled is in a selected state.

[0096] For another example, when the portrait mode with AI enhancement is first activated, the AI ​​enhancement function is not enabled by default, that is, the shooting preview interface 103 shown in Figure 1(b) is displayed. Subsequently, if the AI ​​enhancement function was enabled when the portrait mode was last exited, then the AI ​​enhancement function is enabled by default when the portrait mode is activated this time, that is, the shooting preview interface 108 shown in Figure 1(c) is displayed. If the AI ​​enhancement function was not enabled when the portrait mode was last exited, then the AI ​​enhancement function is not enabled by default when the portrait mode is activated this time, that is, the shooting preview interface 103 shown in Figure 1(b) is displayed.

[0097] Continuing as shown in Figure 1(b), in response to the user's action on function icon 104, the electronic device activates the AI ​​enhancement function and displays the shooting preview interface 108 shown in Figure 1(c). The shooting preview interface 108 may display a prompt message 106, such as a notification bubble containing the text "AI Ultra-HD Portrait Enabled," to remind the user that the AI ​​enhancement function is enabled.

[0098] Similarly, as shown in Figure 1(c), in response to the user's action on function icon 105, the electronic device disables the AI ​​enhancement function and displays the shooting preview interface 103 shown in Figure 1(b).

[0099] The above implementations all use portrait mode as an example of the specified camera mode. The same principle applies when the specified camera mode is other camera modes. For example, when the specified camera mode is photo mode, if the user's instruction to enable the telephoto lens is detected, the corresponding function icon for the AI ​​enhancement function can also be displayed. For example, when the electronic device displays the shooting preview interface 101 as shown in Figure 1(a), in response to the user's operation in the zoom operation bar 107, it is determined that the user has instructed to enable the telephoto lens. Accordingly, the shooting preview interface 109 of the photo mode shown in Figure 1(d) can be displayed. The shooting preview interface 109 also includes a function icon 104 indicating that the AI ​​enhancement function is enabled and a function icon 105 indicating that the AI ​​enhancement function is not enabled. Function icon 105 is in the selected state, and function icon 104 is in the unselected state.

[0100] In some embodiments, after the electronic device enables AI enhancement, if the "one-shot-multiple-captures" function is also enabled, each time a user instructs the user to take a photo, both the corresponding AI-enhanced image and the original image can be generated. That is, a single shot yields multiple large image frames with varying quality. If the "one-shot-multiple-captures" function is not enabled, each time a user instructs the user to take a photo, only the corresponding AI-enhanced image can be generated.

[0101] For example, when an electronic device enables AI enhancement, the "one-shot-multiple-capture" function can be enabled simultaneously. When the electronic device disables AI enhancement, the "one-shot-multiple-capture" function can also be disabled simultaneously. Additionally, when a user instructs the user to disable the "one-shot-multiple-capture" function, it can be disabled while the AI ​​enhancement function remains enabled.

[0102] For example, after the electronic device enables the AI ​​enhancement function, the user needs to manually enable the "one shot, multiple views" function. For instance, as shown in Figure 2(a), the electronic device displays a portrait mode shooting preview interface 108. The function icon 104 in the shooting preview interface 108 is selected, indicating that the AI ​​enhancement function is currently enabled. The shooting preview interface 108 includes a storage icon 201. In response to the user's action on the storage icon 201, such as a swipe up, the shooting preview interface 108 shown in Figure 2(b) is displayed. The shooting preview interface 108 shown in Figure 2(b) includes a camera function configuration bar 202 and function configuration icons 203.

[0103] The camera function configuration bar 202 includes quick configuration icons for several auxiliary shooting functions. These include flash icon 202-1, exposure icon 202-2, high-dynamic range (HDR) image icon 202-3, watermark icon 202-4, and image scaling icon 202-5. The electronic device can turn the flash on or off in response to the user's operation on the flash icon 202-1. The electronic device can turn auto-exposure on or off in response to the user's operation on the exposure icon 202-2. The electronic device can turn HDR on or off in response to the user's operation on the HDR icon 202-3. The electronic device can turn adding a watermark to the captured image data on or off in response to the user's operation on the watermark icon 202-4. The electronic device can configure the image size of the generated large image data in response to the user's operation on the image scaling icon 202-5.

[0104] Continuing as shown in Figure 2(b), in response to the user's action on the function configuration icon 203, the function configuration interface 204 shown in Figure 2(c) is displayed. The function configuration interface 204 includes configuration items 205 corresponding to the "One-Click-Multiple-Use" function. Configuration item 205 has two display states, such as selected and unselected. When configuration item 205 is unselected in the function configuration interface 204, the "One-Click-Multiple-Use" function is also disabled. The electronic device, in response to the user's action on configuration item 205, enables the "One-Click-Multiple-Use" function and displays the function configuration interface 204 shown in Figure 2(d). The function configuration interface 204 shown in Figure 2(d) includes configuration item 205 in a selected state. Furthermore, after enabling the "One-Click-Multiple-Use" function, in response to the user's action on the function configuration icon 203 shown in Figure 2(b), the function configuration interface 204 shown in Figure 2(d) can be displayed.

[0105] In subsequent embodiments, examples will be given using scenarios where AI enhancement and multi-capture functionality are enabled.

[0106] In some embodiments, after the electronic device enables the AI ​​enhancement function, the AI ​​enhancement function takes effect in shooting scenarios where the AIGC algorithm is effective. In these shooting scenarios, the electronic device can utilize the AIGC algorithm to process the captured image data. In shooting scenarios where the AIGC algorithm is ineffective, the AI ​​enhancement function also does not take effect. In these shooting scenarios, the electronic device can display a reminder message indicating that AIGC is not effective.

[0107] Understandably, the effectiveness of the AIGC algorithm depends on the ambient light level of the shooting scene and the content of the captured image data. For example, in a shooting scene with excessively low ambient light, the captured image data, after processing by the AIGC algorithm, will not achieve the expected results; that is, the AIGC algorithm will not be effective in this shooting scene. Similarly, in portrait mode, if the captured image data contains too many faces, or the faces occupy a small display area, or if no faces are present, the AIGC algorithm will also fail to achieve the expected results; that is, the AIGC algorithm will not be effective.

[0108] As shown in Figure 3(a), the electronic device displays the shooting preview interface 108 corresponding to the portrait mode. The function icon 104 in the shooting preview interface 108 is selected, that is, the AI ​​enhancement function is enabled. The electronic device can display real-time captured preview frames in the shooting preview interface 108, such as preview frame 301.

[0109] As shown in Figure 3(a), no face appears in preview frame 301. Based on this preview frame 301, the electronic device can determine that the AIGC algorithm is currently not working. Accordingly, while displaying preview frame 301, the electronic device can also display a reminder message 302, such as a first prompt message. This reminder message 302 may include the text "No face detected, AIGC not working," to inform the user that although the AI ​​enhancement function has been enabled, the current shooting scene does not meet the conditions for using the AI ​​enhancement function.

[0110] When the shooting preview interface 108 shown in Figure 3(a) is displayed, a fourth operation instructing the user to take a picture is detected, and a corresponding thumbnail (referred to as the third thumbnail) and a corresponding original image (referred to as the third image) can be generated. The third thumbnail is displayed on the shooting preview interface 108. In response to the operation performed on the third thumbnail, the third image can be displayed. In this scenario, the AI-enhanced image corresponding to the third thumbnail is not generated, and the display of the AI-enhanced image is not switched after the third image is displayed.

[0111] Continuing as shown in Figure 3(b), the shooting preview interface 108 includes a preview frame 303, in which a face appears. Based on this preview frame 303, the electronic device determines that the AIGC algorithm is effective. Accordingly, no notification information is displayed when the preview frame 303 is shown. Additionally, the electronic device can also display a face recognition box 304 in the preview frame 303, the display position of which overlaps with the face display area in the preview frame 303.

[0112] When displaying the shooting preview interface 108 as shown in Figure 3(b), after receiving the first operation of the user instructing to take a picture (e.g., the user's operation on the camera control 305), the shooting preview interface 108 as shown in Figure 3(c) can be displayed. The shooting preview interface 108 shown in Figure 3(c) includes a preview frame 307 and a thumbnail 308.

[0113] Understandably, after receiving a user's instruction to take a picture, the electronic device can generate a picture-taking command. In response to this picture-taking command, a thumbnail 308 corresponding to the preview frame 303 is generated, and the content displayed in the thumbnail 308 is similar to or exactly the same as the content displayed in the preview frame 303.

[0114] In addition, in response to a photo-taking command, the electronic device needs to generate at least one frame of large image data, in addition to generating a thumbnail. Understandably, the thumbnail and large image data corresponding to the same photo-taking command can be images generated based on the RAW image corresponding to the same photo-taking command. A photo-taking command can correspond to multiple RAW images; the method for determining the RAW image corresponding to the photo-taking command can be referred to in subsequent embodiments and will not be elaborated here. The thumbnail can be a reference RAW image among the multiple RAW images corresponding to the photo-taking command, obtained after downsampling. The large image data can be the target RAW image corresponding to the photo-taking command, obtained after processing by one or more image processing algorithms. The target RAW image (also called the first RAW image) is the RAW image obtained after image fusion of the multiple RAW images corresponding to the photo-taking command. Compared to large image data, thumbnails are generated faster. Compared to thumbnails, the original image has higher resolution and more overlaid display effects (e.g., beautification, filters).

[0115] In possible embodiments, the thumbnail and large image data corresponding to the same shooting command can also be images generated based on the target RAW image corresponding to the shooting command. Alternatively, both the thumbnail and large image data can be images generated based on a reference RAW image among the multiple RAW images corresponding to the shooting command; this application does not specifically limit this approach.

[0116] In some embodiments, when the AI ​​enhancement function and the one-shot-multiple-captures-features function are enabled, the large image data corresponding to the thumbnail includes the AI-enhanced image and the original image.

[0117] When AI enhancement is enabled but the "One-Shot-Multiple-Capture" feature is disabled, the large image data corresponding to the thumbnail includes the AI-enhanced image but excludes the original image. When AI enhancement is disabled, the large image data corresponding to the thumbnail includes the original image but excludes the AI-enhanced image.

[0118] Taking a scenario where both AI enhancement and multi-image capture are enabled as an example, when the electronic device generates a thumbnail corresponding to the photo capture command, it can also simultaneously generate the corresponding original image. After the electronic device exits the camera application (e.g., closes the camera application or the camera application runs in the background), the generation of the AI-enhanced image corresponding to the thumbnail is triggered. In other possible embodiments, the thumbnail, original image, and AI-enhanced image can also be generated simultaneously, and this application embodiment does not specifically limit this.

[0119] As shown in Figure 3(c), after the electronic device generates a thumbnail 308 (e.g., the first thumbnail) of the shooting instruction, the thumbnail 308 can be displayed on the gallery entry control 306 of the shooting preview interface 108 to indicate to the user that the shooting has been completed and that the user can view the image captured by operating the gallery entry control 306.

[0120] Understandably, the Gallery entry control 306 is the entry point that triggers navigation to the Gallery application. The Gallery application is an application used to view image data.

[0121] In response to a user's action on the gallery entry control 306, the electronic device can exit the camera application and run the gallery application in the foreground. In response to detecting an event that the camera application has been exited, the electronic device can also generate an AI-enhanced image corresponding to the thumbnail 308. Since generating the AI-enhanced image takes a long time, the electronic device can display a waiting interface provided by the gallery application, such as the large image preview interface 401 shown in Figure 4(b).

[0122] As shown in Figure 4(a), after detecting user interaction with the gallery entry control 306, the electronic device cancels the display of the shooting preview interface 108 shown in Figure 4(a) and displays the large image preview interface 401 shown in Figure 4(b), which can also be referred to as the first interface. This large image preview interface 401 includes the original image 402 corresponding to the thumbnail 308, which can also be referred to as the first image corresponding to the thumbnail 308. The original image 402 can be an image without AI enhancement. In possible scenarios, when the electronic device displays the large image preview interface 401, if the original image 402 has not yet been generated, the electronic device can display the thumbnail 308 on the large image preview interface 401.

[0123] Continuing as shown in Figure 4(b), the large image preview interface 401 also includes a waiting reminder message 403 to remind the user that the electronic device is generating an AI-enhanced image corresponding to thumbnail 308. After generating the AI-enhanced image of thumbnail 308, the large image preview interface 401 shown in Figure 4(c) is displayed. The large image preview interface 401 shown in Figure 4(c) includes a completion reminder message 404. Afterwards, the electronic device can display the large image preview interface 405 shown in Figure 4(d), also known as the second interface. The large image preview interface 405 includes an AI-enhanced image 406 (e.g., the second image corresponding to thumbnail 308). The image features in the AI-enhanced image 406 have been enhanced; for example, facial features have been highlighted and refined, and contrast has been improved.

[0124] In a possible embodiment, as shown in Figure 4(a), in response to the user's operation on the gallery entry control 306, the large image preview interface 405 shown in Figure 4(d) can be displayed directly, or the large image comparison interface 408 shown in Figure 4(e) (as referred to as the third interface) can be displayed. This application embodiment does not specifically limit this.

[0125] Understandably, after enabling AI enhancement and the "one shot, multiple views" function, and with AI enhancement active, the name information generated by the electronic device for the large image data corresponding to the photo capture command includes a special field. For example, the name information (first name) of AI-enhanced image 406 includes the special field "enhance". When the gallery application displays AI-enhanced image 406 through the large image preview interface 405, it detects that the name information of AI-enhanced image 406 contains the special field "enhance", and can display an aggregation control relative to AI-enhanced image 406. As shown in Figure 4(d), the large image preview interface 405 also includes an image aggregation control 407. This aggregation control 407 is used to prompt the user that there is large image data (e.g., the original image 402) corresponding to AI-enhanced image 406 that has not undergone AI enhancement.

[0126] Continuing as shown in Figure 4(d), in response to the user's action on the aggregation control 407, a large image comparison interface 408 as shown in Figure 4(e) is displayed. The large image comparison interface 408 includes an AI-enhanced image 406 and the original image 402. The AI-enhanced image 406 in the large image comparison interface 408 and the AI-enhanced image 406 shown in Figure 4(d) are the same image.

[0127] Furthermore, AI-enhanced image 406 and the original image 402 are the same RAW image, but large-scale image data of different quality generated after different image processing algorithms. The image features in AI-enhanced image 406 have been enhanced; for example, facial features have been highlighted and refined, and contrast has been improved. The image features in the original image 402 have not been enhanced. The original image may be an image obtained by overlaying various visual effects on a RAW image, such as beauty effects or filter effects. The clarity of AI-enhanced image 406 is higher than that of the original image 402. Methods for evaluating clarity can be found in relevant technologies and will not be elaborated here. Additionally, in portrait mode, the generated AI-enhanced image has a higher resolution than the original image.

[0128] In some embodiments, users can compare the AI-enhanced image 406 and the original image 402 through the operation of the large image comparison interface 408 and select the image that meets their needs.

[0129] As shown in Figure 5(a), the large image comparison interface 408 also includes a locked synchronization lock 501 (synchronization control), a preview display box 502 (second area), and a preview display box 503 (first area). The preview display box 502 is used to display the AI-enhanced image 406. The preview display box 503 is used to display the original image 402.

[0130] In some embodiments, when the synchronized lock 501 in a locked state is displayed on the large image comparison interface 408, the user can simultaneously operate the images displayed in the preview display box 502 and the preview display box 503.

[0131] For example, as shown in Figure 5(a), when a user zooms in on preview display box 502 or preview display box 503, the displayed content of preview display boxes 502 and 503 is updated synchronously. As shown in Figure 5(b), after the update, a partial magnified image 504 (second partial magnified image) is displayed on preview display box 502, and a partial magnified image 505 (first partial magnified image) of the original image 402 is displayed on preview display box 503. Taking the above zoom operation as a relative zoom operation of a face image area as an example, partial magnified image 504 is a partial magnified image of the face in AI-enhanced image 406. Partial magnified image 505 is a partial magnified image of the face in the original image 402.

[0132] In one implementation, in response to a magnification operation, the AI-enhanced image 406 and the original image 402 can be magnified by the same magnification factor. Then, in the magnified AI-enhanced image 406, image region 1 containing a face is identified as a local magnified image 504. In the magnified original image 402, image region 2 containing a face is identified as a local magnified image 505. The position of image region 1 on the AI-enhanced image 406 is the same as the position of image region 2 on the original image 402. In possible embodiments, the AI-enhanced image 406 and the original image 402 can also be magnified by different magnification factors. For example, if a magnification operation is detected acting on the preview display frame 502, the magnification factor for the AI-enhanced image 406 is greater than the magnification factor for the original image 402. If a magnification operation is detected acting on the preview display frame 503, the magnification factor for the original image 402 is greater than the magnification factor for the AI-enhanced image 406.

[0133] For example, when displaying the large image comparison interface 408 shown in Figure 5(b), a user's sliding operation on the preview display box 502 or preview display box 503 in Figure 5(b) is detected, and the display content of the preview display boxes 502 and 503 is updated synchronously. After the update, another magnified partial image a (fourth magnified partial image) of the AI-enhanced image 406 is displayed on the preview display box 502, and another magnified partial image b (third magnified partial image) of the original image 402 is displayed on the preview display box 503. The magnified partial image a can be image region 3 on the magnified AI-enhanced image 406, and the magnified partial image b is image region 4 on the magnified original image 402. The distance between image region 3 and image region 1 can be called the movement distance a, and the distance between image region 4 and image region 2 can be called the movement distance b. The movement distance a is equal to the movement distance b.

[0134] In addition, the content displayed in preview display box 502 and preview display box 503 is the same, but the content displayed in preview display box 502 is clearer.

[0135] In some embodiments, as shown in FIG6(a), the large image comparison interface 408 includes a synchronized lock 501 in a locked state. In response to a user's operation on the locked synchronized lock 501, the large image comparison interface 408 shown in FIG6(b) is displayed. The large image comparison interface 408 shown in FIG6(b) includes a synchronized lock 601 in an unlocked state.

[0136] When the large image comparison interface 408 shown in Figure 6(b) is displayed, the user can operate the AI ​​enhanced image 406 in the preview display box 502 and the original image 402 in the preview display box 503 respectively.

[0137] For example, as shown in Figure 6(b), a zoom-in operation by the user on the preview display box 502 is detected, and the displayed content of the preview display box 502 is updated. As shown in Figure 6(c), after the update, a partial zoom-in image 504 is displayed on the preview display box 502.

[0138] Understandably, when displaying the large image comparison interface 408 shown in Figure 6(b), the zoom operation on the preview display box 502 will not affect the display content of the preview display box 503. That is, the preview display box 503 continues to display the original image 402.

[0139] In some embodiments, as shown in FIG7(a), the large image comparison interface 408 also includes a save-as control 701, also known as a save control. As shown in FIG7(a), in response to the user's operation on the save control 701, the large image comparison interface 408 shown in FIG7(b) is displayed. The large image comparison interface 408 shown in FIG7(b) includes a confirmation pop-up 702. The confirmation pop-up 702 includes a cancel control 703 and a save-as confirmation control 704. In addition, the confirmation pop-up 702 also includes save-as prompt content, such as prompting the user whether to save the original image and the AI-enhanced image, so that the original image and the AI-enhanced image are displayed independently in the gallery application.

[0140] Understandably, after the electronic device generates a thumbnail 308 for the photo-taking instruction, a database record 1 can be added to the electronic device's image library database. After generating the original image 402, the image information of the original image 402 (e.g., image size, resolution, exposure time, name information, capture time, capture location, and information of the camera sensor used to capture the image) is associated with and stored in the image library database along with database record 1. After generating the AI-enhanced image 406, the image information of the AI-enhanced image 406 is also associated with and stored in the image library database along with database record 1. The image information of the original image associated with database record 1 includes name information with special fields. The image information of the AI-enhanced image associated with database record 1 includes name information with special fields. Specific implementation details can be found in subsequent embodiments and will not be elaborated here. When database record 1 is present in the image library database, after the image library application detects the user's instruction to display the AI-enhanced image, it can display the AI-enhanced image, and an aggregation control is displayed relative to the AI-enhanced image.

[0141] The aforementioned "Save the original image and the AI-enhanced image separately so that the original image and the image are displayed independently in the gallery application" refers to:

[0142] The storage name of the original image is modified, and the modified storage name does not contain any special fields. Furthermore, the modified storage name can also be referred to as the new name information. Then, a new database record 2 corresponding to the original image 402 is added to the image library database of the electronic device. This database record 2 is associated with the image information of the original image 402, and the associated image information includes the new name information of the original image 402.

[0143] Modify the storage name of the AI-enhanced image; the modified storage name should not contain any special fields. Add a new database record 3 corresponding to AI-enhanced image 406 to the image library database of the electronic device. This database record 3 is associated with the image information of AI-enhanced image 406, and the associated image information includes the new name information for AI-enhanced image 406, which also does not contain any special fields. Thus, when the image library application responds to user actions and displays either AI-enhanced image 406 or the original image 402, the aggregation control will not be displayed.

[0144] Continuing as shown in Figure 7(b), if a user action on the cancel control 703 is detected, the large image comparison interface 408 shown in Figure 7(c) can be displayed. Simultaneously, the database records in the image library database are not changed, nor are the storage names of the original image and the AI-enhanced image changed. Subsequently, if a user action to view the AI-enhanced image 406 is detected, for example, if the user action on the exit control 705 on the large image comparison interface 408 is detected, the image library application can query database record 1 in the image library database. This database record 1 contains a special field indicating the name of the AI-enhanced image 406. Accordingly, the electronic device can display the large image preview interface 405 shown in Figure 7(d). The large image preview interface 405 shown in Figure 7(d) displays the AI-enhanced image 406, and the aggregation control 407 is still displayed in the display area 706 of the large image preview interface 405, indicating that the AI-enhanced image 406 displayed in the large image preview interface 405 is associated with other images.

[0145] In one implementation, continuing as shown in Figure 7(b), if the user is detected to be interacting with the save confirmation control 704, it triggers the creation of new database record 2, new database record 3, and deletion of database record 1 in the gallery database. Thus, the gallery application includes the independently displayed AI-enhanced image 406 and the original image 402, but does not include the AI-enhanced image 406 associated with other images.

[0146] In this implementation, in response to a user's action on the save confirmation control 704, the electronic device can display a large image preview interface 707 as shown in Figure 7(e). The large image preview interface 707 includes an AI-enhanced image 406. The large image preview interface 707 includes a display area 708, which includes an AI icon 711. Furthermore, the position of the display area 708 in the large image preview interface 707 is the same as the position of the display area 706 in the large image preview interface 405.

[0147] Understandably, after adding database record 3 and deleting database record 1, the gallery application can query database record 3 in the gallery database. The name information of AI-enhanced image 406 in database record 3 does not contain any special fields. Accordingly, the aggregation control is not displayed in the display area 708 of the large image preview interface 707, indicating that the AI-enhanced image 406 displayed in the large image preview interface 707 is an independent image without any other related images.

[0148] Additionally, when displaying the large image preview interface 707 shown in Figure 7(e), in response to a sliding operation, the large image preview interface 709 described in Figure 7(f) can be displayed. The large image preview interface 709 includes the original image 402. The large image preview interface 709 includes a display area 710, the position of which is the same as the position of display area 706 in the large image preview interface 405. The display area 710 in the large image preview interface 709 does not contain aggregation controls.

[0149] In some embodiments, the user can also trigger the gallery application to display the large image preview interface 707 shown in Figure 7(e) and the large image preview interface 709 shown in Figure 7(f) through other means. For example, in response to the third operation, the gallery application's grid preview interface is displayed again, which may include thumbnail a (referred to as the second thumbnail) corresponding to the AI-enhanced image 406 and thumbnail c (referred to as the first thumbnail) of the original image 402. An AI icon is displayed on thumbnail a, indicating that the large image corresponding to thumbnail a is an AI-enhanced image. At this time, neither thumbnail a nor thumbnail b displays an aggregation icon.

[0150] In response to the user's operation on thumbnail a, the large image preview interface 707, shown in Figure 7(e), i.e., the fourth interface, can be displayed. In response to the user's operation on thumbnail c, the large image preview interface 709, shown in Figure 7(f), i.e., the fifth interface, can be displayed. Neither the large image preview interface 707 nor the large image preview interface 709 includes an aggregation control.

[0151] As another implementation, continuing as shown in Figure 7(b), if a user's action on the save confirmation control 704 is detected, new database record 2 and new database record 3 are added to the gallery database, while database record 1 is retained. In this embodiment, the original image and AI-enhanced image with the original stored name are also retained, while a new original image and AI-enhanced image with new name information are added. Thus, the gallery application includes an independently displayed AI-enhanced image 406, an independently displayed original image 402, and an AI-enhanced image 406 associated with other images.

[0152] In this implementation, in response to the user's action on the save confirmation control 704, the electronic device can display the large image preview interface 408 shown in Figure 7(c), or display the large image preview interface 405 shown in Figure 7(d).

[0153] When the large image preview interface 408 shown in Figure 7(c) is displayed, in response to the user's operation on the exit control 705 on the large image comparison interface 408, the gallery application can query the gallery database for database record 1, in which the name information of the AI-enhanced image 406 contains a special field, and accordingly, the electronic device can display the large image preview interface 405 shown in Figure 7(d).

[0154] Subsequently, in response to the user's swiping operation on the large image preview interface 405 shown in Figure 7(d), the large image preview interface 707 shown in Figure 7(e) can be displayed. While displaying the large image preview interface 707 shown in Figure 7(e), in response to the user's swiping operation, the large image preview interface 709 described in Figure 7(f) can be displayed.

[0155] In some embodiments, the user can also trigger the gallery application to display the large image preview interface 405 shown in Figure 7(d) through other means. For example, in response to the second operation, the gallery application's grid preview interface is displayed. When displaying the gallery application's grid preview interface, the grid preview interface includes not only thumbnails a and c, but also thumbnail b. Thumbnail b and thumbnail a are both thumbnails generated based on AI-enhanced images. Thumbnail b displays an aggregation icon, indicating that the large image corresponding to thumbnail b is associated with other images. Thumbnail a displays an AI icon.

[0156] Optionally, in response to the user's operation on thumbnail b, a large image preview interface 709 as shown in Figure 7(f) can be displayed.

[0157] Understandably, before the user's action on the Save As confirmation control 704 shown in Figure 7(b) is detected, neither the AI-enhanced image 406 nor the original image 402 can be displayed independently. Accordingly, the grid preview interface of the gallery application includes thumbnail b but does not include thumbnail a and thumbnail c.

[0158] In other embodiments, while the electronic device displays the large image comparison interface 408, the user may also trigger the deletion of the AI-enhanced image 406 and / or the original image 402.

[0159] As shown in Figure 8(a), the large image comparison interface 408 includes a delete control 801 (second delete control) that triggers the deletion of the AI-enhanced image 406 and a delete control 802 (first delete control) that triggers the deletion of the original image 402. Delete control 801 is displayed in the preview display box 502, and delete control 802 is displayed in the preview display box 503. The user can trigger the electronic device to delete the AI-enhanced image 406 (or the original image 402) by operating delete control 801 (or delete control 802).

[0160] Taking the scenario of deleting the original image 402 as an example, in response to the user's operation on the delete control 802, the large image comparison interface 408 shown in Figure 8(b) is displayed. The large image comparison interface 408 shown in Figure 8(b) includes a confirmation pop-up 803. The confirmation pop-up 803 includes deletion prompts, such as prompting the user to confirm the deletion of the original image 402. The confirmation pop-up 803 also includes a cancel delete control 804 and a confirm delete control 805. If the user's operation on the cancel delete control 804 is detected, the large image comparison interface 408 shown in Figure 8(a) is displayed.

[0161] If a user's action on the confirmation delete control 805 is detected, database record 1 in the image library database can be deleted, and database record 3 can be added. Additionally, the electronic device can display the large image comparison interface 408 shown in Figure 8(c). The large image comparison interface 408 shown in Figure 8(c) may include an AI-enhanced image 406 and an exit control 705. Then, in response to the user's action on the exit control 705 shown in Figure 8(c), the large image preview interface 806 shown in Figure 8(d) is displayed. The large image preview interface 806 also includes the AI-enhanced image 406. The large image preview interface 806 includes a display area 807, which is positioned in the same location as display area 706 in the large image preview interface 405. The display area 807 in the large image preview interface 806 does not contain aggregation controls, but it does contain an AI identifier 808. This AI identifier 808 indicates that the AI-enhanced image 406 displayed in the large image preview interface 806 is an independent image without any associated other images.

[0162] In a possible embodiment, if an operation is detected that acts on the confirmation delete control 805, the large image preview interface 806 shown in Figure 8(d), i.e., the fourth interface, can also be displayed directly.

[0163] In summary, after detecting a user instruction to delete the original image 402, the gallery app includes a separate AI-enhanced image 406. Similarly, after detecting a user instruction to delete the AI-enhanced image 406, the gallery app includes a separate original image 402.

[0164] In some embodiments, while the electronic device displays the shooting preview interface 108 corresponding to the portrait mode, the user can perform multiple operations on the shooting control 305 (such as the shooting control) to trigger the electronic device to perform multiple shots.

[0165] Understandably, each time a user interacts with the camera control 305, the electronic device generates a camera instruction. As described in the previous embodiments, the electronic device generates a thumbnail and the original image corresponding to each camera instruction in the order they are generated. For example, as shown in Figure 9(a), when the preview image 901 is displayed on the shooting preview interface 108, the user's last interaction with the camera control 305 is detected. Accordingly, after the electronic device generates the thumbnail 902 corresponding to the preview image 901, as shown in Figure 9(b), the thumbnail 902 is displayed on the gallery entry control 306.

[0166] Additionally, AI-enhanced images for photo-taking commands may not be generated while the camera app is running in the foreground (e.g., when the camera app interface is displayed). After exiting the camera app (e.g., when the camera app is switched to the background or closed), the generation of AI-enhanced images for the detected photo-taking commands can begin.

[0167] In a possible embodiment, during the camera application's foreground operation, if no user-triggered electronic device to perform a shooting operation is detected within a preset time period, the generation of an AI-enhanced image of the previously detected shooting command can begin. During the generation of the AI-enhanced image, if a user-triggered electronic device to perform a shooting operation is detected, the generation of the AI-enhanced image is paused. As shown in Figure 9(b), in response to a user's instruction to exit the camera application, the camera application's interface (e.g., the shooting preview interface) is canceled, and the desktop 903 shown in Figure 9(c) is displayed. The desktop 903 includes the gallery application's application icon 904. In response to the user's operation on the application icon 904, the application interface provided by the gallery application (e.g., the grid preview interface 905 shown in Figure 9(d)) is displayed. The operation of triggering the display of the grid preview interface 905 can be referred to as the second operation.

[0168] In Figure 9(d), the grid preview interface 905 includes multiple image thumbnails. For example, it includes thumbnails 906-1, 906-2, 906-3, and 906-4. Thumbnails 906-1, 906-2, 906-3, and 906-4 all display aggregate icons; for example, thumbnail 906-4 displays aggregate icon 913-1 (referred to as the first aggregate icon), and thumbnail 906-1 displays aggregate icon 913-2.

[0169] Understandably, thumbnails 906-4 and 902 are related, both generated by the same shooting command. Thumbnail 902 is generated from the RAW image corresponding to the shooting command, while thumbnail 906-4 is generated from the original image (the first image) corresponding to the shooting command. Thumbnail 902 is generated earlier than thumbnail 906-4. Before thumbnail 906-4 is generated, thumbnail 902 is displayed in the first position of the grid preview interface 905. After thumbnail 906-4 is generated, thumbnail 906-4 is displayed in the first position of the grid preview interface 905, replacing thumbnail 902. Both thumbnails 902 and 906-4 can be referred to as the first thumbnail. Furthermore, the same principle applies to other thumbnails in the grid preview interface 905; that is, thumbnails generated from the RAW image are displayed before thumbnails generated from the original image are generated.

[0170] For example, during the display of the shooting preview interface 108, the electronic device, under the AI ​​enhancement function, responds to multiple user instructions to take photos, sequentially generating shooting commands corresponding to thumbnails 906-2, 906-3, and 906-4. The shooting command for thumbnail 906-2 is generated earlier than that for thumbnail 906-3, and the shooting command for thumbnail 906-3 is generated earlier than that for thumbnail 906-4. After exiting the camera application, AI-enhanced images corresponding to each shooting command can be generated sequentially according to their generation times. For example, after detecting a user instruction to exit the camera application, AI-enhanced images corresponding to thumbnails 906-2, 906-3, and 906-4 can be generated sequentially. After generating the AI-enhanced image, a thumbnail of the AI-enhanced image can also be generated based on it. Then, in the grid preview interface 905, the thumbnail of the AI-enhanced image is displayed, replacing the thumbnail of the original image for the same shooting command. For example, after generating the AI-enhanced image of thumbnail 906-4 (i.e., the second image), a corresponding second thumbnail can be generated based on the AI-enhanced image of thumbnail 906-4. The second thumbnail displays a second aggregation icon. Then, the second thumbnail can be displayed in the first position of the grid preview interface 905, replacing thumbnail 906-4.

[0171] In some embodiments, thumbnail 906-1 shown in (d) of FIG. 9 and thumbnail 308 shown in (c) of FIG. 3 are thumbnails corresponding to the same shooting command. Thumbnail 308 is a thumbnail generated based on the RAW image of the shooting command. Thumbnail 906-1 is a thumbnail generated based on AI-enhanced image 406 after the AI-enhanced image 406 of the shooting command is generated. AI-enhanced image 406 has been generated before the grid preview interface 905 is displayed. Accordingly, the grid preview interface 905 can display thumbnail 906-1 of AI-enhanced image 406, but not the thumbnail of the original image 402.

[0172] In a possible embodiment, before displaying the grid preview interface 905, as shown in FIG7(b), a user operation on the save confirmation control 704 is detected. In the grid preview interface 905 shown in FIG9(d), the thumbnail 906-1 including the aggregation icon 913-2 is not displayed, and the thumbnail 906-1 including the AI ​​identifier and the thumbnail of the original image 402 are displayed simultaneously. Alternatively, in the grid preview interface 905 shown in FIG9(d), the thumbnail 906-1 including the aggregation icon 913-2, the thumbnail 906-1 including the AI ​​identifier, and the thumbnail of the original image 402 are displayed simultaneously. In a possible embodiment, before displaying the grid preview interface 905, as shown in FIG8(b), a user operation on the confirm delete control 805 is detected. In the grid preview interface 905 shown in Figure 9(d), the thumbnail 906-1 including the aggregation icon 913-2 and the thumbnail of the original image 402 are not displayed, and the thumbnail 906-1 including the AI ​​identifier is displayed.

[0173] In some embodiments, in response to a user's operation on thumbnail 906-4, the generation of the AI-enhanced image corresponding to thumbnail 906-2 is paused, and system resources are scheduled to begin generating the AI-enhanced image of thumbnail 906-4. For example, as shown in Figure 9(d), in response to a user's operation on thumbnail 906-4, a large image preview interface 907, also known as the first interface, as shown in Figure 9(e), is displayed. This large image preview interface 907 includes the original image 908 corresponding to thumbnail 906-4, which may be an image without AI enhancement.

[0174] As shown in Figure 9(e), the large image preview interface 907 also includes a waiting reminder message 909, which reminds the user that the electronic device is generating an AI-enhanced image corresponding to thumbnail 906-4.

[0175] After generating the AI-enhanced image of thumbnail 906-4, a large image preview interface 910, as shown in Figure 9(f), is displayed. The large image preview interface 910 includes an aggregation control 912 and the AI-enhanced image 911 corresponding to thumbnail 906-4. The aggregation control 912 is used to remind the user that the AI-enhanced image 911 is associated with other images, such as the original image 908 of thumbnail 906-4.

[0176] In addition, after generating AI-enhanced image 911, the electronic device can continue to generate AI-enhanced images corresponding to thumbnails 906-2.

[0177] In some embodiments, when a user's action on a thumbnail of an AI-enhanced image is detected during the display of a grid browsing interface of a gallery application, the AI-enhanced image of that thumbnail can be displayed directly. For example, as shown in Figure 10, when displaying the grid browsing interface 905, the electronic device, in response to a user's action on thumbnail 906-1, can directly display a large image preview interface 405, which includes an AI-enhanced image 406 and an aggregation control 407.

[0178] Figures 1-10 illustrate examples of mobile phone-shaped electronic devices. Understandably, electronic devices can also be other types of terminal devices. For example, electronic devices can be desktops, laptops, tablets, handheld computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), VR devices, AR devices, and other devices with image acquisition capabilities.

[0179] Figure 11A is a schematic diagram of the software architecture of an electronic device provided in an embodiment of this application. As shown in Figure 11A, the software architecture is divided into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. For example, the software architecture of the electronic device, from top to bottom, consists of an application layer, a framework layer, a system library, and a hardware abstraction layer (HAL). Of course, the software architecture of the electronic device may also include layers not shown in Figure 11A, such as a driver layer containing various device drivers.

[0180] As shown in Figure 11A, the application layer includes a camera application and a gallery application. It is understood that Figure 11A shows only a portion of the applications; in fact, the application layer can include other applications, and this application does not limit this. For example, the application layer may also include applications such as messaging, alarm clock, weather, stopwatch, compass, timer, flashlight, and calendar. Furthermore, the application layer may also include other applications with shooting capabilities, such as video recording applications and image editing applications.

[0181] For example, the framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The framework layer includes some predefined functions.

[0182] As shown in Figure 11A, the framework layer includes a camera service and a storage service. The camera service is used to implement image acquisition-related functions, while the storage service is used to store image data.

[0183] For example, the system library may include various core Java libraries and C++ libraries to support various services of applications (or various components of the operating system) in the application layer.

[0184] As shown in Figure 11A, the above system library includes a media database (MediaProvider) and a gallery database (MediaLibrary).

[0185] The media database can be a database provider, primarily responsible for storing and providing information about media data (videos, images, audio, documents, etc.). The media database inherits from ContentProvider and uses an SQLite database to store information about media data such as images, videos, audio, and documents for use by applications (or operating system components). The main functions of the media database include at least: (1) storing information corresponding to the media data. For example, when the media database scans newly added images on the device, it can store the image information, such as image size, resolution, exposure time, name information, capture time, capture location, and information about the camera sensor that captured the image. (2) providing data access interfaces. For example, through the interfaces provided by ContentProvider, other applications can query, insert, delete, or update information about the media data.

[0186] A gallery database is a library for managing media data. It provides the ability to obtain metadata information of media data and allows applications to perform operations such as creation, modification, and deletion based on media data. The core functions of a gallery database include at least: (1) querying metadata information of media data. Metadata information may include information such as the attributes, content, structure, format, and source of the media data. (2) managing albums and media data, such as creating albums, accessing and modifying media data in albums. (3) manipulating media data, such as creating, renaming, copying, and deleting media data.

[0187] In this embodiment, under the AI ​​enhancement function, the generated thumbnail (e.g., thumbnail 308 in the aforementioned embodiment) carries extended information. Examples of extended information can be found in subsequent embodiments and will not be repeated here. The media database can create database records related to the thumbnail based on the extended information in the thumbnail, and trigger the gallery database to also create database records related to the thumbnail (e.g., database record 1). Specific implementation details can also be found in subsequent embodiments and will not be repeated here.

[0188] In addition, after the media data in the electronic device is updated, the media provider will also notify the library to synchronize the data.

[0189] For example, the hardware abstraction layer (HAL) can encapsulate drivers in the kernel layer and provide an interface for calling the framework layer, shielding the implementation details of the low-level hardware.

[0190] As shown in Figure 11A, the HAL of an electronic device includes at least a camera HAL. The camera HAL includes a dump service that provides services for storage services (also known as a storage service process). The dump service includes an AI-enhanced graph processing path and a dump decision framework. For example, the AI-enhanced graph processing path can generate large image data corresponding to a photo-taking command. The AI-enhanced graph processing path includes nodes for executing AIGC algorithms. The AI-enhanced graph processing path may also include nodes for executing other image processing algorithms; however, this embodiment does not specifically limit this.

[0191] In addition, the camera HAL can create camera control channels required for different shooting functions. For example, after the camera application enables portrait mode, the camera HAL can create a camera control channel to implement the shooting functions corresponding to portrait mode, which can also be called the portrait mode camera control channel. The camera control channel can include one or more functional nodes. For example, it can include a camera (sensor) node for controlling the camera sensor, an image front end (IFE) node, and also special function nodes and image processing nodes. Different shooting functions may correspond to different special function nodes. For example, portrait mode can correspond to a scene detection module and an extended processing node for adding extended information. This application embodiment does not specifically limit this. The image processing node can include nodes for executing various image processing algorithms, such as nodes for executing downsampling algorithms, nodes for executing frame selection algorithms, nodes for executing beautification processing, nodes for executing filter addition, nodes for executing watermark addition, nodes for executing image fusion, etc. According to different image output requirements, different functional nodes can form different image processing paths, such as thumbnail processing path, original image processing path, and preview path. For example, the thumbnail processing path is used to generate a thumbnail corresponding to the photo capture command. The thumbnail processing path may include a sensor node, an IFE node, a node that executes a downsampling algorithm, a node that executes a frame selection algorithm, and an extended processing node, etc.

[0192] The original image processing path is used to generate the large image data corresponding to the photo-taking command. This path may include sensor nodes, IFE nodes, nodes performing beautification processing, nodes adding filters, nodes adding watermarks, and nodes performing image fusion. In possible embodiments, the node performing image fusion may not belong to any path.

[0193] The preview path is used to generate preview frames, and the preview path may include sensor nodes, IFE nodes, etc. Of course, the same nodes can be reused between different image processing paths, and this application embodiment does not specifically limit this.

[0194] In addition, the camera HAL includes multiple cache queues, each serving a different path. For example, the preview path corresponds to cache queue 1 (first queue), the original image processing path corresponds to cache queue 2 (second queue), the AI-enhanced image processing path corresponds to cache queue 3 (third queue), and the thumbnail processing path corresponds to cache queue 4.

[0195] As shown in Figure 11B, the camera sensor can store the real-time acquired RAW images into buffer queue 1. The preview path can sequentially acquire each frame of RAW image in buffer queue 1 and generate the corresponding preview frame. For example, if the camera sensor sequentially acquires RAW images 1 to 7, it can store RAW images 1 to 7 sequentially into buffer queue 1. The preview path can then generate preview frames 1 to 7 corresponding to RAW images 1 to 7 sequentially based on the RAW images in buffer queue 1 and display preview frames 1 to 7.

[0196] With AI enhancement and multi-shot functionality enabled, after detecting the shooting command generated by the camera application, the camera HAL can retrieve multiple RAW images related to the shooting command from cache queue 1.

[0197] For example, each RAW image in buffer queue 1 corresponds to a preview frame, and each preview frame corresponds to a display time. That is, the RAW images in buffer queue 1 also correspond to display times. The shooting command also carries a shooting timestamp. The RAW images related to the shooting command can be RAW images where the time interval between the display time and the shooting timestamp is less than a preset time interval. For another example, buffer queue 1 can only store a limited number of RAW images. The camera sensor acquires RAW images in real time and stores them in buffer queue 1. After buffer queue 1 is full of RAW images, the earliest acquired RAW image in buffer queue 1 is deleted each time a new RAW image is stored. Thus, as the camera sensor normally acquires RAW images, the RAW images in buffer queue 1 are continuously updated. In this example, when the camera HAL receives a shooting command, it can use all the RAW images in buffer queue 1 as the RAW images related to the shooting command.

[0198] In addition, after identifying the multi-frame RAW images related to the photo capture command, the information of the photo capture command (photo capture timestamp, name information, etc.) can be associated with the multi-frame RAW images.

[0199] After determining the multiple RAW frames corresponding to the shooting command, a reference RAW frame is selected from the multiple RAW frames. For example, the RAW frame with the best image quality can be selected, or the RAW frame that is suitable for the current feature requirements can be selected as the reference RAW frame.

[0200] Understandably, a Feature is a component created by the camera's HAL when specific functions in Portrait mode are enabled. For example, after enabling Portrait Enhancement and Multi-Shot functionality, Features that can be created include the camera control channel and dump service for Portrait mode.

[0201] When HDR is enabled in Portrait mode, the camera's HAL can create FeatureHDR. Correspondingly, the selected reference RAW image is a suitable RAW image for generating the HDR image.

[0202] Continuing as shown in Figure 11B, after determining that RAW images 1-7 are the multi-frame RAW images corresponding to the shooting command, RAW image 4 is selected as the reference RAW image and stored in the buffer queue 4. In this way, the thumbnail processing path can generate a thumbnail 4 corresponding to RAW image 4 based on RAW image 4 in the buffer queue 4. This thumbnail 4 carries extended information. Then, thumbnail 4 is passed to the camera application for display and storage.

[0203] Additionally, as shown in Figure 11B, the node performing image fusion can fuse the RAW images related to the shooting command to obtain a target RAW image (first RAW image) related to the shooting command, as shown in RAW image a in Figure 11B. The camera HAL can store the target RAW image (e.g., RAW image a) into buffer queue 2 and buffer queue 3 respectively. In a possible embodiment, the camera HAL can store the target RAW image into buffer queue 2 but not into buffer queue 3. The camera HAL can also store the multi-frame RAW images (RAW images 1 to 7) corresponding to the shooting command into buffer queue 3.

[0204] Understandably, the original image processing path belongs to the camera control path of the super portrait mode. After the camera application exits and destroys the camera control path, the original image processing path will also be destroyed simultaneously, thus releasing cache queue 2. When cache queue 2 contains RAW images, the original image processing path needs to immediately generate the corresponding large image data (i.e., the original image) based on the RAW images in cache queue 2. In other words, the original image processing path needs to consume the RAW images stored in cache queue 2 in a timely manner.

[0205] Continuing as shown in Figure 11B, after the target RAW image is stored in cache queue 2, the original image processing path can generate the corresponding original image based on the target RAW image. For example, after RAW image a is stored in cache queue 2, the original image processing path can generate a large image a based on RAW image a. Then, the camera HAL can pass the original image to the storage service for storage.

[0206] The AI-enhanced image processing pathway is a dump service. After the camera application exits, the dump service will not be destroyed, nor will cache queue 3 be released. After obtaining the target RAW image corresponding to the shooting command and storing it in cache queue 3, the AI-enhanced image processing pathway does not need to immediately generate the corresponding large image data (i.e., the AI-enhanced image) based on the target RAW image in cache queue 3. In other words, the AI-enhanced image processing pathway does not need to immediately consume the RAW image in cache queue 3. Accordingly, the AI-enhanced image processing pathway can begin generating the large image data corresponding to the shooting command under specific conditions.

[0207] The specific conditions can be determined according to the actual application scenario. For example, in the embodiments of this application, the specific conditions may be detecting an event that triggers the exit of an application with shooting function, detecting low system resource usage, detecting an event that triggers the shutdown of AI enhancement function, or detecting that no user instruction to shoot has been received within a preset time.

[0208] In this way, during the process of generating large image data through AI-enhanced image processing, complex image processing algorithms (such as AIGC algorithm) can be used to ensure high-quality large image data while avoiding lag during the camera application's shooting task.

[0209] In addition, the RAW graph stored in cache queue 3 will not be deleted until the corresponding AI-enhanced graph is synthesized.

[0210] Of course, for the same photo capture command, the original image is generated earlier than the AI-enhanced image. The original image can be called the first-stage image, and the corresponding processing path for the original image can be called the first-stage image processing path. The AI-enhanced image can be called the second-stage image, and the corresponding processing path for the AI-enhanced image can be called the second-stage image processing path.

[0211] It is understood that Figure 11A is merely an example of a software architecture for an electronic device. The electronic device may also include layers not shown in Figure 11A, and each layer may also include software functional modules not shown in Figure 11A. In subsequent embodiments, the electronic device having the software structure shown in Figure 11A will be described in detail.

[0212] In some embodiments, after the user instructs the activation of a specified camera mode and the opening of AI enhancement and multi-shot functionality, the signaling interaction between software modules in the electronic device is shown in Figure 12. The specified camera module can be the portrait mode and photo mode exemplified in Figure 1, or other camera modes; this embodiment does not specifically limit the specific camera mode used.

[0213] S101, the camera app receives a user's request to enable portrait mode.

[0214] For example, as shown in Figure 1(a), when a user performs an operation on the portrait identifier 102, the camera application can receive the user's operation to turn on portrait mode.

[0215] S102, the camera application calls the camera service to instruct the creation of the camera control channel corresponding to the portrait mode.

[0216] S103, Camera Service instructs the camera HAL to create the camera control channel corresponding to the portrait mode.

[0217] For example, the camera service can send a portrait mode identifier to the camera HAL, instructing the camera HAL to create a camera control channel corresponding to the portrait mode.

[0218] S104, Camera HAL creates the camera control channel corresponding to portrait mode.

[0219] The camera control channel corresponding to portrait mode can include multiple functional nodes. Different functional nodes can also form different control paths, image processing paths, etc. For details, please refer to the example shown in Figure 11A, which will not be elaborated here. For example, after the camera control channel corresponding to portrait mode is created, the camera control path can control the camera sensor that needs to output images in portrait mode to start the flow and acquire RAW images.

[0220] S105, Camera HAL initializes the camera sensor.

[0221] In some embodiments, the camera HAL can initialize the camera sensor via the camera control channel. For example, it can send camera parameters (such as output format, output size, exposure time, etc.) to the camera sensor to control the camera sensor to start current.

[0222] S106, camera sensor acquires RAW images.

[0223] In some embodiments, the camera sensor can transmit the acquired RAW images to the camera HAL. For example, the camera sensor stores the real-time acquired RAW images in a buffer queue 1. The preview path in the camera control channel can generate a preview frame based on the RAW images in the buffer queue 1, and transmit the preview frame to the display component in the operating system through the camera service. The display component then instructs the display screen of the electronic device to display the preview frame in the portrait mode shooting preview interface 108.

[0224] S107, the camera app receives user instructions to enable AI enhancement and activate the multi-shot function.

[0225] For example, as shown in Figure 1(b), after the user operates on the function icon 104 indicating that the AI ​​enhancement function is enabled, the camera application can receive the user's instruction to enable the AI ​​enhancement function. As shown in Figure 2(c), after the user operates on the configuration item 205 in an unselected state, the camera application can receive the user's instruction to enable the multi-shot function.

[0226] Additionally, in a possible embodiment, the camera application, in response to a user instruction to activate portrait mode (or, in photo mode, to enable the telephoto lens), can simultaneously activate AI enhancement and multi-shot functionality. In this embodiment, execution of S107 can be skipped; that is, after executing S104, not only S105 but also S108 can be executed.

[0227] S108, the camera app calls the camera service to indicate that AI enhancement and multi-shot functionality are enabled.

[0228] S109, Camera Services Instructs Camera HAL to enable AI enhancements and multi-shot functionality.

[0229] S110, the scene detection module in the camera control channel corresponding to the camera HAL enabling portrait mode.

[0230] In some embodiments, the process of creating a camera control channel includes creating a scene detection module. In other embodiments, the process of creating a camera control channel does not include creating a scene detection module; the camera HAL may create a scene detection module after executing S109 and before executing S110.

[0231] For example, S110 above may include initializing the scene detection module. After initialization, the scene detection module can register to obtain ambient light brightness information reported by the ambient light sensor in the input manager in the framework layer, and register to obtain preview frames from the camera sensor in the camera HAL.

[0232] S111, the camera HAL registers a callback with the input manager to obtain ambient light brightness information.

[0233] S112, the input manager instructs the ambient light sensor to report the collected ambient light brightness information.

[0234] In some embodiments, if the ambient light sensor has already started collecting ambient light brightness information before S111, S112 can be skipped. If the ambient light sensor is not working before S111, S112 can be executed to trigger the control of the ambient light sensor to start collecting ambient light brightness information.

[0235] S113, ambient light sensor collects ambient light brightness information.

[0236] S114, the camera HAL enables the extended processing node in the thumbnail processing path. The extended processing node is used to add extended information to the thumbnail corresponding to the shooting command. The extended information includes relevant information about the original image of the thumbnail and the AI-enhanced image.

[0237] As an example, the extended information is as follows:

[0238] In summary, the extended information includes at least an identifier indicating that the AI ​​enhancement function and the one-shot-multiple-captures-one-images-multiple-captures-one-images-multiple-captures-one-images-multiple-captures-images-enabled are enabled (e.g., scenario: AIGC), information related to the original image corresponding to the thumbnail and the AI ​​enhancement image, such as name information (e.g., JpegName), image size, and whether it needs to be stored by the storage service. In addition, the information related to the AI ​​enhancement image also includes a first identifier, which corresponds to the name information of the AI ​​enhancement image, indicating that the AI ​​enhancement image is the image obtained after the target RAW image is processed by the AIGC algorithm, or it can indicate that the target RAW image used to generate the AI ​​enhancement image is stored in cache queue 3.

[0239] In some embodiments, the “scence” in the extended information may be determined based on the values ​​assigned to the status flag 1 of the AI ​​enhancement function and the status flag 2 of the one-shot-multiple-capture function.

[0240] Understandably, the status flag 1 for the AI ​​enhancement feature can be assigned either the first or the second value. When status flag 1 is the first value, it indicates that the AI ​​enhancement feature is not enabled or that the AIGC algorithm is unavailable if enabled. When status flag 1 is the second value, it indicates that the AI ​​enhancement feature is enabled and the AIGC algorithm is available.

[0241] The status flag 2 for the "One-Shot Multiple-Receive" function can be assigned a third or fourth value. When status flag 2 is the third value, it indicates that the "One-Shot Multiple-Receive" function is not enabled; when status flag 2 is the fourth value, it indicates that the "One-Shot Multiple-Receive" function is enabled.

[0242] The camera HAL can update the values ​​of status flag 1 and status flag 2 according to the actual situation. For example, after S107 to S109, S115 can be triggered to update the values ​​of status flag 1 and status flag 2. See the following embodiments for details, which will not be elaborated here. In addition, when status flag 1 is the first value, status flag 2 will also be assigned the third value.

[0243] In some embodiments, whether the extended information includes "Firststepphoto" and "Secondstepphoto" is also related to status flag 1 and status flag 2. For example, if status flag 1 is a second value and status flag 2 is a fourth value, the extended information includes both "Firststepphoto" and "Secondstepphoto". Another example is that if status flag 1 is a second value and status flag 2 is a third value, the extended information includes "Secondstepphoto". Yet another example is that if status flag 1 is a first value and status flag 2 is a third value, the extended information includes "Firststepphoto".

[0244] In some embodiments, the name information (JpegName) of “Firststepphoto” and “Secondstepphoto” in the extended information is related to the name information carried in the photo-taking command.

[0245] S115, the camera HAL changes the value of the status flag bit 1 of the AI ​​enhancement function from the first value to the second value, indicating that the AI ​​enhancement function has been enabled; and changes the value of the status flag bit 2 of the one-shot-multiple-capture function from the third value to the fourth value, indicating that the one-shot-multiple-capture function has been enabled.

[0246] As can be understood, as described in the preceding embodiments, in scenarios where the AI ​​enhancement function is not enabled, the state flag bit 1 is assigned a first value. In scenarios where the multi-shot function is not enabled, the state flag bit 2 is assigned a third value. After detecting that the user has triggered the activation of both the AI ​​enhancement function and the multi-shot function, step S115 can be executed to change the values ​​assigned to state flag bits 1 and 2. If only the AI ​​enhancement function is enabled and the multi-shot function is not enabled, only the value assigned to state flag bit 1 needs to be changed.

[0247] In some embodiments, there is no necessary order between S115 and S114.

[0248] S116, the camera app calls the storage service, indicating that AI enhancement and multi-shot functionality are enabled.

[0249] Understandably, the implementation of AI-enhanced features and multi-shot functionality relies not only on camera services but also on storage services. While the camera application instructs the camera service to enable AI-enhanced features and multi-shot functionality, it also needs to instruct the storage service to enable these features.

[0250] In some embodiments, there is no necessary order between S116 and S108; for example, they can be executed simultaneously.

[0251] S117, Storage Service Instructs the Dump Service in the Camera HAL to enable AI Enhancement and One-Shot Multi-Capture Functionality.

[0252] S118, the dump service initializes the AI-enhanced graph processing pathway and dump decision framework.

[0253] After initializing the dump decision framework, it can receive RAW images from the camera sensor (e.g., multi-frame RAW images corresponding to a shooting command or target RAW images) and store them in cache queue 3. Under certain conditions, the dump decision framework can also retrieve RAW images from cache queue 3 and pass them to the AI-enhanced image processing path for processing.

[0254] In some embodiments, after the electronic device responds to a user's operation and enables the AI ​​enhancement function and the one-shot-multiple-capture function, it can also combine the ambient light brightness information received by the scene detection module and the preview frame to determine whether the AIGC algorithm can be effective, that is, whether the AI ​​enhancement function is available. Then, based on the above determination result, the values ​​of status flag 1 and status flag 2 can be updated. For example, after S115 above, as shown in Figure 13, the signaling interaction between the various software and hardware modules in the electronic device is as follows:

[0255] S201, the camera application registers a callback for metadata about scene detection information with the scene detection module of the camera HAL.

[0256] In some embodiments, the scene detection information may include ambient light intensity information received by the scene detection module, and also facial information identified by the scene detection module based on the preview frame. The facial information may include the number of faces appearing in the preview frame, the size of the image area occupied by each face, etc.

[0257] After registering the metadata callback for scene detection information, the scene detection module can send the changed scene detection information back to the camera application when the scene detection information changes.

[0258] S202, the camera sensor sends the acquired RAW image 1 to the camera HAL.

[0259] In some embodiments, after the camera sensor is initialized in S105, the camera sensor begins to acquire RAW images. The camera sensor can then store the real-time acquired RAW images into the buffer queue 1 corresponding to the camera's HAL. After the camera sensor acquires RAW image 1, S202 is executed, that is, RAW image 1 is stored in buffer queue 1.

[0260] S203, the preview path generates the corresponding preview frame 1 based on RAW image 1.

[0261] In some embodiments, the aforementioned RAW image 1 may be image data that has already been processed by the sensor front end (SFE) node. The SFE can convert the RAW image output by the camera sensor into image data in other formats (e.g., remosaic), and perform color correction, noise reduction, downsampling, or de-mosaic processing on the RAW image.

[0262] In some embodiments, S203 may include: after the preview path obtains RAW image 1 from the buffer queue 1, it processes RAW image 1 using an IFE node to obtain the corresponding preview frame 1. The IFE node can obtain the 3A data (auto white balance parameters, auto exposure parameters, and auto focus parameters) of RAW image 1, and based on the 3A data, combined with the auto white balance algorithm, auto exposure algorithm, and auto focus algorithm, adjust the display effect of RAW image 1 to obtain preview frame 1.

[0263] In some other embodiments, S203 may also include: after the preview path obtains RAW image 1 from the cache queue 1, in addition to using the IFE node to process RAW image 1, other types of image processing nodes (such as nodes that deploy beautification algorithms, filter algorithms, and watermarking algorithms) may be used to process RAW image 1 to obtain preview frame 1. This application embodiment does not specifically limit this.

[0264] S204, the preview path sends preview frame 1 to the scene detection module of the camera HAL.

[0265] Understandably, after generating preview frame 1, the preview path can also pass preview frame 1 to the operating system's display component through the camera service, triggering the display component to control the display screen to show preview frame 1.

[0266] S205, the scene detection module determines the face information 1 in preview frame 1.

[0267] In some embodiments, the scene detection module can use a face recognition algorithm to identify the number of faces appearing in preview frame 1 and determine the size of the image region occupied by each face, thus obtaining face information 1. For example, in the scene shown in Figure 3, preview frame 301 is preview frame 1 in S205. No face appears in preview frame 301, and the obtained face information 1 indicates that the number of faces is 0.

[0268] S206, The ambient light sensor reports the collected ambient light brightness information to the scene detection module of the camera HAL.

[0269] In some embodiments, after S112, the ambient light sensor begins to collect ambient light brightness information and reports it to the scene detection module of the camera HAL via the input manager. As one implementation, after the scene detection module registers with the input manager to acquire ambient light brightness, the input manager can transmit the first received ambient light brightness information to the scene detection module. Subsequently, if the ambient light brightness information received by the input manager changes according to preset conditions, such as the difference between the received ambient light brightness information and the most recently transmitted ambient light brightness information being greater than a preset threshold, the input manager can transmit the changed ambient light brightness information to the scene detection module.

[0270] Furthermore, there is no necessary order between S206 and S201. The ambient light brightness information 1 mentioned above can be the latest ambient light brightness information reported by the ambient light sensor to the scene detection module before S207 is executed.

[0271] S207, the scene detection module of the camera HAL returns scene detection information 1 to the camera application. Scene detection information 1 includes face information 1 and ambient light intensity information 1.

[0272] S208, the camera application determines that the AI ​​enhancement function is not working based on scene detection information 1.

[0273] In some embodiments, the camera application can determine whether the AI ​​enhancement function is effective at the current time based on the scene detection information 1. As shown in Figure 3(b), if the AI ​​enhancement function is effective, the reminder information 302 is not displayed. If the AI ​​enhancement function is not effective, the reminder information 302 is displayed as shown in Figure 3(a), that is, the process enters S210.

[0274] For example, if the ambient light brightness information in the scene detection information is less than a preset brightness threshold, it is determined that the AI ​​enhancement function cannot be effective. If the ambient light brightness information in the scene detection information is greater than or equal to the preset brightness threshold, it can be further combined with facial information to further determine that the AI ​​enhancement function cannot be effective.

[0275] For example, if the face information in the scene detection information indicates that the number of faces is 0, it is determined that the AI ​​enhancement function cannot be used. If the face information in the scene detection information indicates that the number of faces is greater than a specified number (e.g., 2), it is determined that the AI ​​enhancement function cannot be used. If the face information in the scene detection information indicates that the size of the image area occupied by the face is smaller than a preset size, it is determined that the AI ​​enhancement function cannot be used.

[0276] S209, The AI ​​enhancement function of the camera application notification scene detection module is not working.

[0277] In some embodiments, the camera application can send an inactive message to the scene detection module via the camera service, which includes bytes indicating that the AI ​​enhancement is not active.

[0278] In other embodiments, the scene detection module can also combine ambient light information and facial information to determine whether the current AI enhancement function is effective. The determination principle is the same as in S208, and will not be repeated here. In this embodiment, S209 can be omitted.

[0279] In other embodiments, after the scene detection module determines whether the current AI enhancement function is effective, it can directly send the determination result to the camera application. In this embodiment, steps S207 and S208 can be omitted. If the determination result is that the AI ​​enhancement function is not effective, step S210 is executed.

[0280] The S210's camera app displays a notification message indicating that AI is not working.

[0281] As shown in Figure 3(a), a reminder message 302 is displayed on the shooting preview interface 108.

[0282] S211, the scene detection module of the camera HAL updates the value of state flag bit 1 from the second value to the first value, and updates the value of state flag bit 2 from the fourth value to the third value.

[0283] Understandably, when the AI ​​enhancement function changes from active to inactive, or vice versa, the camera HAL needs to update the values ​​of status flag 1 and status flag 2. If the AI ​​enhancement function is available (or active), the value of status flag 1 remains the second value, and the value of status flag 2 remains the fourth value. If the AI ​​enhancement function is unavailable (or inactive), the value of status flag 1 changes to the first value, and correspondingly, the value of status flag 2 will also be updated to the third value. Furthermore, if the AI ​​enhancement function subsequently becomes available again, the value of status flag 1 will revert to the second value, and correspondingly, the value of status flag 2 will also revert to the fourth value.

[0284] S212, the scene detection module sends a pause dump command to the dump service.

[0285] S213, The dump service configures the dump flag to the fifth value.

[0286] The dump flag can be a flag managed by the dump service. This dump flag can be configured to either a fifth or a sixth value. A fifth value indicates that the RAW images corresponding to the capture command are not stored in cache queue 3. That is, when the dump flag is at its fifth value, the target RAW image for the capture command is not stored in cache queue 3 after generation. Alternatively, when the dump flag is at its fifth value, even if multiple RAW frames corresponding to the capture command are determined, they are not stored in cache queue 3.

[0287] S214, the camera sensor sends the acquired RAW image 2 to the camera HAL.

[0288] S215, the preview path generates the corresponding preview frame 2 based on RAW image 2.

[0289] S216, the preview path sends preview frame 2 to the scene detection module of the camera HAL.

[0290] S217, the scene detection module determines the face information 2 in preview frame 2.

[0291] For example, in the scene shown in Figure 3(b), preview frame 303 is preview frame 2 in S217. A face appears in preview frame 303, and the obtained face information 2 includes the number of faces as 1 and the size of the image area occupied by the face.

[0292] S218, The ambient light sensor reports the collected ambient light brightness information to the scene detection module of the camera HAL.

[0293] In some embodiments, the implementation details of S214 to S218 can be found in S202 to S206, and will not be repeated here. Furthermore, there is no necessary order between S218 and S214. The ambient light brightness information 2 can be the latest ambient light brightness information reported by the ambient light sensor to the scene detection module before S219 is executed.

[0294] In a possible embodiment, S218 and S206 described above may be the same step, that is, the ambient light brightness information 2 and the ambient light brightness information 1 are the same.

[0295] S219, the scene detection module of the camera HAL returns scene detection information 2 to the camera application. Scene detection information 2 includes face information 2 and ambient light brightness information 2.

[0296] For example, when scene detection information 2 is different from scene detection information 1, execution of S219 can be triggered.

[0297] For example, the difference mentioned above could be that face information 1 and face information 2 are not the same. After face information 2 is determined, execution of S219 can be triggered.

[0298] For example, the difference mentioned above could be that ambient light brightness information 2 is different from ambient light brightness information 1. After receiving ambient light brightness information 2, execution of S218 can be triggered.

[0299] S220, the camera application determines that the AI ​​enhancement function is enabled based on scene detection information 2.

[0300] For example, if the ambient light brightness information 2 is greater than or equal to a preset brightness threshold, the face information 2 indicates that the number of faces is not 0 and is less than a specified number (also known as a preset number), and the face information 2 indicates that the size of the image area occupied by the face is greater than a preset size, then the AI ​​enhancement function is determined to be effective. The above conditions for determining the effectiveness of the AI ​​enhancement function can also be called target conditions.

[0301] S221, the AI ​​enhancement function of the camera application notification scene detection module has been activated.

[0302] In some embodiments, the camera application can send activation information to the scene detection module through the camera service, which includes bytes indicating that the AI ​​enhancements have been activated.

[0303] In other embodiments, the scene detection module may also combine ambient light information and facial information to determine whether the current AI enhancement function is effective. In this embodiment, S221 may be omitted.

[0304] In other embodiments, after the scene detection module determines whether the current AI enhancement function is effective, it can directly send the determination result to the camera application. In this embodiment, steps S219 and S220 can be omitted. If the determination result is that the AI ​​enhancement function is effective, step S222 is executed.

[0305] S222, the camera app no ​​longer displays reminders that AI is not working.

[0306] For example, the shooting preview interface 108 shown in Figure 3(b) is displayed.

[0307] S223, the scene detection module of the camera HAL updates the value of state flag bit 1 from the first value to the second value, and updates the value of state flag bit 2 from the third value to the fourth value.

[0308] S224, the scene detection module sends a restore dump command to the dump service.

[0309] S225, the dump service changes the dump flag from the fifth value to the sixth value.

[0310] The sixth value indicates that the RAW image corresponding to the photo capture command can be stored in cache queue 3. That is, when the dump flag is set to the sixth value, the target RAW image of the photo capture command can be stored in cache queue 3 after it is generated.

[0311] That is, after receiving the recovery and transfer instruction, in response to the shooting instruction, the RAW image corresponding to the shooting instruction can be stored in the cache queue 3.

[0312] It should also be noted that S201 to S225 are all optional steps, and in possible embodiments, S201 to S225 may not be performed.

[0313] In some embodiments, when AI enhancement and multi-shot functionality are enabled but AI enhancement is not active, only the corresponding thumbnail and original image are generated in response to the user's instruction to take a photo; the corresponding AI-enhanced image may not be generated.

[0314] In some embodiments, when AI enhancement and multi-shot functionality are enabled and AI enhancement is active, in response to a user's instruction to take a photo, as shown in Figure 14, the signaling interactions between the various software and hardware modules in the electronic device are as follows:

[0315] S301, the camera application receives a user instruction to take a picture.

[0316] For example, the above-mentioned operation of instructing to take a picture can be the operation of the camera control 305 shown in Figure 3(b). Of course, Figure 3(b) is only an example and is not intended to be a specific limitation.

[0317] S302, the camera application sends a photo-taking command through the camera service. This command includes the names of the original image and the AI-enhanced image.

[0318] The names of the original image and the AI-enhanced image can be generated according to preset rules. The names of different large image datasets can be different. Furthermore, the names of the original image and the AI-enhanced image corresponding to the same shooting command can contain the same part, that is, they can have the same prefix information. This prefix information includes the special field (enhance) mentioned in the previous embodiments. This special field indicates that the shooting command corresponds to at least two large image datasets, and can also be considered target information. For example, the name of the original image is IMG-2024-enhance-001, which can be called the third name. Similarly, the name of the AI-enhanced image is IMG-2024-enhance-002-cover, which can be called the first name. It is understandable that the camera application can determine the names of the original image and the AI-enhanced image in advance before they are generated and configure them in the shooting command.

[0319] In some embodiments, the photo-taking instruction may also carry a photo-taking timestamp, which can be the time point at which the user's instruction to take a photo is detected. This photo-taking timestamp can serve as the time when the original image or the AI-enhanced image was captured.

[0320] S303, the camera sensor stores the acquired RAW image into the camera HAL buffer queue 1.

[0321] In some embodiments, there is no necessary order between S302 and S303. After S106, the camera sensor can acquire RAW images in real time. The acquired RAW images are processed by the SFE node and then transmitted to the camera HAL. For example, the RAW images acquired by the camera sensor are processed by the SFE node and stored in buffer queue 1. The camera HAL can retrieve the RAW images acquired by the camera sensor from buffer queue 1.

[0322] S304, the camera HAL determines the multi-frame RAW image corresponding to the shooting command in the buffer queue 1, and determines the reference RAW image from the multi-frame RAW image.

[0323] In some embodiments, the camera HAL can determine the multi-frame RAW image corresponding to the shooting command from the buffer queue 1 based on the shooting timestamp in the shooting command. Then, from the multi-frame RAW image, the reference RAW image corresponding to the shooting command is determined. For specific implementation details, please refer to Figure 11B, which will not be elaborated here.

[0324] Optionally, the node executing the frame selection algorithm in the thumbnail processing path executes S304 to determine the reference RAW image corresponding to the shooting command.

[0325] S305, the camera HAL stores the reference RAW image into buffer queue 4.

[0326] S306, the camera HAL generates a target thumbnail based on the reference RAW image in buffer queue 4, and adds target extension information to the target thumbnail.

[0327] The target extended information includes indicators that indicate the AI ​​enhancement function and the one-shot-multiple-captures-one-shots ...

[0328] In some embodiments, the thumbnail processing path in the camera's HAL can perform downsampling processing on the reference RAW image to generate a corresponding target thumbnail. Then, target extension information is added to the target thumbnail.

[0329] For example, the relevant information for the original image and the AI-enhanced image includes name information, image size, etc. The name information comes from the shooting command, and the image size comes from the camera sensor. The relevant information for the AI-enhanced image may also include a first identifier, which corresponds to the name information of the AI-enhanced image, indicating that the AI-enhanced image is the image obtained after processing the target RAW image using the AIGC algorithm, or that the target RAW image used to generate the AI-enhanced image is stored in cache queue 3.

[0330] Furthermore, when generating target extended information, if the status flag 1 is assigned the first value, meaning the AI ​​enhancement function is not active, then the target extended information may not contain information related to the AI-enhanced image. If the status flag 1 is the second value and the status flag 2 is the third value, meaning the AI ​​enhancement function is active but the "one-shot-multiple-captures" function is not enabled, then the target extended information may not contain information related to the original image. If the status flag 1 is assigned the second value and the status flag 2 is the fourth value, meaning both the AI ​​enhancement function and the "one-shot-multiple-captures" function are active, then the target extended information includes information related to both the AI-enhanced image and the original image.

[0331] S307, the camera HAL sends a target thumbnail to the camera application.

[0332] In some embodiments, the camera HAL can send a target thumbnail to the camera application via the camera service.

[0333] S308, the camera application stores the target thumbnail in the thumbnail cache.

[0334] In this context, the target thumbnail is stored in the thumbnail cache under the name "target name information," which refers to the name of the original image or AI-enhanced image within the target extended information. This thumbnail cache can also be referred to as the target storage area.

[0335] In some embodiments, the thumbnail cache is a portion of the storage space corresponding to the file system. For example, the storage path corresponding to the thumbnail cache in the file system could be: / Storage / DCIM / Camera / cache.

[0336] S309, in response to the target extension information of the target thumbnail, the camera application sends the target name information to the media database.

[0337] S310, the media database generates database record a corresponding to the target name information.

[0338] Wherein, the aforementioned database record a (also referred to as the first database record) may be the database record 1 mentioned in the foregoing embodiment.

[0339] S311, Media Database Notification Gallery Database Scan Thumbnail Cache.

[0340] In some embodiments, the media database sends a scan notification to the gallery database, triggering the image database to scan the thumbnail cache, that is, to scan the thumbnails stored under / Storage / DCIM / Camera / cache.

[0341] Optionally, the scan notification may also include the target name information of the target thumbnail, so that the gallery database can scan the thumbnail cache according to the target name information.

[0342] Optionally, the target name information for the target thumbnail may not be included in the scan notification. The gallery database can iterate through all thumbnails in the thumbnail cache, and when it encounters a thumbnail for which a database record has not yet been generated in the gallery database, it creates the database record for that thumbnail.

[0343] S312, when the target thumbnail is scanned, the gallery database generates database record b.

[0344] Among them, database record b (also known as the second database record) includes target name information and identifier 1, indicating that the large image data corresponding to the target thumbnail includes the image processed by the AIGC algorithm.

[0345] In some embodiments, when database record b contains identifier 1, other applications obtain the large image data corresponding to the target thumbnail through the gallery database instruction. The gallery database can first determine whether the AI-enhanced image corresponding to the target thumbnail has been generated. If not, it can schedule system resources to prioritize the generation of the AI-enhanced image corresponding to the target thumbnail.

[0346] S313, the camera HAL fuses multiple RAW images corresponding to the shooting command to generate the target RAW image corresponding to the shooting command.

[0347] In some embodiments, there is no necessary order between S313 and S306, and both are steps executed after S304.

[0348] By fusing multiple RAW frames, a target RAW image with better image quality and richer image features can be obtained. The large image data generated based on the target RAW image has higher clarity.

[0349] S314, the camera HAL stores the target RAW image into buffer queue 2 and buffer queue 3 respectively.

[0350] In other embodiments, the target RAW image may be stored in cache queue 2, and the multi-frame RAW images corresponding to the shooting command may be stored in cache queue 3.

[0351] S315, the camera HAL retrieves the target RAW image from buffer queue 2 and generates the corresponding original image.

[0352] As one implementation, the original image processing path of the camera HAL can perform one or more image processing operations based on the target RAW image in the cache queue 2 to obtain the corresponding original image, that is, the first-stage image. For example, the above one or more image processing operations include: (1) noise reduction. (2) adjusting the display effect of the target RAW image according to the 3A data of the target RAW image. (3) beautifying the target RAW image, adding filters, adding watermarks, etc.

[0353] S316, the camera HAL sends the original image (first-stage image) to the storage service.

[0354] S317, the storage service stores the original image (first-stage image) into the storage space corresponding to the file system.

[0355] In some embodiments, the original image may be stored in the file system at / Storage / DCIM / Camera / . The original image is stored in the file system under the name of the original image in the photo capture command, for example, IMG-2024-enhance-001.

[0356] In some embodiments, after storing the original image, the storage service can also manage the target thumbnail corresponding to the original image, for example, by deleting the target thumbnail from the thumbnail buffer.

[0357] S318, the storage service sends the original image information to the media database.

[0358] The image information mentioned above may include the original image size, resolution, exposure time, name information, acquisition time, acquisition location, and information of the camera sensor that acquired the image.

[0359] S319, The media database associates the image information of the original image with database record a.

[0360] S320, the media database notifies the gallery database to synchronize.

[0361] In some embodiments, the media database may send a synchronization notification to the gallery database, such as a first data synchronization notification. Optionally, the synchronization notification may or may not carry target name information.

[0362] S321, The image library database associates the image information of the original image with database record b.

[0363] Understandably, both database record a and database record b contain target name information. Optionally, when the synchronization notification includes target name information, the image library database can locate database record a in the media database according to the target name information, obtain the image information of the original image associated with database record a, and associate it with database record b. Optionally, when the synchronization notification does not include target name information, the image library database determines that database record b has not yet been associated with the image information of the original image and the AI-enhanced image, locates database record a in the media database according to the target name information in database record b, obtains the image information of the original image associated with database record a, and associates it with database record b.

[0364] S322, the camera application detected an event that triggered an exit.

[0365] For example, in the scenario shown in Figure 9(b), the event that triggers exit could be detecting a user swiping up to exit. Alternatively, the aforementioned event could also be detecting an action instructing the user to close the camera app, or detecting an unexpected event requiring the camera app to be closed.

[0366] S323, Camera app notification storage service, the camera app has exited.

[0367] S324, Storage service instructs dump service to begin synthesizing AI-enhanced graph.

[0368] For example, the storage service sends a synthesis instruction 1 to the dump service. This synthesis instruction 1 does not contain any name information.

[0369] S325, the dump service retrieves the RAW graphs stored in cache queue 3 in the order they were stored in cache queue 3 to generate the corresponding AI augmented graphs.

[0370] In some embodiments, if the buffer queue 3 includes multiple frames of RAW images, and the RAW images in the buffer queue 3 are all images obtained through image fusion (e.g., called fused RAW images), the RAW images in the buffer queue 3 correspond one-to-one with the shooting instructions. The dumping decision framework of the dumping service responds to the synthesis instruction 1 and retrieves the RAW images stored in the buffer queue 3 sequentially according to the order in which they were stored. Then, the AI-enhanced image processing path generates the corresponding AI-enhanced image. After retrieving the target RAW image generated in S313, the process proceeds to S326.

[0371] In a possible embodiment, cache queue 3 does not directly store the fused RAW images of each shooting command, but instead stores multi-frame RAW images corresponding to each shooting command. In this embodiment, if cache queue 3 already stores RAW images of multiple shooting commands, the dumping decision framework, in response to synthesis command 1, sequentially retrieves the multi-frame RAW images corresponding to each shooting command from cache queue 3 according to the order of the shooting timestamps of the shooting commands. Then, the node performing image fusion can fuse the multi-frame RAW images of each shooting command to obtain each fused RAW image. Afterwards, the corresponding AI-enhanced image is generated by the AI-enhanced image processing path.

[0372] The following S326 to S332 are examples of obtaining the target RAW image corresponding to the photo capture command in S302.

[0373] S326, After the dump service retrieves the target RAW graph from cache queue 3, it generates the corresponding AI-enhanced graph (two-stage graph) based on the target RAW graph.

[0374] As one implementation method, the AI-enhanced image processing path in the dump service can perform one or more image processing operations based on the target RAW image to obtain the corresponding AI-enhanced image, i.e., a two-stage image. For example, the above one or more image processing operations may include: (1) using the AIGC algorithm to enhance the image features of the target RAW image at the AI ​​level. (2) performing noise reduction. (3) adjusting the display effect of the target RAW image according to the 3A data of the target RAW image. (4) adding watermarks, etc.

[0375] S327, the dump service sends an AI-enhanced graph (two-stage graph) to the storage service.

[0376] S328, the storage service stores the AI-enhanced graph (two-stage graph) in the storage space corresponding to the file system. The storage address of the AI-enhanced graph is different from the storage address of the original graph.

[0377] Furthermore, the storage path of the AI-enhanced image in the file system can be the same as or different from the storage path of the original image, and the actual storage addresses will be different. When the storage paths of the AI-enhanced image and the original image are the same, both the AI-enhanced image and the original image can be found at different storage addresses within that same storage path. Additionally, the storage name of the AI-enhanced image in the file system is the same as the name information of the AI-enhanced image in the photo-taking command.

[0378] S329, the storage service sends image information of AI-enhanced graphs to the media database.

[0379] The aforementioned image information may include the image size, resolution, exposure time, name information, acquisition time, acquisition location, and information of the camera sensor that acquired the image, etc.

[0380] S330, the media database associates the image information of the AI-enhanced image with database record a.

[0381] In a possible embodiment, after associating the image information of the AI-enhanced image with database record a, the image information of the original image associated with database record a can be deleted, or it can be left undeleted; this application embodiment does not limit this.

[0382] S331, the media database notifies the gallery database to synchronize.

[0383] For example, sending a second data synchronization notification to the gallery database.

[0384] S332, The image library database associates the image information of the AI-enhanced image with database record b.

[0385] In some embodiments, the implementation details of S331 and S332 described above can be found in S320 and S321, and will not be repeated here.

[0386] After synchronizing the image information of the AI-enhanced image with the gallery database, other applications can view and manipulate the AI-enhanced image of the target thumbnail through the gallery database.

[0387] After associating the AI-enhanced image information with database record b, if the scenarios shown in Figures 7(a) and (b) occur, database record b (corresponding to database record 1 in the aforementioned embodiment) and database record a can be deleted. The storage information of the AI-enhanced image and the original image in the file system is modified; for example, special fields in the original name information are removed to obtain new name information (i.e., the fourth name). New database records for the original image and the AI-enhanced image are added to both the image library database and the media database. The newly added database record for the original image contains the new name information for the original image. The newly added database record for the AI-enhanced image contains the new name information for the AI-enhanced image (i.e., the second name).

[0388] In one possible implementation, database records b and a can be left undeleted. Instead, new original image and AI-enhanced image records with the new names can be added to the file system. Then, new database records for the original image and AI-enhanced image can be added to both the image library database and the media database. The name information in the new database records does not contain any special fields.

[0389] After associating the AI-enhanced image information with database record b, if the scenario of deleting the AI-enhanced image occurs as shown in Figures 8(a) and (b), database records b and a can also be deleted. The AI-enhanced image stored in the file system is deleted, and the name information of the original image in the file system is modified. A new database record for the original image is added to both the image library database and the media database. Similarly, if the scenario of deleting the original image occurs, database records b and a can also be deleted. The original image stored in the file system is deleted, and the name information of the AI-enhanced image in the file system is modified. A new database record for the AI-enhanced image is added to both the image library database and the media database.

[0390] Following S322 shown in Figure 14, the electronic device needs to synthesize the AI-enhanced images corresponding to each target RAW image in the cache queue 3 one by one. For example, in the scenarios shown in Figure 9(b), (c), and (d), after the electronic device exits the camera application, it begins to synthesize the AI-enhanced images corresponding to each target RAW image in the cache queue 3 one by one. During this process, if a user instructs to view an ungenerated AI-enhanced image is detected, or if a user instructs to view an AI-enhanced image that is being generated but not yet completed is detected, as shown in Figure 15, the signaling interactions between the various software and hardware modules in the electronic device are as follows:

[0391] S401, the gallery application receives a request from the user to select a target thumbnail.

[0392] As shown in Figure 4(a), the gallery entry control 306 displays a target thumbnail (i.e., thumbnail 308). After detecting a user's action on the gallery entry control 306, the camera application switches to the background, and the gallery application switches to the foreground. In this scenario, the gallery application can determine that it has received an action to select the target thumbnail.

[0393] As shown in Figure 9(d), the grid browsing interface 905 includes a target thumbnail (e.g., thumbnail 902). During the display of the grid browsing interface 905 of the gallery application, if a user action on thumbnail 902 is detected, it can be determined that the user has selected thumbnail 902; that is, the gallery application can determine that it has received an action to select the target thumbnail.

[0394] S402, The gallery application instructs the gallery database to search for the database record b corresponding to the target thumbnail.

[0395] S403, The image database determines that database record b contains identifier 1, and an AI-enhanced image of the target thumbnail that has not yet been synthesized.

[0396] In some embodiments, the gallery database can determine whether an AI-enhanced image of the target thumbnail has been generated by checking whether database record b has been associated with image information of the AI-enhanced image.

[0397] In the scenarios shown in Figure 9(b), (c), and (d), if a user selects a target thumbnail before executing S326, the gallery application can respond to this operation by instructing the gallery database to search for database record b. In this scenario, the found database record b contains identifier 1 and is not associated with image information of the AI-enhanced image. That is, the gallery database can determine that database record b contains identifier 1 and that the AI-enhanced image of the target thumbnail has not yet been synthesized, and executes S404. Furthermore, the electronic device no longer executes S326 to S332.

[0398] In the scenario shown in Figure 4(a), an action by the user selecting a target thumbnail is detected. In response to this action, the gallery application can instruct the gallery database to search for database record b. In this scenario, the found database record b contains identifier 1 but does not contain image information associated with the AI-enhanced image, and S404 is executed.

[0399] In other embodiments, if database record b includes identifier 1 and has associated image information of AI-enhanced graph, S403-S416 can be skipped, and S417 and S418 can be executed instead.

[0400] S404, The gallery database sends notification message 1 to the gallery application, indicating that the AI-enhanced image of the target thumbnail has not yet been synthesized.

[0401] In some embodiments, the notification information 1 may include the name information of the AI-enhanced image and an identifier indicating that it has not been synthesized. When the database record b is associated with the image information of the original image, the notification information 1 may also include the name information of the original image and an identifier indicating that it has been synthesized.

[0402] S405, the gallery application displays the original image corresponding to the target thumbnail, and displays the animation awaiting AI enhancement processing.

[0403] In some embodiments, if the notification message 1 carries the name information of the original image, the gallery application can search for the original image in the file system according to the name information and display it. If the notification message 1 does not carry the name information of the original image, the gallery application can search for the target thumbnail from the thumbnail buffer and display it.

[0404] In some other embodiments, if the notification message 1 does not carry any name information, but only carries an identifier indicating that the AI-enhanced graph has not been synthesized, S405 may not be executed.

[0405] In addition, the aforementioned animation for waiting for AI enhancement processing can be an animation effect that connects the waiting reminder information 403 shown in Figure 4(b) and the completion reminder information 404 shown in Figure 4(c).

[0406] S406, The image library application indicates that the AI-enhanced image corresponds to the synthesized target thumbnail of the storage service.

[0407] For example, a gallery app can view the storage name of a target thumbnail, i.e., the target name information, through the gallery database. Then, the gallery app sends a compositing instruction 2 to the storage service, which includes the target name information.

[0408] S407, Storage Service Instructs the camera HAL dump service to synthesize the target thumbnail corresponding to the AI-enhanced image.

[0409] For example, the storage service can send a synthesis instruction 2 to the dump service, triggering the dump service to prioritize the synthesis of the AI-enhanced image corresponding to the target thumbnail.

[0410] S408, The dump service has identified an AI-enhanced image for which the synthesis of the target thumbnail has not yet begun.

[0411] In some embodiments, if the dump service has already started synthesizing the AI ​​augmentation graph before receiving the synthesis instruction 2, it can be determined whether the AI ​​augmentation graph being synthesized is related to the synthesis instruction 2.

[0412] In an embodiment where the target name information is the name information of the AI ​​augmentation graph, the dump service can determine whether the name information of the AI ​​augmentation graph being synthesized is the same as the target name information in synthesis instruction 2. If they are the same, it indicates that the AI ​​augmentation graph being synthesized is related to synthesis instruction 2. If they are different, it indicates that the AI ​​augmentation graph being synthesized is not related to synthesis instruction 2.

[0413] In an embodiment where the target name information is the name information of the original image, the dump service can determine whether the photo capture command corresponding to the AI-enhanced image being synthesized contains the target name information from synthesis command 2. If it does, it indicates that the AI-enhanced image being synthesized is related to synthesis command 2. If it does not, it indicates that the AI-enhanced image being synthesized is unrelated to synthesis command 2.

[0414] Optionally, if the AI ​​augmentation graph being synthesized is related to synthesis instruction 2, S408 and S409 are not executed, and S411 to S418 are executed directly after the AI ​​augmentation graph is generated.

[0415] Optionally, if the AI ​​augmentation graph being synthesized is unrelated to synthesis instruction 2, pause the processing of the AI ​​augmentation graph being generated and execute S409.

[0416] S409, the dump service retrieves the target RAW image corresponding to the target thumbnail from cache queue 3.

[0417] Understandably, after storing the RAW image corresponding to the photo capture command (e.g., the target RAW image) in cache queue 3, the information carried by the photo capture command can be added to the target RAW image to associate the photo capture command with that RAW image. In this way, the dump service can also find the target RAW image in cache queue 3 through the target name information of the target thumbnail.

[0418] S410, the dump service generates an AI-enhanced graph corresponding to the target RAW graph.

[0419] S411, the dump service sends an AI-enhanced graph to the storage service.

[0420] S412, the storage service stores the AI-enhanced graph in the file system's storage space.

[0421] S413, the storage service sends image information of AI-enhanced graphs to the media database.

[0422] S414, the media database connects the image information of the AI-enhanced graph with database record a.

[0423] S415, the media database notifies the gallery database to synchronize.

[0424] S416, the media database associates the AI-enhanced graph with database record b.

[0425] In some embodiments, the implementation details of S410 to S416 can be found in S326 to S332, and will not be repeated here.

[0426] S417, the gallery database sends notification message 2 to the gallery application, indicating that the AI-enhanced image of the target thumbnail has been synthesized.

[0427] For example, the notification information 2 mentioned above includes the name information of the AI-enhanced graph and an identifier indicating that the AI-enhanced graph has been synthesized.

[0428] S418, the gallery application retrieves an AI-enhanced image of the target thumbnail from the file system and displays it.

[0429] In some embodiments, the gallery application can locate and display stored AI-enhanced images in the file system's storage space by using the image's name information. For example, AI-enhanced image 406 is displayed on the large image preview interface 405 shown in Figure 4(d). Another example is AI-enhanced image 911 being displayed on the large image preview interface 910 shown in Figure 9(f).

[0430] In other embodiments, after S322 shown in FIG14 but before the electronic device begins to synthesize the AI-enhanced image, if the user's instruction to view the target thumbnail has been detected, S401 to S418 shown in FIG15 can also be executed. For example, in the scenario shown in FIG4(c), after the electronic device detects the user's instruction to display the large image data of the target thumbnail, it can immediately generate the AI-enhanced image of the target thumbnail by executing S401 to S418.

[0431] In the foregoing embodiments, both the generated original image and the AI-enhanced image can be watermarked. In some embodiments, if an indication to enable the watermark function is detected, such as in the scenario shown in Figure 2(b), where the user selects the watermark icon 202-4, the watermark function is enabled. After enabling the watermark function, before generating the original image and the AI-enhanced image, it is necessary to determine the watermark information applicable to the original image and the watermark information applicable to the AI-enhanced image. This watermark information includes watermark text, watermark size, and other information. Thus, when compositing the original image and the AI-enhanced image, the watermark can be superimposed on both.

[0432] As shown in Figure 16, after enabling the watermark function, following steps S301 and S302, the following steps are also included:

[0433] S501, the camera HAL generates return information corresponding to the shooting command. The return information includes indicators indicating whether the AI ​​enhancement function and the one-shot-multiple-captures-one-shots-features function are effective, as well as the image sizes of the original image and the AI-enhanced image to be generated.

[0434] For example, when status flag 1 is the second value and status flag 2 is the fourth value, the returned information carries an indicator indicating that the AI ​​enhancement function and the one-shot-multiple-capture function are effective. When status flag 1 is the first value and status flag 2 is the third value, the returned information carries an indicator indicating that the AI ​​enhancement function and the one-shot-multiple-capture function are not effective. When status flag 1 is the second value and status flag 2 is the third value, the returned information carries an indicator indicating that the AI ​​enhancement function is effective and an indicator indicating that the one-shot-multiple-capture function is not effective.

[0435] In addition, the required image sizes for the original image and AI-enhanced image can be determined based on the camera sensor's output mode and the image parameters pre-configured for the original image and AI-enhanced image.

[0436] S502, the camera HAL sends a return message to the camera application.

[0437] S503, when the returned information indicates that the AI ​​enhancement function and the one-shot-multiple-captures function are both effective, the camera application generates watermark information 1 corresponding to the original image.

[0438] S504, the camera application sends watermark information 1 to the camera HAL.

[0439] S505, the camera HAL stores watermark information 1, which is used to overlay the original image synthesized by the camera HAL.

[0440] Then, when executing S313, the camera HAL can add watermark information 1 to the original image.

[0441] S506, when the returned information indicates that the AI ​​enhancement function and the one-shot-multiple-captures function are both effective, the camera application generates watermark information 2 corresponding to the AI ​​enhancement image.

[0442] In some embodiments, watermark information 1 may also be referred to as first watermark information. Watermark information 2 may also be referred to as second watermark information. Watermark information 1 includes the first watermark image and text, and watermark information 2 includes the second watermark image and text. The first watermark image and text and the second watermark image and text are the same. Of course, when the image sizes of the original image and the AI-enhanced image are different, the watermark size and watermark overlay position corresponding to watermark information 1 and watermark information 2 may be different. For example, the first watermark size in watermark information 1 and the second watermark size in watermark information 2 are different, and the first watermark addition position in watermark information 1 and the second watermark addition position in watermark information 2 are different.

[0443] S507, The camera application sends watermark information 2 to the camera HAL dump service.

[0444] S508, the watermark information 2 is stored by the dump service and used to overlay on the AI-enhanced image synthesized by the dump service.

[0445] Subsequently, when executing S322, the dump service can add watermark information 2 to the AI-enhanced graph.

[0446] Some embodiments of this application also provide an electronic device, which may include a memory and one or more processors. The memory and processors are coupled. The memory is used to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device can perform various functions or steps performed by the electronic device in the above method embodiments.

[0447] This application also provides a computer-readable storage medium including computer instructions that, when executed on the electronic device, cause the electronic device to perform various functions or steps performed by the mobile phone in the above method embodiments.

[0448] This application also provides a computer program product that, when run on an electronic device, causes the electronic device to perform various functions or steps performed by the mobile phone in the above method embodiments.

[0449] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0450] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0451] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0452] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0453] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0454] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An image generation method, characterized in that, Applied to electronic devices, the method includes: In response to a first operation instructing to take a picture, a first thumbnail and a first image corresponding to the first thumbnail are generated, wherein the resolution of the first image is higher than that of the first thumbnail. In response to an operation applied to the first thumbnail: a first interface is displayed, the first interface including the first image, the first interface not containing an aggregation control; after displaying the first interface, a second interface is displayed, the second interface including a second image and the aggregation control, the second image having a higher resolution than the first image; Upon receiving an operation applied to the aggregation control, a third interface is displayed, which includes the first image and the second image.

2. The method according to claim 1, characterized in that, Before detecting the first operation, the method further includes: In response to an instruction to open the camera application, a shooting preview interface of the camera application is displayed, the shooting preview interface including shooting controls; The first thumbnail generation in response to the first operation of instructing to take a picture includes: generating the first thumbnail based on the RAW image acquired by the camera sensor in response to the first operation applied to the shooting control; After generating the first thumbnail, the method further includes: displaying the first thumbnail on the shooting preview interface; The operation applied to the first thumbnail includes: the operation applied to the first thumbnail on the shooting preview interface.

3. The method according to claim 1, characterized in that, After generating the first thumbnail, the method further includes: In response to an instruction to open the gallery application, a grid preview interface of the gallery application is displayed, the grid preview interface including the first thumbnail, and the first thumbnail including a first aggregation icon; The operation applied to the first thumbnail includes: the operation applied to the first thumbnail on the grid preview interface.

4. The method according to claim 3, characterized in that, The first thumbnail is displayed at a first position in the grid preview interface. After displaying the second interface, the method further includes: In response to the second operation, the grid preview interface is displayed again, and a second thumbnail is displayed at the first position. The second thumbnail is a thumbnail generated based on the second image and includes a second aggregate icon.

5. The method according to claim 4, characterized in that, The method further includes: In response to an operation on the second thumbnail in the grid preview interface, the second interface is displayed, the second interface containing the second image.

6. The method according to any one of claims 1-5, characterized in that, The third interface includes a save-as-a-code control. When displaying the third interface, the method further includes: An operation applied to the Save As control has been received. After receiving an operation applied to the Save As control, in response to receiving a third operation, the grid preview interface is displayed. The grid preview interface includes both the second thumbnail and the first thumbnail. Neither the second thumbnail nor the first thumbnail includes the aggregation icon. In response to an operation on the second thumbnail, a fourth interface is displayed, which includes the second image but does not include the aggregation control; Alternatively, in response to an operation on the first thumbnail, a fifth interface is displayed, which includes the first image but does not include the aggregation control.

7. The method according to claim 6, characterized in that, Before displaying the second interface, the method further includes: determining that the first name of the second image includes target information; After receiving the operation applied to the save control, the name information of the second image is changed from the first name to the second name, and the name information of the first image is changed from the third name to the fourth name. The second name does not contain the target information, the third name includes the target information, and the fourth name does not contain the target information.

8. The method according to claim 1, characterized in that, The third interface includes a first delete control and a second delete control, the first delete control corresponding to the first image and the second delete control corresponding to the second image, and the method further includes: In response to an operation performed on the first delete control, a fourth interface is displayed, which includes the second image but does not include the aggregation control.

9. The method according to claim 8, characterized in that, Before displaying the second interface, the method further includes: determining that the first name of the second image includes target information; After receiving an operation applied to the first delete control, the method further includes: deleting the first image, and modifying the name information of the second image from the first name to a second name, wherein the second name does not contain the target information.

10. The method according to claim 1, characterized in that, The third interface includes a first area and a second area. The first area displays the first image, and the second area displays the second image. The first area is located below the second area.

11. The method according to claim 10, characterized in that, The method further includes: In response to a magnification operation applied to the first region or the second region, a first magnified partial view of the first image is displayed in the first region and a second magnified partial view of the second image is displayed in the second region, wherein the first magnified partial view has the same magnification factor relative to the first image and the second magnified partial view has the same magnification factor relative to the second image.

12. The method according to claim 11, characterized in that, The method further includes: In response to a sliding operation applied to the first region or the second region, a third magnified view of the first image is displayed in the first region and a fourth magnified view of the second image is displayed in the second region, wherein the sliding distance of the third magnified view relative to the first magnified view and the sliding distance of the fourth magnified view relative to the second magnified view are the same.

13. The method according to claim 11 or 12, characterized in that, The third interface also includes a synchronization control, which is in a locked state.

14. The method according to claim 13, characterized in that, The third interface also includes a synchronization control, which is in an unlocked state. The method further includes: In response to a magnification operation applied to the first region, a first partial magnified view of the first image is displayed in the first region, and the second image is maintained in the second region.

15. The method according to claim 1, characterized in that, The method further includes, after responding to an operation performed on the first thumbnail and before displaying the second interface, determining that the second image has not yet been generated, and generating the second image.

16. The method according to any one of claims 1-15, characterized in that, Before detecting the first operation, the method further includes: In response to an instruction to open the camera application, a shooting preview interface of the camera application is displayed, the shooting preview interface including a first function icon; After detecting the selection operation of the first function icon, it is determined that the electronic device meets the target conditions. The target conditions include: the ambient light brightness value of the space where the electronic device is located is not less than a preset brightness threshold, the number of faces in the field of view of the electronic device is greater than 0 and less than a preset number, and the area occupied by the faces in the field of view of the electronic device is not less than a preset size.

17. The method according to claim 1, characterized in that, Before detecting the first operation, the method further includes: In response to an instruction to open the camera application, a shooting preview interface of the camera application is displayed, the shooting preview interface including a first function icon; After detecting the selection operation of the first function icon on the shooting preview interface, if it is determined that the electronic device does not meet the target conditions, a first prompt message is displayed on the shooting preview interface; wherein, the target conditions include: the ambient light brightness value of the space where the electronic device is located is not less than a preset brightness threshold, the number of faces in the field of view of the electronic device is greater than 0 and less than a preset number, and the area occupied by the faces in the field of view of the electronic device is not less than a preset size. When the first prompt message is displayed, in response to receiving a fourth operation instructing to take a picture, a third thumbnail and a third image corresponding to the third thumbnail are generated, wherein the resolution of the third image is higher than that of the third thumbnail; In response to an operation performed on the third thumbnail, the third image is displayed.

18. The method according to claim 2 or 3, characterized in that, Prior to the operation performed on the first thumbnail, the method further includes: In response to an instruction to exit the camera application, the second image is generated.

19. The method according to any one of claims 1-18, characterized in that, The electronic device includes a camera sensor; the method includes: In response to an instruction to open the camera application, the camera sensor begins to acquire RAW images, and stores each frame of RAW image acquired by the camera sensor into a first queue. After detecting the first operation, the method further includes: obtaining a first RAW image corresponding to the first operation based on the RAW images already stored in the first queue, wherein the first RAW image is an image obtained by fusing multiple RAW images; and storing the first RAW image into a second queue and a third queue respectively. Generating the first image corresponding to the first thumbnail includes: generating the first image based on the first RAW image in the second queue; Before displaying the second interface, the method further includes: in response to an operation applied to the first thumbnail, performing one or more image processing operations on the first RAW image in the third queue to generate the second image; wherein the one or more image processing operations include operations to enhance image features.

20. The method according to claim 19, characterized in that, The electronic device includes a camera application and a camera hardware abstraction layer (HAL). After detecting the first operation while the camera application is running in the foreground, the method further includes: In response to the first operation, the camera application sends a photo-taking command to the camera HAL, the photo-taking command including the third name of the first image and the first name of the second image; The step of generating the first thumbnail includes: obtaining a reference RAW image corresponding to the shooting command from the first queue; generating the first thumbnail corresponding to the reference RAW image; the first thumbnail includes extended information, the extended information including a first name, a third name and a first identifier, the first identifier corresponding to the first name, indicating that the first RAW image used to generate the second image is stored in the third queue.

21. The method according to claim 20, characterized in that, The electronic device further includes a media database and a gallery database. After generating the first thumbnail, the method further includes: The camera HAL sends the first thumbnail to the camera application; In response to receiving the first thumbnail containing the extended information, the camera application stores the first thumbnail in a target storage area and writes target name information to the media database, wherein the target name information is the first name or the third name; In response to receiving the target name information, the media database generates a first database record and notifies the gallery database to create a second database record corresponding to the target name information.

22. The method according to claim 21, characterized in that, The electronic device further includes a storage service process, and after generating the first image, the method further includes: The camera HAL sends the first image to the storage service process; In response to receiving the first image, the storage service process sends the image information of the first image to the media database; The media database associates the image information of the first image with the first database record, and sends a first data synchronization notification to the image library database; In response to receiving the first data synchronization notification, the image library database associates the image information of the first image with the second database record.

23. The method according to claim 22, characterized in that, The electronic device also includes a storage service process, and after generating the second image, the method further includes: The camera HAL sends the second image to the storage service process; In response to receiving the second image, the storage service process sends the image information of the second image to the media database; The media database associates the image information of the second image with the record in the first database, and sends a second data synchronization notification to the image library database; In response to receiving the second data synchronization notification, the image library database associates the image information of the second image with the second database record.

24. The method according to claim 23, characterized in that, The storage service and the camera application operate independently of each other. After the storage service process receives the first image, the method further includes: storing the first image by the storage service process; after the storage service process receives the second image, the method further includes: storing the second image by the storage service process.

25. The method according to claim 23, characterized in that, After the camera HAL receives the photo-taking command, the method further includes: The camera HAL sends return information corresponding to the photo-taking command to the camera application. The return information includes: the image size of the first image and the image size of the second image. In response to receiving the returned information, the camera application generates first watermark information corresponding to the first image and second watermark information corresponding to the second image. The first watermark information includes first watermark text, first watermark addition position, and first watermark size; the second watermark information includes second watermark text, second watermark addition position, and second watermark size. The camera application sends the first watermark information and the second watermark information to the camera HAL. After generating the first image, the method further includes: adding the first watermark information onto the first image; After generating the second image, the method further includes adding the second watermark information onto the second image.

26. The method according to any one of claims 1-25, characterized in that, The resolution of the second image is higher than that of the first image.

27. An electronic device, characterized in that, The electronic device includes: a camera sensor, a memory, and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the camera sensor is used to acquire RAW images, the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the method as described in any one of claims 1-26.

28. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-26.

29. A computer program product, characterized in that, The computer program product includes a computer program or instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-26.

Citation Information

Patent Citations

  • Method for battery management of a battery with a charge state compensation system and battery management system

    CN106164815A

  • Image beautification effect display method and device and terminal equipment

    CN113473013A

  • Image processing method, electronic equipment and storage medium

    CN116528038A

  • Image display method and related device

    CN117014543A

  • Imaging apparatus and program

    JP2010068129A