Dynamic photo processing method and related device

By detecting and enhancing key moments in the image frames of dynamic photos, the problem of image quality differences in dynamic photo cover images is solved, achieving consistency in image quality between the replaced cover image and the original cover image, thus improving the user experience.

CN121908117APending Publication Date: 2026-04-21HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2024-10-18
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

The reduced video resolution of the dynamic photos resulted in differences in image quality between the replaced cover image and the original cover image in terms of noise detail, dynamic range, and color brightness, thus degrading the user experience.

Method used

By using electronic devices to detect highlights in the image frames of dynamic photos, the resolution of the image frames selected by the user is enhanced, and the original image data is saved so that the enhanced image frames can be used directly as cover images later, reducing unnecessary repeated enhancement operations.

Benefits of technology

Ensuring that the replaced cover image has the same or similar image quality as the original cover image improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121908117A_ABST
    Figure CN121908117A_ABST
Patent Text Reader

Abstract

The invention provides a dynamic photo processing method and a related device, in the method, when an electronic device shoots a dynamic photo, the electronic device can determine that one or more image frames in the dynamic photo are image frames at wonderful moments, and store raw data of the image frames corresponding to the images at the wonderful moments. When the user replaces the cover image of the dynamic photo, the electronic equipment performs image enhancement on the cover image reselected by the user through the raw data corresponding to the image frame at the wonderful moment, so that the image quality of the reselected cover image is the same as or similar to that of the original cover image, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic technology, and in particular to a method and apparatus for processing dynamic photographs. Background Technology

[0002] A live photo is a special type of photograph consisting of a high-resolution cover image and a short video of about 3 seconds. The cover image is a high-resolution image obtained through image signal processing (ISP) after the electronic device responds to the user's photo capture. The video is a low-resolution video obtained by caching the scene before and after the photo capture, previewing it through ISP. Compared to a regular photo, a live photo includes several seconds of scene information before and after the photo is taken. Users can reselect the cover image within the live photo's video. However, the reduced resolution of the live photo's video, along with differences in noise detail, dynamic range, color brightness, and other aspects compared to the original cover image, results in a significant difference in image quality between the reselected and original cover images, degrading the user experience. Therefore, ensuring that the replaced cover image has the same or similar image quality to the original is a pressing technical problem that needs to be solved. Summary of the Invention

[0003] This application provides a method and related apparatus for processing dynamic photos. Through this method, it can be ensured that after the cover image of the dynamic photo is changed, the changed cover image has the same or similar image quality as the original cover image.

[0004] In a first aspect, this application provides a method for processing dynamic photos. The method may include: an electronic device displaying a dynamic photo display interface, the dynamic photo display interface including a cover image of a first dynamic photo, thumbnails of N image frames of the first dynamic photo, and a first marker; the cover image of the first dynamic photo is displayed as a first cover image; the thumbnails of the N image frames include a thumbnail of the first image frame; the first marker is used to mark the thumbnail of the first image frame; the first image frame is determined to be an image frame representing a highlight moment; the electronic device stores the original image data of the first image frame; in response to a first operation, the electronic device replaces the cover image of the first dynamic photo from the first cover image with an enhanced first image frame; the enhanced first image frame is obtained by the electronic device performing image enhancement on the first image frame based on the original image data of the first image frame; the resolution of the enhanced first image frame is greater than the resolution of the first image frame.

[0005] In this way, electronic devices can enhance the image frame selected by the user using the original image data, resulting in an enhanced image frame with the same or similar image quality as the default cover image, i.e., the first cover image, which can be used as the cover image. This improves the user experience.

[0006] In conjunction with the first aspect, in one possible implementation, the method may further include: in response to the second operation, the electronic device acquires multiple raw image data; based on the multiple raw image data, it acquires a first cover image and N image frames; the electronic device performs highlight moment detection on the N image frames, or the raw image data corresponding to the N image frames, to determine the first image frame.

[0007] In this way, the electronic device can identify the image frame that is considered a highlight among N image frames, for example, the first image frame.

[0008] In conjunction with the first aspect, in one possible implementation, the multiple raw image data include first raw image data acquired when the second operation is received and N second raw image data acquired before and after the second operation is received;

[0009] The acquisition of the first cover image and N image frames based on multiple raw image data includes:

[0010] The first cover image is obtained based on the first original image data, and N image frames are obtained based on N second original image data.

[0011] In this way, the electronic device can acquire the first cover image and N image frames contained in the first dynamic photograph.

[0012] In conjunction with the first aspect, in one possible implementation, in response to the second operation, the method may further include: the electronic device displaying a dynamic photo shooting interface, the dynamic photo shooting interface including a start control and a shooting control, the start control being in a first state, the start control being used to indicate that the electronic device has started the dynamic photo shooting mode; the second operation being an operation on the shooting control.

[0013] In this way, electronic devices can also start taking dynamic photos based on user input.

[0014] In conjunction with the first aspect, in one possible implementation, after the electronic device performs highlight moment detection on N image frames or the original image data corresponding to the N image frames and determines the first image frame, the method may further include: the electronic device saving the first cover image and the N image frames, as well as saving the original image data corresponding to the first image frame.

[0015] In this way, since the original image data contains more image information, the image frame can be enhanced using the saved original image data.

[0016] In conjunction with the first aspect, in one possible implementation, the electronic device performs highlight moment detection on N image frames or the original image data corresponding to the N image frames to determine the first image frame. This may include: the electronic device determining a confidence score corresponding to each of the N image frames; the electronic device sorting the confidence scores of M image frames among the N image frames that have a confidence score greater than a confidence threshold, and determining the first image frame from the M image frames according to the sorting.

[0017] In this way, the electronic device can determine which of the N image frames is the highlight frame based on the confidence scores corresponding to the N image frames.

[0018] In conjunction with the first aspect, in one possible implementation, the method may further include: the electronic device deleting the original image data corresponding to the image frames among N image frames that are determined not to be highlights.

[0019] In this way, electronic devices only save the original image data corresponding to image frames that are determined to be highlights, and do not save the original image data of image frames that are not determined to be highlights, which can save the memory of electronic devices.

[0020] In conjunction with the first aspect, in one possible implementation, the electronic device deletes the original image data corresponding to the image frames determined not to be highlights from N image frames. Specifically, this may include: the electronic device storing the original image data corresponding to M image frames respectively into the buffer of the electronic device; the electronic device deleting the original image data corresponding to the image frames determined not to be highlights from the M image frames in the buffer, and storing the original image data corresponding to the first image frame in the buffer into the memory of the electronic device.

[0021] In this way, electronic devices can first cache the raw image data of multiple image frames, and then save the raw image data corresponding to the highlight moment in memory.

[0022] In conjunction with the first aspect, in one possible implementation, the method may further include: the electronic device performing image enhancement on the first image frame based on the original image data of the first image frame and the first cover image to obtain an enhanced first image frame; and the electronic device saving the enhanced first image frame.

[0023] In this way, the electronic device can save the enhanced first image frame. When the user changes the cover image of the first dynamic photo from the enhanced first image frame to another image frame, and then uses the first image frame as the cover image again, the electronic device can directly use the stored enhanced first image frame as the updated cover image of the first dynamic photo, without having to enhance the first image frame selected by the user to obtain the enhanced first image frame.

[0024] In conjunction with the first aspect, in one possible implementation, when the electronic device saves the original image data corresponding to the first dynamic photograph and the first image frame, the method may further include: the electronic device saving the metadata of the first dynamic photograph.

[0025] In a second aspect, an electronic device is provided, characterized in that it includes one or more processors; one or more memories; the one or more memories storing one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause the electronic device to perform the method described in any possible implementation of the first aspect above.

