Time-lapse photography shooting method and electronic device
By cropping multi-frame time-lapse photography images on electronic devices, and generating time-lapse photography videos that are automatically translated and played, the single film effect caused by a fixed field of view is solved and the user's viewing experience is improved.
Patent Information
- Application Number
- CN202310946527.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2043-07-28
AI Technical Summary
When using electronic devices for time-lapse photography, the single film effect caused by a fixed field of view cannot bring users a better photography experience.
By using the preset camera to acquire multiple frames of captured images and crop them, the field of view of the image after each frame is different, and a time-lapse photography video that is automatically translated and played is generated.
It realizes dynamic video playback effects, bringing users a more diverse and immersive viewing experience, and enhancing the attractiveness of the video.
Smart Images

Figure CN117714899B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of terminal technology, and in particular to a time-lapse photography shooting method and electronic device. Background Art
[0002] Time-lapse photography, also known as time-lapse photography or time-lapse video, compresses a group of photos into a video of a shorter period of time, and then displays the shooting results in the form of a time-lapse video. Usually, time-lapse videos can be used to describe the process of objects or scenery slowly changing in real space. Through time-lapse videos, people can observe wonderful scenes that are usually invisible to the naked eye.
[0003] At present, when using electronic devices for time-lapse photography, users generally fix the electronic devices on tripods for shooting. Therefore, the objects photographed by the electronic devices are all objects within a fixed field of view, and the corresponding time-lapse photography video after filming can only show the content within the fixed field of view. The filming effect is relatively simple and cannot bring users a better photography experience. Summary of the invention
[0004] The embodiments of the present disclosure provide a time-lapse photography shooting method and an electronic device. The time-lapse photography video generated by the electronic device can play each frame of the image frame by frame in the form of automatic panning playback. Since the field of view of each frame of the image is different, a dynamic video playback effect can be displayed to the user. This film-forming effect can bring a more diverse visual experience to the user.
[0005] To achieve the above objectives, the embodiments of the present disclosure adopt the following technical solutions:
[0006] In a first aspect, the present disclosure provides a time-lapse photography shooting method, the method comprising: first, when a camera application of the electronic device enters a time-lapse photography mode, the electronic device uses a preset camera to obtain multiple frames of captured images, the preset camera is a preset camera corresponding to a target zoom option, and the size of the captured image is larger than the size of a standard image corresponding to the target zoom option; then the electronic device crops the multiple frames of captured images to obtain multiple frames of cropped images, the size of each frame of the multiple frames of cropped images is consistent with the size of the standard image, and the field of view content of two adjacent frames of the multiple frames of cropped images at least partially overlaps; finally, based on the multiple frames of cropped images, a time-lapse photography video is generated.
[0007] Based on the data processing method of the first aspect, during the time-lapse photography process, the electronic device can use the preset camera corresponding to the target zoom option to obtain multiple frames of captured images. Since the size of the captured image is larger than the size of the standard image corresponding to the target zoom option, the multiple frames of captured images can be cropped to obtain multiple frames of cropped images. The field of view content of two adjacent frames of cropped images in the multiple frames of cropped images at least partially overlaps. Since the field of view content of two adjacent frames of cropped images at least partially overlaps, when playing the time-lapse photography video generated based on the multiple frames of cropped images, the time-lapse photography video can present an automatic panning playback effect. The field of view content of two adjacent frames of cropped images at least partially overlaps, which allows users to feel the flow and changes of the video screen when watching the time-lapse photography video, and the partial overlap can make the video screen coherent, and the viewing is more fluid and not abrupt. This filming effect not only allows users to feel the dynamic visual effect, but also brings users a more attractive and immersive viewing experience.
[0008] In combination with the first aspect, in another possible implementation, before using a preset camera to obtain multiple frames of captured images, the method further includes: detecting a user's selection operation on multiple zoom options; if no user's selection operation on multiple zoom options is detected, determining that the preset camera is the preset camera corresponding to the first zoom option; the target zoom option is the first zoom option; using the preset camera to obtain multiple frames of captured images includes: using the preset camera corresponding to the first zoom option to obtain multiple frames of captured images. Based on this implementation, by determining the target zoom option selected by the user, the preset camera is determined according to the target zoom option, and then the preset camera is used to obtain multiple frames of captured images. This ensures that the size of the obtained multiple frames of captured images is larger than the size of the standard image corresponding to the target zoom option, thereby providing a basis for subsequent image cropping.
[0009] In combination with the first aspect, in another possible implementation, after detecting the user's selection operation on multiple zoom options, the method further includes: when detecting the user's selection operation on the second zoom option among the multiple zoom options, determining that the preset camera is the preset camera corresponding to the second zoom option; the target zoom option is the second zoom option; using the preset camera to obtain multiple frames of captured images, including: using the preset camera corresponding to the second zoom option to obtain multiple frames of captured images. Based on this implementation, a method for determining the preset camera after determining the target zoom option selected by the user is provided. The accurate preset camera is determined according to the target zoom option, thereby ensuring that the size of the multiple frames of captured images obtained using the preset camera is larger than the size of the standard image corresponding to the target zoom option, thereby providing a basis for subsequent image cropping.
[0010] In combination with the first aspect, in another possible implementation, multiple frames of captured images are cropped to obtain multiple frames of cropped images, including: determining the size of each frame of captured images in the multiple frames of captured images and the size of the standard image; determining the multiple relationship between the size of each frame of captured images and the size of the standard image according to the size of each frame of captured images and the size of the standard image; determining the size of the cropping area corresponding to each frame of captured images according to the multiple relationship between the size of each frame of captured images and the size of the standard image; cropping each frame of captured images according to the size of the cropping area corresponding to each frame of captured images to obtain each frame of cropped images in the multiple frames of cropped images. Based on this implementation, the size of the cropping area corresponding to each frame of captured images in the multiple frames of captured images and the size of the standard image can be accurately determined. Afterwards, each frame of captured images is cropped according to the size of the cropping area corresponding to each frame of captured images, so that the size of each frame of cropped images in the multiple frames of cropped images has no error. Afterwards, the time-lapse video generated by multi-frame cropped images will be more in line with the display size of the electronic device when played, bringing users a better viewing experience.
[0011] In combination with the first aspect, in another possible implementation, each frame of the captured image is cropped according to the size of the cropping area corresponding to each frame of the captured image to obtain each frame of the cropped image in the multiple frames of cropped images, including: determining the total number of frames of the multiple frames of the captured image; determining the cropping vertex coordinates of each frame of the captured image in the multiple frames of the captured image according to the total number of frames of the multiple frames of the captured image; the horizontal coordinates of the cropping vertex coordinates of two adjacent frames of the captured image are different; according to the cropping vertex coordinates of each frame of the captured image and the size of the cropping area corresponding to each frame of the captured image, each frame of the captured image is cropped in turn to obtain each frame of the cropped image. Based on this solution, since the horizontal coordinates of the cropping vertex coordinates of two adjacent frames of the captured image are different, the size of each frame of the cropped image is the same, and the field of view content of each frame of the cropped image will also be different. In this way, by playing a time-lapse video based on multiple frames of cropped images, the user can feel the effect of the flow of the field of view.
[0012] In combination with the first aspect, in another possible implementation, the horizontal coordinate of the cropping vertex of each frame of the captured image is x n , the vertical coordinate of the cropping vertex of each frame of the image is y n ;
[0013] x n Obtained by the following formula:
[0014]
[0015] y n Obtained by the following formula:
[0016]
[0017] Wherein, w is the width of the captured image, h is the height of the captured image, w' is the width of the standard image, h' is the width of the standard image, F is the total number of frames, and n is used to represent the nth frame. Based on this implementation, the electronic device can calculate the horizontal coordinate and the vertical coordinate of the cropping vertex of each frame of the captured image in this way, so as to obtain the cropped image of each frame according to the horizontal coordinate and the vertical coordinate.
[0018] In combination with the first aspect, in another possible implementation, generating a time-lapse video based on multiple cropped frames of images includes: performing upsampling and video recording processing on the multiple cropped frames of images to obtain a video stream; performing frame extraction and encoding processing on the video stream to obtain the time-lapse video. Based on this implementation, the electronic device can process the multiple cropped frames of images to obtain the time-lapse video.
[0019] In combination with the first aspect, in another possible implementation, the first zoom option is 1x, and the camera corresponding to the first zoom option is an ultra-wide-angle camera; the second zoom option is 2x, and the camera corresponding to the second zoom option is a main camera.
[0020] In a second aspect, an embodiment of the present disclosure provides a time-lapse photography device, which can be applied to an electronic device to implement the method in the first aspect above. The functions of the time-lapse photography device can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, such as an acquisition module, a cropping module, and a generation module.
[0021] The acquisition module is configured to acquire multiple frames of captured images using a preset camera when the camera application enters the time-lapse photography mode. The preset camera is a preset camera corresponding to the target zoom option, and the size of the captured image is larger than the size of the standard image corresponding to the target zoom option. The cropping module is configured to crop the multiple frames of captured images to obtain multiple frames of cropped images. The size of each frame of the cropped images in the multiple frames is consistent with the size of the standard image, and the field of view content of two adjacent frames of the cropped images in the multiple frames of cropped images at least partially overlaps. The generation module is configured to generate a time-lapse photography video based on the multiple frames of cropped images.
[0022] In conjunction with the second aspect, in a possible implementation, the time-lapse photography device further includes a detection module and a determination module. The detection module is configured to detect a user's selection operation on multiple zoom options. The determination module is configured to determine that the preset camera is the preset camera corresponding to the first zoom option and the target zoom option is the first zoom option when no user's selection operation on the multiple zoom options is detected. The acquisition module is further configured to acquire multiple frames of captured images using the preset camera corresponding to the first zoom option.
[0023] In conjunction with the second aspect, in a possible implementation, the determination module is further configured to, when detecting that the user has selected a second zoom option among multiple zoom options, determine that the preset camera is the preset camera corresponding to the second zoom option; the target zoom option is the second zoom option. The acquisition module is further configured to acquire multiple frames of captured images using the preset camera corresponding to the second zoom option.
[0024] In combination with the second aspect, in a possible implementation method, the cropping module is also configured to determine the size of each frame of captured images and the size of the standard image in the multiple frames of captured images; determine the multiple relationship between the size of each frame of captured images and the size of the standard image based on the size of each frame of captured images and the size of the standard image; determine the size of the cropped area corresponding to each frame of captured images based on the multiple relationship between the size of each frame of captured images and the size of the standard image; crop each frame of captured images based on the size of the cropped area corresponding to each frame of captured images to obtain each cropped image in the multiple frames of cropped images.
[0025] In combination with the second aspect, in a possible implementation method, the cropping module is also configured to determine the total number of frames of the multiple frames of captured images; determine the cropping vertex coordinates of each frame of the multiple frames of captured images based on the total number of frames of the multiple frames of captured images; the horizontal coordinates of the cropping vertex coordinates of two adjacent frames of captured images are different; and crop each frame of the captured images in turn based on the cropping vertex coordinates of each frame of the captured images and the size of the cropping area corresponding to each frame of the captured images to obtain each frame of the cropped image.
[0026] In combination with the second aspect, in a possible implementation, the horizontal coordinate of the cropping vertex of each frame of the captured image is x n , the vertical coordinate of the cropping vertex of each frame of the image is y n ;
[0027] x n Obtained by the following formula:
[0028]
[0029] y n Obtained by the following formula:
[0030]
[0031] Wherein, w is the width of the captured image, h is the height of the captured image; w' is the width of the standard image, h' is the width of the standard image, F is the total number of frames, and n is used to represent the nth frame.
[0032] In combination with the second aspect, in a possible implementation, the generation module is further configured to perform upsampling and video recording on the multiple frames of cropped images to obtain a video stream; and perform frame extraction and encoding on the video stream to obtain a time-lapse video.
[0033] In combination with the second aspect, in a possible implementation, the first zoom option is 1x, and the camera corresponding to the first zoom option is an ultra-wide-angle camera; the second zoom option is 2x, and the camera corresponding to the second zoom option is a main camera.
[0034] In a third aspect, the present disclosure provides an electronic device, comprising: a memory, a display screen, and one or more processors; the memory, the display screen, and the processor are coupled. The memory is used to store computer program codes, and the computer program codes include computer instructions; when the electronic device is running, the processor is used to execute one or more computer instructions stored in the memory, so that the electronic device executes the data processing method as described in any one of the first aspects above.
[0035] In a fourth aspect, the present disclosure provides a computer storage medium, comprising computer instructions, which, when executed on an electronic device, enables the electronic device to execute any of the data processing methods in the first aspect.
[0036] In a fifth aspect, the present disclosure provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the data processing method as described in any one of the first aspects.
[0037] In a sixth aspect, a device (for example, the device may be a chip system) is provided, the device including a processor for supporting a first terminal device to implement the functions involved in the first aspect. In one possible design, the device also includes a memory for storing necessary program instructions and data for the first terminal device. When the device is a chip system, it may be composed of a chip, or may include a chip and other discrete devices.
[0038] It should be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure.
[0040] Figure 2 A schematic diagram of a software structure of an electronic device provided in an embodiment of the present disclosure Figure 1 .
[0041] Figure 3 This is one of the flowchart diagrams of a time-lapse photography method provided in an embodiment of the present disclosure.
[0042] Figure 4 This is one of the display schematic diagrams provided in the embodiment of the present disclosure.
[0043] Figure 5 A cutting schematic diagram provided for an embodiment of the present disclosure.
[0044] Figure 6 The second flowchart of a time-lapse photography method provided in an embodiment of the present disclosure is shown.
[0045] Figure 7 The present invention provides a second display schematic diagram of an embodiment of the present invention.
[0046] Figure 8 The third flowchart of a time-lapse photography method provided in an embodiment of the present disclosure.
[0047] Fig. 9 A schematic diagram of the structure of a time-lapse photography device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0048] The technical solution in the embodiment of the present disclosure will be described below in conjunction with the drawings in the embodiment of the present disclosure. Among them, in the description of the present disclosure, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in the present disclosure is only a kind of association relationship describing the associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. And, in the description of the present disclosure, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present disclosure, in the embodiments of the present disclosure, the words "first", "second" and the like are used to distinguish between the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the differences. At the same time, in the embodiments of the present disclosure, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present disclosure should not be interpreted as being more preferred or more advantageous than other embodiments or design. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for easy understanding.
[0049] In addition, the network architecture and business scenarios described in the embodiments of the present disclosure are intended to more clearly illustrate the technical solutions of the embodiments of the present disclosure, and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. Ordinary technicians in this field can know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present disclosure are also applicable to similar technical problems.
[0050] In order to make the description of the following embodiments clear and concise, a brief introduction to the relevant concepts or technologies is first given:
[0051] 1. The field of view (FOV) is also called the field of view. The size of the field of view determines the field of view of the image captured by an optical instrument (for example, a camera). The larger the FOV of the camera, the larger the field of view of the image; the smaller the FOV of the camera, the smaller the field of view of the image.
[0052] 2. Automatic Pan is a video playback technology that automatically adjusts the position and direction of the field of view to achieve a panning effect on the video content. In automatic panning, the video will move automatically.
[0053] 3. Preview stream refers to the image data obtained by the camera in real time, which is used to display the preview data stream.
[0054] 4. Recording stream refers to the image data continuously acquired by the camera, which is used for video recording.
[0055] Time-lapse photography can compress the slow changes of the objects or scenes being photographed into a shorter period of time and play them in the form of a video. For example, time-lapse photography can be used to shoot natural scenery (such as changing clouds, sunrise and sunset, blooming and falling flowers, starry sky, Milky Way), urban scenery, urban life, astronomical phenomena (such as solar and lunar eclipses), construction or biological evolution (such as cell division, egg hatching) and many other scenes.
[0056] When using electronic devices for time-lapse photography, the electronic devices are usually placed in a fixed position, so the field of view corresponding to the time-lapse video shot by the electronic devices is also fixed. Therefore, the final generated time-lapse video also shows the change process of objects or scenery within the fixed field of view. This film effect is too single and cannot provide users with a better viewing experience.
[0057] To this end, the embodiments of the present disclosure provide a time-lapse photography shooting method, which is applied to electronic devices. The time-lapse photography video generated by the time-lapse photography shooting method can play each frame of the image frame by frame in the form of automatic panning playback. Since the field of view of each frame of the image is different, a dynamic video playback effect can be displayed to the user. This film effect can bring a more diverse visual experience to the user.
[0058] For example, the electronic device may be a mobile terminal such as a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or other devices, or may be a professional camera or other device. The embodiments of the present disclosure do not impose any restrictions on the specific type of the electronic device.
[0059] For example, Figure 1A schematic diagram of the structure of an electronic device 100 is shown. The electronic device may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0060] Among them, the above-mentioned sensor module 180 may include sensors such as pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.
[0061] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0062] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0063] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0064] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0065] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (IC) interface, an inter-integrated circuit sound (IS) 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.
[0066] It is understandable that the interface connection relationship between the modules shown in this embodiment is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0067] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142, it can also power the electronic device through the power management module 141.
[0068] 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, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. In some embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0069] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor. In some embodiments, the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
[0070] 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 a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0071] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
[0072] The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 can be set in the same device as at least some modules of the processor 110.
[0073] The wireless communication module 160 can provide wireless communication solutions for application in the electronic device 100, including WLAN (such as (wirelessfidelity, Wi-Fi) network), Bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), nearfield communication technology (nearfield communication, NFC), infrared technology (infrared, IR), etc.
[0074] The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 1, modulates the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 may also receive a signal to be sent from the processor 110, modulate the signal, amplify the signal, and convert it into an electromagnetic wave for radiation via the antenna 1.
[0075] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0076] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel.
[0077] The electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor. The ISP is used to process the data fed back by the camera 193. The camera 193 is used to capture a static image or a video. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0078] The external memory 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 memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0079] The internal memory 121 may be used to store computer executable program codes, which may include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. For example, in an embodiment of the present disclosure, the processor 110 may execute the instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.
[0080] The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0081] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0082] The button 190 includes a power button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
[0083] In addition, an operating system, such as Hongmeng operating system, iOS operating system, Android operating system, Windows operating system, etc., is running on the above components. Applications can be installed and run on the operating system. In other embodiments, there may be multiple operating systems running in the electronic device.
[0084] It should be understood that Figure 1 The hardware modules included in the electronic device shown are only described for example, and do not limit the specific structure of the electronic device. In fact, the electronic device provided by the embodiment of the present disclosure may also include other hardware modules that have an interactive relationship with the hardware modules illustrated in the figure, which are not specifically limited here. For example, the electronic device may also include a flashlight, a micro-projection device, etc. For another example, if the electronic device is a PC, then the electronic device may also include components such as a keyboard and a mouse.
[0085] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device is illustrated.
[0086] Figure 2 is a software structure diagram of an electronic device in an embodiment of the present disclosure. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, The system is divided into five layers, from top to bottom: application layer, application framework layer, Android runtime and system library, HAL (hardware abstraction layer) layer and kernel layer.
[0087] The application layer may include a series of application packages. For example, the application package may include applications (APP) such as email, camera, calendar, call, map, navigation, WLAN, Bluetooth, music, game, video, browser, short message, etc.
[0088] In the disclosed embodiment, an APP with a shooting function, such as a camera APP, may be installed in the application layer. Of course, when other APPs need to use the time-lapse shooting function, they may also call the camera APP to achieve shooting.
[0089] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0090] The application framework layer may include an activity manager, a window manager, a content provider, a view system, a resource manager, a notification manager, etc., and the embodiments of the present disclosure do not impose any restrictions on this.
[0091] Activity Manager: used to manage the life cycle of each application. Applications usually run in the operating system in the form of Activities. For each Activity, there is a corresponding application record (ActivityRecord) in the Activity Manager. This ActivityRecord records the status of the Activity of the application. The Activity Manager can use this ActivityRecord as an identifier to schedule the Activity process of the application.
[0092] Window Manager Service: It is used to manage the graphical user interface (GUI) resources used on the screen. Specifically, it can be used to obtain the screen size, create and destroy windows, show and hide windows, layout windows, manage focus, and manage input methods and wallpapers.
[0093] Content providers are used to store and retrieve data and make it accessible to applications. This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc. Resource managers provide applications with various resources, such as localized strings, icons, images, layout files, video files, etc.
[0094] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0095] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0096] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of multiple common audio and video formats, as well as static image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. OpenGL ES is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing. SGL is a drawing engine for 2D drawing.
[0097] The HAL layer may include multiple functional modules. For example: a decision engine module, a sensor module, a RAW2YUV module, a fork (FORK) module, a processing module, a downscaler module, a preview (Preview) module, a crop (CROP) module, an upscaler module and a video module. Among them, the sensor module may include a first sensor module and a second sensor module. The first sensor module may call the preset camera corresponding to the first zoom option to obtain the original image data. The second sensor module may call the preset camera corresponding to the second zoom option to obtain the original image data.
[0098] The decision engine module is used to respond to the user's zoom selection operation and determine the preset camera corresponding to the target zoom option. The sensor module is used to respond to the user's time-lapse shooting instruction and call the preset camera corresponding to the target zoom option to obtain raw image data, which is represented in RAW format and can also be called RAW image data. The raw image data can be Figure 3 The first image data in the corresponding embodiment, or Figure 6 The first picture data in the corresponding embodiment.
[0099] The RAW2YUV module is used to convert RAW image data into YUV image data. The fork module is used to copy the YUV image data generated by the RAW2YUV module to obtain two identical YUV image data. One YUV image data is used to generate a preview stream, and the other YUV image data is used to generate a video stream.
[0100] The processing module is used to perform conventional image processing on one of the YUV image data copied by the forking module to obtain processed image data. The downsampling module is used to reduce the resolution of the processed image data to a lower level. The preview module is used to perform preview processing on the downsampled image to obtain a preview stream.
[0101] The cropping module is used to crop the other YUV image data copied by the forking module and obtain the cropped image data. The upsampling module is used to increase the resolution of the cropped image data to a higher level. The video recording module is used to synthesize the upsampled images to obtain a video stream.
[0102] That is to say, after the sensor module generates raw image data, the raw image data can be converted from RAW format to YUV format through the RAW2YUV module to obtain YUV image data. Then, the YUV image data is copied using the fork module to obtain two YUV image data. Next, one of the YUV image data is sequentially input into the processing module, the downsampling module, and the preview module to obtain a preview stream. The other YUV image data is sequentially input into the cropping module, the upsampling module, and the video recording module to obtain a video recording stream, and finally the video recording stream is used to generate a time-lapse video.
[0103] The kernel layer is a layer between hardware and software. The kernel layer at least includes display driver, camera driver, audio driver, sensor driver, etc., and the embodiments of the present disclosure do not impose any restrictions on this.
[0104] The methods in the following embodiments can all be implemented in an electronic device having the above hardware structure or software structure.
[0105] The following is a detailed description of a time-lapse photography method provided by an embodiment of the present disclosure in conjunction with the accompanying drawings. The method can be applied to the above-mentioned electronic device. Figure 3 As shown, the method specifically includes:
[0106] Step 301: After the electronic device enters the delayed photography mode, the camera APP sends a delayed photography notification to the first sensor module.
[0107] The time-lapse photography notification may be an image preview notification or a time-lapse photography video notification. The time-lapse photography notification is used to request the first sensor module to obtain first image data, and the first image data may be used to generate a preview stream or a video stream.
[0108] In some examples, taking the electronic device as a mobile phone, when a user needs to use the camera APP of the mobile phone to shoot time-lapse photography, the user can trigger the camera application of the mobile phone to start, and the camera application of the mobile phone can trigger the camera of the mobile phone to start. After the camera is turned on, the camera can be used to display preview images and record videos for the user on the camera APP.
[0109] Camera apps usually have one or more shooting modes, such as photo, panorama, video, slow motion or time-lapse photography. Figure 4As shown, after detecting that the user opens the camera APP, the mobile phone can call the camera APP to open the camera and enter the camera interface 400. The camera interface 400 can display the preview interface 401 of the camera APP. The camera interface 400 is provided with an option 402 for the time-lapse photography shooting mode. If it is detected that the user selects option 402, the mobile phone can enter the time-lapse photography shooting mode. Of course, one or more shooting modes such as video, photo, portrait or panorama can also be set in the camera interface 400, and the embodiment of the present disclosure does not impose any restrictions on this.
[0110] After the mobile phone enters the time-lapse photography mode, the mobile phone can display the shooting picture currently captured by the camera in the preview interface 401. Since the shooting has not started at this time, the shooting picture displayed in real time in the preview interface 401 can be called a preview picture. In addition, the camera interface 400 also includes a shooting button 403 for time-lapse photography. If it is detected that the user clicks the shooting button 403 in the preview interface 401, it means that the user has performed a shooting operation in the time-lapse photography mode. The camera interface 400 also includes a zoom selection button 404 for time-lapse photography, and the zoom selection button 404 includes multiple zoom options, such as 1x and 2x. Usually, the default zoom option of the mobile phone is 1x. If it is not detected that the user clicks the zoom option in the zoom selection button 404, it means that the user chooses to obtain the shooting image with a 1x zoom camera. It can be understood that the zoom options can also include 0.5x, 3x, etc., and the present disclosure does not limit this.
[0111] Among them, if the zoom option is 1x, it means the zoom factor is 1. If the zoom option is 2x, it means the zoom factor is 2. Generally, when the zoom factor is 1, the mobile phone displays the image taken by the main camera. That is, the standard camera corresponding to the zoom factor 1 is the main camera. For example, the image size taken by the main camera is 1152×648. When the zoom factor is 2, the electronic device displays the image taken by the telephoto camera. That is, the standard camera corresponding to the zoom factor 2 is the telephoto camera.
[0112] It is understandable that different electronic devices have different image sizes captured by the main camera, the telephoto camera, and the ultra-wide-angle camera. The present disclosure does not limit the image sizes captured by different cameras, which shall be subject to actual application.
[0113] Since the time-lapse video currently shot by electronic devices is a video with a fixed field of view, the field of view in the time-lapse video seen by the user remains unchanged. As each frame of the image is played, the user can only observe changes in the objects in the fixed field of view. In order to make the time-lapse video more attractive to users, the present disclosure utilizes the time-lapse shooting method to play the time-lapse video in an automatic panning playback mode. In this way, the field of view in the time-lapse video will change as the video is played. In other words, the field of view of each frame of the time-lapse video is different.
[0114] In order to achieve a different field of view for each frame of the time-lapse video. The present disclosure uses a preset camera corresponding to the target zoom option to shoot when using a camera to shoot. The size of the captured image obtained by the preset camera is larger than the size of the standard image obtained by the standard camera corresponding to the target zoom option. For example, the size of the standard image is 1152×648, and the size of the captured image is 1920×1080. The preset camera can be used to obtain multiple frames of captured images according to the set shooting duration and shooting frame rate. After obtaining multiple frames of captured images, the multiple frames of captured images can be cropped so that the field of view of each cropped image is different. For example, cropping multiple frames of captured images can be cropping the size of the multiple frames of captured images from 1920×1080 to 1152×648. That is, the size of the captured image is cropped to be consistent with the size of the standard image. In this way, it can be ensured that the size finally displayed by the electronic device is consistent with the standard size corresponding to the target zoom multiple. Among them, the standard size is the size of the standard image captured by the standard camera.
[0115] Finally, a time-lapse video is generated based on the cropped images. When playing, the time-lapse video allows users to feel the flow and change of the visual field, allowing users to experience dynamic visual effects, and bringing users a more attractive and immersive viewing experience.
[0116] In some examples, since the preset camera is called through a sensor module, the camera APP can set a first zoom option (also referred to as a default zoom option) and a first sensor module corresponding to the first zoom option, for example, the first zoom option is 1x. The first sensor module corresponding to the first zoom option is a sensor module corresponding to the ultra-wide-angle camera.
[0117] The camera APP can also be used to detect the user's selection operation on multiple zoom options. When the user's selection operation on the multiple zoom options in the zoom selection button 404 is not detected, it is considered that the user has selected the first zoom option. Since the camera APP pre-sets the first sensor module corresponding to the first zoom option, the camera APP can directly send a time-lapse photography notification to the first sensor module. After receiving the time-lapse photography notification, the first sensor module can call the preset camera (i.e., the ultra-wide-angle camera) corresponding to the first zoom option to obtain the captured image. In this case, the camera APP does not need to determine the first sensor module corresponding to the first zoom option through other hardware modules. Thereby reducing the hardware cost of the electronic device.
[0118] Exemplarily, the first zoom option may be 1x. Accordingly, the preset camera corresponding to the first zoom option 1x is an ultra-wide-angle camera. The first zoom option may also be other zoom options. Different zoom options correspond to different preset cameras. And the size of the captured image obtained by the preset camera is larger than the size of the standard image obtained by the standard camera.
[0119] In other examples, when the camera APP does not detect the user's selection operation of multiple zoom options, the camera APP may also send a zoom notification to the decision engine module. The zoom notification includes a first zoom option. After receiving the zoom notification, the decision engine module determines the first sensor module corresponding to the first zoom option according to the first zoom option in the zoom notification. Then, the first sensor module is used to call the preset camera corresponding to the first zoom option to obtain the captured image.
[0120] In some examples, the decision engine module in the electronic device can store a correspondence between zoom options and sensor modules. The correspondence between zoom options and sensor modules includes a sensor module corresponding to each zoom option in a plurality of zoom options. After determining the target zoom option selected by the user, the target sensor module corresponding to the target zoom option can be determined based on the correspondence between the zoom options and sensor modules.
[0121] In other examples, the correspondence between zoom options and cameras may be stored in the decision engine module. The correspondence between the zoom options and the cameras includes the camera corresponding to each zoom option in the multiple zoom options. After determining the target zoom option selected by the user, the target camera corresponding to the target zoom option may be determined based on the correspondence between the zoom options and the cameras. Since the camera and the sensor module are in a calling and called relationship, after determining the target camera, the target sensor module may also be determined. Afterwards, the decision engine module may send a time-lapse photography notification to the target sensor module to instruct the target sensor module to call the target camera to obtain the captured image.
[0122] Step 302: The first sensor module receives a time-lapse photography notification.
[0123] Step 303: In response to the time-lapse photography notification, the first sensor module calls the first camera to obtain first image data, and sends a format conversion notification to the RAW2YUV module.
[0124] The format conversion notification is used to instruct the RAW2YUV module to convert the format of the first image data. The format conversion notification includes the first image data. The first camera is a preset camera corresponding to the first zoom option.
[0125] The first image data, namely, the image data captured by a preset camera corresponding to the first zoom option of the electronic device, may include multiple frames of initial image data.
[0126] After the first sensor module receives the time-lapse photography notification, the first sensor module can respond to the time-lapse photography notification and call the preset camera corresponding to the first zoom option to obtain the first image data. After obtaining the first image data, a format conversion notification can be sent to the RAW2YUV module to convert the format of the first image data.
[0127] Step 304: The RAW2YUV module receives a format conversion notification.
[0128] Step 305: In response to the format conversion notification, the RAW2YUV module performs format conversion on the first image data to obtain second image data, and sends a copy notification to the fork module.
[0129] The copy notification is used to instruct the fork module to copy the second image data. The copy notification includes the second image data.
[0130] Since the formats of the multiple frames of initial image data in the first image data cannot be directly processed by most image processing algorithms, the first sensor module can send the first image data to the RAW2YUV module, and use the RAW2YUV module to convert the formats of the multiple frames of initial image data in the first image data. In response, after receiving the first image data, the RAW2YUV module can perform format conversion processing on the multiple frames of initial image data in the first image data to obtain the second image data.
[0131] In some examples, the format of the first image data is RAW format. The RAW2YUV module converts the format of the first image data by converting the first image data from RAW format to YUV format to obtain the second image data.
[0132] The second image data, that is, the RAW2YUV module obtains the first image data after processing the second image data. The second image data may include multiple frames of converted image data. In some examples, the format of the multiple frames of converted image data in the second image data generated by the RAW2YUV module is in yuv format.
[0133] Step 306: The fork module receives the replication notification.
[0134] Step 307: In response to the copy notification, the forking module copies the second image data to obtain third image data, sends a processing notification to the processing module, and sends a cropping notification to the cropping module.
[0135] The second image data and the third image data are the same.
[0136] Since the second image data is not only used to generate a preview stream, but also to generate a video stream. Therefore, the RAW2YUV module can send the second image data to the forking module, and use the forking module to copy the second image data to obtain the third image data. In response, after receiving the second image data, the forking module can copy the multi-frame converted image data in the second image data to obtain the third image data. After obtaining the third image data, a processing notification can be sent to the processing module to facilitate the subsequent generation of a preview stream. And a cropping notification is sent to the cropping module to facilitate the subsequent generation of a time-lapse video.
[0137] The third image data, that is, the data obtained after the forking module processes the second image data, may include multiple frames of converted image data.
[0138] In some examples, the processing notification is used to instruct the processing module to process the second image data to obtain the fourth image data. The cropping notification is used to instruct the cropping module to crop the third image data to obtain the fifth image data. The processing notification includes the second image data, and the cropping notification includes the third image data.
[0139] In some other examples, the processing notification is used to instruct the processing module to process the third image data to obtain the fourth image data. The cropping notification is used to instruct the cropping module to crop the second image data to obtain the fifth image data. The processing notification includes the third image data, and the cropping notification includes the second image data.
[0140] The following is an exemplary description using an example in which the processing notification includes the second image data and the cropping notification includes the third image data.
[0141] Step 308: The processing module receives the processing notification.
[0142] Step 309: In response to the processing notification, the processing module processes the second image data to obtain fourth image data, and sends a downsampling notification to the downsampling module.
[0143] The downsampling notification is used to instruct the downsampling module to downsample the fourth image data to obtain the sixth image data. The downsampling notification includes the fourth image data.
[0144] After the processing module receives the time-lapse photography notification, the processing module can process the second image data in response to the time-lapse photography notification to obtain the fourth image data. After obtaining the fourth image data, a downsampling notification can be sent to the downsampling module to reduce the resolution of the fourth image data.
[0145] The fourth image data, that is, the data obtained after the processing module processes the second image data, includes multiple frames of processed image data.
[0146] In some examples, the processing module processes the second image data to obtain the fourth image data. The processing performed by the processing module on the second image data is conventional image processing. The processing module may include multiple modules, for example, the processing module includes an image processing engine (IPE) and an enhanced image processing (super image turbo, SIT). The processing module processes the second image data by inputting the second image data into the IPE, and the IPE performs basic image processing on the second image data to obtain the processed second image data. Then, the IPE inputs the processed second image data into the SIT, and the SIT performs beautification processing on the processed second image data to obtain the fourth image data.
[0147] The basic image processing operations performed by IPE on the second image data include but are not limited to hardware noise reduction (MFNR, MFSR), resizing, noise processing, color processing (color difference correction, chromaticity suppression), detail enhancement (skin color enhancement), etc. The beautification processing operations performed by SIT on the processed second image data include but are not limited to beautifying the processed second image data based on specific user needs, such as blurring, beautification, etc.
[0148] The second image data is processed by IPE and SIT in the processing module to obtain fourth image data, and the image details of the fourth image data are more vivid and more in line with the user's aesthetic taste for images.
[0149] It should be noted that the processing module of the second image data includes but is not limited to the image processing such as hardware noise reduction, resizing, noise processing, color processing, detail enhancement and blur processing mentioned above, and the embodiments of the present disclosure do not impose any restrictions on this.
[0150] Step 310: The downsampling module receives a downsampling notification.
[0151] Step 311: In response to the downsampling notification, the downsampling module downsamples the fourth image data to obtain sixth image data, and sends a preview notification to the preview module.
[0152] The preview notification is used to instruct the preview module to generate a preview stream according to the sixth image data. The preview notification includes the sixth image data.
[0153] After the downsampling module receives the downsampling notification, the downsampling module can respond to the downsampling notification and downsample the fourth image data to obtain the sixth image data. After obtaining the sixth image data, a preview notification can be sent to the preview module to obtain a preview stream.
[0154] In some scenarios, the resolution of the fourth image data may be too high to be effectively transmitted or processed. Therefore, the processing module may send the fourth image data to the downsampling module, and use the downsampling module to reduce the resolution of the fourth image data, thereby obtaining the sixth image data. In this way, the complexity and computational load of subsequent processing can be reduced.
[0155] The sixth image data, that is, the data obtained after the downsampling module processes the fourth image data, may include multiple frames of downsampled image data.
[0156] Step 312: The preview module receives the preview notification.
[0157] Step 313: In response to the preview notification, the preview module performs preview processing on the sixth image data to obtain a preview stream.
[0158] After the preview module receives the preview notification, the preview module may perform preview processing on the sixth image data in response to the preview notification, thereby obtaining a preview stream.
[0159] In one example, the preview module performs preview processing on the sixth image data, which may include initializing and configuring the preview function of the electronic device based on the sixth image data, such as selecting a resolution for previewing the sixth image data, setting a preview frame rate for the sixth image data, and dynamically adjusting preview parameters, etc., so as to obtain a preview stream. In this way, the camera APP can conveniently use the preview function, so that the user can view the image captured by the electronic device in real time.
[0160] Step 314: The cutting module receives the cutting notification.
[0161] Step 315: In response to the cropping notification, the cropping module performs cropping processing on the third image data to obtain fifth image data, and sends an upsampling notification to the upsampling module.
[0162] The upsampling notification is used to instruct the upsampling module to perform upsampling processing on the fifth image data to obtain the seventh image data. The upsampling notification includes the fifth image data.
[0163] Combined with step 301, it can be known that in order to change the field of view in the time-lapse video. The present disclosure utilizes the time-lapse photography method to make the field of view of each frame image in the time-lapse video different. Among them, the different fields of view of each frame image are achieved by cropping each frame of the captured image. Therefore, the bifurcation module can send the third image data to the cropping module, and use the cropping module to crop the third image data to obtain the fifth image data. In response, after receiving the third image data, the cropping module can crop the multiple frames of converted image data in the third image data to obtain the fifth image data. After acquiring the fifth image data, an upsampling notification can be sent to the upsampling module to facilitate the subsequent generation of the video stream.
[0164] The fifth image data, that is, the data obtained after the cropping module processes the third image data, may include multiple frames of cropped image data.
[0165] In some examples, the cropping module performs cropping processing on the third image data, which may include first determining the size of each frame of converted image data in the third image data and the size of the standard image corresponding to the target zoom factor; then determining the multiple relationship between the size of each frame of converted image data and the size of the standard image according to the size of each frame of converted image data in the third image data and the size of the standard image; then determining the size of the cropping area corresponding to each frame of converted image data according to the multiple relationship between the size of each frame of converted image data and the size of the standard image; finally, cropping each frame of converted image data according to the size of the cropping area corresponding to each frame of converted image data to obtain each frame of cropped image in the fifth image data. The field of view content of two adjacent frames of cropped images in the multiple frames of cropped images at least partially overlaps.
[0166] In other examples, cropping each frame of converted image data according to the size of the cropping area corresponding to each frame of converted image data to obtain each frame of cropped image in the fifth image data includes: first, determining the total number of frames of the third image data. Then, according to the total number of frames, determining the cropping vertex coordinates of each frame of converted image data in the third image data. Finally, according to the cropping vertex coordinates of each frame of converted image data and the size of the cropping area corresponding to each frame of converted image data, cropping each frame of converted image data in the third image data in sequence to obtain each frame of cropped image. Among them, the horizontal coordinates of the cropping vertex coordinates of the converted image data of two adjacent frames are different. The difference between the horizontal coordinates of the cropping vertex coordinates of the converted image data of two adjacent frames is a preset value, which is determined according to the width of each frame of converted image data, the width of the standard image, and the total number of frames. The size of each frame of cropped image is consistent with the size of the standard image.
[0167] The preset value may be fixed or variable. When the preset value is fixed, the time-lapse video obtained from the multiple cropped frames may be evenly panned for playback, thereby providing a smoother playback experience for the user.
[0168] like Figure 5 As shown, the size of each frame of the converted image data in the third image data can be represented by (w, h), where w is the width of each frame of the converted image data, and h is the height of each frame of the converted image data. The size of the standard image can be represented by (w', h'). w' is the width of the standard image, and h' is the height of the standard image.
[0169] Since the size of the cropped area corresponding to each frame of converted image data is consistent with the size of the standard image, the size of the cropped area corresponding to each frame of converted image data can also be expressed by (w', h'), and w' and h' satisfy the following expression.
[0170]
[0171] Wherein, α is a parameter, and α is used to characterize the multiple relationship between the size of each frame of the converted image data in the third image data and the size of the standard image. α can be adjusted according to the multiple relationship between the actual sizes, and the present disclosure is not limited to this.
[0172] After determining the size of the cropping area corresponding to each frame of converted image data, the total number of frames of the third image data can be determined according to the recording duration. According to the total number of frames, the size of each frame of converted image data in the third image data, and the size of the cropping area corresponding to each frame of converted image data, the cropping vertex coordinates of each frame of converted image data are obtained. Finally, according to the cropping vertex coordinates of each frame of converted image data and the size of the cropping area corresponding to each frame of converted image data, each frame of converted image data in the third image data is cropped in turn to obtain each frame of cropped image.
[0173] For example, if the recording time of the time-lapse video is t, then the total number of frames of the third image data F = 60*t*f. Where f is the frame rate of the time-lapse video. In order to play the time-lapse video in the form of automatic panning, it is necessary to determine the coordinates of the cutout vertices (x n and n ). n The width coordinate of the clipping vertex of each frame of converted image data. n The height coordinates of the clipping vertices of each frame of converted image data.
[0174] In some examples, reference Figure 5 The automatic translation effect shown. According to the determined total number of frames, the horizontal coordinate x in the clipping vertex coordinate of each frame of the converted image data can be calculated in turn. n .x n Satisfies the following expression:
[0175]
[0176] The ordinate y in the clipping vertex coordinates of each frame of the converted image data n can remain unchanged. For example, y n is located in the center of each frame of the converted image data in the third image data. In addition, y n It may also be located at the top of each frame of converted image data in the third image data or at other customized positions, which is not limited by the present disclosure.
[0177] With y n For example, the center position of each frame of the converted image data in the third image data is taken as an example, y n Satisfies the following expression:
[0178]
[0179] It can be understood that the y coordinates of the clipping vertex of each frame of the converted image data are nCan be changed. For example, according to user needs, set the y coordinates of the clipping vertex of each frame of converted image data n . Then according to user needs, calculate y n The specific value of .
[0180] Exemplarily, the first zoom factor is 1x, and the third image data is an image acquired by an ultra-wide-angle camera. The size of the multi-frame converted image data in the third image data is 1920×1080. The size of the standard image corresponding to the zoom factor 1x is 1152×648. Based on the size of the multi-frame converted image data and the size of the standard image, it can be known that the size of the standard image is 0.6 times the size of the multi-frame converted image data.
[0181] Then, the size w' and h' of the cropped area corresponding to each frame of converted image data can be calculated based on the multiple relationship between the size of the standard image and the size of the converted image data of multiple frames. w' and h' satisfy the following expression:
[0182]
[0183] Then, according to the above x n and n The expression is used to calculate the clipping vertex coordinates of each frame of the transformed image data. Finally, according to the clipping vertex coordinates of each frame of the transformed image data and the size of the clipping area corresponding to each frame of the transformed image data, each frame of the transformed image data in the third image data is clipped to obtain the fifth image data.
[0184] It should be noted that the embodiment of the present disclosure may not limit the execution order between step 308 and step 314. For example, step 308 may be executed first and then step 314; step 314 may be executed first and then step 308; or step 308 and step 314 may be executed simultaneously, which may be determined according to actual usage requirements.
[0185] Step 316: The upsampling module receives the upsampling notification.
[0186] Step 317: In response to the upsampling notification, the upsampling module performs upsampling processing on the fifth image data to obtain seventh image data, and sends a recording notification to the recording module.
[0187] The video recording notification is used to instruct the video recording module to generate a video recording stream according to the seventh image data.
[0188] After the upsampling module receives the upsampling notification, the upsampling module may respond to the upsampling notification and perform upsampling processing on the fifth image data to obtain the seventh image data. After obtaining the seventh image data, a recording notification may be sent to the recording module to obtain a recording stream.
[0189] In some scenarios, the resolution of the fifth image data may be too low, and the resolution of the image needs to be increased to adapt to electronic devices with higher resolutions. Therefore, the processing module can send the fifth image data to the upsampling module, and use the upsampling module to increase the resolution of the fifth image data, thereby obtaining the seventh image data. In this way, the user's viewing experience can be improved.
[0190] The seventh image data, that is, the data obtained after the upsampling module processes the fifth image data, may include multiple frames of upsampled image data.
[0191] Step 318: The video recording module receives the video recording notification.
[0192] Step 319: In response to the video recording notification, the video recording module processes the seventh image data to obtain a video recording stream, and sends the video recording stream to the camera APP.
[0193] The video recording notification is used to instruct the video recording module to generate a video recording stream according to the seventh image data.
[0194] After the video recording module receives the video recording notification, the video recording module may perform preview processing on the seventh image data in response to the video recording notification, thereby obtaining a preview stream.
[0195] In one example, the video recording module processes the seventh image data and may include initializing and configuring the recording function of the electronic device based on the seventh image data, such as selecting an audio source of the seventh image data, setting the recording resolution and encoding format of the seventh image data, etc., so as to obtain a video stream. In this way, the camera APP can conveniently use the video recording function.
[0196] Step 320: The camera APP receives the video stream, and performs frame extraction and encoding processing on the video stream to obtain a time-lapse video.
[0197] In some examples, the camera app can obtain the video stream through the video module of the HAL layer, and then parse the video stream to extract each frame of the image. Among them, for time-lapse video, the camera app can selectively process the extracted frame images, such as extracting frames, reordering frames according to plan, or applying other special effects. Then, the camera app can use a suitable encoding algorithm (such as H.264, H.265, etc.) to encode each frame of the image to generate an encoded video frame. Finally, the camera app can combine the encoded video frames to generate a time-lapse video. In addition, the encoded video frames can also be saved to local storage.
[0198] In addition, the time-lapse photography shooting method disclosed in the present invention can also be applied to ordinary video scenes and movie mode scenes. After acquiring the video stream, each frame image in the video stream can be cropped so that the field of view content of two adjacent frames of the cropped image at least partially overlaps. In this way, the video screen in ordinary video scenes and movie mode scenes can also achieve the effect of automatic panning playback. The details are not repeated here.
[0199] The following is a detailed description of a time-lapse photography method provided by an embodiment of the present disclosure in conjunction with the accompanying drawings. The method can be applied to the above-mentioned electronic device. Figure 6 As shown, the method specifically includes:
[0200] Step 601: After the electronic device enters the delayed photography mode, upon detecting a user's selection operation on a target zoom option, the camera APP in the electronic device sends a zoom notification to the decision engine module.
[0201] The zoom notification is used to instruct the decision engine module user to select a target zoom option from a plurality of zoom options. The zoom notification includes the target zoom option.
[0202] In some examples, taking a mobile phone as an example, after the mobile phone enters the time-lapse photography mode, Figure 4 As shown, the camera interface 400 of the camera APP can display a zoom selection button 404. Figure 7 As shown, the mobile phone can receive a click operation of the user on the zoom option 2x, and in response to the click operation, the display screen 702 of the object in the preview interface 401 of the mobile phone presents an enlarged display state.
[0203] In some examples, when the camera APP detects that the user has selected the second zoom option among multiple zoom options, the camera APP may send a zoom notification to the decision engine module. The target zoom option is the second zoom option. When the user's selection operation on the second zoom option in the zoom selection button 404 is detected, it means that the user chooses to use other zoom options for shooting, so the camera APP needs to use the decision engine module to determine the second sensor module corresponding to the second zoom option selected by the user. So that the second sensor module can be used to call the preset camera corresponding to the second zoom option to obtain the captured image. Exemplarily, when the second zoom option is 2x, the preset camera corresponding to the second zoom option is the main camera.
[0204] In some examples, the decision engine module in the electronic device may store the correspondence between the zoom option and the sensor module. Alternatively, the decision engine module may store the correspondence between the zoom option and the camera. For details, see step 301, which will not be repeated here.
[0205] Step 602: The decision engine module receives a zoom notification.
[0206] Step 603: In response to the zoom notification, the decision engine module determines a second sensor module corresponding to the second zoom option, and sends a time-lapse photography notification to the second sensor module.
[0207] After the decision engine module receives the zoom notification, the decision engine module can determine the second sensor module corresponding to the second zoom option in response to the zoom notification. After determining the second sensor module, a time-lapse photography notification can be sent to the second sensor module.
[0208] In some examples, referring to step 301, the decision engine module may store the correspondence between the zoom option and the sensor module. Alternatively, the decision engine module may store the correspondence between the zoom option and the camera. Therefore, the second sensor module determined by the decision engine module may be determined based on the correspondence between the zoom option and the sensor module. Alternatively, the second sensor module determined by the decision engine module may be determined based on the correspondence between the zoom option and the camera. The present disclosure does not limit this.
[0209] Step 604: The second sensor module receives the time-lapse photography notification.
[0210] Step 605: In response to the time-lapse photography notification, the second sensor module calls the second camera to obtain the first image data, and sends a format conversion notification to the RAW2YUV module.
[0211] The second camera is a preset camera corresponding to the second zoom option. The format conversion notification is used to instruct the RAW2YUV module to convert the format of the first image data. The format conversion notification includes the first image data.
[0212] The first image data is the image data captured by the preset camera corresponding to the second zoom option of the electronic device. The first image data may include multiple frames of initial image data. The above content can refer to step 302 and step 303, which will not be repeated here.
[0213] Step 606: The RAW2YUV module receives a format conversion notification.
[0214] Step 607: In response to the format conversion notification, the RAW2YUV module performs format conversion on the initial image data to obtain second image data, and sends a copy notification to the forked module.
[0215] The copy notification is used to instruct the fork module to copy the second picture data. The copy notification includes the second picture data. The above content can refer to step 304 and step 305, which will not be repeated here.
[0216] Step 608: The fork module receives the replication notification.
[0217] Step 609: In response to the copy notification, the forking module copies the second image data to obtain third image data, sends a processing notification to the processing module, and sends a cropping notification to the cropping module.
[0218] The second picture data and the third picture data are the same.
[0219] In some examples, the processing notification is used to instruct the processing module to process the second picture data to obtain the fourth picture data. The cropping notification is used to instruct the cropping module to crop the third picture data to obtain the fifth picture data. The processing notification includes the second picture data, and the cropping notification includes the third picture data.
[0220] In some other examples, the processing notification is used to instruct the processing module to process the third image data to obtain the fourth image data. The cropping notification is used to instruct the cropping module to crop the second image data to obtain the fifth image data. Or the processing notification includes the third image data, and the cropping notification includes the second image data. The above content can refer to step 306 and step 307, which will not be repeated here.
[0221] Step 610: The processing module receives the processing notification.
[0222] Step 611: In response to the processing notification, the processing module processes the second picture data to obtain fourth picture data, and sends a downsampling notification to the downsampling module.
[0223] The downsampling notification is used to instruct the downsampling module to downsample the fourth picture data to obtain the fifth picture data. The downsampling notification includes the fourth picture data. The above content can refer to step 308 and step 309, which will not be repeated here.
[0224] Step 612: The downsampling module receives the downsampling notification.
[0225] Step 613: In response to the downsampling notification, the downsampling module downsamples the fourth image data to obtain sixth image data, and sends a preview notification to the preview module.
[0226] The preview notification is used to instruct the preview module to generate a preview stream according to the sixth picture data. The preview notification includes the sixth picture data. The above content can refer to step 310 and step 311, which will not be repeated here.
[0227] Step 614: The preview module receives the preview notification.
[0228] Step 615: In response to the preview notification, the preview module performs preview processing on the sixth image data to obtain a preview stream.
[0229] The above content can be referred to step 312 and step 313, which will not be repeated here.
[0230] Step 616: The cutting module receives the cutting notification.
[0231] Step 617: In response to the cropping notification, the cropping module crops the third picture data to obtain fifth picture data, and sends an upsampling notification to the upsampling module.
[0232] In combination with step 315 and step 601, when the user selects the second zoom factor 2x, the third picture data is an image acquired by the main camera. The size of the converted picture data of the multiple frames in the third picture data is 1152×648. The size of the standard image captured by the standard camera corresponding to the zoom factor 2x is 576×324. Based on the size of the converted picture data of the multiple frames in the third picture data and the size of the standard image, it can be known that the size of the standard image is 0.5 times the size of the converted picture data of the multiple frames in the third picture data.
[0233] Then, the size (w', h') of the cropping area corresponding to each frame of converted image data can be calculated based on the multiple relationship between the size of the standard image and the size of the multiple frames of converted image data in the third image data. w' and h' satisfy the following expression:
[0234]
[0235] Next, according to x in step 315 n and n The expression of is used to calculate the clipping vertex coordinates of each frame of the transformed picture data. Finally, according to the clipping vertex coordinates of each frame of the transformed picture data and the size of the clipping area corresponding to each frame of the transformed picture data, the clipping of each frame of the transformed picture data in the third picture data is performed in sequence to obtain the fifth picture data. The above content can be referred to step 314 and step 315, which will not be repeated here.
[0236] Step 618: The upsampling module receives the upsampling notification.
[0237] The upsampling notification is used to instruct the upsampling module to perform upsampling processing on the fifth picture data to obtain the seventh picture data. The upsampling notification includes the fifth picture data.
[0238] Step 619: In response to the upsampling notification, the upsampling module performs upsampling processing on the fifth picture data to obtain the seventh picture data, and sends a recording notification to the recording module.
[0239] The video recording notification is used to instruct the video recording module to generate a video recording stream according to the seventh picture data. The above content can refer to step 316 and step 317, which will not be repeated here.
[0240] Step 620: The video recording module receives the video recording notification.
[0241] Step 621: In response to the video recording notification, the video recording module processes the seventh image data to obtain a video recording stream, and sends the video recording stream to the camera APP. The above content can refer to step 318 and step 319, which will not be repeated here.
[0242] Step 622: The camera APP receives the video stream, and performs frame extraction and encoding processing on the video stream to obtain a time-lapse video. The above content can refer to step 320, which will not be repeated here.
[0243] Therefore, in the process of time-lapse photography, the preset camera corresponding to the target zoom option is used to obtain multiple frames of captured images by adopting this scheme. Since the size of the captured image is larger than the size of the standard image corresponding to the target zoom option, the multiple frames of captured images can be cropped to obtain multiple frames of cropped images. The field of view content of the cropped images of two adjacent frames in the multiple frames of cropped images at least partially overlaps. Then, a time-lapse photography video can be generated based on the multiple frames of cropped images. Since the field of view content of the cropped images of two adjacent frames at least partially overlaps, the time-lapse photography video can present an automatic panning playback effect when playing, and gradually show the user the entire field of view. The field of view content of the cropped images of two adjacent frames at least partially overlaps, which allows the user to feel the flow and change of the video screen when watching the time-lapse photography video, and the partial overlap can make the video screen coherent, and the viewing is more fluid and not abrupt. This filming effect not only allows users to feel the dynamic visual effect, but also brings users a more attractive and immersive viewing experience.
[0244] For ease of understanding, the following Figure 8 The data processing method provided by the embodiment of the present disclosure is described. Figure 7 As shown, the data processing method may include the following steps 801-803.
[0245] Step 801: When the camera application enters the time-lapse photography mode, the electronic device uses a preset camera to obtain multiple frames of captured images. The preset camera is a preset camera corresponding to the target zoom option, and the size of the captured image is larger than the size of the standard image corresponding to the target zoom option.
[0246] In the embodiment of the present disclosure, when the camera application enters the time-lapse photography mode, the electronic device uses a preset camera to obtain multiple frames of captured images. The preset camera is the preset camera corresponding to the target zoom option. The size of the captured image is larger than the size of the standard image corresponding to the target zoom option. Figure 3Steps 301 to 303 in the illustrated embodiment will not be described in detail in the embodiment of the present disclosure.
[0247] In some examples, before acquiring multiple frames of captured images using a preset camera, the method also includes: detecting a user's selection operation on multiple zoom options; if no user's selection operation on multiple zoom options is detected, determining that the preset camera is the preset camera corresponding to the first zoom option; and the target zoom option is the first zoom option.
[0248] The preset camera corresponding to the first zoom option and the above Figure 3 The first camera in step 303 in the illustrated embodiment is similar.
[0249] In the embodiment of the present disclosure, the user's selection operation on multiple zoom options is detected; when the user's selection operation on multiple zoom options is not detected, the preset camera is determined to be the preset camera corresponding to the first zoom option; the target zoom option is the first zoom option, and the above Figure 3 Steps 301 to 303 in the illustrated embodiment will not be described in detail in the embodiment of the present disclosure.
[0250] Using a preset camera to obtain multiple frames of captured images includes: using a preset camera corresponding to a first zoom option to obtain multiple frames of captured images.
[0251] In the embodiment of the present disclosure, the method of obtaining multiple frames of captured images by using the preset camera corresponding to the first zoom option can refer to the above Figure 3 Steps 301 to 303 in the illustrated embodiment will not be described in detail in the embodiment of the present disclosure.
[0252] In some examples, after detecting a user's selection operation on multiple zoom options, the method also includes: when detecting a user's selection operation on a second zoom option among the multiple zoom options, determining that the preset camera is the preset camera corresponding to the second zoom option; and the target zoom option is the second zoom option.
[0253] The second zoom option corresponds to the preset camera and the above Figure 6 The second camera in step 605 in the illustrated embodiment is similar.
[0254] In the embodiment of the present disclosure, when it is detected that the user selects the second zoom option among multiple zoom options, the preset camera is determined to be the preset camera corresponding to the second zoom option; the target zoom option is the second zoom option, which can refer to the above Figure 6 Steps 601 to 605 in the illustrated embodiment will not be described in detail in the embodiment of the present disclosure.
[0255] Using a preset camera to obtain multiple frames of captured images includes: using a preset camera corresponding to a second zoom option to obtain multiple frames of captured images.
[0256] In the embodiment of the present disclosure, the method of obtaining multiple frames of captured images by using the preset camera corresponding to the second zoom option can refer to the above Figure 6 Step 605 in the illustrated embodiment will not be described in detail in the embodiment of the present disclosure.
[0257] Step 802: The electronic device crops the multiple frames of captured images to obtain multiple frames of cropped images, wherein the size of each frame of the multiple frames of cropped images is consistent with the size of the standard image, and the field of view contents of two adjacent frames of the multiple frames of cropped images at least partially overlap.
[0258] In the embodiment of the present disclosure, multiple frames of captured images are cropped to obtain multiple frames of cropped images. The size of each frame of the cropped images in the multiple frames is consistent with the size of the standard image. The field of view contents of two adjacent frames of the cropped images in the multiple frames of cropped images at least partially overlap. Figure 3 Step 315 in the illustrated embodiment will not be described in detail in the embodiment of the present disclosure.
[0259] Among them, the multiple frame captured images and the above Figure 3 The third image data in step 315 in the embodiment shown is similar to the image data after multiple frames of cropping and the above Figure 3 The fifth image data in step 315 in the illustrated embodiment is similar.
[0260] In some examples, multiple frames of captured images are cropped to obtain multiple frames of cropped images, including: determining the size of each frame of captured images in the multiple frames of captured images and the size of a standard image; determining a multiple relationship between the size of each frame of captured images and the size of the standard image based on the size of each frame of captured images and the size of the standard image; determining a size of a cropped area corresponding to each frame of captured images based on the multiple relationship between the size of each frame of captured images and the size of the standard image; and cropping each frame of captured images based on the size of the cropped area corresponding to each frame of captured images to obtain each cropped image in the multiple frames of cropped images.
[0261] In the embodiments of the present disclosure, the size of each captured image in the multiple frames and the size of the standard image are determined; the multiple relationship between the size of each captured image and the size of the standard image is determined according to the size of each captured image and the size of the standard image; the size of the cropped area corresponding to each captured image is determined according to the multiple relationship between the size of each captured image and the size of the standard image; each frame of the captured image is cropped according to the size of the cropped area corresponding to each frame of the captured image, and each frame of the cropped image in the multiple frames of cropped images can refer to the above Figure 3 Step 315 in the illustrated embodiment will not be described in detail in the embodiment of the present disclosure.
[0262] In some examples, each frame of captured image is cropped according to the size of the cropping area corresponding to each frame of captured image to obtain each cropped image in multiple frames of cropped images, including: determining the total number of frames of the multiple frames of captured image; determining the cropping vertex coordinates of each frame of captured image in the multiple frames of captured image according to the total number of frames of the multiple frames of captured image; the horizontal coordinates of the cropping vertex coordinates of two adjacent frames of captured images are different; and cropping each frame of captured image in turn according to the cropping vertex coordinates of each frame of captured image and the size of the cropping area corresponding to each frame of captured image to obtain each cropped image.
[0263] In the embodiment of the present disclosure, the total number of frames of the multiple captured images is determined; the coordinates of the cropping vertices of each captured image in the multiple captured images are determined according to the total number of frames of the multiple captured images; the horizontal coordinates of the coordinates of the cropping vertices of two adjacent frames of the captured images are different; each frame of the captured image is cropped in turn according to the coordinates of the cropping vertices of each frame of the captured image and the size of the cropping area corresponding to each frame of the captured image, and the cropped image of each frame can be obtained by referring to the above Figure 3 Step 315 in the illustrated embodiment will not be described in detail in the embodiment of the present disclosure.
[0264] In some examples, the horizontal coordinate of the cropping vertex of each frame of the captured image is x n , the vertical coordinate of the cropping vertex of each frame of the image is y n ;
[0265] x n Obtained by the following formula:
[0266]
[0267] y n Obtained by the following formula:
[0268]
[0269] Wherein, w is the width of the captured image, h is the height of the captured image; w' is the width of the standard image, h' is the width of the standard image, F is the total number of frames, and n is used to represent the nth frame.
[0270] Step 803: The electronic device generates a time-lapse video based on the multiple frames of cropped images.
[0271] In the embodiment of the present disclosure, the generation of time-lapse video based on the cropped images of multiple frames can refer to the above Figure 3 Steps 316 to 320 in the illustrated embodiment will not be described in detail in the embodiment of the present disclosure.
[0272] In some examples, a time-lapse video is generated based on multiple frames of cropped images, including: upsampling and recording the multiple frames of cropped images to obtain a video stream; and performing frame extraction and encoding on the video stream to obtain a time-lapse video.
[0273] In the embodiment of the present disclosure, the images after the multi-frame cropping are upsampled and recorded to obtain a video stream; the video stream is subjected to frame extraction and encoding to obtain a time-lapse video. Figure 3 Steps 316 to 320 in the illustrated embodiment will not be described in detail in the embodiment of the present disclosure.
[0274] In some examples, the first zoom option is 1x, and the camera corresponding to the first zoom option is an ultra-wide-angle camera; the second zoom option is 2x, and the camera corresponding to the second zoom option is a main camera.
[0275] For example, Fig. 9 FIG. 1 shows a structural schematic diagram of a time-lapse photography device 900. Fig. 9 As shown, the time-lapse photography device 900 may include: an acquisition module 901, a cropping module 902, a generation module 903, and the like.
[0276] Among them, the acquisition module 901 is configured to use a preset camera to acquire multiple frames of captured images when the camera application enters the time-lapse photography mode. The preset camera is the preset camera corresponding to the target zoom option, and the size of the captured image is larger than the size of the standard image corresponding to the target zoom option.
[0277] The cropping module 902 is configured to crop multiple frames of captured images to obtain multiple frames of cropped images, the size of each frame of the multiple frames of cropped images is consistent with the size of the standard image, and the field of view content of two adjacent frames of the multiple frames of cropped images at least partially overlaps.
[0278] The generating module 903 is configured to generate a time-lapse video based on multiple cropped frames of images.
[0279] In a possible implementation, the time-lapse photography device further includes a detection module 904 and a determination module 905. The detection module 904 is configured to detect a user's selection operation on multiple zoom options. The determination module 905 is configured to determine that the preset camera is the preset camera corresponding to the first zoom option when no user's selection operation on multiple zoom options is detected; and the target zoom option is the first zoom option. The acquisition module 901 is further configured to acquire multiple frames of captured images using the preset camera corresponding to the first zoom option.
[0280] In a possible implementation, the determination module 905 is further configured to, when detecting that the user has selected a second zoom option from among the multiple zoom options, determine that the preset camera is the preset camera corresponding to the second zoom option; and the target zoom option is the second zoom option. The acquisition module is further configured to acquire multiple frames of captured images using the preset camera corresponding to the second zoom option.
[0281] In a possible implementation, the cropping module 902 is further configured to determine the size of each captured image frame in the multiple frames of captured images and the size of the standard image; determine the multiple relationship between the size of each captured image frame and the size of the standard image based on the size of each captured image frame and the size of the standard image; determine the size of the cropping area corresponding to each captured image frame based on the multiple relationship between the size of each captured image frame and the size of the standard image; and crop each captured image frame based on the size of the cropping area corresponding to each captured image frame to obtain each cropped image in the multiple frames of cropped images.
[0282] In a possible implementation, the cropping module 902 is further configured to determine the total number of frames of the multiple frames of captured images; determine the cropping vertex coordinates of each frame of the multiple frames of captured images according to the total number of frames of the multiple frames of captured images; the horizontal coordinates of the cropping vertex coordinates of two adjacent frames of captured images are different; and crop each frame of the captured images in turn according to the cropping vertex coordinates of each frame of the captured images and the size of the cropping area corresponding to each frame of the captured images to obtain a cropped image of each frame.
[0283] In a possible implementation, the horizontal coordinate of the cropping vertex of each frame of the captured image is x n , the vertical coordinate of the cropping vertex of each frame of the image is y n ;
[0284] x n Obtained by the following formula:
[0285]
[0286] y n Obtained by the following formula:
[0287]
[0288] Wherein, w is the width of the captured image, h is the height of the captured image; w' is the width of the standard image, h' is the width of the standard image, F is the total number of frames, and n is used to represent the nth frame.
[0289] In a possible implementation, the generation module 903 is further configured to perform upsampling and video processing on the multiple frames of cropped images to obtain a video stream; and perform frame extraction and encoding processing on the video stream to obtain a time-lapse video.
[0290] In a possible implementation, the first zoom option is 1x, and the camera corresponding to the first zoom option is an ultra-wide-angle camera; the second zoom option is 2x, and the camera corresponding to the second zoom option is a main camera.
[0291] It should be understood that the division of units or modules (hereinafter referred to as units) in the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or physically separated. And the units in the device can all be implemented in the form of software calling through processing elements; or all in the form of hardware; or some units can be implemented in the form of software calling through processing elements, and some units can be implemented in the form of hardware.
[0292] For example, each unit can be a separately established processing element, or it can be integrated in a certain chip of the device. In addition, it can also be stored in a memory in the form of a program, and called and executed by a certain processing element of the device. In addition, all or part of these units can be integrated together, or they can be implemented independently. The processing element here can also be called a processor, which can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each unit above can be implemented by an integrated logic circuit of hardware in the processor element or in the form of software called by a processing element.
[0293] It should be understood that each step in the above method embodiment provided by the present disclosure can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present disclosure can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.
[0294] In one example, the unit in the above apparatus may be one or more integrated circuits configured to implement the above method, such as one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of at least two of these integrated circuit forms.
[0295] For another example, when the units in the device can be implemented in the form of a processing element scheduling program, the processing element can be a general-purpose processor, such as a CPU or other processor that can call a program. For another example, these units can be integrated together and implemented in the form of a system on a chip SOC.
[0296] In one implementation, the units of the above apparatus implementing the corresponding steps in the above method can be implemented in the form of a processing element scheduling program. For example, the apparatus may include a processing element and a storage element, and the processing element calls the program stored in the storage element to execute the method of the above method embodiment. The storage element may be a storage element on the same chip as the processing element, that is, an on-chip storage element.
[0297] In another implementation, the program for executing the above method may be in a storage element on a different chip from the processing element, i.e., an off-chip storage element. In this case, the processing element calls or loads the program from the off-chip storage element to the on-chip storage element to call and execute the method of the above method embodiment.
[0298] For example, the embodiments of the present disclosure may also provide a device, such as an electronic device, which may include a processor and a memory for storing instructions executable by the processor. When the processor is configured to execute the above instructions, the electronic device implements the data processing method of the above embodiment. The memory may be located inside the electronic device or outside the electronic device. And the processor includes one or more.
[0299] In another implementation, the unit of the device implementing each step in the above method may be configured as one or more processing elements, which may be arranged on the corresponding electronic device, and the processing element here may be an integrated circuit, for example: one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of these integrated circuits. These integrated circuits may be integrated together to form a chip.
[0300] For example, the present disclosure also provides a chip, which can be applied to the above electronic device. The chip includes one or more interface circuits and one or more processors; the interface circuits and the processors are interconnected through lines; the processor receives and executes computer instructions from the memory of the electronic device through the interface circuit to implement the method in the above method embodiment.
[0301] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by an electronic device, the electronic device can implement the above-mentioned data processing method.
[0302] The disclosed embodiments also provide a computer program product, including computer instructions for the electronic device to run as described above, and when the computer instructions are run in the electronic device, the electronic device can implement the data processing method as described above. Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0303] In the several embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0304] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0305] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0306] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, such as a program. The software product is stored in a program product, such as a computer-readable storage medium, including a number of instructions to enable a terminal device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the methods of each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, ROM, RAM, disk or optical disk and other media that can store program codes.
[0307] For example, the embodiments of the present disclosure may also provide a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by an electronic device, the electronic device implements the data processing method in the aforementioned method embodiment.
[0308] The above are only specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for time-lapse photography, characterized in that: include: When the camera application enters the time-lapse photography mode, based on a target zoom option, a plurality of frames of captured images are acquired using a preset camera corresponding to the target zoom option, the preset camera corresponding to the target zoom option is different from a standard camera corresponding to the target zoom option, and a size of the captured image is larger than a size of a standard image captured by the standard camera corresponding to the target zoom option; Based on the size of the standard image and the size of the captured image, the multiple frames of captured images are cropped to obtain multiple frames of cropped images, wherein the size of each frame of the multiple frames of cropped images is consistent with the size of the standard image, and the field of view contents of two adjacent frames of cropped images in the multiple frames of cropped images at least partially overlap; Generate a time-lapse video based on the multiple cropped images; The step of cropping the multiple frames of captured images to obtain multiple frames of cropped images includes: Determining a multiple relationship between the size of each frame of captured image and the size of the standard image according to the size of each frame of captured image and the size of the standard image; Determining the size of the cropping area corresponding to each frame of the captured image according to a multiple relationship between the size of each frame of the captured image and the size of the standard image; Cropping each frame of the captured image according to the size of the cropping area corresponding to each frame of the captured image, to obtain each frame of the cropped image in the plurality of frames of cropped images; The horizontal coordinate of the cropping vertex of each frame of the captured image is x n The vertical coordinate of the cropping vertex of each frame of the captured image is y n ; The x n Obtained by the following formula: The n Obtained by the following formula: Wherein, w is the width of the captured image, h is the height of the captured image; w' is the width of the standard image, h' is the width of the standard image, F is the total number of frames, and n is used to represent the nth frame.
2. The method according to claim 1, characterized in that Before acquiring multiple frames of captured images using a preset camera, the method further includes: Detecting a user's selection operation of multiple zoom options; In the case where the user's selection operation on the multiple zoom options is not detected, determining that the preset camera is the preset camera corresponding to the first zoom option; and the target zoom option is the first zoom option; The method of obtaining multiple frames of captured images by using a preset camera includes: The plurality of frames of captured images are acquired using a preset camera corresponding to the first zoom option.
3. The method according to claim 2, characterized in that After detecting the user's selection operation on the plurality of zoom options, the method further includes: In the case of detecting that the user selects a second zoom option from among the multiple zoom options, determining that the preset camera is the preset camera corresponding to the second zoom option; and the target zoom option is the second zoom option; The method of obtaining multiple frames of captured images by using a preset camera includes: The plurality of frames of captured images are acquired using a preset camera corresponding to the second zoom option.
4. The method according to claim 1, characterized in that: The step of cropping each frame of the captured image according to the size of the cropping area corresponding to each frame of the captured image to obtain each frame of the cropped image in the plurality of frames of cropped images includes: Determine the total number of frames of the multiple captured images; Determining the coordinates of the cutting vertices of each frame of the plurality of frames of captured images according to the total number of frames of the plurality of frames of captured images; the horizontal coordinates of the coordinates of the cutting vertices of the two adjacent frames of captured images are different; According to the coordinates of the cropping vertices of each frame of captured image and the size of the cropping area corresponding to each frame of captured image, each frame of captured image is cropped in turn to obtain the cropped image of each frame.
5. The method according to any one of claims 1 to 3, characterized in that: The step of generating a time-lapse video based on the multiple cropped frames of images includes: Performing upsampling and video recording processing on the multiple cropped frames to obtain a video stream; The video stream is subjected to frame extraction and encoding processing to obtain the time-lapse video.
6. The method according to any one of claims 1 to 3, characterized in that The first zoom option is 1x, and the camera corresponding to the first zoom option is an ultra-wide-angle camera; the second zoom option is 2x, and the camera corresponding to the second zoom option is a main camera.
7. An electronic device, characterized in that: The electronic device comprises a processor and a memory for storing instructions executable by the processor; when the processor is configured to execute the instructions, the electronic device implements the method according to any one of claims 1 to 6.
8. A computer-readable storage medium having computer program instructions stored thereon; characterized in that: When the computer program instructions are executed by an electronic device, the electronic device implements the method according to any one of claims 1 to 6.