[0026] Thirdly, a chip is provided, the chip including a processor and a communication interface, the communication interface being used to receive a signal and transmit the signal to the processor, the processor processing the signal, causing the chip to perform the method described in any possible implementation of the first aspect above.

[0027] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a computer, causes the computer to implement the method described in any possible implementation of the first aspect above.

[0028] Fifthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to perform the method described in any possible implementation of the first aspect above.

[0029] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0030] Figure 1 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0031] Figure 2 This is a software structure diagram of the electronic device provided in the embodiments of this application;

[0032] Figures 3A-3D This is a schematic diagram of the user interface for enabling the dynamic photo shooting function provided in an embodiment of this application;

[0033] Figure 4 This is a schematic diagram illustrating the principle of generating dynamic photos using an electronic device provided in an embodiment of this application;

[0034] Figure 5 This is a schematic diagram of a user interface of an electronic device provided in an embodiment of this application;

[0035] Figure 6 This is a schematic diagram of a user interface of an electronic device provided in an embodiment of this application;

[0036] Figure 7 This is a schematic diagram of a user interface of an electronic device provided in an embodiment of this application;

[0037] Figure 8 This is a schematic diagram of a user interface of an electronic device provided in an embodiment of this application;

[0038] Figure 9 This is a flowchart illustrating a method for processing dynamic photos provided in an embodiment of this application;

[0039] Figure 10 This is a schematic diagram of a highlight detection process provided in an embodiment of this application;

[0040] Figure 11 This is a schematic diagram illustrating the flow of dynamic photo-related image data provided in the embodiments of this application;

[0041] Figure 12 This is a schematic diagram of a user interface of an electronic device provided in an embodiment of this application;

[0042] Figure 13 This is a schematic diagram of the input and output of the cover reselection model provided in the embodiments of this application;

[0043] Figure 14 This is a schematic diagram of the related image data of the stored dynamic photos provided in the embodiments of this application;

[0044] Figure 15 This is a schematic diagram of the structure of the electronic device 1500 provided in the embodiments of this application. Detailed Implementation

[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0046] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. The terms “first” and “second” are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as “first” or “second” may explicitly or implicitly include one or more of that feature. “First” and “second,” etc., are used to distinguish different objects, not to describe a particular order of objects. For example, a first object and a second object are used to distinguish different objects, not to describe a particular order of objects.

[0047] In the description of the embodiments in this application, unless otherwise stated, "multiple" means two or more. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.

[0048] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or related scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0049] The term "and / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A existing alone, A and B existing simultaneously, and B existing alone.

[0050] The term "user interface (UI)" used in the following embodiments of this application refers to the medium interface through which an application or operating system interacts and exchanges information with the user. It realizes the conversion between the internal form of information and the form that the user can accept. The user interface is source code written in a specific computer language such as Java or Extensible Markup Language (XML). The interface source code is parsed and rendered on the electronic device, ultimately presenting content that the user can recognize. A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be visible interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets displayed on the screen of an electronic device.

[0051] To better understand the technical solutions provided in this application, before describing the technical solutions, we will first introduce, in conjunction with the accompanying drawings, the electronic device to which this application applies, which has the function of capturing dynamic photos and changing dynamic photo cover images. In some embodiments, the electronic device may be a portable electronic device that also includes other functions such as a personal digital assistant and / or music player, such as a mobile phone, tablet computer, wearable electronic device with wireless communication capabilities (such as a smartwatch), etc. Exemplary embodiments of the portable electronic device include, but are not limited to, devices equipped with... Alternatively, it can be a portable electronic device with another operating system. The aforementioned portable electronic device can also be other portable electronic devices, such as laptops. It should also be understood that in some other embodiments, the aforementioned electronic device may not be a portable electronic device, but rather a desktop computer. This application does not limit the specific form or type of the electronic device.

[0052] The exemplary electronic device 100 provided in the embodiments of this application will be introduced first below.

[0053] Figure 1 This is a schematic diagram of the structure of the electronic device 100 provided in the embodiments of this application.

[0054] The following detailed description uses electronic device 100 as an example. It should be understood that electronic device 100 may have more or fewer components than shown in the figures, may combine two or more components, or may have different component configurations. The various components shown in the figures can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.

[0055] Electronic device 100 may include: processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc.

[0056] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0057] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0058] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0059] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

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

[0061] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0062] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.

[0063] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0064] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.

[0065] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.

[0066] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0067] The SIM interface can be used to communicate with the SIM card interface 195 to transmit data to or read data from the SIM card.

[0068] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

[0069] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0070] The charging management module 140 is used to receive charging input from the charger. The charger can be a wireless charger or a wired charger.

[0071] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc.

[0072] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0073] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0074] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0075] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0076] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0077] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0078] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0079] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.

[0080] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0081] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and color. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0082] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

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

[0084] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0085] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0086] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0087] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application required for a function (such as facial recognition, fingerprint recognition, mobile payment, etc.). The data storage area may store data created during the use of electronic device 100 (such as facial information template data, fingerprint information templates, etc.). Furthermore, internal memory 121 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0088] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0089] Audio module 170 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. Audio module 170 can also be used for encoding and decoding audio signals. In some examples, audio module 170 may be located in processor 110, or some functional modules of audio module 170 may be located in processor 110. Speaker 170A, also called a "loudspeaker," is used to convert audio electrical signals into sound signals. Receiver 170B, also called a "handset," is used to convert audio electrical signals into sound signals. Microphone 170C, also called a "microphone" or "microphone," is used to convert sound signals into electrical signals. Headphone jack 170D is used to connect wired headphones.

[0090] The sensor module 180 may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, gravity sensors, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, bone conduction sensors, etc.

[0091] The gyroscope sensor can be used to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes) can be determined by the gyroscope sensor. The offset angle of the electronic device 100 can also be determined by the gyroscope sensor.

[0092] An accelerometer can detect the magnitude of acceleration of an electronic device 100 in various directions (typically three axes). In some embodiments, the accelerometer can be used to identify the posture of the electronic device 100, and can be applied to applications such as screen orientation switching and pedometers.

[0093] Magnetic sensors can include Hall effect sensors, magnetometers, and so on.

[0094] Buttons 190 include a power button, volume buttons, etc. Motor 191 can generate vibration feedback. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, and also to indicate messages, missed calls, notifications, etc.

[0095] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and detach from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The electronic device 100 interacts with the network through the SIM card to achieve functions such as calls and data communication. In some examples, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be removed from it.

[0096] Figure 2 This is a software structure diagram of an electronic device 100 according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. The following will combine... Figure 2 The modules involved in the embodiments of this application are described. In some embodiments, the system can be divided into four layers, from top to bottom: the application layer, the application framework and service layer, the hardware abstraction layer (HAL), and the kernel layer. The application layer may include a series of application packages.

[0097] like Figure 2 As shown, the application layer can include camera, settings, third-party applications, etc. Third-party applications can include gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, etc.

[0098] The application framework and service layer provide application programming interfaces (APIs) and programming frameworks for applications in the application layer. The application framework and service layer can include some predefined functions.

[0099] like Figure 2 As shown, the application framework and service layer may include camera service, media library, activity management service, resource manager, phone manager, notification management service, window manager, content provider, view system, etc.

[0100] The camera service is used to notify the camera module to start shooting in order to save the cover image and video frames, which are generated by the ISP module.

[0101] In some examples, the camera service may also include a highlight detection service, which can be used to detect whether a video frame belongs to a highlight moment image frame. Specific detection methods are described below and will not be repeated here.

[0102] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0103] Activity management services are used to manage activities, such as managing their lifecycle. An activity is a component that can contain a user interface and is primarily used to interact with the user, such as making a phone call, sending an email, and viewing a map. Most of the content that users see in an application is provided by activity components, and an application can include multiple activities.

[0104] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0105] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0106] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0107] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).

[0108] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0109] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog-style notifications on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0110] The Hardware Abstraction Layer (HAL) is a software layer that shields upper-layer applications from the underlying hardware. Upper-layer applications do not need to care about how the underlying hardware works; the underlying hardware only needs to provide a unified interface to the upper layers through the HAL.

[0111] like Figure 2 As shown, the hardware abstraction layer includes a camera module, an ISP module, a cover image reselection algorithm module, and a file system.

[0112] The camera module is used to acquire raw image data.

[0113] The ISP module is used to generate cover images and video frames based on the raw image data.

[0114] The cover image reselection algorithm module is used to generate a new cover image.

[0115] A file system is used to manage various data within the system. For example, a file system can be used to manage animated photo files, which may include the photo's cover image, video, metadata, raw data of highlights, and so on. When a user reselects a cover image for an animated photo, the file can also include the reselected cover image.

[0116] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0117] It should be noted that, Figure 2 This example only illustrates one way of dividing the system framework and should not be construed as a specific limitation on the embodiments of this application. In the embodiments of this application, different frameworks can be used for different operating systems when the electronic device is equipped with different operating systems. It is understood that when different frameworks are adopted, the way the framework is divided into layers, the specific naming, and the specific layer in which each module is located can be different. For example, the hardware abstraction layer and the kernel layer can be referred to as the kernel layer.

[0118] An electronic device can store image frames captured within a preset time period (e.g., 1.5 seconds) before the user presses the shutter and image frames captured within the preset time period after the shutter is pressed as a video. The image frames captured at the moment the user presses the shutter are stored as still photos. Then, the video and still photos are combined to create a live photo. The still photos can serve as the default cover image for the live photo. In other words, the live photo stored by the electronic device consists of two parts: a cover image and a video containing multiple image frames. The live photo stored by the electronic device includes two files: an image file storing the cover image and a video file storing the video. These image and video files can be associated, for example, with the same filename but different file extensions. The video in the live photo may contain image frames corresponding to the cover image. The cover image can be the same as its corresponding image frame, or it can be obtained by processing that corresponding image frame.

[0119] In this application embodiment, the storage of dynamic photos is not limited to the storage of video based on image frames captured within a period of time before and after the user presses the shutter. It is also possible to store video based solely on image frames captured within a period of time before the user presses the shutter (which may include the moment the user presses the shutter) or solely on image frames captured within a period of time after the user presses the shutter (which may include the moment the user presses the shutter).

[0120] Still photos, as opposed to moving images, typically present a static image to the user's perception, rather than a dynamic one like a moving image. Still photo formats include, but are not limited to, Joint Photographic Experts Group (JPEG or JPG) and Protable Network Graphics (PNG).

[0121] The video file formats include, but are not limited to: avi, wmv, mpeg, mp4, m4v, mov, asf, flv, f4v, rmvb, rm, 3gp, vo, RMVB, MOV, etc.

[0122] Image file formats include, but are not limited to: JPG, PNG, GIF, PSD, TIF, BMP, etc.

[0123] Next, we will explain how electronic device 100 captures dynamic photos.

[0124] Enable live photo shooting function

[0125] Before taking a video, the electronic device 100 needs to enable the video shooting function.

[0126] The dynamic photo shooting function refers to the electronic device 100 automatically acquiring at least one image frame within a first time period before the user clicks the shutter, multiple image frames within a second time period after the user clicks the shutter, and then acquiring a cover image after that. The electronic device 100 can then generate a dynamic photo based on these multiple image frames and the cover image, and store the dynamic photo in a gallery application (or simply a gallery).

[0127] In embodiments of this application, clicking can include: touching (down) and lifting (up). That is, the user's finger or stylus touches the screen for a preset time and then lifts it.

[0128] First, let me explain how electronic device 100 enables the live photo shooting function.

[0129] in, Figures 3A-3D An exemplary diagram of the user interface of an electronic device 100 for enabling the dynamic photo shooting function is shown.

[0130] like Figure 3A As shown, the electronic device 100 can display a desktop 300, which displays a page containing application icons. This page includes multiple application icons (e.g., settings app icon, app store app icon, gallery app icon, browser app icon, etc.). Below the multiple application icons, a page indicator is displayed to indicate the total number of desktops, the position of the negative one screen, the position of the currently displayed desktop, and the positional relationship between the currently displayed desktop and other desktops. Below the page indicator, a tray area or dock is displayed. The tray area includes multiple tray icons, such as a camera app icon, a contacts app icon, a phone app icon, and a messaging app icon. The tray area remains displayed when switching pages. In some embodiments, the page may also include multiple application icons and a page indicator. The page indicator may not be part of the page and may exist independently. The tray icons are also optional, and this embodiment does not limit this.

[0131] Electronic device 100 can receive user input (e.g., a click) on a camera application icon, and in response to this input, electronic device 100 can display, for example... Figure 3B The user interface shown. Figure 3B This is a user interface for shooting and display services provided by an electronic device 100 according to an embodiment of this application, and can also be referred to as a camera preview interface.

[0132] like Figure 3B As shown, the preview interface may include a mode bar 311, a shooting control 312, a camera switching control 313, a display control 314, and a preview window 315.

[0133] The mode bar 311 may include multiple shooting mode options, such as "Night Scene," "Portrait," "Photo," and "Video." Different shooting modes provide users with different shooting effects. Users can select any of the multiple shooting modes to shoot according to different needs. For example, "Photo" can be the default shooting mode for taking photos. "Video" is used for recording videos. "Night Scene" mode is suitable for shooting scenes with low light, such as at night. "Portrait" mode is suitable for shooting scenes where the subject is a person. Electronic device 100 may also provide more shooting modes, such as "Large Aperture," "Movie," and "Professional," which will not be listed here.

[0134] The electronic device 100 can detect user operations performed on the shooting mode options in the mode bar 311, and change the currently used shooting mode according to the user operations. These user operations include, for example, left / right swipes. For instance, when the device detects a left swipe (left swipe) on the mode bar 311, causing the cursor to stop at the "Portrait" option, the electronic device 100 can switch to "Portrait" mode. By default, the electronic device 100 first uses "Photo" mode.

[0135] The shooting control 312 is used to trigger taking a picture. The electronic device 100 can detect whether there is a user operation on the shooting control 312, such as a click operation. When a user operation on the shooting control 312 is detected, the electronic device 100 can generate a photo-taking command. The electronic device 100 can acquire the image reported by the camera with the corresponding timestamp according to the photo-taking command, and then save it as a photo.

[0136] The camera switching control 313 can be used to switch the camera that the electronic device 100 uses to capture images (e.g., switching the front camera to the rear camera, and vice versa).

[0137] The echo control 314 can be used to browse thumbnails of captured photos / videos. When a user operation is detected on the echo control 314, the electronic device 100 can also display the photo or video corresponding to the thumbnail.

[0138] The preview window 315 can be used to display images reported by the camera in real time. In different shooting modes, the electronic device 100 can process the images reported by the camera to improve the image display effect. For example, in "portrait" mode, the electronic device 100 can blur the background in the image reported by the camera to highlight the portrait. Here, the preview window 315 can display the images processed by the image processing algorithms corresponding to different shooting modes in real time, allowing the user to perceive the shooting effects corresponding to different shooting modes in real time.

[0139] The preview interface also includes a quick access area 316. For example... Figure 3BAs shown, the quick access control area 316 may include a smart barcode scanning control 316A, a dynamic photo shooting mode control 316B, an AI scene recognition control 316C, a flash control 316D, a filter mode control 316E, and a settings control 316F. The smart barcode scanning control 316A can be used to trigger the electronic device 100 to recognize QR codes, barcodes, or multi-function codes when enabled. The dynamic photo shooting mode control 316B can be used to generate a dynamic photo when the user presses the shutter button when enabled. When the dynamic photo shooting mode control 316B is off, the electronic device 100 does not have the dynamic photo shooting function enabled. The AI ​​scene recognition control 316C can be used to trigger the electronic device 100 to recognize the shooting scene in the preview screen when enabled, and recommend shooting modes based on the shooting scene. Currently, the AI ​​scene recognition control 316C is off. The flash control 316D can be used to trigger the electronic device 100 to turn the flash on or off. The filter mode control 316E can be used to trigger the electronic device 100 to process the image captured by the camera using a color filter. The setting control 316F can be used to set the shooting parameters of the electronic device 100 (e.g., image size, image storage format, etc.).

[0140] Figure 3B The camera interface in normal shooting mode is shown. In normal shooting mode, the preview stream supports a zoom range of 0.5x to 10x. The current zoom value is 1x.

[0141] For example, such as Figure 3B As shown, after the electronic device 100 first enters the camera application, if the dynamic photo shooting mode control 316B is in the off state, the electronic device 100 can display... Figure 3B The displayed message "Click to enable live photos" prompts the user to enable the live photo shooting function.

[0142] For example, such as Figure 3C As shown, the electronic device 100 can receive user input (e.g., click, tap) on the dynamic photo shooting mode control 316B in the preview interface, and in response to the user's input, the electronic device 100 can display... Figure 3D The preview interface shown. Figure 3D In the preview interface shown, the dynamic photo shooting mode control 316B has switched its display format, such as darkening the color and removing the diagonal lines, to indicate that the dynamic photo shooting function of the electronic device 100 has been enabled.

[0143] Optionally, after the electronic device 100 enables the live photo shooting function, the electronic device 100 can display... Figure 3D The message displayed reads, "After enabling Live Photos, long-pressing a photo will display a live effect," indicating that users can view multiple frames in a live photo by long-pressing.

[0144] Figure 4 A schematic diagram illustrating the principle of how electronic device 100 generates dynamic photos is shown.

[0145] After the electronic device 100 activates the dynamic photo capture function, it can begin caching multiple image frames acquired within a first duration (1.5 seconds) prior to the current time. As the preview time increases, the electronic device 100 can refresh at least one image frame stored for the first duration, clearing previously stored image frames. Optionally, each image frame carries a timestamp, which can be generated by the camera. In this document, the first duration is not limited to 1.5 seconds; it can be set according to requirements in practical applications.

[0146] After detecting that the user has pressed the shutter button, the electronic device 100 can continue to buffer the user's shutter press and at least one image frame acquired within a second duration (1.5 seconds). The second duration is not limited to 1.5 seconds and can be set according to requirements in practical applications.

[0147] In one possible implementation, the electronic device 100 may use a single image frame captured at the moment the user presses the shutter as the default cover image of the video. In other possible implementations, the default cover image may be at least one image frame before the user presses the shutter, or at least one image frame after the user presses the shutter, or the image frame with the best image evaluation among the at least one image frame before and after the user presses the shutter. In other possible implementations, the cover image may also be an image frame displayed by the electronic device 100 at the moment the user presses the shutter. In other possible implementations, the default cover image may also be several image frames before the user presses the shutter, or several image frames after the user presses the shutter, or a single image frame obtained by fusing several image frames before and after the user presses the shutter. The default cover image can also be determined based on other methods; this application uses the example of the default cover image being a single image frame captured by the electronic device 100 at the moment the user presses the shutter for illustration.

[0148] After acquiring at least one image frame before the user presses the shutter button, at least one image frame after the user presses the shutter button, and a cover image, the electronic device 100 can generate a moving photograph and save it in a gallery.

[0149] In this embodiment, the cover image may also be referred to as a cover picture, cover frame, or simply a cover. The electronic device can display a thumbnail of the cover image in its gallery or photo album. Users can click on the thumbnail of the cover image in the electronic device's gallery or photo album to view the corresponding animated photo.

[0150] In the embodiments of this application, a moving photograph can also be referred to as a moving image. An image frame can also be referred to as a video frame.

[0151] Currently, users can change the cover image of a live photo. For example, users can select any image frame from the image frames contained in the live photo and set it as the cover image.

[0152] It's important to note that the cover image of a dynamic photo refers to a category of images used as the cover of the dynamic photo. The default cover image, however, is simply one specific image within this category. The cover image of the dynamic photo can be changed; when the dynamic photo is generated, the default cover image is used. When the user chooses to change the cover image, the dynamic photo's cover image can be replaced with a new cover image, which can be referred to as the second cover image.

[0153] The following diagram illustrates the process of changing the cover image of a live photo.

[0154] First, the user can open the interface for changing the cover image of a live photo. There are several ways a user can initiate the process of changing the cover image of a live photo on their electronic device. For example, in one feasible example, the user can click on the thumbnail of a live photo in the gallery application interface; in response to this action, the electronic device can display the cover image of that live photo. The user then clicks the "Edit" control; in response to this action, the electronic device can access the interface for changing the cover image of the live photo. Specifically, see [link to documentation]. Figures 5-8 The description in the text.

[0155] Alternatively, in another feasible example, a user can click on a thumbnail of a live photo within the gallery's application interface. In response to this action, the electronic device can display the cover image of the live photo. The user then clicks the "Edit" control and a control indicating that the current interface is a live photo. In response to this action, the electronic device can access an interface to change the cover image of the live photo.

[0156] It is understandable that different electronic device manufacturers may set different ways of displaying and changing the cover image of a dynamic photo. This application does not limit the way users display dynamic photos on electronic devices. The following will use... Figures 5-8 The following example illustrates how to enable and change the cover image of a dynamic photo.

[0157] Figures 5-8 This demonstrates how an electronic device, based on user input, replaces a selected image frame in a dynamic photo with a cover image.

[0158] Figure 5An example is shown of a user interface 500 for a gallery application on an electronic device. For example... Figure 5 As shown, the user interface 500 may contain thumbnails of multiple photos. Specifically, the user interface 500 may include a thumbnail 501 of a cover image for a dynamic photo. The thumbnail 501 of the cover image may include an icon 502. The icon 502 can be used to indicate that the photo corresponding to the thumbnail 501 of the cover image is a dynamic photo. A user can click on the thumbnail 501 of the cover image, and in response to this user action, the electronic device can display the user interface 600.

[0159] Figure 6 An example of an electronic device's user interface 600 is shown. For example... Figure 6 As shown, the user interface 600 can be a preview interface for an animated photo corresponding to a thumbnail 501 of the cover image. The user interface 600 may include a preview area 603, which can be used to display the cover image 604. The user interface 600 may also include an icon 601, which can be used to indicate that the user interface 600 is a preview interface for an animated photo, and that the photo displayed in the user interface 600 is an animated photo.

[0160] The cover image 604 is... Figure 5 The cover photo corresponding to thumbnail 501 shown in the image.

[0161] In some feasible examples, when the user clicks icon 601 or long-presses preview area 603, the electronic device can play the complete moving photo. That is, the electronic device can play all the image frames contained in the moving photo.

[0162] like Figure 6 As shown, the user interface 600 may also include multiple function options, such as options for viewing more function options, options for sharing, options for editing, options for saving, options for deleting, etc. A user can click on option 602, and in response to this user action, the electronic device can display the user interface 700.

[0163] Figure 7 An example of an electronic device's user interface 700 is shown. For example... Figure 7As shown, the user interface 700 may include a preview area 701, a display area 703, controls 705 and 706. The preview area 701 may display a preview image 702 (also called a preview image) containing image frame 703c. The display area 703 may be used to display thumbnails of multiple image frames contained in the animated photograph corresponding to the cover image 604, such as thumbnails of image frames 703a, 703b, 703c, 703d, and 703e. The display area 703 may also include an indicator 704. The indicator 704 may be used to indicate that a certain image frame of the animated photograph is the cover image of the animated photograph. For example, the indicator 704 may indicate that a certain image frame of the animated photograph is the image frame corresponding to the cover image of the animated photograph; for example, the indicator 704 indicates that image frame 703b is the image frame corresponding to the cover image of the animated photograph. The preview image 702 of image frame 703b is currently displayed in the preview area 701. After the user changes the cover image of the animated photo, they can click the control 705 to save the animated photo with the changed cover image. The control 706 can be used to return to the previous screen.

[0164] Optionally, the user interface 700 may also include one or more function options for editing animated photos, such as filter function options for adding filters to image frames in the animated photo, function options for cropping preview images in the preview area 701, etc. This application embodiment does not limit this aspect.

[0165] It is understandable that the preview image 702 of image frame 703c can be the same as or different from the cover image 604. Since the moving pictures stored by the electronic device include video files and image files, after detecting a user's operation on the shutter button, the electronic device 100 can capture an image frame based on the moment the user operates on the shutter button, store this image frame as an image file in image format, and refresh the thumbnail of the most recent photo in the camera's preview interface to this image file. When generating a moving picture, the electronic device can use this image file as the default cover image of the moving picture, and determine the image frame in the video file closest to the capture time of the cover image as the image frame corresponding to the cover image. Since the cover image and the image frame in the video file closest to the capture time of the cover image may not be the same image frame, and the processing algorithms for image frames in image files and video files may differ, the default cover image of the electronic device and the preview image of its corresponding video frame can be the same or different.

[0166] Understandable, Figure 7The animated photograph shown includes thumbnails of five image frames (i.e., thumbnails of image frame 703a, image frame 703b, image frame 703c, image frame 703d, and image frame 703e) as an example only. An animated photograph may have more or fewer image frames, and this application embodiment does not limit this.

[0167] It should be noted that the multiple image frames of the dynamic photo displayed in the display area 703 can be arranged in the order in which the multiple image frames are acquired when the electronic device takes the dynamic photo.

[0168] Optionally, when the animated photo contains many image frames, the display area 703 for displaying the image frames may further include controls for scrolling forward and backward. Users can click the controls for scrolling forward to view image frames before image frame 703a. Users can click the controls for scrolling backward to view image frames after image frame 703e.

[0169] Optionally, when the moving image contains many image frames, the user can swipe right in the display area 703 to view image frames before image frame 703a. The user can also swipe left in the display area 703 to view image frames after image frame 703e.

[0170] Optionally, when the animated photo contains many image frames, the user can also view the image frames before image frame 703a and the image frames after image frame 703e via voice commands. For example, the user can issue voice commands such as "swipe forward" or "swipe left" to the electronic device, and the electronic device, upon receiving the voice command, can display thumbnails of the image frames before image frame 703a. Similarly, the user can issue voice commands such as "swipe backward" or "swipe right" to the electronic device, and the electronic device, upon receiving the voice command, can display thumbnails of the image frames after image frame 703e.

[0171] Users can change the cover image of a live photo. That is, users can set any image frame in the live photo other than the one currently used as the cover image as the cover image.

[0172] For example, such as Figure 8 As shown, the user can select image frame 703e in the user interface 700. In response to this user operation, the electronic device 100 can display control 801 in the user interface 700. The user can click control 801 to set image frame 703e as the cover image of the moving picture.

[0173] When a user selects the thumbnail of image frame 703e, the preview image in preview area 701 can be updated to the preview image 802 of image frame 703e.

[0174] After a user changes the cover photo of a live photo, they can click control 705 to save it. This will update the cover photo in the saved live photo library accordingly. In other words, the live photo the user sees in the library is the updated cover photo.

[0175] Thus, through the above Figures 5-8 The illustrated steps allow users to change the cover image of a live photo. However, the resolution, noise details, dynamic range, color brightness, and other aspects of the video frames contained in the live photo differ from the original cover image. This results in a significant difference in image quality between the reselected cover image and the original cover image, thus degrading the user experience.

[0176] Based on this, this application provides a method for processing dynamic photos. When the electronic device 100 captures a dynamic photo, the electronic device 100 can determine one or more image frames in the dynamic photo as image frames of highlights, and save the raw data corresponding to the image frames of highlights. When the user changes the cover image of the dynamic photo, the electronic device 100 uses the raw data corresponding to the image frames of highlights to perform image enhancement on the user's newly selected cover image, so that the image quality of the newly selected cover image is the same as or similar to that of the original cover image, which helps to improve the user experience.

[0177] The following describes a method for processing dynamic photos provided by an embodiment of this application, with reference to the accompanying drawings.

[0178] Figure 9 An exemplary flowchart illustrating a method for processing dynamic photos provided in an embodiment of this application is shown. Figure 9 As shown in the embodiments of this application, a method for processing dynamic photos may include the following steps:

[0179] S901. Enables dynamic photo shooting mode and receives user operation 1.

[0180] The electronic device 100 can display a preview interface of a camera application, and then, in response to an operation to enable the live photo shooting mode, activate the live photo shooting mode. When it receives a user's trigger to start shooting, it begins capturing live photos. For example, as... Figure 3B In the preview interface shown, the user can click the dynamic photo shooting mode control 316B, and in response to the user's operation, the electronic device 100 can activate the dynamic photo shooting mode. Then, the user can click the shooting control 312, and the electronic device 100 can take a dynamic photo.

[0181] In other words, user operation 1 can be used to trigger electronic device 100 to start taking dynamic photos. For example, user operation 1 can be performed by the user clicking the shooting control in the preview interface. This application embodiment does not limit the specifics of user operation 1.

[0182] S902a. Acquire the cover image and N image frames.

[0183] Upon detecting user operation 1, electronic device 100 can capture an image frame, which can be used as the default cover image for a moving photo. For example, the default cover image can be... Figure 6 The cover image 604 shown in the image.

[0184] The electronic device 100 can also capture N image frames before and after user operation 1. These N image frames can be generated when user operation 1 is detected, for example, when the user clicks... Figure 3D The image frames captured 1.5 seconds before and after the shooting control 312 shown in the figure.

[0185] Optionally, the N image frames may include image frame 0 corresponding to the default cover image. That is, the default cover image can also be processed into one of the N image frames. In other words, the N image frames include one frame with the exact same content as the default cover image.

[0186] Alternatively, in some examples, the N video frames may not include a frame whose content is exactly the same as the default cover image. However, the electronic device 100 may use the frame whose content is most similar to the default cover image among the N video frames as the video frame corresponding to the cover image.

[0187] It is understandable that the default cover image is generated by the photo ISP, while the N image frames are generated by the preview ISP. The image quality of the default cover image is higher than that of the N image frames.

[0188] It should be noted that the parameters used to characterize image quality are not limited in the embodiments of this application. Parameters used to characterize image quality include, but are not limited to, resolution, dynamic range, contrast ratio, peak signal-to-noise ratio, etc. Taking resolution as an example, the image quality of the cover image being higher than that of N image frames can be understood as the resolution of the cover image being higher than that of the N image frames.

[0189] It should also be noted that the above description uses 1.5 seconds as an example only, but the embodiments of this application do not impose specific limitations on this.

[0190] S902b. Perform highlight moment detection on N image frames to determine the image frames with highlight moments among the N image frames.

[0191] When acquiring N image frames, the electronic device 100 can perform highlight moment detection on each image frame to determine one or more image frames as highlight moments. N is an integer greater than or equal to 1. This application embodiment does not limit the value of N.

[0192] In one possible implementation, the electronic device 100 can determine the image frame with higher resolution and a larger captured target object range among N image frames as the image frame of the highlight moment. For example, when image frame 1 has the highest resolution among the N image frames, the electronic device 100 can determine image frame 1 as the image frame of the highlight moment. Another example is when the target object (e.g., a person, etc.) appears in image frame 1 among the N image frames. Figure 6 When the range of the panda (e.g., on the cover image 604 shown) is larger, the electronic device 100 can identify image frame 1 as the image frame of the highlight moment. For example, image frame 1 could be... Figure 7 Image frame 703e is shown in the image.

[0193] Optionally, in one possible implementation, the electronic device 100 can sequentially input each of the N image frames into the highlight moment detection model, and the highlight moment detection model can output a confidence score corresponding to each image frame. When the confidence score of an image frame is greater than a preset confidence threshold, the electronic device 100 can determine that the image frame is a highlight moment image frame.

[0194] Furthermore, in one possible implementation, if there are multiple image frames among the N image frames with a confidence score greater than a preset confidence threshold, then the electronic device 100 can determine that the top M image frames with the highest confidence scores are the image frames of the highlight moment. M is an integer greater than or equal to 1 and less than N. For example, M can be 1, or 2, 3, etc., and the value of M is not limited in this application embodiment.

[0195] For example, such as Figure 10 As shown, electronic device 100 is in the position as Figure 10In the shooting scenario shown, the dynamic photo shooting mode is enabled. When the user presses the shooting control, the electronic device 100 can acquire the raw image data (which can be called raw data) corresponding to the image frame, and perform preview ISP processing on the raw data to obtain a YUV format image frame. The electronic device 100 can input the YUV format image frame into the highlight moment detection model, which can output the confidence score of the YUV format image frame. The electronic device 100 can determine whether the confidence score of the YUV format image frame is greater than a confidence threshold. If the confidence score of the YUV format image frame is greater than the confidence threshold, the electronic device 100 can store the raw data of the YUV format image frame in the buffer. If the confidence score of the YUV format image frame is less than or equal to the confidence threshold, the electronic device 100 can delete the raw data of the YUV format image frame. In turn, the electronic device 100 can determine whether the confidence scores of N image frames are greater than the confidence threshold.

[0196] In one possible implementation, when the number of N image frames with confidence scores greater than the confidence threshold is less than or equal to M, the electronic device 100 can directly determine that the image frame with a confidence score greater than the confidence threshold is an image frame of a highlight moment, and store the raw data corresponding to the image frame with a confidence score greater than the confidence threshold in the storage area.

[0197] Alternatively, in another possible implementation, such as Figure 10 As shown, the electronic device 100 can sort the confidence scores corresponding to the raw data in the cache, and store the top M raw data with the highest confidence scores into the storage area. Then, the electronic device 100 can delete other raw data with lower confidence scores from the cache.

[0198] Alternatively, in another possible implementation, the electronic device 100 can directly detect moments in the acquired raw data to determine whether the image frame corresponding to the raw data is a highlight moment. For example, the electronic device 100 can input the raw data into a highlight moment detection model, which can output a confidence score for the raw data. If the confidence score of the raw data is greater than a confidence threshold, the electronic device 100 can save the raw data. If the confidence score of the raw data is less than the confidence threshold, the electronic device 100 can process the raw data into a YUV format image frame and then delete the raw data.

[0199] Furthermore, in one possible implementation, if the confidence score of the raw data is greater than the confidence threshold, the electronic device 100 can first save the raw data to a cache. When the confidence score of the raw data is one of the top M raw data in the cache, the electronic device 100 can save the raw data to a storage area. If the confidence score of the raw data is not one of the top M raw data in the cache, the electronic device 100 can delete the raw data from the cache.

[0200] Alternatively, in another possible implementation, the electronic device 100 may also determine the image frame for the highlight moment based on the user's selection. For example, the electronic device 100 may display N image frames in the preview interface of a camera application, prompting the user to set the image frame for the highlight moment. When the user selects image frame 1 from the N image frames as the image frame for the highlight moment, the electronic device 100 can save the raw data of image frame 1. The user may also set multiple image frames as the image frames for the highlight moment; this embodiment does not limit this approach.

[0201] S903. Generate a dynamic photo and save the raw data of the image frames of the dynamic photo and the highlights. The dynamic photo includes a default cover image and a video consisting of N image frames, including image frame 1.

[0202] Electronic device 100 can generate dynamic photos from a default cover image and N video frames, and save the raw data of the dynamic photos and image frames of the highlights.

[0203] In some embodiments, when generating a moving image, the electronic device may also save metadata, which includes, but is not limited to, digital image stabilization (EIS) information, ISO sensitivity, and the time and location of the moving image being captured.

[0204] It is understandable that each of the N image frames can have its own EIS information and sensitivity, etc.

[0205] During the process of electronic device 100 capturing dynamic photos, the flow and processing of image data related to the dynamic photos can be found in [reference needed]. Figure 11 .like Figure 11 As shown, firstly, when the electronic device 100 turns on the dynamic photo shooting mode, the electronic device 100 begins to acquire raw data. After the raw data is processed by the preview ISP, a YUV format image frame can be obtained.

[0206] In this embodiment, the YUV format image frames serve three purposes. First, when the electronic device 100 displays a camera preview interface, the YUV format image frames are displayed in real-time on the preview interface. Second, the electronic device 100 can process the RAW data acquired 1.5 seconds before and after the user presses the shooting control, processing the resulting YUV format image frames into a buffer, and use them to compose the video contained in the dynamic photo. Third, the YUV format image frames processed from the RAW data acquired 1.5 seconds before and after the user presses the shooting control can also perform highlight moment detection, and store the RAW data corresponding to the image frames identified as highlight moments into the buffer. The electronic device 100 will delete the RAW data corresponding to YUV format image frames that are not highlight moments. For details on how to perform highlight moment detection on the YUV format image frames processed from the RAW data acquired 1.5 seconds before and after the user presses the shooting control, please refer to [link to relevant documentation]. Figure 10 The description in the text will not be repeated here.

[0207] Then, when the user presses the shooting control, the raw data captured by the electronic device 100 is sent not only to the preview ISP for processing, but also to the shooting ISP for processing to obtain the captured image. This captured image can be used as the default cover image for the video.

[0208] Finally, the electronic device 100 can generate a dynamic photo by processing the raw data (including the raw data acquired when the user presses the shooting control) within 1.5 seconds before and after the user presses the shooting control into a YUV format image frame via a preview ISP, and by processing the raw data acquired when the user presses the shooting control into a photographic image via a photographic ISP. The photographic image obtained from the raw data acquired when the user presses the shooting control can be used as the default cover image for the dynamic photo.

[0209] The electronic device 100 can store the raw data of the cover image, a video of about 3 seconds consisting of N image frames, and image frames of one or more highlights in the storage area (e.g., ROM) of the electronic device 100.

[0210] For example, such as Figure 11 As shown, the storage area may include a file 1 containing the animated photo 1. This file 1 contains the cover image of the animated photo 1, a video of about 3 seconds consisting of N image frames, and raw data of image frames of one or more highlights.

[0211] Alternatively, in other embodiments, the animated photo may be a user-downloaded animated photo or an animated photo shared by other users. That is, electronic device 100 can obtain the animated photo file from other devices (e.g., a server, other users' electronic devices), which may contain a cover image of the animated photo, a video of about 3 seconds consisting of N image frames, and raw data of image frames of one or more highlights.

[0212] In one possible implementation, when a moving photograph contains N image frames, one or more of these image frames are considered highlight frames. When the electronic device 100 displays the moving photograph, it can display a highlight marker to indicate the image frame that is a highlight. For example, as... Figure 12 As shown, in the user interface 700 that displays dynamic photos, the user interface 700 may include a highlight mark 1201, which can be used to mark the image frame 703e as a highlight image frame.

[0213] The highlight marker 1201 can be located near image frame 703e. For example, as... Figure 12 As shown, the highlight marker 1201 can be located below image frame 703e. It is understood that the highlight marker 1201 can also be located above image frame 703e. The specific style, color, and location of the highlight marker 1201 are not limited in this embodiment.

[0214] S904. User operation 2 is received, which is used to set image frame 1 as the cover image of the moving photo.

[0215] Electronic device 100 can receive user operation 2, which can be used to set image frame 1 in the dynamic photo as a new cover image.

[0216] In one possible implementation, when the electronic device 100 has not yet displayed the animated photo, the user operation 2 may include the user opening a gallery application, viewing the animated photo in the gallery application, and then selecting image frame 1 and setting image frame 1 as the cover image of the animated photo. That is, user operation 2 may include: the user first... Figure 5 In the user interface 500 shown, click the thumbnail 501 of the cover image of the animated photo, and then... Figure 6 In the user interface 600 shown, click function option 602, then in Figure 8 In the user interface 700 shown, after clicking image frame 703e, click control 801.

[0217] Alternatively, in another possible implementation, when the electronic device 100 has displayed as shown Figure 7 When the user interface 700 shown is used to display dynamic photos, user operation 2 may include: the user first selects image frame 703e in the user interface 700, and then clicks as shown in the image frame 703e. Figure 8 The control shown is 801.

[0218] Alternatively, in another possible implementation, the user can access the interface to view the live photos from the camera application. For example, after the electronic device 100 finishes taking a live photo, the user can click as follows: Figure 3D The echo control 314 is shown in the image. In response to this user operation, the electronic device 100 can display the interface of a gallery application, where the user can view animated photos. Then, the user can select image frame 1 and set image frame 1 as the cover image of the animated photo. That is, user operation 2 can include: the user first selecting an image frame... Figure 3D In the preview interface shown, click the echo control 314, and then, as shown... Figure 5 In the user interface 500 shown, click the thumbnail 501 of the cover image of the animated photo, and then in the following... Figure 6 In the user interface 600 shown, click function option 602, and then... Figure 8 In the user interface 700 shown, after clicking image frame 703e, click control 801.

[0219] Alternatively, in another possible implementation, the user operation 2 can be a voice command input by the user, which can be used to instruct the electronic device 100 to display a dynamic photo and set image frame 1 in the dynamic photo as a new cover image.

[0220] It is understood that the embodiments of this application do not limit the specific user operation 2.

[0221] S905. Perform image enhancement on image frame 1 to obtain enhanced image frame 1, the resolution of enhanced image frame 1 is greater than the resolution of image frame 1.

[0222] The electronic device 100 can enhance the image frame 1 selected by the user as the cover image, so that the image quality of the enhanced image (i.e., the reselected cover image) is close to the image quality of the default cover image. For example, the resolution of the resulting reselected cover image is close to or equal to the resolution of the default cover image. The resolution of the reselected cover image is greater than the resolution of image frame 1.

[0223] In one possible implementation, when image frame 1 is an image frame of a highlight moment and the file of the dynamic photo stores the raw data corresponding to image frame 1, the electronic device 100 can perform image enhancement on image frame 1 based on the raw data of image frame 1, thereby improving the image quality of image frame 1, so that the image quality of the finally enhanced image frame 1 is close to that of the default cover image.

[0224] Furthermore, in one possible implementation, the electronic device 100 can perform image enhancement on image frame 1 based on the raw data of image frame 1 and the default cover image to obtain enhanced image frame 1. In this embodiment, the enhanced image frame 1 can also be referred to as the reselected cover image. For example, as... Figure 13 As shown, the electronic device 100 can input the selected image frame (i.e., image frame 1), the raw data of the selected image frame, and the default cover image into the cover reselection model, which can output a reselected cover image. The content of the reselected cover image is the same as the content of the image frame, but the image quality of the reselected cover image is close to that of the default cover image.

[0225] Optionally, in one possible implementation, if the image frame 1 selected by the user is not an image frame of a highlight moment and the raw data of the image frame is not stored in the file of the dynamic photo, the electronic device 100 can perform image enhancement on the image frame 1 based on the default cover image to obtain the enhanced image frame 1.

[0226] Alternatively, in another possible implementation, if the image frame 1 selected by the user is not an image frame of a highlight moment and the raw data of the image frame is not stored in the file of the dynamic photo, the electronic device 100 can perform image enhancement on the image frame 1 based on the raw data of an image frame of a highlight moment with similar content to the image frame 1 and / or the default cover image to obtain the enhanced image frame 1.

[0227] The cover reselection model includes, but is not limited to, neural networks and image enhancement algorithms. The neural networks include, but are not limited to, deep neural networks, convolutional neural networks, etc. This application does not limit the specific cover reselection model.

[0228] The training data for the cover reselection model can be image frames from a dynamic photograph, the corresponding raw data of the image frames, and a default cover image. The electronic device 100 can input the image frames, their corresponding raw data, and the default cover image into the cover reselection model, which can then output training images. The electronic device 100 can then compare the image quality of the training image with that of the default cover image until the difference between the quality of the output training image and the default cover image is less than a certain threshold, at which point the training of the cover reselection model is complete.

[0229] Alternatively, in one possible implementation, the electronic device 100 can download the reselection cover model from a server. Then, the electronic device 100 can continuously adjust the relevant parameters of the reselection cover model based on the relevant image data of the dynamic photos within the electronic device 100, so that the image quality and style of the reselection cover image output by the reselection cover model conform to the user's habits.

[0230] Alternatively, in another possible implementation, the cover reselection model can be located on a server. When a user needs to change the cover image of a dynamic photo, the electronic device 100 can send the user-selected image frame, its raw data, and the default cover image to the server. The server then inputs the user-selected image frame, its raw data, and the default cover image into the cover reselection model to obtain the reselected cover image. The server can then send the reselected cover image to the electronic device 100.

[0231] S906. Update the cover image of the moving photo to the enhanced image frame 1.

[0232] Electronic device 100 can update the cover image of a live photo to the enhanced image frame 1. When the user views the live photo again, the cover image has been updated to the reselected cover image. For example, when the user reopens a live photo... Figure 5 When the user interface 500 of the gallery is displayed, the thumbnail 501 of the cover image of the animated photo in the user interface 500 will be updated to the thumbnail of the reselected cover image. For example... Figure 6 The cover image 604 of the dynamic photo displayed in the preview area of ​​the user interface 600 will also be updated to a reselected cover image.

[0233] In one possible implementation, the electronic device 100 can store the reselected cover image in a dynamic photo file. For example, as shown... Figure 14 As shown, in file 1 of the dynamic photos stored in the storage area, the relative... Figure 11 The document shown in document 1 has added the option to reselect the cover image.

[0234] Optionally, in this embodiment, step S905 can be performed before step S904. In some examples, after the electronic device 100 detects a highlight moment and determines the image frame of that highlight moment, it can perform image enhancement on the image frame of the highlight moment to obtain an enhanced image frame. The electronic device 100 can also save the enhanced image frame corresponding to the image frame of the highlight moment. When the electronic device 100 receives an operation from the user to change the cover image of the animated photo, the electronic device 100 directly obtains the enhanced image frame corresponding to the image frame selected by the user and updates the enhanced image as the cover image of the animated photo.

[0235] According to the dynamic photo processing method provided in this application embodiment, when the electronic device 100 captures a dynamic photo, it performs highlight detection on the image frames in the video of the dynamic photo. When an image frame is determined to be a highlight image, the corresponding raw data of the image frame is saved. Then, when changing the cover image of the dynamic photo, the selected image frame can be enhanced using the raw data to obtain an enhanced image frame (which can be called a reselected cover image), and the cover image of the dynamic photo is replaced with the reselected cover image. Since the raw data is the original image data captured by the camera, it contains more image information (e.g., dynamic range, color details, high color depth, etc.), and has higher resolution and clarity. By enhancing the selected image frame using raw data, the image quality of the reselected cover image obtained through image enhancement can be closer to the default cover image, thereby improving the user experience. In addition, storing only the raw data of the highlight image frames can save storage space of the electronic device 100.

[0236] In some examples, the default cover image may also be referred to as the original cover image.

[0237] Figure 15 An electronic device 1500 provided in an embodiment of this application is illustrated by way of example. Figure 15 As shown, the electronic device 1500 may include a shooting module 1501, a processing module 1502, a display module 1503, and a storage module 1504. Wherein:

[0238] The shooting module 1501 can be used to capture raw image data when the electronic device 1500 activates the dynamic photo shooting mode. The captured raw data includes raw data captured 1.5 seconds before and after the user presses the shooting control, as well as raw data captured when the user presses the shooting control.

[0239] The processing module 1502 can be used to process the raw data collected 1.5 seconds before and after the user presses the shooting control into YUV format image frames; and to process the raw data collected when the user presses the shooting control into a picture.

[0240] The processing module 1502 can also be used to generate a dynamic photo from the processed YUV format image frame and the processed captured image, wherein the captured image can be used as the default cover image of the dynamic photo.

[0241] The processing module 1502 can also be used to perform highlight detection on the processed YUV format image frames to determine whether the YUV format image frame is a highlight image frame. If it is, the raw data corresponding to the YUV format image frame is stored in the storage module 1504. If it is not, the raw data corresponding to the YUV format image frame is deleted.

[0242] The display module 1503 can be used to display the generated animated photograph, as well as the cover image of the animated photograph and the multiple image frames contained in the animated photograph.

[0243] The processing module 1502 can also be used to perform image enhancement on the image frame selected by the user when the user changes the cover image of the animated photo, to obtain a reselected cover image, and then replace the cover image of the animated photo with the reselected cover image. For details on how the processing module 1502 performs image enhancement on the image frame selected by the user, please refer to the description in step S905 above, which will not be repeated here.

[0244] Storage module 1504 can be used to store dynamic photo files, which may contain raw data of a default cover image, multiple image frames, image frames of highlights, metadata, etc. When the cover image of the dynamic photo is changed, the dynamic photo file may also include a reselected cover image. For example, the reselected cover image may be the enhanced image frame 1 mentioned above.

[0245] It is understood that the electronic device 1500 can execute any of the possible implementations executed by the electronic device 100.

[0246] This application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the technical solutions described in the above embodiments. Its implementation principle and technical effects are similar to those of the related embodiments described above, and will not be repeated here.

[0247] This application provides a readable storage medium containing instructions that, when executed by an electronic device, cause the electronic device to perform the technical solution described in the above embodiments. The implementation principle and technical effects are similar and will not be repeated here.

[0248] This application provides a chip for executing instructions. When the chip is running, it performs the technical solutions described in the above embodiments. Its implementation principle and technical effects are similar and will not be repeated here.

[0249] In this embodiment, the first image frame can be image frame 1. The first cover image can be the default cover image. The enhanced first image frame can be the enhanced image frame 1 plus the reselected cover image. The first marker can be a highlight marker 1201.

[0250] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

[0251] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

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

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

Claims

1. A method for processing dynamic photos, characterized in that, The method includes: An electronic device displays a dynamic photo display interface, which includes a cover image of a first dynamic photo, thumbnails of N image frames of the first dynamic photo, and a first marker. The cover image of the first dynamic photo is displayed as a first cover image. The N image frames include thumbnails of the first image frames. The first marker is used to mark the thumbnails of the first image frames. The first image frame is determined to be an image frame of a highlight moment. The electronic device stores the original image data of the first image frame. In response to the first operation, the electronic device replaces the cover image of the first dynamic photo from the first cover image with an enhanced first image frame, the enhanced first image frame being obtained by the electronic device performing image enhancement on the first image frame based on the original image data of the first image frame, the resolution of the enhanced first image frame being greater than the resolution of the first image frame.

2. The method according to claim 1, characterized in that, The method further includes: In response to the second operation, the electronic device acquires multiple raw image data; The first cover image and the N image frames are obtained based on the multiple original image data; The electronic device performs highlight detection on the N image frames or the original image data corresponding to the N image frames to determine the first image frame.

3. The method according to claim 2, characterized in that, The plurality of raw image data includes first raw image data acquired when the second operation is received, and N second raw image data acquired before and after the second operation is received; The step of obtaining the first cover image and the N image frames based on multiple original image data includes: The first cover image is obtained based on the first original image data, and the N image frames are obtained based on the N second original image data.

4. The method according to claim 3, characterized in that, In response to the second operation, the method further includes: The electronic device displays a dynamic photo shooting interface, which includes a start control and a shooting control. The start control is in a first state, and when the start control is in the first state, it is used to indicate that the electronic device has turned on the dynamic photo shooting mode. The second operation is the operation of the shooting control.

5. The method according to claim 4, characterized in that, After the electronic device performs highlight moment detection on the N image frames or the original image data corresponding to the N image frames, and determines the first image frame, the method further includes: The electronic device stores the first cover image and the N image frames, as well as the original image data corresponding to the first image frame.

6. The method according to claim 2, characterized in that, The electronic device performs highlight moment detection on the N image frames or the original image data corresponding to the N image frames to determine the first image frame, including: The electronic device determines a confidence score for each of the N image frames; The electronic device sorts the confidence scores of M image frames out of the N image frames that have a confidence score greater than a confidence threshold, and determines the first image frame from the M image frames according to the sorting.

7. The method according to claim 6, characterized in that, The method further includes: The electronic device deletes the original image data corresponding to the image frames among the N image frames that are determined not to be highlights.

8. The method according to claim 7, characterized in that, The electronic device deletes the original image data corresponding to the image frames among the N image frames that are determined not to be highlights, specifically including: The electronic device stores the original image data corresponding to the M image frames into the buffer area of ​​the electronic device; The electronic device deletes the original image data corresponding to the image frames in the M image frames in the buffer that are determined not to be highlights, and stores the original image data corresponding to the first image frame in the buffer into the memory of the electronic device.

9. The method according to any one of claims 1-8, characterized in that, The method further includes: The electronic device performs image enhancement on the first image frame based on the original image data of the first image frame and the first cover image to obtain the enhanced first image frame; The electronic device stores the enhanced first image frame.

10. The method according to claim 9, characterized in that, When the electronic device saves the first dynamic photo and the original image data corresponding to the first image frame, the method further includes: The electronic device stores the metadata of the first dynamic photo.

11. An electronic device, characterized in that, It includes one or more processors; one or more memories; said one or more memories storing one or more computer programs, said one or more computer programs including instructions that, when executed by said one or more processors, cause the method as described in any one of claims 1 to 10 to be performed.

12. A chip, characterized in that, The chip includes a processor and a communication interface, the communication interface being used to receive signals and transmit the signals to the processor, the processor processing the signals such that the method as described in any one of claims 1 to 10 is executed.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on a computer, cause the method as described in any one of claims 1 to 10 to be performed.

14. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1 to 10.