WO2023160234A1 - Transition animation generation method, electronic device, and storage medium - Google Patents

Transition animation generation method, electronic device, and storage medium Download PDF

Info

Publication number
WO2023160234A1
WO2023160234A1 PCT/CN2022/143304 CN2022143304W WO2023160234A1 WO 2023160234 A1 WO2023160234 A1 WO 2023160234A1 CN 2022143304 W CN2022143304 W CN 2022143304W WO 2023160234 A1 WO2023160234 A1 WO 2023160234A1
Authority
WO
WIPO (PCT)
Prior art keywords
transition
image
shooting mode
frame
video
Prior art date
Application number
PCT/CN2022/143304
Other languages
French (fr)
Chinese (zh)
Inventor
孙丽娜
Original Assignee
荣耀终端有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Publication of WO2023160234A1 publication Critical patent/WO2023160234A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/667Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes

Definitions

  • the present invention relates to the technical field of intelligent terminals, in particular to a method for generating a transition motion effect, electronic equipment and a storage medium.
  • electronic devices such as mobile phones and tablet computers are usually equipped with multiple cameras.
  • many mobile phones are equipped with multiple front cameras and multiple rear cameras.
  • some mobile phones can also provide users with multi-lens video recording functions on the basis of providing users with camera functions such as taking pictures and video recordings.
  • the various shooting modes provided by the multi-camera video recording function can use one or more cameras for shooting, and users can choose corresponding camera functions for shooting according to their own needs. It can be understood that when starting to shoot a video, the system of the mobile phone can establish a channel for sending the data collected by the camera corresponding to the current shooting mode to be encoded, so as to send the image data collected by the corresponding camera to the encoder for encoding to obtain the captured image.
  • the user can choose to switch to other shooting modes different from the current shooting mode for shooting.
  • the mobile phone will switch from the image preview interface of the shooting mode before switching to the image preview interface of the shooting mode after switching.
  • the displayed transition preview interface is relatively blunt. Especially when the color of the camera view corresponding to the shooting mode that the user chooses to switch is quite different from the color of the camera view corresponding to the shooting mode used before switching, this blunt transition preview interface will appear particularly abrupt, which will bring users a sense of confusion. A bad visual experience leads to poor user experience.
  • the embodiment of the present application provides a method for generating a transition motion effect, an electronic device, and a storage medium.
  • the generated transition motion effect as a transition preview interface when switching shooting modes, the transition preview displayed before and after switching can be There are more smooth and coordinated transitions on the interface content, and the transition will not appear blunt, which is conducive to improving user experience.
  • the embodiment of the present application provides a method for generating a transition motion effect, which is applied to an electronic device.
  • the first instruction of the second shooting mode in response to the first instruction, switch the video shooting mode to the second shooting mode, and generate and play the transition animation effect, wherein the transition animation effect is captured in the first shooting mode in the first shooting mode
  • a video part is played between a second video part shot in the second shooting mode, and the transition motion effect includes the first image in the first video part and the second image in the second video part.
  • the electronic device may detect an instruction to switch the shooting mode, that is, the above-mentioned first instruction. At this time, the electronic device may display the transition motion effect generated based on the first image captured in the first shooting mode and the second image captured in the second shooting mode during the process of switching the shooting mode, such that the electronic device displays
  • the conversion interface and the framing corresponding to the two shooting modes before and after switching can be related in content, so it will look more smooth and coordinated.
  • first shooting mode and second shooting mode reference may be made to the shooting modes of various multi-mirror video recording functions exemplified in FIG. 5e in the following embodiments, and there is no limitation here.
  • the first image is the last N frames of images captured in the first shooting mode
  • the second image is the first M frames of images captured in the second shooting mode, where N and M are natural numbers.
  • the above-mentioned first image may be, for example, the last frame image of the first video part captured in the first shooting mode, multiple frames of images collected in the first shooting mode before switching, etc.; the above-mentioned second shooting mode may be, for example, the second shooting The first frame image or the first few frame images of the second video part captured by the mode are not limited here.
  • the camera used to capture the first image in the first shooting mode and the camera used to capture the second image in the second shooting mode are cameras located on different sides of the electronic device .
  • the two shooting modes before and after switching can use different cameras.
  • the camera used in the first shooting mode before switching is a front camera
  • the camera used in the second shooting mode after switching is a rear camera.
  • the camera used in the first shooting mode before switching may only include a rear camera
  • the camera used in the second shooting mode after switching includes a front camera, etc., which will not be repeated here.
  • the transition motion effect is generated in the following manner: according to the time required for the electronic device to generate the first frame image of the second video part in the second shooting mode, determine the generated transition The number of transition image frames for each part of the animation effect.
  • the number of transition image frames of each part of the generated transition motion effect can be determined according to the time when the first frame image is captured by the second shooting mode switched to, for example, the time when the first frame image is captured by the second shooting mode.
  • the transition motion effect includes a first transition part and a second transition part generated sequentially, wherein each frame transition image of the first transition part is based on the first image Generate: each frame of transition images in the second transition part is generated based on the second image, or, each frame of transition images in the second transition part is generated based on the spliced image of the first image and the second image.
  • the generated transition motion effect may include two parts, wherein the first part (that is, the above-mentioned first transition part) may be generated based on the first image captured in the first shooting mode.
  • the first transition part may be, for example, parts A 1 -A 50 shown in FIG. 6a or A 1 -A 70 shown in FIG. 6b in the following embodiments.
  • the second part of the generated transition motion effect (that is, the above-mentioned second transition part) can be generated based on the second image captured in the second shooting mode, or based on the first image and the second image captured in the two shooting modes Jointly generate, for example, generate the above-mentioned second transition part based on the spliced images of the two.
  • the second transition part generated based on the second image shot in the second shooting mode may be, for example, parts B 1 to B 50 shown in Figure 6a in the following embodiments, or parts B 1 to B 30 shown in Figure 6b .
  • the electronic device includes a preset transition image frame number i for the first transition part of the transition effect, and a second transition part for the transition effect
  • the preset number of transition image frames is j, and according to the time required for the electronic device to generate the first frame image of the second video part in the second shooting mode, determine the transition of each part of the generated transition motion effect
  • the number of image frames including: if the time required to generate the first frame image of the second video part in the second shooting mode is greater than the time required to generate the first transition part, determine the first time of the generated transition motion effect
  • the number of transition image frames in the transition part is i+k
  • the number of transition image frames in the second transition part is j-k, where k ⁇ j.
  • the electronic device can preset the number of transition image frames included in each part of the transition motion effect within a certain transition duration, for example, the i frame included in the first transition part and the i frame included in the second transition part The j frames included. It can be understood that the total number of transition image frames included in the transition motion effect generated and displayed by the electronic device is fixed, and the display duration of the transition motion effect is constant. The time for the electronic device to generate and display the i-frame transition images of the first transition part is also certain. When switching the shooting mode, if the camera corresponding to the second shooting mode starts slowly, etc., it may cause the second shooting mode to shoot The time to the first frame of image is relatively long.
  • the i-frame transition image of the first transition part preset by the electronic device is about to be displayed.
  • the electronic device can continue to generate the transition image based on the first image captured in the first shooting mode.
  • the field image is displayed.
  • the number of frames of the transition image included in the first transition part increases, for example, k frames are added.
  • This change process can refer to the relevant description of the partial change from A 1 to A 50 shown in FIG. 6a to A 1 to A 70 shown in FIG. 6b in the following embodiments, and details are not repeated here.
  • the transition motion effect includes a third transition part, a fourth transition part, and a fifth transition part generated in sequence, wherein each frame of the third transition part The field image is generated based on the first image; each frame of the transition image in the fourth transition part is generated based on the spliced image of the first image and the second image; each frame of the transition image in the fifth transition part is generated based on the second image.
  • the generated transition animation can include three parts.
  • the above three transition parts, the fourth transition part and the fifth transition part can be used respectively Represents the first, second and third parts of the transition animation.
  • the generated first part of the transition motion effect (that is, the third transition part) may be generated based on the first image captured in the first shooting mode.
  • the first part may be, for example, parts A 1 -A 30 shown in FIG. 6c in the following embodiments, or A 1 ⁇ A 50 shown in FIG. 6d .
  • the second part of the generated transition motion effect (that is, the above-mentioned fourth transition part) can be jointly generated based on the first image and the second image captured by the two shooting modes, for example, the transition motion can be generated based on the spliced images of the two.
  • the first part may be, for example, parts AB 1 to AB 40 shown in FIG. 6c or parts AB 1 to AB 30 shown in FIG. 6d in the following embodiments.
  • the third part of the generated transition motion effect (that is, the fifth transition part) may be generated based on the second image captured in the second shooting mode.
  • the third part can be, for example, parts B 1 -B 30 shown in FIG. 6c or parts B 1 -B 20 shown in FIG. 6d in the following embodiments.
  • the electronic device includes a preset transition image frame number for the third transition part of the transition effect, and a preset number of frames for the fourth transition part of the transition effect.
  • the electronic device can preset the number of transition image frames included in each part of the transition motion effect within a certain transition duration, for example, the number of transition image frames included in the third transition part (that is, the first part of the transition motion effect)
  • Frame a of the fourth transition part that is, the second part of the transition motion effect
  • the fifth transition part that is, the third part of the transition motion effect
  • the total number of transition image frames included in the transition motion effect generated and displayed by the electronic device is fixed, and the display duration of the transition motion effect is constant. If the camera corresponding to the second shooting mode starts slowly, etc., it may take a long time for the second shooting mode to capture the first frame of image. At this time, the transition image of the first part a frame preset by the electronic device is about to be displayed. At this time, the electronic device may continue to generate and display the transition image based on the first image captured in the first shooting mode, so that the number of frames of the transition image included in the first part increases, for example, by x frames.
  • This change process can refer to the relevant description of the partial change from A 1 to A 30 shown in FIG. 6c to A 1 to A 50 shown in FIG. 6d in the following embodiments, and details are not repeated here.
  • This change process can refer to the changes from AB 1 to AB 40 shown in FIG. 6c to AB 1 to AB 30 shown in FIG . Relevant descriptions of parts B 1 -B 20 shown in 6d will not be repeated here.
  • the transition image of the transition motion effect is obtained by adding a dynamic change effect to the first image or the second image.
  • the dynamic change effect includes at least one of the following: a mask mask, a gradient of blur, and a gradient of transparency.
  • the effect of the transition motion effect can be obtained by processing special effects such as mask mask, blur gradient, and transparency gradient.
  • the special effect type of the transition motion effect can be determined based on user selection, or can be preset in the electronic device, which is not limited here.
  • the embodiment of the present application provides an electronic device, the electronic device includes: one or more processors; one or more memories; one or more memories store one or more programs, when one or more When a program is executed by one or more processors, the electronic device executes the above method for generating transition motion effects.
  • the embodiment of the present application provides a computer-readable storage medium, where instructions are stored on the storage medium, and when the instructions are executed on a computer, the computer executes the above method for generating transition motion effects.
  • an embodiment of the present application provides a computer program product, the product includes a computer program/instruction, and when the computer program/instruction is executed by a processor, the above method for generating a transition motion effect is realized.
  • FIG. 1 a is a schematic diagram of a camera shooting function interface of a mobile phone 100 provided by an embodiment of the present application.
  • FIG. 1 b is a schematic diagram of an operation interface for switching shooting modes when the mobile phone 100 shoots a video according to an embodiment of the present application.
  • Fig. 2a is a schematic diagram of the transition time allocated to each part of the transition motion effect corresponding to the acquisition time of the first frame image after the second shooting mode provided by the embodiment of the present application is 350 ms.
  • Fig. 2b is a schematic diagram of the transition time allocated to each part of the transition motion effect corresponding to the acquisition of the first frame of image after the second shooting mode provided by the embodiment of the present application, which takes 500 ms.
  • FIG. 2c is a schematic diagram of a hardware structure of a mobile phone 100 provided by an embodiment of the present application.
  • FIG. 3 a is a schematic diagram of a shooting interface in a shooting mode before switching according to an embodiment of the present application.
  • Fig. 3b is a schematic diagram of a transition preview interface provided by the embodiment of the present application.
  • FIG. 3 c is a schematic diagram of a shooting interface in a switched shooting mode according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of an implementation flow of a method for generating a transition motion effect provided by an embodiment of the present application.
  • Fig. 5a is a schematic diagram of a shooting interface displayed after the camera is started according to an embodiment of the present application.
  • FIG. 5 b is a schematic diagram of a shooting function selection interface displayed after the camera is started according to an embodiment of the present application.
  • FIG. 5c is a schematic diagram of an operation interface of a multi-mirror video recording function provided by an embodiment of the present application.
  • FIG. 5d is a schematic diagram of some multi-mirror video shooting interfaces provided by the embodiment of the present application.
  • FIG. 5e is a schematic diagram of an operation interface for switching shooting modes provided by an embodiment of the present application.
  • FIG. 5f is a schematic diagram of an interface after switching the shooting mode provided by the embodiment of the present application.
  • Fig. 6a is a schematic diagram of a transition motion effect including two parts provided by an embodiment of the present application, based on a preset transition motion effect generation strategy to control the generation and display sequence of each frame transition image in each part.
  • Figure 6b shows a transition motion effect including two parts provided by the embodiment of the present application. After adjusting the number of transition images in each part based on the preset transition motion effect generation strategy, the generation of transition images in each frame is controlled. And send a schematic diagram of the sequence.
  • Fig. 6c is a schematic diagram of a transition motion effect including three parts provided by the embodiment of the present application, based on a preset transition motion effect generation strategy to control the generation and display sequence of each frame transition image in each part.
  • Figure 6d shows a transition motion effect including three parts provided by the embodiment of the present application. After adjusting the number of transition images in each part based on the preset transition motion effect generation strategy, the generation of transition images in each frame is controlled. And send a schematic diagram of the sequence.
  • Fig. 7a is a schematic diagram of a front panorama preview interface displayed by the mobile phone 100 before switching the shooting mode according to the embodiment of the present application.
  • FIG. 7 b is a schematic diagram of a switching interface displayed by the mobile phone 100 before the second shooting mode is started during a process of switching shooting modes provided by an embodiment of the present application.
  • FIG. 7 c is a schematic diagram of a switching interface displayed by the mobile phone 100 after the second shooting mode is activated during a process of switching shooting modes provided by an embodiment of the present application.
  • FIG. 7 d is a schematic diagram of a dual-view preview interface displayed by the mobile phone 100 after the switching of the shooting mode provided by the embodiment of the present application.
  • FIG. 8 is a block diagram of a software structure of a mobile phone 100 provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of an interaction process of a method for generating a transition motion effect provided by an embodiment of the present application.
  • Fig. 1a shows a schematic diagram of a camera function interface in which a mobile phone 100 provides multiple shooting modes according to an embodiment of the present application.
  • the mobile phone 100 may display the camera interface 101 shown in FIG. 1 a .
  • the interface 101 includes multiple shooting modes such as front single camera mode 011, rear single camera mode 012, front-rear dual camera mode 013, rear-rear dual camera mode 014 or picture-in-picture mode 015, etc.
  • the user chooses.
  • the camera interface 101 can display two parts of the image preview area, that is, the foreground preview area 102 captured by the front camera shown in FIG.
  • the background preview area 103 captured by the rear camera.
  • the front single-shot mode 011 and the rear single-shot mode 012 shown in FIG. 1a can be called single-shot modes;
  • the rear dual-camera mode 014 and the picture-in-picture mode 015 can be called multi-camera modes.
  • the mobile phone 100 uses a front camera for video shooting; in the rear single camera mode 012, the mobile phone 100 uses a rear camera for video shooting.
  • the mobile phone 100 uses two rear cameras for video shooting; in the front-rear dual camera mode 013, the mobile phone 100 uses a front camera and a rear camera for video shooting.
  • the picture-in-picture mode 015 may also include a front picture-in-picture mode, a rear picture-in-picture mode, and a front-to-back picture-in-picture mode.
  • the mobile phone 100 can use a front camera and a rear camera for video shooting, and put the picture taken by the front camera or the rear camera on the picture taken by the rear camera or the front camera. among.
  • Fig. 1b shows a schematic diagram of an operation interface for switching shooting modes when the mobile phone 100 is shooting a video according to an embodiment of the present application.
  • the mobile phone 100 responds to the user's operation of choosing to use the front-rear dual camera mode 013 to shoot video, and displays the shooting interface 020 shown in Figure 1b.
  • the user can click the switching control 021 to select another to switch between shooting modes.
  • the user can select the rear-rear dual-camera mode 014 as the switched shooting mode after clicking the switching control 021.
  • the mobile phone 100 switches from the front-rear dual-camera mode 013 to the rear-rear dual-camera mode in response to the user's switching operation.
  • Camera mode 014 The mobile phone 100 responds to the user's operation of switching the shooting mode.
  • the transition displayed on the mobile phone 100 The transition of the preview interface will be relatively blunt and the user experience will be poor.
  • an embodiment of the present application provides a method for generating a transition motion effect. Specifically, the method generates the initial part of the transition motion effect based on one or more frames of images collected in the shooting mode before switching when the user's operation of switching the shooting mode is detected, and based on the One or more frames of images collected generate the end part of the transition motion effect, so as to realize the continuous transition from the preview of the shooting screen of the shooting mode before switching to the preview of the shooting screen of the shooting mode after switching. In this way, displaying the transition motion effect as the transition preview interface in the process of switching the shooting mode will appear smoother and more coordinated, thereby eliminating the problem of the blunt transition preview interface, which is conducive to improving user experience.
  • one or more frames of images collected in the shooting mode before switching can be, for example, images collected in the shooting mode before switching
  • the last frame or multiple frames of images, and the one or multiple frames of images collected in the switched shooting mode may be, for example, the first frame or several previous frames of images collected in the switched shooting mode.
  • the image special effect processing may include but not limited to blurring, masking, image rotation and other processing methods, which are not limited here .
  • the shooting mode before switching is collectively described as the first shooting mode
  • the shooting mode after switching is collectively described as the second shooting mode.
  • the display duration of one or more frames of images collected in the first shooting mode and the second shooting mode can be Controlled according to the preset transition motion effect generation strategy, the display duration of images in the first shooting mode and the second shooting mode determined by the strategy can be related to starting each lens in the second shooting mode and collecting the second shooting
  • the time length of the first frame image in the mode is related. That is to say, the display duration of each part of the transition motion effect can be dynamically adjusted according to the time when the first frame of image is captured in the second shooting mode.
  • the length of time required to switch the shooting mode may also vary, and the display time of each part of the transition animation effect can also be adjusted accordingly according to the change of the switching time length, which is not limited here.
  • the displayed transition animation duration (that is, the transition duration) is, for example, 1s. If the mobile phone switches from the first shooting mode to the second It takes 350ms to collect the first frame of image after the second shooting mode, and within 1s of the transition animation, the first frame generated based on the last frame or multiple frames of images collected in the first shooting mode can be displayed from the 1st to the 350th ms.
  • Part 350ms to 700ms shows the second part generated based on the last frame in the first shooting mode and the first frame image collected in the second shooting mode by mosaic texture
  • the 700ms to 1s shows the second part captured in the second shooting mode
  • the mobile phone switches from the first shooting mode to the second shooting mode and it takes 500ms to collect the first frame of image, as shown in Figure 2b
  • the first 1ms to the 500thms can display the above-mentioned A part
  • the second part above is displayed from 500ms to 700ms
  • the third part above is displayed from 700ms to 1s.
  • Fig. 2c shows a schematic diagram of a hardware structure of a mobile phone 100 according to an embodiment of the present application.
  • the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, A display screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an acceleration sensor 180E, a distance sensor 180F, a touch sensor 180K, an ambient light sensor 180L and the like.
  • the structure shown in the embodiment of the present invention does not constitute a specific limitation on the mobile phone 100 .
  • the mobile phone 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange different components, which is not limited here.
  • the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • controller video codec
  • different processing units may be independent devices, or may be integrated in one or more processors.
  • the controller generates an operation control signal according to the instruction operation code and timing signal of the processor 110, and completes the control of fetching and executing instructions, so as to execute the acquisition image related to the transition motion effect generation method of the present application. , and perform special effects processing on the acquired image, so as to use the generated transition motion effect to switch the shooting mode, so that the transition preview interface displayed on the mobile phone 100 before and after the switching of the shooting mode is smoother and less rigid.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • processor 110 may include one or more interfaces.
  • the interface may include a universal serial bus (universal serial bus, USB) interface and the like.
  • USB interface 130 can be used to connect a charger to charge the mobile phone 100, and can also be used to transmit data between the mobile phone 100 and peripheral devices.
  • the charging management module 140 is configured to receive a charging input from a charger.
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the wireless communication function of the mobile phone 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in handset 100 can be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the mobile phone 100 .
  • a modem processor may include a modulator and a demodulator.
  • the wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system, etc. applied on the mobile phone 100 (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • the antenna 1 of the mobile phone 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology.
  • the mobile phone 100 realizes the display function through the GPU, the display screen 194, and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos and the like.
  • the display screen 194 includes a display panel.
  • the mobile phone 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
  • the mobile phone 100 can display the image preview captured by the camera of the corresponding shooting mode when shooting a video through the display screen 194, and the preview of the transition image generated and displayed during the process of switching the shooting mode, that is, the transition preview interface A preview of the displayed image.
  • the mobile phone 100 can realize the shooting function through ISP, camera 193 , video codec, GPU, display screen 194 and application processor.
  • the ISP is used for processing the data fed back by the camera 193 .
  • the ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be located in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object generates an optical image through the lens and projects it to the photosensitive element.
  • the photosensitive element can be a charge coupled device (charge coupled device, CCD) or a complementary metal-oxide-semiconductor (complementary metal-oxide-semiconductor, CMOS) phototransistor.
  • CCD charge coupled device
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other image signals.
  • the mobile phone 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
  • the front or rear camera 193 can be used to collect video images, and when the shooting mode is switched, the images collected by the camera 193 are processed into
  • Video codecs are used to compress or decompress digital video.
  • 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 mobile phone 100.
  • an external memory card such as a Micro SD card
  • the internal memory 121 may be used to store computer-executable program codes including instructions.
  • the internal memory 121 may include an area for storing programs and an area for storing data. Wherein, the storage data area can store data created during the use of the mobile phone 100 (such as video data obtained by shooting, etc.) and the like.
  • the internal memory 121 may include a high-speed random access memory, and may also include a nonvolatile memory or the like.
  • the processor 110 executes various functional applications and data processing of the mobile phone 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the internal memory 121 may store related instructions for executing the method for generating transition motion effects provided in the embodiment of the present application, so that the processor 110 can call and execute to generate corresponding transition motion effects.
  • the mobile phone 100 can realize the audio function through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal.
  • pressure sensor 180A may be disposed on display screen 194 .
  • the mobile phone 100 can also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • the gyroscope sensor 180B can be used to determine the motion posture of the mobile phone 100 . In some embodiments, the gyro sensor 180B can also be used for image stabilization.
  • the acceleration sensor 180E can detect the acceleration of the mobile phone 100 in various directions (generally three axes). When the mobile phone 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic equipment, and it can be used in applications such as horizontal and vertical screen switching.
  • the distance sensor 180F is used to measure the distance.
  • the mobile phone 100 can measure the distance by infrared or laser. In some embodiments, for example, in a shooting scene, the mobile phone 100 can use the distance sensor 180F for distance measurement to achieve fast focusing.
  • the ambient light sensor 180L is used for sensing ambient light brightness. In the embodiment of the present application, the ambient light sensor 180L can also be used to automatically adjust the white balance when shooting a video.
  • the touch sensor 180K is also called “touch device”.
  • the touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
  • 3a to 3c show the schematic diagrams of scenes where the mobile phone 100 displays transition effects when the user operates the mobile phone 100 to switch the shooting mode during the process of shooting a video according to the embodiment of the present application.
  • Fig. 3a shows the shooting interface 310 in the shooting mode before switching (ie the first shooting mode).
  • the first shooting mode adopted by the mobile phone 100 when shooting a video is the front single camera mode
  • the shooting interface 310 displayed on the mobile phone 100 displays a front panoramic preview captured by the front camera. If the user clicks the switching control 311 on the shooting interface 310 shown in FIG. 3a, the mobile phone 100 can first enter and display the transition preview interface 320 shown in FIG. 3b, and then enter and display the switched shooting mode shown in FIG. shooting interface 330 under the shooting mode).
  • the second shooting mode is the front/rear dual-camera mode.
  • the front-rear dual-camera mode or the rear-rear dual-camera mode may also be called a dual-view shooting mode, which is not limited here.
  • the last frame of image captured by the first shooting mode before switching is, for example, a flower shown in FIG.
  • the field preview interface 320 can be a transition image obtained by adding a mask, increasing transparency, or gradually blurring based on the last frame of the image of the flower captured in the first shooting mode.
  • the flower can be displayed from clear to blurred effects such as gradual changes.
  • the transition preview interface shown in Figure 3b can also be switched to the interface style shown in Figure 3c, that is, the foreground preview interface shown in Figure 3c can still be displayed Based on the transition image obtained by processing the image of the last frame of the flower captured in the first shooting mode, the dynamic change effect of the flower can gradually change from blurred to clear.
  • the transition preview interface displayed on the mobile phone 100 may also be in other forms, which is not limited here.
  • the transition preview interface 320 shown in FIG. 3 b displayed on the mobile phone 100 may display a transition motion effect.
  • the image captured by the switched second shooting mode is generated after corresponding image processing, so as to realize the continuous transition of the transition screen content from the first shooting mode to the second shooting mode, so that the screen content of the captured video content is played more smoothly ,coordination.
  • FIG. 4 shows a schematic flowchart of an implementation of a method for generating transition animation effects according to an embodiment of the present application. It can be understood that, in the embodiment of the present application, the execution subject of each step in the process shown in FIG. 4 is the mobile phone 100. To avoid repeated description, the following description will not describe the execution subject of each step one by one.
  • the process includes the following steps:
  • the user can operate the mobile phone 100 to run a camera application to shoot a video.
  • the operation of the user to start the camera to shoot video can be operated by voice, such as "YOYO, start the camera";
  • the mobile phone 100 can also automatically trigger and start the camera based on a preset trigger condition, or the user can also operate the mobile phone 100 to start the camera through a preset operation gesture, which is not limited here.
  • the camera application After the camera application is started, it can enter the shooting mode set by default, and the user can also select a shooting mode on the shooting interface after the camera is started, as the first shooting mode.
  • the set shooting mode may also be a shooting mode selected by the user, which is not limited here.
  • the user selects functions such as video recording or multi-lens video recording on the shooting interface of the camera application displayed on the mobile phone 100, and then selects a shooting mode on the corresponding function interface, such as selecting the foreground single shooting mode 011 shown in FIG. 1a above. , and then click the control to start shooting to start shooting video.
  • the mobile phone 100 responds to the above-mentioned series of operations of the user, starts to collect video images in the first shooting mode, and executes video shooting.
  • FIGS. 5 a to 5 d show some schematic diagrams of operation interfaces for starting a camera to shoot video using a multi-lens video function.
  • the user can click the icon of the camera application on the desktop of the mobile phone 100, so that the mobile phone 100 starts the camera application and displays the interface shown in FIG. 5a.
  • the user can slide left and right on the camera function menu 511, refer to the operation 1 shown in Figure 5a, and more option controls 512 are displayed on the shooting interface 510 , click the more option control, and the mobile phone 100 can display the more function interface 520 shown in FIG. 5b.
  • a variety of camera functions can be displayed on the more functional interface 520, such as slow motion, panorama, time-lapse photography, watermark, document correction, super macro, high pixel, micro movie, etc. as shown in Figure 5b
  • the camera application run by the mobile phone 100 may also provide more or less camera functions than those shown in FIG. 5b, which is not limited here.
  • the user can click on the multi-camera video recording 521 on the more functional interface 520, and the mobile phone 100 can display the multi-camera video recording operation interface 530 shown in FIG. 5c.
  • the multi-mirror video recording operation interface 530 may display image previews captured by the front camera and rear camera of the mobile phone 100 , such as the foreground preview and background preview shown in FIG. 5c .
  • the multi-mirror video recording operation interface 530 can also display a shooting start control 531 and a front and rear lens switching control 532 .
  • the user can click the front and rear camera switching control 532 on the multi-camera recording operation interface 530 to switch the front camera corresponding to the foreground preview shown in FIG. 5c to the rear camera, and details will not be described here.
  • the mobile phone 100 may display the multi-mirror video shooting interface 540 shown in FIG. 5d.
  • the interface shown in FIG. 5d and related descriptions will be described in conjunction with related implementation content in step 402 below, and will not be repeated here.
  • the user can operate and switch the shooting mode on the recording interface displayed after the mobile phone 100 starts shooting video.
  • the recording interface can be, for example, the multi-mirror video shooting interface 540 shown in FIG.
  • the first shooting mode used by the video is switched to the second shooting mode.
  • the mobile phone 100 detects that the user switches the shooting mode, it can acquire one or more frames of images in the first shooting mode, and obtain a frame in the second shooting mode in time after starting the lens corresponding to the second shooting mode. or multiple frames of images.
  • the image in the first shooting mode acquired by the mobile phone 100 may be the last frame or multiple frames of images collected in the first shooting mode; the image in the second shooting mode acquired by the mobile phone 100 may be the second The first frame or the first few frames of images captured in shooting mode.
  • the images acquired by the mobile phone 100 at this time will be used to generate transition effects.
  • the multi-camera video shooting interface 540 includes an operation prompt box 541 , a control for pausing recording 542 , a control 543 for ending recording, and the like.
  • the operation prompt content displayed in the operation prompt box 541 refer to the "slide to switch multi-mirror mode" shown in FIG. 5d.
  • the user if the user performs a sliding operation according to the sliding direction guided by the operation prompt box 541, and selects a shooting mode on the opened shooting mode selection interface to switch, etc.
  • Fig. 5e shows a schematic diagram of an operation interface for switching shooting modes according to an embodiment of the present application.
  • the mobile phone 100 may display the shooting mode selection interface 550 shown in FIG. 5e. It can be understood that the difference between the shooting mode selection interface 550 shown in FIG. 5e and the shooting mode selection interface 101 shown in FIG.
  • the selection interface 101 may also be an operation interface for the user to select a shooting mode before starting to shoot a video, which is not limited here.
  • the shooting mode selection interface 550 may also include a front single camera mode 551, a rear single camera mode 552, a front-rear dual camera mode 553, and a rear-rear dual camera mode. mode 554 or picture-in-picture mode 555.
  • the current first shooting mode of the mobile phone 100 is, for example, the front-rear dual camera mode 553 , and the user can select the picture-in-picture mode 555 or other shooting modes on the shooting mode selection interface 550 to switch.
  • the mobile phone 100 when the mobile phone 100 detects the operation of switching the shooting mode by the user in the above step 402, it may blur the captured image or add a mask according to the preset transition motion effect generation strategy.
  • the transition animation generation strategy based on which the transition image is processed can also be based on the blurring effect selected by the user, or adding a mask mask effect, or corresponding to a certain transparency processing effect It is determined by the transition effect, and there is no limitation here.
  • the processing of each part of the transition animation effect and the control of the display duration by the transition animation generation strategy may be related to the transition duration.
  • the switching duration can be based on the time before and after switching the shooting mode, the channel of the camera data encoding corresponding to the first shooting mode is closed and the corresponding camera is turned off, until the cameras corresponding to the second shooting mode are started. And complete the establishment of the time difference between the moments when the corresponding camera data is sent to the encoding path to determine.
  • the transition duration may also be the switching duration selected and set by the user on the shooting interface. For example, if some users want to add a longer time transition effect to the captured video, they can choose to set the duration of the transition effect to 3s or 5s, etc. At this time, the preset transition effect in the mobile phone 100 is generated
  • the strategy can also control the display duration of each part of the transition animation according to the transition duration set by the user. There is no limitation here.
  • the transition motion effect generation strategy described above may include: performing corresponding special effect processing on the acquired image in the first shooting mode or in the second shooting mode and related image processing parameters.
  • the mobile phone 100 processes the acquired frames of images based on the preset image processing parameters, and then compiles them into the video stream of transition effects.
  • the frame or multiple frames of images can be processed into the initial part of the transition motion effect for display.
  • the transition animation displayed on the mobile phone 100 may always be continuous frames generated based on the images in the first shooting mode.
  • the mobile phone 100 can process the frame of image and the images acquired after this frame as the end part of the transition motion effect for display.
  • the preset transition motion effect generation strategy on the mobile phone 100 may also include: the display duration of the part of the transition motion effect based on the image in the first shooting mode, and the display duration based on the image in the second shooting mode
  • the control rules for the display duration of the generated part, and the control rules for the display order of the acquired images in the transition animation after processing (for example, the display order of the transition images of each frame shown in Figure 6a to Figure 6b below), etc. .
  • the part generated based on the image in the first shooting mode can be, for example, the part A 1 to A 50 shown in Figure 6a or 6d below, or the part A 1 to A 70 shown in Figure 6b below or the part shown in Figure 6c Parts A 1 -A 30 shown are not limited here.
  • the part generated based on the image in the second shooting mode can be, for example, the part B 1 to B 50 shown in Figure 6a below or the part B 1 to B 30 shown in Figure 6b below, or it can be the part AB 1 shown in Figure 6c below Parts -AB 40 and B 1 -B 30 or parts AB 1 -AB 30 and B 1 -B 20 shown in FIG. 6d are not limited here.
  • the sum of the display duration of the part generated based on the image in the first shooting mode and the display duration of the part generated based on the image in the second shooting mode in the transition motion effect can be less than or equal to the switching duration, as above
  • the switching duration may be set by the user or determined based on the required time for closing and starting the camera corresponding to the shooting mode before and after switching, for example, which is not limited here.
  • the transition motion effect generated by the mobile phone 100 based on the images in the first shooting mode and the images in the second shooting mode can be displayed on the screen of the mobile phone 100 as a real-time transition preview interface.
  • the mobile phone 100 performs corresponding actions on the images in the first shooting mode and the images in the second shooting mode according to the preset transition animation generation strategy.
  • each frame of transition image generated can be sent to display frame by frame.
  • the screen of the mobile phone 100 can synchronously display the transition images of each frame after the processing is completed within the time period of switching the shooting mode (that is, the above-mentioned switching duration), and the transition images of each frame of the completed processing form a transition motion effect according to the generation sequence .
  • a channel for encoding the processed transition image can also be established in the system of the mobile phone 100, for example, it can be sent to a multi-channel encoding module In the video file captured in this way, during the cut-off period caused by the channel reconstruction of the camera data of the corresponding shooting mode for encoding, the generated transition motion effect can be displayed as the connecting part before and after the switching of the shooting mode. This also makes the picture smoother when the captured video file is played.
  • the transition motion effect generated during the process of switching the shooting mode is also encoded into the recorded video content.
  • the recorded part corresponding to the process of the user switching the shooting mode is the generated transition motion effect.
  • the video picture transition before and after switching the shooting mode can appear smoother, and there will be no black screen or abrupt transition effect, which is conducive to improving user experience.
  • the mobile phone 100 is a schematic diagram of an interface displaying the generated transition effects, which will be described in detail below in conjunction with FIGS. 7a to 7d , and will not be repeated here.
  • the mobile phone 100 completes the switching of the shooting mode, which means that hardware such as the lens corresponding to the second shooting mode on the mobile phone 100 is started and ready for function, for example, the corresponding lens can capture images within the field of view range.
  • the screen of the mobile phone 100 finishes displaying the transition effect, and can display a preview of the image collected in the second shooting mode.
  • the video shot by the mobile phone 100 is based on the continuous frame images collected by each camera during the shooting process, and after processing such as correction and filtering, a piece of video stream data is sent through the corresponding channel for encoding processing.
  • Each segment of video stream data in an encoded form may be, for example, in an Advanced Video Coding (Advanced Video Coding, AVC) format or the like.
  • AVC Advanced Video Coding
  • the camera data encoding channel established corresponding to the shooting mode before switching is often different from the camera data encoding channel established corresponding to the shooting mode after switching, therefore, electronic devices such as mobile phones will turn off the switching before and after switching the shooting mode.
  • the established path corresponds to the previous shooting mode, and the path corresponding to the switched shooting mode is re-established after the camera corresponding to the switched shooting mode is started. Therefore, in the process of shooting a video, if you switch the shooting mode, there will be interruptions in the captured video file, such as black screen, blur, etc. Therefore, optionally, in some embodiments, during the shooting mode switching process, the generated transition motion effect may be encoded through a corresponding channel to obtain another piece of frequency stream data.
  • the encoded video stream data in AVC format can be combined and packaged according to the corresponding time stamps, thereby generating a video file containing transition effects.
  • the packaged and packaged video file format can be, for example, MP4, or audio video interleaved format (Audio Video Interleaved, AVI) and other media file formats, and there is no limitation here.
  • the transition motion effect generation method provided in the embodiment of the present application can encode the generated transition motion effect into the captured video file, so as to solve the problem of video data interruption before and after switching the shooting mode in the captured video , and the transition motion effect can be integrated with the front and rear video content, making the transition of the captured video content more smooth and coordinated.
  • Fig. 5f shows a schematic interface after switching the shooting mode according to the embodiment of the present application.
  • the mobile phone 100 may, for example, display the interface after switching the shooting mode as shown in FIG. 5f.
  • the mobile phone 100 can display the shooting interface 560 after switching the shooting mode.
  • the video image preview displayed on the shooting interface 560 is in the form of a picture-in-picture composition.
  • the picture 561 used as the background shows a preview of the background
  • the picture 562 used as the picture shows a preview of the foreground.
  • the mobile phone 100 continues to shoot videos in the switched picture-in-picture mode 555 until the user clicks the end recording control 563 to end the shooting of the video and generate a corresponding captured video.
  • the following is a schematic diagram of the display sequence of each frame of the transition image in the transition animation effect, to exemplarily introduce the transition animation effect generation method provided by the embodiment of the present application, and the transition animation effect based on which the corresponding generation transition animation effect is based. Build strategy.
  • Figures 6a to 6d show some schematic diagrams of controlling the generation and display order of each frame of transition images in the transition animation based on a preset transition animation generation strategy according to an embodiment of the present application.
  • the switching time before and after switching the shooting mode is, for example, 1s
  • the number of transition image frames preset to be played within this 1s is, for example, 100 frames
  • the transition images of each part are, for example, based on the last frame of image A in the first shooting mode , and the first frame image B in the second shooting mode is generated.
  • the strategy for controlling the generation and display order of each frame transition image in the transition motion effect may include: controlling the first part of the transition motion effect ( For example, 50 frames of images) display images in the first shooting mode, and the second part (for example, 50 frames of images) displays images in the second shooting mode.
  • controlling the first part of the transition motion effect For example, 50 frames of images
  • the second part for example, 50 frames of images
  • Fig. 6a shows a schematic diagram of a transition motion effect including two parts based on a preset transition motion effect generation strategy to control the generation and display sequence of each frame transition image in each part according to an embodiment of the present application.
  • a 1 -A 50 are, for example, frames of transition images obtained through special effect processing based on the last frame of image A in the first shooting mode, and A 1 -A 50 form the first part of the transition motion effect.
  • a 1 is the first frame display image of the transition effect, and the degree of the special effect on each frame of the transition image from A 1 to A 50 can be gradually changed.
  • the special effect is a mask mask
  • the mask color on the transition image of each frame from A 1 to A 50 can gradually change from light to dark
  • the degree of blurring of the field image can gradually change from low to high in turn, that is, a special effect that gradually changes from clear to blurred.
  • the special effect can also be in other forms, which are not limited here.
  • B 1 to B 50 are, for example, frames of transition images obtained through special effect processing based on the first frame of image B in the second shooting mode, and B 1 to B 50 form the second frame of the transition motion effect. part.
  • B 50 is the last frame display image of the transition effect, and the degree of the special effect on the transition images of frames B 1 to B 50 can be gradually changed.
  • the special effect is a mask mask
  • the mask color on the transition image of each frame from B 1 to B 50 can gradually change from dark to light
  • the special effect is blur processing
  • each frame from B 1 to B 50 The blurring degree of the transition image can be gradually reduced, that is, a special effect that gradually changes from blurred to clear.
  • the special effect can also be in other forms, which are not limited here.
  • a 1 to A 50 shown in FIG. 6a may also be obtained based on the last few frames of image processing in the first shooting mode, and B 1 to B 50 shown in FIG. 6a may also be obtained based on the second The images of the first few frames in the shooting mode are obtained through processing, and there is no limitation here.
  • the effect of the transition motion effect displayed on the mobile phone 100 may be to first display the last frame of image A in the first shooting mode that gradually changes from clear to blurred, and then display the image A in the second shooting mode that gradually changes from blurred to clear.
  • the first frame of image B The images of the two shooting modes are continuously displayed where the mask color is the darkest or the effect is highly blurred. Even if the content of image A and image B is very different, such as the color difference, switching from image A to image B during the continuation will not be difficult. Sufficient time for visual acceptance will be left for the user, and the image switching transition will be smooth without appearing blunt or abrupt.
  • Figure 6b shows a transition motion effect including two parts according to the embodiment of the present application. After adjusting the number of transition images in each part based on the preset transition motion effect generation strategy, control the generation and transmission of transition images in each frame. Schematic diagram of the sequence shown.
  • A50 processed by the mobile phone 100 is generated and sent to the display, some or all of the lenses in the second shooting mode are not yet functionally ready to capture images, as shown in FIG.
  • the strategy can control to continue to generate images A 51 , A 52 .
  • a 51 to A 70 shown in FIG. 6b can also be displayed as image special effects corresponding to A 50 , until the mobile phone 100 acquires image B, and the special effects corresponding to B 1 to B 30 can be corresponding to A 50
  • the degree of gradually changes from fuzzy to clear which is not limited here.
  • the strategy for controlling the generation and display order of each frame of the transition image in the transition animation may include: controlling the first part of the transition animation (For example, 30 frames of images) are obtained based on the images in the first shooting mode through special effects processing, and the second part (for example, 40 frames of images) is obtained based on the images in the first shooting mode and the images in the second shooting mode through splicing + special effects processing , and the third part (for example, 30 frames of images) is obtained through special effect processing based on the images in the second shooting mode.
  • Fig. 6c is a schematic diagram showing a transition motion effect including three parts based on a preset transition motion effect generation strategy to control the generation and display sequence of each frame transition image in each part according to an embodiment of the present application.
  • a 1 to A 30 are, for example, frame transition images obtained by special effect processing based on the last frame of image A in the first shooting mode, as the preamble of the transition motion effect, that is, the transition motion The first part of the effect.
  • a 1 is the first frame display image of the transition effect, and the display effect of the images from A 1 to A 30 can gradually change from clear to blurred.
  • AB 1 to AB 40 are, for example, based on the last frame of image A in the first shooting mode and the first frame of image B in the second shooting mode after splicing + special effect processing.
  • Field image as the middle part of the transition effect, that is, the second part of the transition effect.
  • image A and image B are spliced into the effect of image AB, for example, you can refer to the splicing effect of the last frame image of the front panoramic preview and the first frame image of the background preview shown in Figure 7c below, or other forms of splicing The effect is not limited here.
  • the change of the degree of blurring of the images from AB 1 to AB 40 can be, for example, a change effect of low blur ⁇ high blur ⁇ low blur, wherein the blur degree of the image of AB 1 can be the same as that of the image of A 30 .
  • B 1 to B 30 are, for example, frame transition images obtained by special effect processing based on the first frame image B in the second shooting mode, as the end part of the transition motion effect, that is, the transition motion Effective third part.
  • B 30 is the display image of the last frame of the transition effect, and the display effect of the images from B 1 to B 30 can gradually change from blurred to clear. It will be appreciated that the B 1 image may be blurred to the same extent as the AB 40 image.
  • a 1 to A 30 shown in FIG. 6c may also be obtained based on the last few frames of image processing in the first shooting mode
  • B 1 to B 30 shown in FIG. 6c may also be obtained based on the second The image processing of the first few frames in the shooting mode is obtained, and AB 1 ⁇ AB 40 can be obtained from the last frame in the first shooting mode and the first frame image stitching + special effects in the second shooting mode, which will not be done here limit.
  • the effect of the transition animation displayed on the mobile phone 100 may be to first display the last frame of image A in the first shooting mode that gradually changes from clear to blurred, and then display that the degree of blur gradually increases and then gradually decreases.
  • the spliced image AB of and finally shows the first frame of image B in the second shooting mode that gradually becomes clear from blur.
  • the image switching transition in the transition motion effect generated by the mobile phone 100 can also be made smooth without appearing blunt or abrupt.
  • Figure 6d shows a transition animation effect including three parts according to the embodiment of the present application. After adjusting the number of transition images in each part based on the preset transition animation generation strategy, control the generation and transmission of transition images in each frame. Schematic diagram of the sequence shown.
  • the strategy can be controlled to continue to process images A 31 , A 32 ... A 50 based on image A in the first shooting mode until the mobile phone 100 acquires image B in the second shooting mode, and then generate conversion images based on image A and image B processing.
  • the second part of the field motion effect needs to display the transition images of each frame, such as AB 1 to AB 30 shown in FIG. 6 d .
  • each frame of transition images to be displayed at the end of the transition motion effect is generated based on image B processing, such as B 1 -B 20 shown in FIG. 6 d .
  • a 31 to A 50 shown in FIG. 6 b can also be displayed as image special effects corresponding to A 30 , until the mobile phone 100 acquires image B, the blur corresponding to AB 1 to AB 30 and B 1 to B 20 The degree starts from the blur degree corresponding to A 30 and gradually changes from fuzzy to clear, which is not limited here.
  • the preset switching duration of the shooting mode on the mobile phone 100 may also be other durations, such as 750ms or 450ms.
  • the duration of the transition motion effect is also 750ms or 450ms, and the video stream of the transition motion effect may include 75 frames of images, 45 frames of images, or images of other frames, and there is no limitation here.
  • Fig. 7a to Fig. 7d show some schematic diagrams of the preview interface of transition motion effects according to the embodiment of the present application.
  • the first shooting mode as the front single-shot mode 551 shown in FIG. 5e above
  • the second shooting mode as the front-rear dual-shot mode 553 as an example.
  • the mobile phone 100 may display a front panoramic preview interface 710 in the front single-shot mode 551 .
  • the mobile phone 100 detects the user's operation of switching the shooting mode, it can acquire the last frame of the front panoramic preview image shot in the front single shot mode 551, and process the frame of the image as the one displayed in the transition effect. Transition image.
  • the processing of the last frame image of the front panoramic preview by the mobile phone 100 is to add a mask mask
  • the switching interface 720 displayed by the mobile phone 100 at this time can display the last frame of the front panoramic preview
  • the frame image can be added to the image shown in Figure 7b
  • the mask effect shown in Figure 7b and Figure 7c may be the effect when the mask color is the darkest, at this time the picture displayed by the mobile phone 100 is the most blurred, in other embodiments, the mask shown in Figure 7b to Figure 7c
  • the mask mask effect shown can also be a mask mask effect in the process of changing the mask color from dark to light, which is not limited here.
  • the mobile phone 100 may display a dual-view preview interface 740 in the front-rear dual-camera mode 553 .
  • the foreground preview displayed on the dual-view preview interface 740 can be the same as or different from the last frame image content of the foreground front preview shown in FIG. The image currently captured by the front camera.
  • the background preview displayed on the dual-view preview interface 740 can be the same as or different from the content of the first frame of the background preview shown in FIG. The image currently captured by the rear camera in mode 553.
  • FIG. 8 shows a software structural block diagram of a mobile phone 100 according to an embodiment of the present application.
  • the software system of the mobile phone 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.
  • the software structure of the mobile phone 100 is illustrated by taking the Android system with a layered architecture as an example.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces.
  • the Android system is divided into four layers, which are application program layer, application program framework layer, hardware abstraction layer, and kernel layer from top to bottom.
  • the application layer may include a series of application packages.
  • An application package may include a camera application.
  • the application program layer can be further divided into a user interface (User Interface, also called UI interface) 801 and application logic 802 .
  • User Interface also called UI interface
  • the UI interface 801 of the camera application may include camera function controls such as recording 803 and multi-mirror recording 804, wherein the multi-mirror recording function may also include shooting modes such as front, back, front-back, back-back, and picture-in-picture.
  • Shooting modes such as front, rear, front-rear, rear-rear, and picture-in-picture can correspond to, for example, the front single-camera mode 551, rear-camera single-camera mode 552, and front-rear dual-camera mode 553 shown in FIG. 5e. , rear-rear dual camera mode 554 and picture-in-picture mode 555, etc.
  • the application logic 802 of the camera application may include a switch control module 810 , a multi-channel encoding module 820 and a transition animation generation module 830 .
  • the switching control module 810 is used for responding to the user selecting a camera function on the UI interface 801 , starting the camera to start shooting video, and switching the shooting mode.
  • the switching control module 810 responds to the user's operation of switching the shooting mode, it can send a corresponding instruction or signal to the transition motion effect generating module 830 to trigger the generation of the transition motion effect.
  • the switching control module 810 can send a corresponding instruction or signal to the transition motion effect generating module 830 to trigger the generation of the transition motion effect.
  • the multi-channel encoding module 820 is used to receive the encoding instruction sent by the transition motion effect generation module 830 for the image that has completed the special effect processing, and encode each frame of the transition image according to the generation and display order of the processed transition image of each frame as The video stream data is encoded into the captured video file.
  • the multi-channel encoding module 820 can receive and encode the image data transmitted by the channel corresponding to the camera data established in the first shooting mode, and the first shooting mode corresponds to the established channel.
  • the image data may be, for example, the image data corresponding to the camera device 1 in the hardware abstraction layer described below.
  • the shooting mode is switched, the channel corresponding to the first shooting mode is closed, and the multi-channel encoding module 820 no longer encodes the image data of the channel corresponding to the first shooting mode.
  • the multi-channel encoding module 820 can continue to encode the image data transmitted by the channel corresponding to the second shooting mode.
  • the image data transmitted by one channel may be, for example, the image data corresponding to the camera device 2 and the camera device 3 in the hardware abstraction layer described below. It can be understood that the encoding task performed by the multi-channel encoding module 820 after receiving the encoding instruction from the transition motion effect generating module 830 is different from the encoding task performed by encoding the image data collected by the camera to generate a video file in each shooting mode.
  • the multi-channel encoding module 820 can encode the images captured by one or more lenses after rendering and special effect processing of each frame transition image.
  • the encoding module can also use single-channel encoding modules or dual-channel encoding modules, etc., are not limited here.
  • OpenGL Open Graphics Library
  • OpenGL ES Open Graphics Library for Embedded Systems
  • OpenGL is a cross-language, cross-platform application programming interface for rendering 2D and 3D graphics.
  • OpenGL may also be referred to simply as "GL”
  • OpenGL ES may also be referred to as "GL ES”.
  • the Android application program can call the OpenGL or OpenGL ES interface to draw and render the UI interface 801.
  • the transition animation generation module 830 in the application logic 802 of the camera application may specifically include a texture generator (Texture Generator) 831, a rendering thread (Render Thread) 832, a rendering processing program (Render Handler) 833 and coloring library 834 etc.
  • a texture generator Textture Generator
  • Render Thread rendering thread
  • Render Handler rendering processing program
  • the texture generator 831 may register an image listener in response to an instruction or a signal sent by the switching control module 810, and extract texture features from the image acquired through monitoring.
  • the texture feature is a global feature, which reflects the visual features of homogeneous phenomena in the image, and reflects the slow-changing or periodic-changing surface tissue structure arrangement properties of the object surface.
  • Image texture is represented by the gray distribution of pixels and their surrounding spatial neighborhoods, that is, local texture information.
  • the repeatability of local texture information to varying degrees is global texture information. Therefore, each frame of image can extract the corresponding unique texture features.
  • the rendering thread 832 is a thread for running the renderer. It can be understood that the renderer is usually built based on a graphics application programming interface (application programming interface, API), and commonly used graphics APIs include OpenGL, so in some embodiments, the rendering thread 832 may also be called a GL rendering thread.
  • the renderer running on the GL rendering thread can obtain the image to be rendered and displayed as the material for generating the transition effect.
  • the rendering processing program 833 can be run by the GPU, and is used for processing such as special effects or splicing on the images acquired on the GL rendering thread. It can be understood that the renderer running on the rendering thread 832 can call the GPU to execute the rendering processing program 833 to process the image.
  • the shader library 834 is used to cooperate with the GPU to execute the shader program, and may include multiple shaders (Shader). Wherein, the essence of the Shader is a program executed on the GPU. This program is written in the OpenGL ES SL language, so in some embodiments, the shader provided by the shader library 834 can also be called a GL ES shader ( GL ES Shader). Shaders commonly used in OpenGL ES include vertex shaders, fragment shaders, and more.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer can include the framework layer including the camera access interface (Camera API).
  • the camera access interface is a set of interfaces for accessing the camera device introduced by Android. It adopts a pipeline design to make the data flow from the camera Flow to Surface.
  • the camera access interface includes Camera Manager. Camera management can be used to manage camera devices, through which camera device information on the mobile phone 100 can be queried to obtain camera device objects.
  • the camera device information may include, for example, a series of fixed parameters related to the camera device, such as basic setting parameters and output format parameters.
  • the hardware abstraction layer is an interface layer between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform, provides a virtual hardware platform for the operating system, makes it hardware-independent, and can be transplanted on various platforms.
  • the HAL includes the camera hardware abstraction layer (Camera HAL, also known as the camera HAL).
  • the camera HAL may include camera device 1, camera device 2, camera device 3, and so on. It can be understood that the camera device 1 , the camera device 2 and the camera device 3 are abstract devices, such as abstract devices such as the camera 1 , the camera 2 , and the camera 3 .
  • the kernel driver layer is the layer between hardware and software.
  • the kernel driver layer includes at least a display driver, a camera driver, etc.
  • the display driver can be used to drive the display screen 194 of the mobile phone 100
  • the camera driver can be used to drive each camera 193 of the mobile phone 100 .
  • FIG. 9 shows a schematic diagram of an interaction process of a method for generating transition motion effects according to an embodiment of the present application.
  • the interaction process involves the switching control module 810 shown in FIG. 8 , the multi-channel encoding module 820 , and the texture generator 831 in the transition motion effect generation module 830 , the rendering thread 832 , the rendering processing program 833 and Shader library 834.
  • the process includes the following steps:
  • the switching control module 810 executes environment initialization of the first shooting mode.
  • the initialization of the multi-camera video shooting environment is triggered.
  • the mobile phone 100 may adopt a default shooting mode or a certain shooting mode selected by the user, and the shooting mode adopted at this time is the first shooting mode. Therefore, the initialization of the shooting environment is also the initialization of the environment in the first shooting mode. It can be understood that the environment initialization may include, for example, driving the camera corresponding to the first shooting mode to work, and the drawing and rendering environment in the system of the mobile phone 100 is ready.
  • the switching control module 810 may be set in the application program layer of the mobile phone 100 system shown in FIG. 8 , for example.
  • the switching control module 810 can also be set in other layers of the system framework of electronic devices such as mobile phones, for example, it can be set in the application program framework layer to be called by the application logic of the camera application in the application program layer, here No restrictions.
  • the switching control module 810 sends a texture initialization instruction of the first shooting mode to the texture generator 831 .
  • the switching control module 810 may send an initialization command to the texture generator 831 when responding to the user's shooting operation, so that the texture generator 831 initializes an operating environment for extracting textures from images captured in the first shooting mode.
  • the texture generator 831 may be set in the application layer of the mobile phone 100 system shown in FIG. 8 above.
  • the texture generator 831 can also be set in other layers of the system framework of electronic devices such as mobile phones, for example, it can be set in the application framework layer to be called by the application logic of the camera application in the application layer. No restrictions.
  • the texture generator 831 calculates the texture effect corresponding to the image captured in the first shooting mode.
  • the texture generator 831 may calculate a corresponding texture effect for the image collected in the first shooting mode, that is, extract the texture feature corresponding to the image.
  • the texture generator 831 updates the texture effect to the rendering thread 832 .
  • the texture generator 831 can send the calculated texture effect parameters (ie, texture feature parameters) to the rendering thread 832 to update the current frame The texture effect of the image.
  • the rendering thread 832 sends an instruction to initialize the rendering environment to the rendering processing program 833 .
  • the rendering thread 832 may send an initialization instruction to the rendering processing program 833, so that the GPU runs the rendering processing program to initialize the rendering environment.
  • the rendering processing program 833 calls the corresponding shader in the shader library 834 to execute the shader program.
  • the GPU runs the rendering processing program 833 and completes the initialization of the rendering environment, it can call the corresponding shader in the shader library 834 to cooperate with the GPU to run the corresponding shader program.
  • the rendering processing program 833 may send the position, color, texture coordinates, etc. of the frame texture of the updated texture effect to the corresponding shader, so as to cooperate with the GPU to execute the shader program.
  • the shader library 834 may be set in the application layer of the mobile phone 100 system shown in FIG. 8 above.
  • the shader library 834 can also be set in other layers of the system framework of electronic devices such as mobile phones, for example, it can be set in the application framework layer to be called by the application logic of the camera application in the application layer. No restrictions.
  • the texture generator 831 registers an image listener in response to the initialization instruction, acquires frame images in the first shooting mode, and extracts corresponding frame textures.
  • the texture generator 831 when the texture generator 831 executes the above steps S03 to S04, it may also register the image listener in response to the initialization instruction received in the above step S02.
  • the image listener is used to monitor and monitor images in the first shooting mode and the second shooting mode requested by the user to generate transition motion effects.
  • the switching control module 810 sends a shooting mode switching signal to the texture generator 831 in response to the user's operation of switching the shooting mode.
  • the user selects another shooting mode different from the current shooting mode on the interface of the camera application (such as the shooting mode selection interface 550 shown in FIG. operation, sending a shooting mode switching signal to the texture generator 831 .
  • the shooting mode switching signal is used to notify the texture generator 831 that the shooting mode is about to switch.
  • the texture generator 831 acquires a frame of image in the first shooting mode, and extracts a corresponding frame texture.
  • the texture generator 831 when the texture generator 831 receives the shooting mode switching signal, it may register an image listener based on the above step S07, acquire a frame of image in the first shooting mode, and extract the frame texture of the corresponding image.
  • the one frame of image in the first shooting mode acquired by the texture generator 831 here may be, for example, the last frame of image in the first shooting mode or the last several consecutive frames of images, and the acquired image will be used for Generate transition effects, there is no limitation here.
  • each frame of image corresponds to a frame of texture
  • the special effect processing performed on each frame of texture can be understood as the special effect processing performed on the corresponding frame image.
  • the texture generator 831 sends the extracted frame texture to the rendering thread 832 .
  • the texture generator 831 may send the extracted frame texture to the rendering thread 832 for subsequent corresponding processing by the renderer running on the rendering thread 832 .
  • the rendering thread 832 receives the frame texture sent by the texture generator 831, and the frame texture is the frame texture extracted from a frame of image in the first shooting mode in the above step S09.
  • the rendering thread 832 sends the frame texture to the rendering processing program 833, and requests to perform transition animation processing on the frame texture.
  • the rendering thread 832 can send the frame texture to the rendering processing program 833, and the rendering thread 832 can also request the rendering processing program 833 run by the GPU to process the frame texture One or more frames of images in the transition effect.
  • the operation of the rendering thread 832 and the rendering processing program 833 is not limited to the application layer shown in FIG.
  • the processing performed by other parts is not limited here.
  • For the specific running process of the rendering thread 832 and the rendering processing program 833 reference may be made to the execution processing process of the rendering process in the prior art, which will not be repeated here.
  • the rendering processing program 833 sends the special effect processing parameters corresponding to the texture of the frame to the shader library 834 .
  • the rendering processing program 833 run by the GPU may preset the aforementioned transition motion effect generation strategy, and based on the strategy, the rendering processing program may determine special effect processing parameters for each frame of the transition motion effect.
  • the special effect processing parameters include, for example, color and opacity parameters of the mask, blur degree coefficients of blur processing, etc., and may also include texture information of each frame of image, etc.
  • the texture information may be, for example, the position, color and texture coordinate information of the texture corresponding to each frame image.
  • the shader library 834 provides corresponding shaders to cooperate with the GPU to run the shader program, and perform special effect processing on the frame texture, so as to obtain a frame texture with corresponding special effects, and then generate a frame of image displayed at the corresponding position in the transition animation .
  • the rendering processing program 833 calls a corresponding shader to the shader library 834 to perform special effect processing on the frame texture, and draws and renders to the display.
  • the corresponding shader can be called to cooperate with the GPU to execute the shader program to perform corresponding special effects on the texture of the current frame processing, and after the processing is completed, the display parameters of the corresponding image are sent to the interface synthesis service (surface flinger) for display, that is, after the interface synthesis service (surface flinger) completes the merger with other layers, it is displayed as the interface to be displayed The process will not be repeated here.
  • the rendering processing program 833 sends the frame texture sent for display to the multi-channel encoding module 820 for encoding to generate video stream data for transition effects.
  • the transition image obtained after the rendering processing program 833 run by the GPU completes the special effect processing on the texture of the current frame image can also be sent to the multi-channel encoding module through the corresponding channel 820 to encode, that is, to send the encoding process to generate the video stream data corresponding to the transition effect.
  • the multi-channel encoding module 820 can use a corresponding encoder to compress and encode the processed frame texture or frame image, and the format of the encoded video stream file can be, for example, the above-mentioned AVC format.
  • the encoded video stream data in AVC format can be combined and packaged according to the corresponding time stamps to form a video file containing the generated video stream data.
  • the video file format after packaging can be, for example, MP4, or AVI and other media file formats, which will not be described in detail here.
  • step S15 may not be executed for the generated transition animation effect.
  • the generated transition effects are only displayed in the transition preview interface for switching shooting modes, and there is no limitation here.
  • the multi-channel encoding module 820 may be set in the application program layer of the mobile phone 100 system shown in FIG. 8 , for example.
  • the multi-channel encoding module 820 can also be set in other layers of the system framework of electronic devices such as mobile phones, for example, it can be set in the application program framework layer for the application logic call of the camera application in the application program layer. This is not limited.
  • the rendering processing program 833 returns the image processing result of the first shooting mode to the switching control module 810 through the rendering thread 832 and the texture generator 831 .
  • the rendering processing program 833 run by the GPU may return the image processing result of the first shooting mode to the switching control module 810 through the rendering thread 832 and the texture generator 831 after completing the special effect processing of the texture or image of the current frame.
  • the return value of processing completion is sent to the switching control module 810 through the rendering thread 832 and the texture generator 831 .
  • the return value indicates that the current frame of texture or image in the transition animation has been processed, and the processing of the next frame of image can be continued.
  • the texture generator 831 acquires a frame of image in the second shooting mode, and extracts a corresponding frame texture.
  • the texture generator 831 can acquire the first frame of image in the second shooting mode based on the image listener .
  • the texture generator 831 may continue to acquire continuous second frame, third frame and other multi-frame images for processing as a transition effect
  • the transition images of each frame in are not limited here.
  • the texture generator 831 sends the extracted frame texture to the rendering thread 832 .
  • the extracted frame texture sent by the texture generator 831 to the rendering thread 832 is the frame texture corresponding to the image in the second shooting mode acquired in the above step S17.
  • the texture generator 831 acquires the image and extracts the frame texture of the corresponding image, it can send the extracted frame texture to the rendering thread 832 for subsequent corresponding processing by the renderer running on the rendering thread 832 .
  • the frame texture acquired by the rendering thread 832 is the frame texture corresponding to the image in the second shooting mode sent by the texture generator 831 in the above step S18.
  • the rendering thread 832 sends the frame texture to the rendering processing program 833, and requests to perform transition animation processing on the frame texture.
  • the rendering thread 832 can send the frame texture to the rendering processing program 833, and the rendering thread 832 can also request the rendering processing program 833 run by the GPU to process the frame texture It is one or more frames of images in the transition effect.
  • the rendering processing program 833 sends the special effect processing parameters corresponding to the texture of the frame to the shader library 834 .
  • the rendering processing program 833 determines the special effect processing parameters corresponding to the texture of the current frame, it can send them to the corresponding shader in the shader library 834, so as to cooperate with the GPU to execute the shader program.
  • the rendering processing program 833 can send them to the corresponding shader in the shader library 834, so as to cooperate with the GPU to execute the shader program.
  • the rendering processing program 833 calls a corresponding shader to the shader library 834 to perform special effect processing on the texture of the frame, and draws and renders to the display.
  • the rendering processing program 833 run by the GPU sends the special effect processing parameters corresponding to the texture of the frame to the shader library 834
  • the corresponding shader can be called to cooperate with the GPU to execute the shader program to perform corresponding special effects on the texture of the current frame Processing, and after the processing is completed, the display parameters of the corresponding image are sent to the surface flinger for display.
  • the display parameters of the corresponding image are sent to the surface flinger for display.
  • the rendering processing program 833 sends the frame texture sent for display to the multi-channel encoding module 820 for encoding to generate video stream data for transition effects.
  • the transition image obtained after the rendering processing program 833 run by the GPU completes the special effect processing on the texture of the current frame image can also be sent to the multi-channel encoding module through the corresponding channel 820 to encode, that is, to send the encoding process to generate the video stream data corresponding to the transition effect.
  • the multi-channel encoding module through the corresponding channel 820 to encode, that is, to send the encoding process to generate the video stream data corresponding to the transition effect.
  • step S23 may not be executed for the generated transition animation effect.
  • the generated transition effects are only displayed in the transition preview interface for switching shooting modes, and there is no limitation here.
  • the rendering processing program 833 returns the image processing result of the second shooting mode to the switching control module 810 through the rendering thread 832 and the texture generator 831 .
  • the rendering processing program 833 run by the GPU may return the image processing result of the second shooting mode to the switching control module 810 through the rendering thread 832 and the texture generator 831 after completing the special effect processing of the texture or image of the current frame.
  • the return value of processing completion is sent to the switching control module 810 through the rendering thread 832 and the texture generator 831 .
  • the return value indicates that the current frame of texture or image in the transition animation has been processed, and the processing of the next frame of image can be continued.
  • the switching control module 810 sends a shooting mode switching completion signal to the texture generator 831 .
  • the switching control module 810 may determine that the switching of the shooting mode has been completed, and then may send a shooting mode switching completion signal to the texture generator 831 .
  • the texture generator 831 receives the shooting mode switching completion signal from the switching control module 810, it determines that it does not need to monitor and acquire images in a certain shooting mode, and at this time, the corresponding image monitor can be deregistered.
  • the image listener registered on the texture generator 831 is not only used to obtain images in the first shooting mode and the second shooting mode when switching the shooting mode, but the image listener can be used to During the video shooting process, the images captured and uploaded by the lens are constantly monitored. In this case, after switching the shooting mode, the texture generator 831 may not cancel the registered image listener. After switching the shooting mode, the image monitor can continuously acquire and upload the images captured and uploaded by the corresponding working lens in the second shooting mode.
  • an embodiment or “an embodiment” in the description means that the specific features, structures or characteristics described in conjunction with the embodiment are included in at least one exemplary implementation or technology disclosed according to the embodiment of the present application.
  • the appearances of the phrase “in one embodiment” in various places in the specification are not necessarily all referring to the same embodiment.
  • the disclosure of the embodiment of the present application also relates to a device for executing operations in text.
  • This apparatus may be specially constructed for the required purposes or it may comprise a general purpose computer selectively activated or reconfigured by a computer program stored in the computer.
  • a computer program may be stored on a computer readable medium such as, but not limited to, any type of disk, including floppy disk, compact disk, CD-ROM, magneto-optical disk, read-only memory (ROM), random-access memory (RAM) , EPROM, EEPROM, magnetic or optical card, application specific integrated circuit (ASIC), or any type of medium suitable for storing electronic instructions, and each may be coupled to a computer system bus.
  • computers referred to in the specification may comprise a single processor or may be architectures involving multiple processors for increased computing power.

Abstract

The present application relates to the technical field of smart terminals, and specifically relates to a transition animation generation method, an electronic device, and a storage medium. The method comprises: when carrying out video shooting using a first shooting mode, detecting a first instruction for switching from the first shooting mode to a second shooting mode; and in response to the first instruction, switching a video shooting mode to the second shooting mode and generating and playing a transition animation, wherein the transition animation is played between a first video part shot in the first shooting mode and a second video part shot in the second shooting mode, and the transition animation comprises a first image in the first video part and a second image in the second video part. By means of the generated transition animation serving as a transition preview interface when switching shooting modes, the change of the transition preview interface displayed before and after switching can be smoother and more coordinated rather than appearing abrupt, and improvement of user experience is facilitated.

Description

转场动效生成方法、电子设备和存储介质Transition dynamic effect generation method, electronic device and storage medium
本申请要求于2022年2月24日提交中国专利局、申请号为202210171604.7、申请名称为“转场动效生成方法、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202210171604.7 and the application name "transition animation generation method, electronic equipment and storage medium" submitted to the China Patent Office on February 24, 2022, the entire content of which is incorporated by reference incorporated in this application.
技术领域technical field
本发明涉及智能终端技术领域,具体涉及一种转场动效生成方法、电子设备和存储介质。The present invention relates to the technical field of intelligent terminals, in particular to a method for generating a transition motion effect, electronic equipment and a storage medium.
背景技术Background technique
为了提高用户体验,手机、平板电脑等电子设备通常配置多个摄像头。例如目前很多手机配置有多个前置摄像头和多个后置摄像头。基于此,一些手机在向用户提供拍照、录像等相机功能的基础上,还可以向用户提供多镜录像功能等。其中,多镜录像功能所提供的各种拍摄模式可以使用一个或多个摄像头进行拍摄,用户可以根据自己的需求选择相应的相机功能进行拍摄。可以理解,开始拍摄视频时,手机的系统中可以建立当前拍摄模式所对应启动的摄像头所采集数据送编码的通路,以用于将相应摄像头采集的图像数据送入编码器进行编码以得到所拍摄的视频文件。另外可以理解,如果当前拍摄模式使用的是多个摄像头,手机的系统中对应各个摄像头所建立的通路也可以是多个,即多个通路将各个摄像头采集的图像数据送入多路编码器中进行编码以得到所拍摄的视频文件。In order to improve user experience, electronic devices such as mobile phones and tablet computers are usually equipped with multiple cameras. For example, many mobile phones are equipped with multiple front cameras and multiple rear cameras. Based on this, some mobile phones can also provide users with multi-lens video recording functions on the basis of providing users with camera functions such as taking pictures and video recordings. Among them, the various shooting modes provided by the multi-camera video recording function can use one or more cameras for shooting, and users can choose corresponding camera functions for shooting according to their own needs. It can be understood that when starting to shoot a video, the system of the mobile phone can establish a channel for sending the data collected by the camera corresponding to the current shooting mode to be encoded, so as to send the image data collected by the corresponding camera to the encoder for encoding to obtain the captured image. video file. In addition, it can be understood that if multiple cameras are used in the current shooting mode, there may also be multiple channels established corresponding to each camera in the mobile phone system, that is, multiple channels send the image data collected by each camera to a multi-channel encoder. Encode to get the captured video file.
用户可以在拍摄视频的过程中,可以选择切换到与当前拍摄模式不同的其他拍摄模式进行拍摄。然而,在切换拍摄模式的过程中,由于切换前后的拍摄模式所使用的镜头取景等方面的差异,会导致手机在从切换前拍摄模式的图像预览界面切换到切换后拍摄模式的图像预览界面的过程中,所显示的转场预览界面比较生硬。尤其当用户选择切换的拍摄模式对应的摄像头取景与切换前使用的拍摄模式对应的摄像头取景的颜色等方面差异较大时,这种生硬的转场预览界面会显得尤为突兀,进而会给用户带来不好的视觉体验,导致用户体验变差。During the process of shooting video, the user can choose to switch to other shooting modes different from the current shooting mode for shooting. However, in the process of switching the shooting mode, due to the difference in the lens framing used in the shooting mode before and after switching, the mobile phone will switch from the image preview interface of the shooting mode before switching to the image preview interface of the shooting mode after switching. During the process, the displayed transition preview interface is relatively blunt. Especially when the color of the camera view corresponding to the shooting mode that the user chooses to switch is quite different from the color of the camera view corresponding to the shooting mode used before switching, this blunt transition preview interface will appear particularly abrupt, which will bring users a sense of confusion. A bad visual experience leads to poor user experience.
发明内容Contents of the invention
本申请实施例提供了一种转场动效生成方法、电子设备和存储介质,通过所生成的转场动效作为切换拍摄模式时的转场预览界面,能够使切换前后所显示的转场预览界面内容上存在更加流畅协调的接续过渡,转换不会显得生硬,从而利于提高用户体验。The embodiment of the present application provides a method for generating a transition motion effect, an electronic device, and a storage medium. By using the generated transition motion effect as a transition preview interface when switching shooting modes, the transition preview displayed before and after switching can be There are more smooth and coordinated transitions on the interface content, and the transition will not appear blunt, which is conducive to improving user experience.
第一方面,本申请实施例提供了一种转场动效生成方法,应用于电子设备,该方法包括:在采用第一拍摄模式进行视频拍摄的过程中,检测到从第一拍摄模式切换到第二拍摄模式的第一指令;响应于第一指令,将视频拍摄模式切换为第二拍摄模式,并生成和播放转场动效,其中,转场动效在第一拍摄模式下拍摄的第一视频部分和在第二拍摄模式下拍摄的第二视频部分之间播放,并且转场动效包括第一视频部分中的第一图像、以及第二视频部分中的第二图像。In the first aspect, the embodiment of the present application provides a method for generating a transition motion effect, which is applied to an electronic device. The first instruction of the second shooting mode; in response to the first instruction, switch the video shooting mode to the second shooting mode, and generate and play the transition animation effect, wherein the transition animation effect is captured in the first shooting mode in the first shooting mode A video part is played between a second video part shot in the second shooting mode, and the transition motion effect includes the first image in the first video part and the second image in the second video part.
即当用户操作电子设备进行拍摄模式的切换时,电子设备可以检测到切换拍摄模式的指令,即上述第一指令。此时,电子设备可以在切换拍摄模式的过程中显示基于第一拍摄模式所拍摄的第一图像和第二拍摄模式所拍摄的第二图像所生成的转场动效,如此电子设备所显示的转换界面与切换前后的两种拍摄模式对应的取景都可以有内容上的关联,因而看起来会更加流畅协调。上述第一拍摄模式和第二拍摄模式可以参考下文实施例中图5e所示例的各种多镜录像功能的拍摄模式等,在此不做限制。That is, when the user operates the electronic device to switch the shooting mode, the electronic device may detect an instruction to switch the shooting mode, that is, the above-mentioned first instruction. At this time, the electronic device may display the transition motion effect generated based on the first image captured in the first shooting mode and the second image captured in the second shooting mode during the process of switching the shooting mode, such that the electronic device displays The conversion interface and the framing corresponding to the two shooting modes before and after switching can be related in content, so it will look more smooth and coordinated. For the above-mentioned first shooting mode and second shooting mode, reference may be made to the shooting modes of various multi-mirror video recording functions exemplified in FIG. 5e in the following embodiments, and there is no limitation here.
在上述第一方面的一种可能的实现中,第一图像为在第一拍摄模式下拍摄的最后N帧图像,第二图像为在第二拍摄模式下拍摄的前M帧图像,其中,N和M为自然数。In a possible implementation of the first aspect above, the first image is the last N frames of images captured in the first shooting mode, and the second image is the first M frames of images captured in the second shooting mode, where N and M are natural numbers.
即上述第一图像例如可以是第一拍摄模式所拍摄的第一视频部分的最后一帧图像,切换前第一拍摄模式下采集的多帧图像等;上述第二拍摄模式例如可以是第二拍摄模式所拍摄的第二视频部分的第一帧图像或者前几帧图像等,在此不做限制。That is, the above-mentioned first image may be, for example, the last frame image of the first video part captured in the first shooting mode, multiple frames of images collected in the first shooting mode before switching, etc.; the above-mentioned second shooting mode may be, for example, the second shooting The first frame image or the first few frame images of the second video part captured by the mode are not limited here.
在上述第一方面的一种可能的实现中,在第一拍摄模式下拍摄第一图像采用的摄像头、与在第二拍摄模式下拍摄第二图像采用的摄像头,是位于电子设备不同侧的摄像头。In a possible implementation of the first aspect above, the camera used to capture the first image in the first shooting mode and the camera used to capture the second image in the second shooting mode are cameras located on different sides of the electronic device .
即切换前后两种拍摄模式可以采用不同的摄像头。例如切换前的第一拍摄模式所采用的摄像头为前置摄像头,而切换后的第二拍摄模式所采用的摄像头为后置摄像头。或者例如切换前的第一拍摄模式所采用的摄像头可以仅包括后置摄像头,而切换后的第二拍摄模式所采用的摄像头包括前置摄像头等,在此不做赘述。That is, the two shooting modes before and after switching can use different cameras. For example, the camera used in the first shooting mode before switching is a front camera, while the camera used in the second shooting mode after switching is a rear camera. Or, for example, the camera used in the first shooting mode before switching may only include a rear camera, while the camera used in the second shooting mode after switching includes a front camera, etc., which will not be repeated here.
在上述第一方面的一种可能的实现中,通过以下方式生成转场动效:根据电子设备在第二拍摄模式下生成第二视频部分的第一帧图像所需的时间,确定生成的转场动效的各个部分的转场图像帧数。In a possible implementation of the above first aspect, the transition motion effect is generated in the following manner: according to the time required for the electronic device to generate the first frame image of the second video part in the second shooting mode, determine the generated transition The number of transition image frames for each part of the animation effect.
即所生成的转场动效各个部分的转场图像帧数,可以根据切换到的第二拍摄模式拍摄到第一帧图像的时间来确定,例如第二拍摄模式拍摄到第一帧图像的时间越长,基于第一拍摄模式拍摄到的第一图像所生成的转场图像帧数越多,即下文所描述的转场动效中第一转场部分的转场图像帧数越多,相应地第一转场部分的显示时间也会越长。相反地,第二拍摄模式拍摄到第一帧图像的时间越短,基于第二拍摄模式拍摄到的第二图像生成的转场图像帧数越多,即下文所描述的第二转场部分或第三转场部分的转场图像帧数越多,相应地第二转场部分或第三转场部分的显示时间较长一些。具体可以参考下文实施例中相关描述,在此不做赘述。That is, the number of transition image frames of each part of the generated transition motion effect can be determined according to the time when the first frame image is captured by the second shooting mode switched to, for example, the time when the first frame image is captured by the second shooting mode The longer it is, the more transition image frames are generated based on the first image captured in the first shooting mode, that is, the more transition image frames are in the first transition part in the transition motion described below, and the corresponding The display time of the first transition part of the ground will also be longer. Conversely, the shorter the time for capturing the first frame image in the second shooting mode, the more frames of transition images generated based on the second image captured in the second shooting mode, that is, the second transition part or The more frames of transition images in the third transition part, the longer the display time of the second transition part or the third transition part is. For details, reference may be made to relevant descriptions in the following embodiments, and details are not repeated here.
在上述第一方面的一种可能的实现中,转场动效包括依次生成的第一转场部分和第二转场部分,其中,第一转场部分的各帧转场图像基于第一图像生成;第二转场部分的各帧转场图像基于第二图像生成,或者,第二转场部分的各帧转场图像基于第一图像与第二图像的拼接图像生成。In a possible implementation of the first aspect above, the transition motion effect includes a first transition part and a second transition part generated sequentially, wherein each frame transition image of the first transition part is based on the first image Generate: each frame of transition images in the second transition part is generated based on the second image, or, each frame of transition images in the second transition part is generated based on the spliced image of the first image and the second image.
即所生成的转场动效可以包括两个部分,其中第一部分(即上述第一转场部分)可以基于第一拍摄模式拍摄的第一图像生成。第一转场部分例如可以是下文实施例中图6a所示的A 1~A 50部分、或者图6b所示的A 1~A 70。所生成的转场动效的第二部分(即上述第二转场部分)可以基于第二拍摄模式拍摄的第二图像生成,也可以基于两种拍摄模式所拍摄的第一图像和第二图像共同生成,例如基于二者的拼接图像生成上述第二转场部分。在此不做限制。其中,基于第二拍摄模式拍摄的第二图像生成的第二转场部分,例如可以是下文实施例中图6a所示的B 1~B 50部分、或者图6b所示的B 1~B 30That is, the generated transition motion effect may include two parts, wherein the first part (that is, the above-mentioned first transition part) may be generated based on the first image captured in the first shooting mode. The first transition part may be, for example, parts A 1 -A 50 shown in FIG. 6a or A 1 -A 70 shown in FIG. 6b in the following embodiments. The second part of the generated transition motion effect (that is, the above-mentioned second transition part) can be generated based on the second image captured in the second shooting mode, or based on the first image and the second image captured in the two shooting modes Jointly generate, for example, generate the above-mentioned second transition part based on the spliced images of the two. There is no limitation here. Wherein, the second transition part generated based on the second image shot in the second shooting mode may be, for example, parts B 1 to B 50 shown in Figure 6a in the following embodiments, or parts B 1 to B 30 shown in Figure 6b .
在上述第一方面的一种可能的实现中,电子设备包括对转场动效的第一转场部分预设的转场图像帧数为i、以及对转场动效的第二转场部分预设的转场图像帧数为j,并且,根据电子设备在第二拍摄模式下生成第二视频部分的第一帧图像所需的时间,确定生成的转场动效的各个部分的转场图像帧数,包括:若在第二拍摄模式下生成第二视频部分的第一帧图像所需的时间大于生成第一转场部分所需的时间,则确定生成的转场动效的第一转场部分的转场图像帧数为i+k、以及第二转场部分的转场图像帧数为j-k,其中k<j。In a possible implementation of the first aspect above, the electronic device includes a preset transition image frame number i for the first transition part of the transition effect, and a second transition part for the transition effect The preset number of transition image frames is j, and according to the time required for the electronic device to generate the first frame image of the second video part in the second shooting mode, determine the transition of each part of the generated transition motion effect The number of image frames, including: if the time required to generate the first frame image of the second video part in the second shooting mode is greater than the time required to generate the first transition part, determine the first time of the generated transition motion effect The number of transition image frames in the transition part is i+k, and the number of transition image frames in the second transition part is j-k, where k<j.
即电子设备中可以在一定的转场时长内,预设转场动效的各个部分所包括的转场图像帧数,例如上述第一转场部分所包括的i帧和第二转场部分所包括的j帧。可以理解,电子设备生成和显示的转场动效所包括的总计转场图像帧数是一定的,转场动效的显示时长是一定的。其中电子设备生成和显示第一转场部分的i帧转场图像的时间也是一定的,当切换拍摄模式时,如果第二拍摄模式对应的摄像头启动较慢等,可能会导致第二拍摄模式拍摄到第一帧图像的时间较长,此时电子设备预设的第一转场部分的i帧转场图像即将显示完,此时电子设备可以基于第一拍摄模式拍摄的第一图像继续生成转场图像并显 示,如此,第一转场部分所包括的转场图像帧数便增加了,例如增加了k帧。这一变化过程可以参考下文实施例中图6a所示的A 1~A 50部分变化至图6b所示的A 1~A 70的相关描述,在此不做赘述。 That is, the electronic device can preset the number of transition image frames included in each part of the transition motion effect within a certain transition duration, for example, the i frame included in the first transition part and the i frame included in the second transition part The j frames included. It can be understood that the total number of transition image frames included in the transition motion effect generated and displayed by the electronic device is fixed, and the display duration of the transition motion effect is constant. The time for the electronic device to generate and display the i-frame transition images of the first transition part is also certain. When switching the shooting mode, if the camera corresponding to the second shooting mode starts slowly, etc., it may cause the second shooting mode to shoot The time to the first frame of image is relatively long. At this time, the i-frame transition image of the first transition part preset by the electronic device is about to be displayed. At this time, the electronic device can continue to generate the transition image based on the first image captured in the first shooting mode. The field image is displayed. In this way, the number of frames of the transition image included in the first transition part increases, for example, k frames are added. This change process can refer to the relevant description of the partial change from A 1 to A 50 shown in FIG. 6a to A 1 to A 70 shown in FIG. 6b in the following embodiments, and details are not repeated here.
鉴于转场动效所包括的总计转场图像帧数(即i+j帧)是一定的,那么在第二拍摄模式获取第一帧图像后,基于第二图像生成的第二转场部分中所包括的转场图像帧数,则可以相应地减少k帧。这一变化过程可以参考下文实施例中图6a所示的B 1~B 50部分变化至图6b所示的B 1~B 30的相关描述,在此不做赘述。 In view of the fact that the total number of transition image frames (ie i+j frames) included in the transition motion effect is certain, after the first frame image is acquired in the second shooting mode, in the second transition part generated based on the second image The number of transition image frames included can be correspondingly reduced by k frames. This change process can refer to the relevant description of the partial change from B 1 to B 50 shown in FIG. 6a to B 1 to B 30 shown in FIG. 6b in the following embodiments, and details are not repeated here.
在上述第一方面的一种可能的实现中,转场动效包括依次生成的第三转场部分、第四转场部分和第五转场部分,其中,第三转场部分的各帧转场图像基于第一图像生成;第四转场部分的各帧转场图像基于第一图像与第二图像的拼接图像生成;第五转场部分的各帧转场图像基于第二图像生成。In a possible implementation of the first aspect above, the transition motion effect includes a third transition part, a fourth transition part, and a fifth transition part generated in sequence, wherein each frame of the third transition part The field image is generated based on the first image; each frame of the transition image in the fourth transition part is generated based on the spliced image of the first image and the second image; each frame of the transition image in the fifth transition part is generated based on the second image.
即所生成的转场动效可以包括三个部分,为了区别于上述包含两个部分的转场动效的描述,可以分别用上述三转场部分、第四转场部分以及第五转场部分表示转场动效的第一部分、第二部分和第三部分。That is, the generated transition animation can include three parts. In order to distinguish it from the description of the above two-part transition animation, the above three transition parts, the fourth transition part and the fifth transition part can be used respectively Represents the first, second and third parts of the transition animation.
所生成的转场动效的第一部分(即上述第三转场部分)可以基于第一拍摄模式拍摄的第一图像生成。第一部分例如可以是下文实施例中图6c所示的A 1~A 30部分、或者图6d所示的A 1~A 50The generated first part of the transition motion effect (that is, the third transition part) may be generated based on the first image captured in the first shooting mode. The first part may be, for example, parts A 1 -A 30 shown in FIG. 6c in the following embodiments, or A 1 ˜A 50 shown in FIG. 6d .
所生成的转场动效的第二部分(即上述第四转场部分)可以基于两种拍摄模式所拍摄的第一图像和第二图像共同生成,例如基于二者的拼接图像生成转场动效的第一部分。该第一部分,例如可以是下文实施例中图6c所示的AB 1~AB 40部分、或者图6d所示的AB 1至AB 30部分。 The second part of the generated transition motion effect (that is, the above-mentioned fourth transition part) can be jointly generated based on the first image and the second image captured by the two shooting modes, for example, the transition motion can be generated based on the spliced images of the two. The first part of the effect. The first part may be, for example, parts AB 1 to AB 40 shown in FIG. 6c or parts AB 1 to AB 30 shown in FIG. 6d in the following embodiments.
所生成的转场动效的第三部分(即上述第五转场部分)可以基于第二拍摄模式拍摄的第二图像生成。第三部分例如可以是下文实施例中图6c所示的B 1~B 30部分、或者图6d所示的B 1~B 20部分。 The third part of the generated transition motion effect (that is, the fifth transition part) may be generated based on the second image captured in the second shooting mode. The third part can be, for example, parts B 1 -B 30 shown in FIG. 6c or parts B 1 -B 20 shown in FIG. 6d in the following embodiments.
在上述第一方面的一种可能的实现中,电子设备包括对转场动效的第三转场部分预设的转场图像帧数为a、对转场动效的第四转场部分预设的转场图像帧数为b、以及对转场动效的第五转场部分预设的转场图像帧数为c,并且,根据电子设备在第二拍摄模式下生成第二视频部分的第一帧图像所需的时间,确定生成的转场动效的各个部分的转场图像帧数,包括:若在第二拍摄模式下生成第二视频部分的第一帧图像所需的时间大于生成第三转场部分所需的时间,则确定生成的转场动效的第三转场部分的转场图像帧数为a+x、第四转场部分的转场图像帧数为b-y、以及第五转场部分的转场图像帧数为c-z,其中x=y+z、并且y<b、z<c。In a possible implementation of the above-mentioned first aspect, the electronic device includes a preset transition image frame number for the third transition part of the transition effect, and a preset number of frames for the fourth transition part of the transition effect. Set the number of transition image frames as b, and the preset transition image frame number for the fifth transition part of the transition effect as c, and generate the second video part according to the electronic device in the second shooting mode The time required for the first frame image determines the number of transition image frames of each part of the generated transition motion effect, including: if the time required to generate the first frame image of the second video part in the second shooting mode is greater than The time required to generate the third transition part, then determine the number of transition image frames of the third transition part of the generated transition motion effect as a+x, and the number of transition image frames of the fourth transition part as b-y, And the number of transition image frames of the fifth transition part is c-z, where x=y+z, and y<b, z<c.
即电子设备中可以在一定的转场时长内,预设转场动效的各个部分所包括的转场图像帧数,例如上述第三转场部分(即转场动效的第一部分)所包括的a帧、第四转场部分(即转场动效的第二部分)所包括的b帧以及第五转场部分(即转场动效的第三部分)所包括的c帧。That is, the electronic device can preset the number of transition image frames included in each part of the transition motion effect within a certain transition duration, for example, the number of transition image frames included in the third transition part (that is, the first part of the transition motion effect) Frame a of the fourth transition part (that is, the second part of the transition motion effect) includes the b frame and the fifth transition part (that is, the third part of the transition motion effect) includes the c frame.
可以理解,电子设备生成和显示的转场动效所包括的总计转场图像帧数是一定的,转场动效的显示时长是一定的。如果第二拍摄模式对应的摄像头启动较慢等,可能会导致第二拍摄模式拍摄到第一帧图像的时间较长,此时电子设备预设的第一部分的a帧转场图像即将显示完,此时电子设备可以基于第一拍摄模式拍摄的第一图像继续生成转场图像并显示,如此,第一部分所包括的转场图像帧数便增加了,例如增加了x帧。这一变化过程可以参考下文实施例中图6c所示的A 1~A 30部分变化至图6d所示的A 1~A 50的相关描述,在此不做赘述。 It can be understood that the total number of transition image frames included in the transition motion effect generated and displayed by the electronic device is fixed, and the display duration of the transition motion effect is constant. If the camera corresponding to the second shooting mode starts slowly, etc., it may take a long time for the second shooting mode to capture the first frame of image. At this time, the transition image of the first part a frame preset by the electronic device is about to be displayed. At this time, the electronic device may continue to generate and display the transition image based on the first image captured in the first shooting mode, so that the number of frames of the transition image included in the first part increases, for example, by x frames. This change process can refer to the relevant description of the partial change from A 1 to A 30 shown in FIG. 6c to A 1 to A 50 shown in FIG. 6d in the following embodiments, and details are not repeated here.
鉴于转场动效所包括的总计转场图像帧数(即a+b+c帧)是一定的,那么在第二拍摄模式获取第一帧图像后,基于第一图像和第二图像生成的第二部分中所包括的转场图像帧数,可以相应地减少y帧;基于第二图像生成的第三部分中所包括的转场图像帧数,可以相应地减少z帧,其中x=y+z。这一变化过程可以参考下文实施例中图6c所示的AB 1~AB 40部分变化至图6d所示的AB 1至AB 30部分、以及图6c所示的B 1~B 30部分变化至图6d所示的B 1~B 20部分的相关描述,在此不做赘述。 In view of the fact that the total number of transition image frames (that is, a+b+c frames) included in the transition motion effect is certain, after the first frame image is acquired in the second shooting mode, the generated image based on the first image and the second image The number of transition image frames included in the second part can be correspondingly reduced by y frames; the number of transition image frames included in the third part generated based on the second image can be correspondingly reduced by z frames, where x=y +z. This change process can refer to the changes from AB 1 to AB 40 shown in FIG. 6c to AB 1 to AB 30 shown in FIG . Relevant descriptions of parts B 1 -B 20 shown in 6d will not be repeated here.
在上述第一方面的一种可能的实现中,转场动效的转场图像基于第一图像或第二图像添加动态变化效果处理得到。In a possible implementation of the first aspect above, the transition image of the transition motion effect is obtained by adding a dynamic change effect to the first image or the second image.
在上述第一方面的一种可能的实现中,动态变化效果包括下列中的至少一项:蒙版遮罩、模糊度渐变以及透明度渐变。In a possible implementation of the first aspect above, the dynamic change effect includes at least one of the following: a mask mask, a gradient of blur, and a gradient of transparency.
即转场动效的效果,可以是经过蒙版遮罩、模糊度渐变以及透明度渐变等特效效果处理得到的。在一些实施例中,转场动效的特效类型可以基于用户选择确定,也可以预设在电子设备中,在此不做限制。That is, the effect of the transition motion effect can be obtained by processing special effects such as mask mask, blur gradient, and transparency gradient. In some embodiments, the special effect type of the transition motion effect can be determined based on user selection, or can be preset in the electronic device, which is not limited here.
第二方面,本申请实施例提供了一种电子设备,该电子设备包括:一个或多个处理器;一个或多个存储器;一个或多个存储器存储有一个或多个程序,当一个或者多个程序被一个或多个处理器执行时,使得电子设备执行上述转场动效生成方法。In the second aspect, the embodiment of the present application provides an electronic device, the electronic device includes: one or more processors; one or more memories; one or more memories store one or more programs, when one or more When a program is executed by one or more processors, the electronic device executes the above method for generating transition motion effects.
第三方面,本申请实施例提供了一种计算机可读存储介质,该存储介质上存储有指令,指令在计算机上执行时使计算机执行上述转场动效生成方法。In a third aspect, the embodiment of the present application provides a computer-readable storage medium, where instructions are stored on the storage medium, and when the instructions are executed on a computer, the computer executes the above method for generating transition motion effects.
第四方面,本申请实施例提供了一种计算机程序产品,该产品包括计算机程序/指令,计算机程序/指令被处理器执行时实现上述转场动效生成方法。In a fourth aspect, an embodiment of the present application provides a computer program product, the product includes a computer program/instruction, and when the computer program/instruction is executed by a processor, the above method for generating a transition motion effect is realized.
附图说明Description of drawings
图1a所示为本申请实施例提供的一种手机100的相机拍摄功能界面示意图。FIG. 1 a is a schematic diagram of a camera shooting function interface of a mobile phone 100 provided by an embodiment of the present application.
图1b所示为本申请实施例提供的一种手机100拍摄视频时切换拍摄模式的操作界面示意图。FIG. 1 b is a schematic diagram of an operation interface for switching shooting modes when the mobile phone 100 shoots a video according to an embodiment of the present application.
图2a所示为本申请实施例提供的第二拍摄模式后采集到第一帧图像耗时为350ms所对应的转场动效中各部分所分配的转场时长示意图。Fig. 2a is a schematic diagram of the transition time allocated to each part of the transition motion effect corresponding to the acquisition time of the first frame image after the second shooting mode provided by the embodiment of the present application is 350 ms.
图2b所示为本申请实施例提供的第二拍摄模式后采集到第一帧图像耗时为500ms所对应的转场动效中各部分所分配的转场时长示意图。Fig. 2b is a schematic diagram of the transition time allocated to each part of the transition motion effect corresponding to the acquisition of the first frame of image after the second shooting mode provided by the embodiment of the present application, which takes 500 ms.
图2c所示为本申请实施例提供的一种手机100的硬件结构示意图。FIG. 2c is a schematic diagram of a hardware structure of a mobile phone 100 provided by an embodiment of the present application.
图3a所示为本申请实施例提供的一种切换前的拍摄模式下的拍摄界面示意图。FIG. 3 a is a schematic diagram of a shooting interface in a shooting mode before switching according to an embodiment of the present application.
图3b所示为本申请实施例提供的一种转场预览界面示意图。Fig. 3b is a schematic diagram of a transition preview interface provided by the embodiment of the present application.
图3c所示为本申请实施例提供的一种切换后的拍摄模式下的拍摄界面示意图。FIG. 3 c is a schematic diagram of a shooting interface in a switched shooting mode according to an embodiment of the present application.
图4所示为本申请实施例提供的一种转场动效生成方法的实施流程示意图。FIG. 4 is a schematic diagram of an implementation flow of a method for generating a transition motion effect provided by an embodiment of the present application.
图5a所示为本申请实施例提供的一种启动相机后所显示的拍摄界面示意图。Fig. 5a is a schematic diagram of a shooting interface displayed after the camera is started according to an embodiment of the present application.
图5b所示为本申请实施例提供的一种启动相机后所显示的拍摄功能选择界面示意图。FIG. 5 b is a schematic diagram of a shooting function selection interface displayed after the camera is started according to an embodiment of the present application.
图5c所示为本申请实施例提供的一种的多镜录像功能的操作界面示意图。FIG. 5c is a schematic diagram of an operation interface of a multi-mirror video recording function provided by an embodiment of the present application.
图5d所示为本申请实施例提供的一些多镜录像拍摄界面示意图。FIG. 5d is a schematic diagram of some multi-mirror video shooting interfaces provided by the embodiment of the present application.
图5e所示为本申请实施例提供的一种切换拍摄模式的操作界面示意图。FIG. 5e is a schematic diagram of an operation interface for switching shooting modes provided by an embodiment of the present application.
图5f所示为本申请实施例提供的一种切换拍摄模式后的界面示意图。FIG. 5f is a schematic diagram of an interface after switching the shooting mode provided by the embodiment of the present application.
图6a所示为本申请实施例提供的一种包括两个部分的转场动效基于预设的转场动效生成策略控制各部分中各帧转场图像的生成及送显的顺序示意图。Fig. 6a is a schematic diagram of a transition motion effect including two parts provided by an embodiment of the present application, based on a preset transition motion effect generation strategy to control the generation and display sequence of each frame transition image in each part.
图6b所示为本申请实施例提供的一种包括两个部分的转场动效基于预设的转场动效生成策略调整各部分的转场图像数量后,控制各帧转场图像的生成及送显的顺序示意图。Figure 6b shows a transition motion effect including two parts provided by the embodiment of the present application. After adjusting the number of transition images in each part based on the preset transition motion effect generation strategy, the generation of transition images in each frame is controlled. And send a schematic diagram of the sequence.
图6c所示为本申请实施例提供的一种包括三个部分的转场动效基于预设的转场动效生成策略控制各部分中各帧转场图像的生成及送显的顺序示意图。Fig. 6c is a schematic diagram of a transition motion effect including three parts provided by the embodiment of the present application, based on a preset transition motion effect generation strategy to control the generation and display sequence of each frame transition image in each part.
图6d所示为本申请实施例提供的一种包括三个部分的转场动效基于预设的转场动效生成策略调整各部分的转场图像数量后,控制各帧转场图像的生成及送显的顺序示意图。Figure 6d shows a transition motion effect including three parts provided by the embodiment of the present application. After adjusting the number of transition images in each part based on the preset transition motion effect generation strategy, the generation of transition images in each frame is controlled. And send a schematic diagram of the sequence.
图7a所示为本申请实施例提供的一种切换拍摄模式前手机100显示的前置全景预览界面示意图。Fig. 7a is a schematic diagram of a front panorama preview interface displayed by the mobile phone 100 before switching the shooting mode according to the embodiment of the present application.
图7b所示为本申请实施例提供的一种切换拍摄模式过程中,第二拍摄模式启动前手机100显示的切换界面示意图。FIG. 7 b is a schematic diagram of a switching interface displayed by the mobile phone 100 before the second shooting mode is started during a process of switching shooting modes provided by an embodiment of the present application.
图7c所示为本申请实施例提供的一种切换拍摄模式过程中,第二拍摄模式启动后手机100显示的切换界面示意图。FIG. 7 c is a schematic diagram of a switching interface displayed by the mobile phone 100 after the second shooting mode is activated during a process of switching shooting modes provided by an embodiment of the present application.
图7d所示为本申请实施例提供的完成拍摄模式的切换后手机100显示的双景预览界面示意图。FIG. 7 d is a schematic diagram of a dual-view preview interface displayed by the mobile phone 100 after the switching of the shooting mode provided by the embodiment of the present application.
图8所示为本申请实施例提供的一种手机100的软件结构框图。FIG. 8 is a block diagram of a software structure of a mobile phone 100 provided by an embodiment of the present application.
图9所示为本申请实施例提供的一种转场动效生成方法的交互流程示意图。FIG. 9 is a schematic diagram of an interaction process of a method for generating a transition motion effect provided by an embodiment of the present application.
具体实施方式Detailed ways
为了便于理解本申请方案,下面先对本申请应用的切换场景中涉及的各种拍摄模式进行介绍。In order to facilitate the understanding of the solution of the present application, various shooting modes involved in the switching scene of the application of the present application are firstly introduced below.
图1a根据本申请实施例示出了一种手机100提供多种拍摄模式的相机功能界面示意图。Fig. 1a shows a schematic diagram of a camera function interface in which a mobile phone 100 provides multiple shooting modes according to an embodiment of the present application.
如图1a所示,例如用户在手机100运行的相机应用的界面上选择使用多镜录像功能时,手机100可以显示图1a所示的相机界面101。其中,该界面101上包括前置单摄模式011、后置单摄模式012、前-后双摄模式013、后-后双摄模式014或者画中画模式015等多种拍摄模式,可以供用户选择。例如用户选择前-后双摄模式013作为当前的拍摄模式,则相机界面101可以显示两部分图像预览区域,即图1a所示的前置摄像头拍摄到的前景预览区域102、和图1a所示的后置摄像头拍摄到的后景预览区域103。As shown in FIG. 1 a , for example, when the user chooses to use the multi-mirror video recording function on the interface of the camera application running on the mobile phone 100 , the mobile phone 100 may display the camera interface 101 shown in FIG. 1 a . Among them, the interface 101 includes multiple shooting modes such as front single camera mode 011, rear single camera mode 012, front-rear dual camera mode 013, rear-rear dual camera mode 014 or picture-in-picture mode 015, etc. The user chooses. For example, if the user selects the front-rear dual camera mode 013 as the current shooting mode, the camera interface 101 can display two parts of the image preview area, that is, the foreground preview area 102 captured by the front camera shown in FIG. The background preview area 103 captured by the rear camera.
可以理解,在一些实施例中,图1a所示的前置单摄模式011、后置单摄模式012等可以称为单摄模式;图1a所示的前-后双摄模式013、后-后双摄模式014以及画中画模式015等则可以称为多摄模式。具体地,在前置单摄模式011下,手机100采用一个前置摄像头进行视频拍摄;在后置单摄模式012下,手机100采用一个后置摄像头进行视频拍摄。在后-后双摄模式014下,手机100采用两个后置摄像头进行视频拍摄;在前-后双摄模式013下,手机100采用一个前置摄像头和一个后置摄像头进行视频拍摄。在一些实施例中,画中画模式015还可以包括前置画中画模式、后置画中画模式以及前后画中画模式。以前后画中画模式为例,手机100可以采用一个前置摄像头和一个后置摄像头进行视频拍摄,且将前置摄像头或后置摄像头拍摄的画面置于后置摄像头或前置摄像头拍摄的画面之中。It can be understood that, in some embodiments, the front single-shot mode 011 and the rear single-shot mode 012 shown in FIG. 1a can be called single-shot modes; The rear dual-camera mode 014 and the picture-in-picture mode 015 can be called multi-camera modes. Specifically, in the front single camera mode 011, the mobile phone 100 uses a front camera for video shooting; in the rear single camera mode 012, the mobile phone 100 uses a rear camera for video shooting. In the rear-rear dual camera mode 014, the mobile phone 100 uses two rear cameras for video shooting; in the front-rear dual camera mode 013, the mobile phone 100 uses a front camera and a rear camera for video shooting. In some embodiments, the picture-in-picture mode 015 may also include a front picture-in-picture mode, a rear picture-in-picture mode, and a front-to-back picture-in-picture mode. Taking the front and rear picture-in-picture mode as an example, the mobile phone 100 can use a front camera and a rear camera for video shooting, and put the picture taken by the front camera or the rear camera on the picture taken by the rear camera or the front camera. among.
图1b根据本申请实施例示出了一种手机100拍摄视频时切换拍摄模式的操作界面示意图。Fig. 1b shows a schematic diagram of an operation interface for switching shooting modes when the mobile phone 100 is shooting a video according to an embodiment of the present application.
如图1b所示,手机100响应于用户选择使用前-后双摄模式013拍摄视频的操作,显示图1b所示的拍摄界面020,在拍摄界面020上,用户可以点击切换控件021选择另一种拍摄模式进行切换。例如用户可以在点击切换控件021后选择后-后双摄模式014作为切换后的拍摄模式,此时手机100则响应于用户的切换操作,由前-后双摄模式013切换为后-后双摄模式014。手机100在响应用户的切换拍摄模式的操作,切换拍摄模式时,如果切换前的拍摄模式与切换后的拍摄模式取景差异较大,例如切换前后取景色差较大时,手机100所显示的转场预览界面转换会比较生硬,用户体验较差。As shown in Figure 1b, the mobile phone 100 responds to the user's operation of choosing to use the front-rear dual camera mode 013 to shoot video, and displays the shooting interface 020 shown in Figure 1b. On the shooting interface 020, the user can click the switching control 021 to select another to switch between shooting modes. For example, the user can select the rear-rear dual-camera mode 014 as the switched shooting mode after clicking the switching control 021. At this time, the mobile phone 100 switches from the front-rear dual-camera mode 013 to the rear-rear dual-camera mode in response to the user's switching operation. Camera mode 014. The mobile phone 100 responds to the user's operation of switching the shooting mode. When switching the shooting mode, if there is a big difference between the shooting mode before switching and the shooting mode after switching, for example, when the viewing angle difference before and after switching is large, the transition displayed on the mobile phone 100 The transition of the preview interface will be relatively blunt and the user experience will be poor.
为了解决手机等电子设备在切换拍摄模式的过程,所显示的转场预览界面比较生硬的问题,本申请实施例提供了一种转场动效生成方法。具体地,该方法通过在检测到用户切换拍摄模式的操作时,基于切换前的拍摄模式下采集的一帧或多帧图像生成转场动效的起始部分,并基于切换后的拍摄模式下采集的一帧或多帧图像生成转场动效的结束部分,从而实现从切换前拍摄模式的拍摄画面预览到切换后拍摄模式的拍摄画面预览的接续过渡。如此,切换拍摄模式的过程中显示该转场动效作为转场预览界面,则会显得比较流畅、协调,从而消除了转场预览界面生硬的问题,有利于提高用户体验。In order to solve the problem that the displayed transition preview interface is relatively blunt during the process of switching shooting modes of electronic devices such as mobile phones, an embodiment of the present application provides a method for generating a transition motion effect. Specifically, the method generates the initial part of the transition motion effect based on one or more frames of images collected in the shooting mode before switching when the user's operation of switching the shooting mode is detected, and based on the One or more frames of images collected generate the end part of the transition motion effect, so as to realize the continuous transition from the preview of the shooting screen of the shooting mode before switching to the preview of the shooting screen of the shooting mode after switching. In this way, displaying the transition motion effect as the transition preview interface in the process of switching the shooting mode will appear smoother and more coordinated, thereby eliminating the problem of the blunt transition preview interface, which is conducive to improving user experience.
可以理解,基于本申请实施例所提供的转场动效生成方法所生成的转场动效中,切换前的拍摄模式 下采集的一帧或多帧图像例如可以是切换前拍摄模式下采集的最后一帧或多帧图像,切换后的拍摄模式下采集的一帧或多帧图像例如可以是切换后拍摄模式下采集的第一帧或者前几帧图像。对于采集到的用于生成转场动效的图像(简称转场图像),所进行的图像特效处理可以包括但不限于模糊处理、蒙版遮罩、图像旋转等处理方式,在此不做限制。It can be understood that in the transition motion effect generated based on the transition motion effect generation method provided in the embodiment of the present application, one or more frames of images collected in the shooting mode before switching can be, for example, images collected in the shooting mode before switching The last frame or multiple frames of images, and the one or multiple frames of images collected in the switched shooting mode may be, for example, the first frame or several previous frames of images collected in the switched shooting mode. For the images collected for generating transition effects (referred to as transition images), the image special effect processing may include but not limited to blurring, masking, image rotation and other processing methods, which are not limited here .
为了避免混淆,在下文描述中,将切换前的拍摄模式统一描述为第一拍摄模式,将切换后的拍摄模式统一描述为第二拍摄模式。In order to avoid confusion, in the following description, the shooting mode before switching is collectively described as the first shooting mode, and the shooting mode after switching is collectively described as the second shooting mode.
可以理解,基于本申请实施例所提供的转场动效生成方法所生成的转场动效中,第一拍摄模式下和第二拍摄模式下采集的一帧或多帧图像的显示时长,可以根据预设的转场动效生成策略来控制,该策略所确定的第一拍摄模式和第二拍摄模式的图像的显示时长,可以与启动第二拍摄模式下的各个镜头并采集到第二拍摄模式下第一帧图像的时间长短相关。也就是说,转场动效的各个部分的显示时长可以随第二拍摄模式采集到第一帧图像的时间来动态调整。另外,切换拍摄模式所需要的时间长短也可能会有变动,则转场动效的各个部分显示时间也可以随切换时长的变动相应调整,在此不做限制。It can be understood that in the transition motion effect generated based on the transition motion effect generation method provided in the embodiment of the present application, the display duration of one or more frames of images collected in the first shooting mode and the second shooting mode can be Controlled according to the preset transition motion effect generation strategy, the display duration of images in the first shooting mode and the second shooting mode determined by the strategy can be related to starting each lens in the second shooting mode and collecting the second shooting The time length of the first frame image in the mode is related. That is to say, the display duration of each part of the transition motion effect can be dynamically adjusted according to the time when the first frame of image is captured in the second shooting mode. In addition, the length of time required to switch the shooting mode may also vary, and the display time of each part of the transition animation effect can also be adjusted accordingly according to the change of the switching time length, which is not limited here.
作为示例,参考图2a所示,例如手机响应用户操作切换拍摄模式的过程中,所显示的转场动效持续时间(即转场时长)例如是1s,如果手机从第一拍摄模式切换至第二拍摄模式后采集到第一帧图像耗时350ms,则在转场动效的1s时间内,第1ms至第350ms可以显示基于第一拍摄模式下采集的最后一帧或多帧图像生成的第一部分,第350ms至700ms显示基于第一拍摄模式下的最后一帧和第二拍摄模式下采集的第一帧图像拼接纹理生成的第二部分,第700ms至1s则显示第二拍摄模式下采集的第一帧图像或者前几帧图像生成的第三部分。而如果手机从第一拍摄模式切换至第二拍摄模式后采集到第一帧图像耗时为500ms,如图2b所示,则在转场时长1s间内,第1ms至第500ms可以显示上述第一部分,第500ms至第700ms显示上述第二部分,第700ms至1s显示上述第三部分。As an example, as shown in Figure 2a, for example, during the process of the mobile phone switching shooting modes in response to user operations, the displayed transition animation duration (that is, the transition duration) is, for example, 1s. If the mobile phone switches from the first shooting mode to the second It takes 350ms to collect the first frame of image after the second shooting mode, and within 1s of the transition animation, the first frame generated based on the last frame or multiple frames of images collected in the first shooting mode can be displayed from the 1st to the 350th ms. Part 350ms to 700ms shows the second part generated based on the last frame in the first shooting mode and the first frame image collected in the second shooting mode by mosaic texture, and the 700ms to 1s shows the second part captured in the second shooting mode The first frame image or the third part generated by the previous few frames. However, if the mobile phone switches from the first shooting mode to the second shooting mode and it takes 500ms to collect the first frame of image, as shown in Figure 2b, then within the transition time of 1s, the first 1ms to the 500thms can display the above-mentioned A part, the second part above is displayed from 500ms to 700ms, and the third part above is displayed from 700ms to 1s.
可以理解,本申请实施例所提供的技术方案适用于各种电子设备,可以包括但不限于手机、平板电脑、桌面型、膝上型、手持计算机、上网本、增强现实(Augmented Reality,AR)\虚拟现实(Virtual Reality,VR)设备、智能电视、智能手表等、以及其中嵌入或耦接有一个或多个处理器、或具有拍摄功能的其他电子设备,在此不做限制。下面继续以手机为例,介绍本申请实施例提供的转场动效生成方法的具体实现过程。It can be understood that the technical solutions provided in the embodiments of the present application are applicable to various electronic devices, including but not limited to mobile phones, tablet computers, desktops, laptops, handheld computers, netbooks, augmented reality (Augmented Reality, AR)\ Virtual reality (Virtual Reality, VR) devices, smart TVs, smart watches, etc., and other electronic devices with one or more processors embedded or coupled therein, or with a shooting function, are not limited here. Continuing to take the mobile phone as an example, the specific implementation process of the method for generating transition motion effects provided by the embodiment of the present application will be introduced below.
图2c根据本申请实施例示出了一种手机100的硬件结构示意图。Fig. 2c shows a schematic diagram of a hardware structure of a mobile phone 100 according to an embodiment of the present application.
如图2c所示,手机100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,加速度传感器180E,距离传感器180F,触摸传感器180K,环境光传感器180L等。As shown in Figure 2c, the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, A display screen 194, and a subscriber identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an acceleration sensor 180E, a distance sensor 180F, a touch sensor 180K, an ambient light sensor 180L and the like.
可以理解的是,本发明实施例示意的结构并不构成对手机100的具体限定。在本申请另一些实施例中,手机100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置,在此不做限制。It can be understood that, the structure shown in the embodiment of the present invention does not constitute a specific limitation on the mobile phone 100 . In other embodiments of the present application, the mobile phone 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange different components, which is not limited here.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器等。其中,不同的处理单元可以是独立的器 件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
在本申请实施例中,控制器根据处理器110的指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制,以执行本申请的转场动效生成方法相关的获取图像、以及对所获取的图像进行特效处理等指令,从而利用所生成的转场动效实现切换拍摄模式,使拍摄模式切换前后手机100所显示的转场预览界面更加流畅,不显生硬。In the embodiment of the present application, the controller generates an operation control signal according to the instruction operation code and timing signal of the processor 110, and completes the control of fetching and executing instructions, so as to execute the acquisition image related to the transition motion effect generation method of the present application. , and perform special effects processing on the acquired image, so as to use the generated transition motion effect to switch the shooting mode, so that the transition preview interface displayed on the mobile phone 100 before and after the switching of the shooting mode is smoother and less rigid.
处理器110中还可以设置存储器,用于存储指令和数据。A memory may also be provided in the processor 110 for storing instructions and data.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括通用串行总线(universal serial bus,USB)接口等。其中,USB接口130可以用于连接充电器为手机100充电,也可以用于手机100与外围设备之间传输数据。In some embodiments, processor 110 may include one or more interfaces. The interface may include a universal serial bus (universal serial bus, USB) interface and the like. Wherein, the USB interface 130 can be used to connect a charger to charge the mobile phone 100, and can also be used to transmit data between the mobile phone 100 and peripheral devices.
充电管理模块140用于从充电器接收充电输入。电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。The charging management module 140 is configured to receive a charging input from a charger. The power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 . The power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the display screen 194 , the camera 193 , and the wireless communication module 160 .
手机100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the mobile phone 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。手机100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in handset 100 can be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
移动通信模块150可以提供应用在手机100上的包括2G/3G/4G/5G等无线通信的解决方案。调制解调处理器可以包括调制器和解调器。The mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the mobile phone 100 . A modem processor may include a modulator and a demodulator.
无线通信模块160可以提供应用在手机100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。The wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system, etc. applied on the mobile phone 100 (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
在一些实施例中,手机100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得手机100可以通过无线通信技术与网络以及其他设备通信。In some embodiments, the antenna 1 of the mobile phone 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology.
手机100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The mobile phone 100 realizes the display function through the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。在一些实施例中,手机100可以包括1个或N个显示屏194,N为大于1的正整数。在本申请实施例中,手机100可以通过显示屏194显示拍摄视频时相应拍摄模式的摄像头采集的图像预览,以及切换拍摄模式的过程中所生成及显示的转场图像预览,即转场预览界面所显示的图像预览。The display screen 194 is used to display images, videos and the like. The display screen 194 includes a display panel. In some embodiments, the mobile phone 100 may include 1 or N display screens 194, where N is a positive integer greater than 1. In the embodiment of the present application, the mobile phone 100 can display the image preview captured by the camera of the corresponding shooting mode when shooting a video through the display screen 194, and the preview of the transition image generated and displayed during the process of switching the shooting mode, that is, the transition preview interface A preview of the displayed image.
手机100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The mobile phone 100 can realize the shooting function through ISP, camera 193 , video codec, GPU, display screen 194 and application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照或者拍摄视频时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将该电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used for processing the data fed back by the camera 193 . For example, when taking a picture or shooting a video, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be located in the camera 193 .
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary  metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,手机100可以包括1个或N个摄像头193,N为大于1的正整数。在本申请实施例中,手机100拍摄视频时,可以利用前置或者后置的摄像头193采集视频图像,并在切换拍摄模式时,基于摄像头193采集的图像处理成转场图像等。Camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element can be a charge coupled device (charge coupled device, CCD) or a complementary metal-oxide-semiconductor (complementary metal-oxide-semiconductor, CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other image signals. In some embodiments, the mobile phone 100 may include 1 or N cameras 193, where N is a positive integer greater than 1. In the embodiment of the present application, when the mobile phone 100 shoots a video, the front or rear camera 193 can be used to collect video images, and when the shooting mode is switched, the images collected by the camera 193 are processed into transition images and the like.
视频编解码器用于对数字视频压缩或解压缩。Video codecs are used to compress or decompress digital video.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展手机100的存储能力。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 mobile phone 100.
内部存储器121可以用于存储计算机可执行程序代码,该可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储数据区可存储手机100使用过程中所创建的数据(比如拍摄得到的视频数据等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行手机100的各种功能应用以及数据处理。在本申请实施例中,内部存储器121可以存储用于执行本申请实施例所提供的转场动效生成方法的相关指令,以供处理器110调用运行生成相应的转场动效。The internal memory 121 may be used to store computer-executable program codes including instructions. The internal memory 121 may include an area for storing programs and an area for storing data. Wherein, the storage data area can store data created during the use of the mobile phone 100 (such as video data obtained by shooting, etc.) and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a nonvolatile memory or the like. The processor 110 executes various functional applications and data processing of the mobile phone 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor. In the embodiment of the present application, the internal memory 121 may store related instructions for executing the method for generating transition motion effects provided in the embodiment of the present application, so that the processor 110 can call and execute to generate corresponding transition motion effects.
手机100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The mobile phone 100 can realize the audio function through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。当有触摸操作作用于显示屏194,手机100也可以根据压力传感器180A的检测信号计算触摸的位置。The pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, pressure sensor 180A may be disposed on display screen 194 . When a touch operation acts on the display screen 194, the mobile phone 100 can also calculate the touched position according to the detection signal of the pressure sensor 180A.
陀螺仪传感器180B可以用于确定手机100的运动姿态。在一些实施例中,陀螺仪传感器180B也可以用于拍摄防抖。The gyroscope sensor 180B can be used to determine the motion posture of the mobile phone 100 . In some embodiments, the gyro sensor 180B can also be used for image stabilization.
加速度传感器180E可检测手机100在各个方向上(一般为三轴)加速度的大小。当手机100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换等应用。The acceleration sensor 180E can detect the acceleration of the mobile phone 100 in various directions (generally three axes). When the mobile phone 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic equipment, and it can be used in applications such as horizontal and vertical screen switching.
距离传感器180F,用于测量距离。手机100可以通过红外或激光测量距离。在一些实施例中,例如拍摄场景中,手机100可以利用距离传感器180F测距以实现快速对焦。The distance sensor 180F is used to measure the distance. The mobile phone 100 can measure the distance by infrared or laser. In some embodiments, for example, in a shooting scene, the mobile phone 100 can use the distance sensor 180F for distance measurement to achieve fast focusing.
环境光传感器180L用于感知环境光亮度。在本申请实施例中,环境光传感器180L也可用于拍摄视频时自动调节白平衡。The ambient light sensor 180L is used for sensing ambient light brightness. In the embodiment of the present application, the ambient light sensor 180L can also be used to automatically adjust the white balance when shooting a video.
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。The touch sensor 180K is also called "touch device". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
基于上述图2c所示的手机100的结构,下面结合相关附图详细说明本申请实施例所提供的转场动效生成方法实现过程中所涉及的各个方面。Based on the structure of the mobile phone 100 shown in FIG. 2c above, various aspects involved in the implementation process of the method for generating transition motion effects provided by the embodiment of the present application will be described in detail below in conjunction with the relevant drawings.
图3a至3c根据本申请实施例示出了拍摄视频的过程中,用户操作手机100切换拍摄模式时,手机100显示转场动效的场景示意图。3a to 3c show the schematic diagrams of scenes where the mobile phone 100 displays transition effects when the user operates the mobile phone 100 to switch the shooting mode during the process of shooting a video according to the embodiment of the present application.
图3a所示为切换前拍摄模式(即第一拍摄模式)下的拍摄界面310。如图3a所示,例如手机100拍摄视频时采用的第一拍摄模式是前置单摄模式,则手机100所显示的拍摄界面310中显示前置摄像头采集的前置全景预览。用户如果在图3a所示的拍摄界面310上点击切换控件311,则手机100可以先进入显示图3b所示的转场预览界面320,继而进入显示图3c所示切换后拍摄模式(即第二拍摄模式)下的拍摄界面330。Fig. 3a shows the shooting interface 310 in the shooting mode before switching (ie the first shooting mode). As shown in FIG. 3 a , for example, the first shooting mode adopted by the mobile phone 100 when shooting a video is the front single camera mode, then the shooting interface 310 displayed on the mobile phone 100 displays a front panoramic preview captured by the front camera. If the user clicks the switching control 311 on the shooting interface 310 shown in FIG. 3a, the mobile phone 100 can first enter and display the transition preview interface 320 shown in FIG. 3b, and then enter and display the switched shooting mode shown in FIG. shooting interface 330 under the shooting mode).
例如手机100切换拍摄模式后的第二拍摄模式是前/后双摄模式,如图3c所示,切换拍摄模式后, 手机100所显示的拍摄界面330包括前景预览界面331和后景预览界面332。可以理解,在一些实施例中,前-后双摄模式或者后-后双摄模式也可以称为双景拍摄模式,在此不做限制。For example, after the mobile phone 100 switches the shooting mode, the second shooting mode is the front/rear dual-camera mode. As shown in FIG. . It can be understood that, in some embodiments, the front-rear dual-camera mode or the rear-rear dual-camera mode may also be called a dual-view shooting mode, which is not limited here.
其中,切换前第一拍摄模式拍摄到的最后一帧图像,例如是图3a所示的一朵花朵,则在切换后的第二拍摄模式拍摄到第一帧图像之前,图3b所示的转场预览界面320可以是基于第一拍摄模式拍摄到的最后一帧花朵的图像进行添加蒙版遮罩或提高透明度又或者逐渐模糊等处理得到的转场图像,该花朵可以显示为从清晰到模糊逐渐变化等效果。当切换后的第二拍摄模式拍摄到第一帧图像后,图3b所示的转场预览界面也可以切换为图3c所示的界面样式,即图3c所示意的前景预览界面中仍然可以显示基于第一拍摄模式拍摄到的最后一帧花朵的图像处理得到的转场图像,该花朵的动态变化效果可以再从模糊逐渐变清晰。在另一些实施例中,切换拍摄模式的过程中,手机100所显示的转场预览界面也可以是其他形式,在此不做限制。Wherein, the last frame of image captured by the first shooting mode before switching is, for example, a flower shown in FIG. The field preview interface 320 can be a transition image obtained by adding a mask, increasing transparency, or gradually blurring based on the last frame of the image of the flower captured in the first shooting mode. The flower can be displayed from clear to blurred effects such as gradual changes. After the first frame of image is captured by the switched second shooting mode, the transition preview interface shown in Figure 3b can also be switched to the interface style shown in Figure 3c, that is, the foreground preview interface shown in Figure 3c can still be displayed Based on the transition image obtained by processing the image of the last frame of the flower captured in the first shooting mode, the dynamic change effect of the flower can gradually change from blurred to clear. In some other embodiments, during the process of switching the shooting mode, the transition preview interface displayed on the mobile phone 100 may also be in other forms, which is not limited here.
其中,手机100所显示的图3b所示的转场预览界面320中可以显示转场动效,在本申请实施例中,该转场动效可以基于切换前的第一拍摄模式采集的图像、和切换后的第二拍摄模式采集的图像进行相应图像处理后生成,以实现第一拍摄模式至第二拍摄模式的转场画面内容接续过渡,从而使得拍摄得到的视频内容播放时画面内容更加流畅、协调。Wherein, the transition preview interface 320 shown in FIG. 3 b displayed on the mobile phone 100 may display a transition motion effect. The image captured by the switched second shooting mode is generated after corresponding image processing, so as to realize the continuous transition of the transition screen content from the first shooting mode to the second shooting mode, so that the screen content of the captured video content is played more smoothly ,coordination.
基于上述图3a至3c所示的场景,图4根据本申请实施例示出了一种转场动效生成方法的实施流程示意图。可以理解,在本申请实施例中,图4所示流程中的各步骤执行主体均为手机100,为了避免重复描述,以下描述中将不再逐一描述各步骤的执行主体。Based on the scenarios shown in FIGS. 3a to 3c above, FIG. 4 shows a schematic flowchart of an implementation of a method for generating transition animation effects according to an embodiment of the present application. It can be understood that, in the embodiment of the present application, the execution subject of each step in the process shown in FIG. 4 is the mobile phone 100. To avoid repeated description, the following description will not describe the execution subject of each step one by one.
如图4所示,该流程包括以下步骤:As shown in Figure 4, the process includes the following steps:
401:响应于用户启动相机拍摄视频的操作,以第一拍摄模式开始拍摄视频。401: In response to the user's operation of starting a camera to shoot a video, start to shoot a video in a first shooting mode.
示例性地,用户可以操作手机100运行相机应用拍摄视频。可以理解,用户启动相机拍摄视频的操作,可以通过语音操作,例如“YOYO,启动相机”;也可以通过触控操作,例如用户可以点击手机100桌面的相机应用图标,或者点击手机100上预设的相机启动按键等;手机100也可以基于预设的触发条件自动触发启动相机,或者用户还可以通过预设的操作手势操作手机100启动相机,在此不做限制。Exemplarily, the user can operate the mobile phone 100 to run a camera application to shoot a video. It can be understood that the operation of the user to start the camera to shoot video can be operated by voice, such as "YOYO, start the camera"; The camera start button, etc.; the mobile phone 100 can also automatically trigger and start the camera based on a preset trigger condition, or the user can also operate the mobile phone 100 to start the camera through a preset operation gesture, which is not limited here.
相机应用启动后,可以进入默认设置的拍摄模式,用户也可以在相机启动后的拍摄界面上选择一种拍摄模式,作为第一拍摄模式,可以理解,第一拍摄模式既可以是相机启动是默认设置的拍摄模式,也可以是用户选择的拍摄模式,在此不做限制。After the camera application is started, it can enter the shooting mode set by default, and the user can also select a shooting mode on the shooting interface after the camera is started, as the first shooting mode. The set shooting mode may also be a shooting mode selected by the user, which is not limited here.
例如,用户在手机100所显示的相机应用的拍摄界面上选择录像或者多镜录像等功能,然后在相应的功能界面上选择一种拍摄模式,例如选择上述图1a所示的前景单摄模式011,再点击开始拍摄的控件便可以开始拍摄视频。手机100则响应于用户的上述一系列操作,以第一拍摄模式开始采集视频图像、执行视频拍摄。For example, the user selects functions such as video recording or multi-lens video recording on the shooting interface of the camera application displayed on the mobile phone 100, and then selects a shooting mode on the corresponding function interface, such as selecting the foreground single shooting mode 011 shown in FIG. 1a above. , and then click the control to start shooting to start shooting video. The mobile phone 100 responds to the above-mentioned series of operations of the user, starts to collect video images in the first shooting mode, and executes video shooting.
作为示例,图5a至5d示出了一些启动相机使用多镜录像功能拍摄视频的操作界面示意图。As an example, FIGS. 5 a to 5 d show some schematic diagrams of operation interfaces for starting a camera to shoot video using a multi-lens video function.
用户可以在手机100的桌面上点击相机应用的图标,使手机100启动相机应用,显示图5a所示界面。The user can click the icon of the camera application on the desktop of the mobile phone 100, so that the mobile phone 100 starts the camera application and displays the interface shown in FIG. 5a.
如图5a所示,手机100启动相机后所显示的拍摄界面510上,用户可以在相机功能菜单511上左右滑动,参考图5a所示的操作①,待拍摄界面510上显示更多选项控件512时,点击该更多选项控件,则手机100可以显示图5b所示的更多功能界面520。As shown in Figure 5a, on the shooting interface 510 displayed after the mobile phone 100 starts the camera, the user can slide left and right on the camera function menu 511, refer to the operation ① shown in Figure 5a, and more option controls 512 are displayed on the shooting interface 510 , click the more option control, and the mobile phone 100 can display the more function interface 520 shown in FIG. 5b.
如图5b所示,更多功能界面520上可以显示多种相机功能,例如包括图5b所示的慢动作、全景、延时摄影、水印、文档矫正、超级微距、高像素、微电影等,在另一些实施例中,手机100所运行的相机应用还可以提供比图5b所示更多或者更少的相机功能,在此不做限制。用户可以点击更多功能界面 520上的多镜录像521,则手机100可以显示图5c所示的多镜录像操作界面530。As shown in Figure 5b, a variety of camera functions can be displayed on the more functional interface 520, such as slow motion, panorama, time-lapse photography, watermark, document correction, super macro, high pixel, micro movie, etc. as shown in Figure 5b , in some other embodiments, the camera application run by the mobile phone 100 may also provide more or less camera functions than those shown in FIG. 5b, which is not limited here. The user can click on the multi-camera video recording 521 on the more functional interface 520, and the mobile phone 100 can display the multi-camera video recording operation interface 530 shown in FIG. 5c.
如图5c所示,多镜录像操作界面530上可以显示通过手机100的前置摄像头和后置摄像头采集的图像预览,例如图5c所示的前景预览和后景预览。多镜录像操作界面530上还可以显示开始拍摄控件531以及前后置镜头切换控件532。用户可以在多镜录像操作界面530上点击前后置镜头切换控件532,将图5c所示的前景预览对应使用的前置摄像头切换为后置摄像头,在此不做赘述。As shown in FIG. 5c , the multi-mirror video recording operation interface 530 may display image previews captured by the front camera and rear camera of the mobile phone 100 , such as the foreground preview and background preview shown in FIG. 5c . The multi-mirror video recording operation interface 530 can also display a shooting start control 531 and a front and rear lens switching control 532 . The user can click the front and rear camera switching control 532 on the multi-camera recording operation interface 530 to switch the front camera corresponding to the foreground preview shown in FIG. 5c to the rear camera, and details will not be described here.
当用户需要录制视频时,可以点击图5c所示的多镜录像操作界面530上的开始拍摄控件,开始拍摄视频。此时,手机100则可以显示图5d所示的多镜录像拍摄界面540。图5d所示界面及相关描述,将在下述步骤402中结合相关实施内容进行描述,在此不做赘述。When the user needs to record a video, he can click the start shooting control on the multi-mirror video recording operation interface 530 shown in FIG. 5c to start shooting a video. At this time, the mobile phone 100 may display the multi-mirror video shooting interface 540 shown in FIG. 5d. The interface shown in FIG. 5d and related descriptions will be described in conjunction with related implementation content in step 402 below, and will not be repeated here.
402:响应于用户切换拍摄模式的操作,获取第一拍摄模式下的至少一帧图像、以及第二拍摄模式下的至少一帧图像。402: Acquire at least one frame of images in the first shooting mode and at least one frame of images in the second shooting mode in response to the user's operation of switching the shooting mode.
示例性地,用户可以在手机100开始拍摄视频后显示的录制界面上操作切换拍摄模式,该录制界面例如可以是图5d所示的多镜录像拍摄界面540,该操作例如是将手机100当前录制视频使用的第一拍摄模式切换为第二拍摄模式。手机100在检测到用户切换拍摄模式的操作时,则可以获取第一拍摄模式下的一帧或多帧图像、并在启动第二拍摄模式对应的镜头后及时获取第二拍摄模式下的一帧或多帧图像。可以理解,手机100所获取的第一拍摄模式下的图像,可以是第一拍摄模式下采集的最后一帧或多帧图像;手机100所获取的第二拍摄模式下的图像,可以是第二拍摄模式下采集的第一帧或前几帧图像。手机100此时所获取的图像,将用于生成转场动效。Exemplarily, the user can operate and switch the shooting mode on the recording interface displayed after the mobile phone 100 starts shooting video. The recording interface can be, for example, the multi-mirror video shooting interface 540 shown in FIG. The first shooting mode used by the video is switched to the second shooting mode. When the mobile phone 100 detects that the user switches the shooting mode, it can acquire one or more frames of images in the first shooting mode, and obtain a frame in the second shooting mode in time after starting the lens corresponding to the second shooting mode. or multiple frames of images. It can be understood that the image in the first shooting mode acquired by the mobile phone 100 may be the last frame or multiple frames of images collected in the first shooting mode; the image in the second shooting mode acquired by the mobile phone 100 may be the second The first frame or the first few frames of images captured in shooting mode. The images acquired by the mobile phone 100 at this time will be used to generate transition effects.
作为示例,参考图5d所示,多镜录像拍摄界面540上包括操作提示框541、以及暂停录制控件542和结束录制控件543等。该操作提示框541所显示的操作提示内容可以参考图5d所示的“滑动切换多镜模式”。手机100录制视频的过程中,如果用户或者按照操作提示框541所引导的滑动方向进行滑动操作,并在打开的拍摄模式选择界面上选择一种拍摄模式进行切换等。As an example, as shown in FIG. 5 d , the multi-camera video shooting interface 540 includes an operation prompt box 541 , a control for pausing recording 542 , a control 543 for ending recording, and the like. For the operation prompt content displayed in the operation prompt box 541, refer to the "slide to switch multi-mirror mode" shown in FIG. 5d. During the video recording process of the mobile phone 100, if the user performs a sliding operation according to the sliding direction guided by the operation prompt box 541, and selects a shooting mode on the opened shooting mode selection interface to switch, etc.
图5e根据本申请实施例示出了一种切换拍摄模式的操作界面示意图。Fig. 5e shows a schematic diagram of an operation interface for switching shooting modes according to an embodiment of the present application.
当用户在上述图5d所示的多镜录像拍摄界面540上按照操作提示框541中显示的操作提示进行相应操作后,手机100可以显示图5e所示的拍摄模式选择界面550。可以理解,图5e所示的拍摄模式选择界面550与上述图1a所示的拍摄模式选择界面101的区别之处在于手机100处于竖屏或横屏的状态不同,另外图1a所示的拍摄模式选择界面101也可以是开始拍摄视频前,用户选择拍摄模式的操作界面,在此不做限制。After the user performs corresponding operations on the multi-camera video shooting interface 540 shown in FIG. 5d according to the operation prompts displayed in the operation prompt box 541, the mobile phone 100 may display the shooting mode selection interface 550 shown in FIG. 5e. It can be understood that the difference between the shooting mode selection interface 550 shown in FIG. 5e and the shooting mode selection interface 101 shown in FIG. The selection interface 101 may also be an operation interface for the user to select a shooting mode before starting to shoot a video, which is not limited here.
与图1a所示类似地,如图5e所示,拍摄模式选择界面550上也可以包括前置单摄模式551、后置单摄模式552、前-后双摄模式553、后-后双摄模式554或者画中画模式555。作为示例,手机100当前的第一拍摄模式例如是前-后双摄模式553,用户可以在拍摄模式选择界面550选择界面上选择画中画模式555或者其他拍摄模式进行切换操作。Similar to that shown in FIG. 1a, as shown in FIG. 5e, the shooting mode selection interface 550 may also include a front single camera mode 551, a rear single camera mode 552, a front-rear dual camera mode 553, and a rear-rear dual camera mode. mode 554 or picture-in-picture mode 555. As an example, the current first shooting mode of the mobile phone 100 is, for example, the front-rear dual camera mode 553 , and the user can select the picture-in-picture mode 555 or other shooting modes on the shooting mode selection interface 550 to switch.
403:根据预设的转场动效生成策略、切换时长、以及所获取的第一拍摄模式下的至少一帧图像和第二拍摄模式下的至少一帧图像,生成转场动效。403: Generate a transition motion effect according to a preset transition motion effect generation strategy, switching duration, and acquired at least one frame of images in the first shooting mode and at least one frame of images in the second shooting mode.
示例性地,手机100在上述步骤402中检测到用户切换拍摄模式的操作时,可以根据预设的转场动效生成策略对所获取的图像进行模糊处理、或添加蒙版遮罩等处理。在另一些实施例中,处理转场图像所基于的转场动效生成策略,也可以是根据用户选择模糊处理效果、或者是添加蒙版遮罩效果、又或者是进行某种透明度处理效果对应的转场动效来确定,在此不做限制。其中,转场动效生成策略对转场动效各个部分的处理及显示时长的控制等,可以与转场时长相关。Exemplarily, when the mobile phone 100 detects the operation of switching the shooting mode by the user in the above step 402, it may blur the captured image or add a mask according to the preset transition motion effect generation strategy. In some other embodiments, the transition animation generation strategy based on which the transition image is processed can also be based on the blurring effect selected by the user, or adding a mask mask effect, or corresponding to a certain transparency processing effect It is determined by the transition effect, and there is no limitation here. Among them, the processing of each part of the transition animation effect and the control of the display duration by the transition animation generation strategy may be related to the transition duration.
可以理解,在一些实施例中,该切换时长可以根据切换拍摄模式前后,第一拍摄模式对应的摄像头 数据送编码的通路关闭以及相应摄像头关闭的时刻,到第二拍摄模式对应的各摄像头完成启动并完成建立相应的摄像头数据送编码通路的时刻之间的时间差值来确定。在另一些实施例中,转场时长也可以是用户在拍摄界面上选择设定的切换时长。例如有些用户想要在拍摄的视频中添加较长时间的转场动效,则可以选择设定转场动效的时长为3s或5s等,此时手机100中预设的转场动效生成策略,也可以根据用户设定的转场时长,来控制转场动效各个部分的显示时长。在此不做限制。It can be understood that, in some embodiments, the switching duration can be based on the time before and after switching the shooting mode, the channel of the camera data encoding corresponding to the first shooting mode is closed and the corresponding camera is turned off, until the cameras corresponding to the second shooting mode are started. And complete the establishment of the time difference between the moments when the corresponding camera data is sent to the encoding path to determine. In some other embodiments, the transition duration may also be the switching duration selected and set by the user on the shooting interface. For example, if some users want to add a longer time transition effect to the captured video, they can choose to set the duration of the transition effect to 3s or 5s, etc. At this time, the preset transition effect in the mobile phone 100 is generated The strategy can also control the display duration of each part of the transition animation according to the transition duration set by the user. There is no limitation here.
上述转场动效生成策略可以包括:对所获取的第一拍摄模式或第二拍摄模式下的图像进行相应特效处理的相关图像处理参数。手机100基于预设的图像处理参数对所获取的各帧图像进行处理后,再编入转场动效的视频流中。其中,手机100在获取第一拍摄模式下的一帧或多帧图像后,便可以对该帧或多帧图像处理为转场动效中的起始部分进行显示。可以理解,在手机100获取到第二拍摄模式下的第一帧图像之前,手机100所显示的转场动效中可以一直是基于第一拍摄模式下的图像生成的连续帧。当手机100获取到第二拍摄模式下的第一帧图像后,手机100则可以将该帧图像以及在该帧之后获取的图像,处理为转场动效的结束部分进行显示。The transition motion effect generation strategy described above may include: performing corresponding special effect processing on the acquired image in the first shooting mode or in the second shooting mode and related image processing parameters. The mobile phone 100 processes the acquired frames of images based on the preset image processing parameters, and then compiles them into the video stream of transition effects. Wherein, after the mobile phone 100 acquires one or more frames of images in the first shooting mode, the frame or multiple frames of images can be processed into the initial part of the transition motion effect for display. It can be understood that before the mobile phone 100 acquires the first frame of image in the second shooting mode, the transition animation displayed on the mobile phone 100 may always be continuous frames generated based on the images in the first shooting mode. After the mobile phone 100 acquires the first frame of image in the second shooting mode, the mobile phone 100 can process the frame of image and the images acquired after this frame as the end part of the transition motion effect for display.
因此可以理解,手机100上预设的转场动效生成策略还可以包括:对转场动效中基于第一拍摄模式下的图像生成的部分的显示时长、以及基于第二拍摄模式下的图像生成的部分的显示时长的控制规则,以及对所获取的图像处理后在转场动效中的显示顺序(例如下文图6a至图6b所示各帧转场图像的显示顺序)的控制规则等。其中,基于第一拍摄模式下的图像生成的部分例如可以是下文图6a或图6d所示的A 1~A 50部分,也可以是下文图6b所示的A 1~A 70部分或者图6c所示的A 1~A 30部分,在此不做限制。基于第二拍摄模式下的图像生成的部分例如可以是下文图6a所示的B 1~B 50部分或图6b所示的B 1~B 30部分,也可以是下文图6c所示的AB 1~AB 40和B 1~B 30部分或图6d所示的AB 1~AB 30和B 1~B 20部分,在此不做限制。 Therefore, it can be understood that the preset transition motion effect generation strategy on the mobile phone 100 may also include: the display duration of the part of the transition motion effect based on the image in the first shooting mode, and the display duration based on the image in the second shooting mode The control rules for the display duration of the generated part, and the control rules for the display order of the acquired images in the transition animation after processing (for example, the display order of the transition images of each frame shown in Figure 6a to Figure 6b below), etc. . Wherein, the part generated based on the image in the first shooting mode can be, for example, the part A 1 to A 50 shown in Figure 6a or 6d below, or the part A 1 to A 70 shown in Figure 6b below or the part shown in Figure 6c Parts A 1 -A 30 shown are not limited here. The part generated based on the image in the second shooting mode can be, for example, the part B 1 to B 50 shown in Figure 6a below or the part B 1 to B 30 shown in Figure 6b below, or it can be the part AB 1 shown in Figure 6c below Parts -AB 40 and B 1 -B 30 or parts AB 1 -AB 30 and B 1 -B 20 shown in FIG. 6d are not limited here.
另外可以理解,转场动效中基于第一拍摄模式下的图像生成的部分的显示时长、与基于第二拍摄模式下的图像生成的部分的显示时长之和,可以小于或者等于切换时长,如上所述,该切换时长例如可以是用户设定或者基于切换前后的拍摄模式对应的摄像头关闭及启动所需时间而确定的,在此不做限定。对于预设的转场动效生成策略控制生成转场动效的各个部分转场图像的过程,具体下文中将结合附图进行详细的示例性描述,在此不做赘述。In addition, it can be understood that the sum of the display duration of the part generated based on the image in the first shooting mode and the display duration of the part generated based on the image in the second shooting mode in the transition motion effect can be less than or equal to the switching duration, as above As mentioned above, the switching duration may be set by the user or determined based on the required time for closing and starting the camera corresponding to the shooting mode before and after switching, for example, which is not limited here. As for the process of generating the transition images of each part of the transition animation controlled by the preset transition animation generation strategy, a detailed exemplary description will be given below in conjunction with the accompanying drawings, and details will not be repeated here.
404:切换拍摄模式的过程中显示所生成的转场动效。404: Display the generated transition motion effect during the process of switching the shooting mode.
示例性地,手机100基于第一拍摄模式下的图像、以及第二拍摄模式下的图像所生成转场动效,可以在手机100的屏幕上作为实时的转场预览界面进行显示。参考下文图9所示的交互流程,可以理解,手机100在上述步骤403中根据预设的转场动效生成策略,对第一拍摄模式下的图像、以及第二拍摄模式下的图像进行相应特效处理后,生成的每一帧转场图像可以逐帧送显。即手机100的屏幕可以在切换拍摄模式的时间段(即上述切换时长)内,同步显示完成处理得到的各帧转场图像,该完成处理的各帧转场图像依照生成顺序形成转场动效。Exemplarily, the transition motion effect generated by the mobile phone 100 based on the images in the first shooting mode and the images in the second shooting mode can be displayed on the screen of the mobile phone 100 as a real-time transition preview interface. With reference to the interaction process shown in FIG. 9 below, it can be understood that in the above step 403, the mobile phone 100 performs corresponding actions on the images in the first shooting mode and the images in the second shooting mode according to the preset transition animation generation strategy. After special effects processing, each frame of transition image generated can be sent to display frame by frame. That is, the screen of the mobile phone 100 can synchronously display the transition images of each frame after the processing is completed within the time period of switching the shooting mode (that is, the above-mentioned switching duration), and the transition images of each frame of the completed processing form a transition motion effect according to the generation sequence .
另外,如果要在拍摄得到的视频文件中也显示所生成的转场动效,还可以在手机100的系统中建立将处理得到的转场图像送编码的通路,例如可以送入多路编码模块中进行编码,如此拍摄得到的视频文件中因相应拍摄模式的摄像头数据送编码的通路重建导致的断流时段内,便可以显示所生成的转场动效作为拍摄模式切换前后的衔接部分。这也使得拍摄得到的视频文件播放时画面更加流畅。In addition, if the generated transition motion effect is also displayed in the captured video file, a channel for encoding the processed transition image can also be established in the system of the mobile phone 100, for example, it can be sent to a multi-channel encoding module In the video file captured in this way, during the cut-off period caused by the channel reconstruction of the camera data of the corresponding shooting mode for encoding, the generated transition motion effect can be displayed as the connecting part before and after the switching of the shooting mode. This also makes the picture smoother when the captured video file is played.
可以理解,在手机100完成视频的录制时,切换拍摄模式的过程中生成的转场动效也被编码到录制得到的视频内容中。此时录制得到的视频内容中,录制到的用户切换拍摄模式过程对应的部分即为所生成的转场动效。如此,手机100录制得到的视频内容中,切换拍摄模式前后的视频画面过渡可以显得更 加流畅,不会再出现一段黑屏或者突兀的转场效果,利于提高用户体验。手机100显示所生成的转场动效的界面示意图,将在下文结合图7a至图7d进行详细描述,在此不做赘述。It can be understood that when the mobile phone 100 finishes recording the video, the transition motion effect generated during the process of switching the shooting mode is also encoded into the recorded video content. In the video content recorded at this time, the recorded part corresponding to the process of the user switching the shooting mode is the generated transition motion effect. In this way, in the video content recorded by the mobile phone 100, the video picture transition before and after switching the shooting mode can appear smoother, and there will be no black screen or abrupt transition effect, which is conducive to improving user experience. The mobile phone 100 is a schematic diagram of an interface displaying the generated transition effects, which will be described in detail below in conjunction with FIGS. 7a to 7d , and will not be repeated here.
405:完成拍摄模式的切换,以第二拍摄模式继续拍摄视频。405: Complete the switching of the shooting mode, and continue shooting video in the second shooting mode.
示例性地,手机100完成拍摄模式的切换,意味着手机100上对应于第二拍摄模式的镜头等硬件已启动并功能就绪,例如相应镜头可以采集视场角范围内的图像等。此时手机100屏幕显示完转场动效,可以显示第二拍摄模式下采集的图像预览。可以理解,手机100所拍摄的视频是基于拍摄过程中各镜头采集的连续帧图像,经矫正、滤镜等处理后再通过相应的通路送编码处理得到的一段视频流数据。编码形式的各段视频流数据,例如可以是高级视频编码(Advanced Video Coding,AVC)格式等。Exemplarily, the mobile phone 100 completes the switching of the shooting mode, which means that hardware such as the lens corresponding to the second shooting mode on the mobile phone 100 is started and ready for function, for example, the corresponding lens can capture images within the field of view range. At this time, the screen of the mobile phone 100 finishes displaying the transition effect, and can display a preview of the image collected in the second shooting mode. It can be understood that the video shot by the mobile phone 100 is based on the continuous frame images collected by each camera during the shooting process, and after processing such as correction and filtering, a piece of video stream data is sent through the corresponding channel for encoding processing. Each segment of video stream data in an encoded form may be, for example, in an Advanced Video Coding (Advanced Video Coding, AVC) format or the like.
由于切换前的拍摄模式所对应建立的摄像头数据送编码的通路,与切换后的拍摄模式所对应建立的摄像头数据送编码的通路往往不同,因此,切换拍摄模式前后,手机等电子设备会关闭切换前拍摄模式对应建立的通路,并在切换后拍摄模式所对应的摄像头启动后重新建立切换后拍摄模式所对应的通路。因此拍摄视频的过程中,如果切换拍摄模式,拍摄得到的视频文件中会出现断流,例如黑屏、模糊等。因此,可选地,在一些实施例中,可以在拍摄模式切换过程中,将所生成的转场动效通过相应的通路送编码得到另一段频流数据。待手机100响应于用户拍摄及切换拍摄模式的操作完成视频拍摄后,编码得到的各段AVC格式的视频流数据可以按照相应的时间戳进行合并封装,从而生成包含转场动效的视频文件。可以理解,封装打包后的视频文件格式例如可以是MP4、或音频视频交错格式(Audio Video Interleaved,AVI)等媒体文件格式,在此不做限制。Since the camera data encoding channel established corresponding to the shooting mode before switching is often different from the camera data encoding channel established corresponding to the shooting mode after switching, therefore, electronic devices such as mobile phones will turn off the switching before and after switching the shooting mode. The established path corresponds to the previous shooting mode, and the path corresponding to the switched shooting mode is re-established after the camera corresponding to the switched shooting mode is started. Therefore, in the process of shooting a video, if you switch the shooting mode, there will be interruptions in the captured video file, such as black screen, blur, etc. Therefore, optionally, in some embodiments, during the shooting mode switching process, the generated transition motion effect may be encoded through a corresponding channel to obtain another piece of frequency stream data. After the mobile phone 100 completes video shooting in response to the user's shooting and switching shooting modes, the encoded video stream data in AVC format can be combined and packaged according to the corresponding time stamps, thereby generating a video file containing transition effects. It can be understood that the packaged and packaged video file format can be, for example, MP4, or audio video interleaved format (Audio Video Interleaved, AVI) and other media file formats, and there is no limitation here.
如此,本申请实施例所提供的转场动效生成方法,可以将生成的转场动效编码到所拍摄的视频文件中,以解决所拍摄的视频中切换拍摄模式前后视频数据断流的问题,并且该转场动效能够与前后的视频内容形成融合,使所拍摄的视频内容中转场也更加流畅、协调。In this way, the transition motion effect generation method provided in the embodiment of the present application can encode the generated transition motion effect into the captured video file, so as to solve the problem of video data interruption before and after switching the shooting mode in the captured video , and the transition motion effect can be integrated with the front and rear video content, making the transition of the captured video content more smooth and coordinated.
作为示例,图5f根据本申请实施例示出了一种切换拍摄模式后的界面示意图。As an example, Fig. 5f shows a schematic interface after switching the shooting mode according to the embodiment of the present application.
可以理解,手机100响应于用户操作完成拍摄模式的切换后,手机100例如可以显示图5f所示的切换拍摄模式后的界面。It can be understood that after the mobile phone 100 finishes switching the shooting mode in response to the user's operation, the mobile phone 100 may, for example, display the interface after switching the shooting mode as shown in FIG. 5f.
如图5f所示,用户选择画中画模式555作为第二拍摄模式进行切换后,手机100完成拍摄模式的切换可以显示拍摄界面560。该拍摄界面560所显示的视频图像预览则是画中画的构图形式,例如作为背景的画面561显示后景预览,作为画中的画面562显示前景预览。切换拍摄模式后,手机100继续以切换后的画中画模式555继续拍摄视频,直至用户点击结束录制控件563时结束视频的拍摄并生成相应所拍摄的视频。As shown in FIG. 5f , after the user selects the picture-in-picture mode 555 as the second shooting mode to switch, the mobile phone 100 can display the shooting interface 560 after switching the shooting mode. The video image preview displayed on the shooting interface 560 is in the form of a picture-in-picture composition. For example, the picture 561 used as the background shows a preview of the background, and the picture 562 used as the picture shows a preview of the foreground. After switching the shooting mode, the mobile phone 100 continues to shoot videos in the switched picture-in-picture mode 555 until the user clicks the end recording control 563 to end the shooting of the video and generate a corresponding captured video.
下面结合转场动效中各帧转场图像的显示顺序示意图,来示例性的介绍本申请实施例所提供的转场动效生成方法中,对应生成转场动效所基于的转场动效生成策略。The following is a schematic diagram of the display sequence of each frame of the transition image in the transition animation effect, to exemplarily introduce the transition animation effect generation method provided by the embodiment of the present application, and the transition animation effect based on which the corresponding generation transition animation effect is based. Build strategy.
图6a至图6d根据本申请实施例示出了一些基于预设转场动效生成策略控制转场动效中的各帧转场图像的生成以及送显顺序的示意图。作为示例,切换拍摄模式前后切换时长例如为1s,这1s内预设播放的转场图像帧数例如为100帧,并且各部分的转场图像例如基于第一拍摄模式下的最后一帧图像A、以及第二拍摄模式下的第一帧图像B生成。其中手机100上预设的对第一拍摄模式下的图像A、和第二拍摄模式下的图像B进行特效处理并生成相应转场动效所基于的预设转场动效生成策略中,可以包括图6a至图6d所示的控制转场动效中各帧转场图像生成及送显顺序的策略。Figures 6a to 6d show some schematic diagrams of controlling the generation and display order of each frame of transition images in the transition animation based on a preset transition animation generation strategy according to an embodiment of the present application. As an example, the switching time before and after switching the shooting mode is, for example, 1s, and the number of transition image frames preset to be played within this 1s is, for example, 100 frames, and the transition images of each part are, for example, based on the last frame of image A in the first shooting mode , and the first frame image B in the second shooting mode is generated. Among the preset transition motion effect generation strategies preset on the mobile phone 100 for image A in the first shooting mode and image B in the second shooting mode to perform special effect processing and generate corresponding transition motion effects, you can Including the strategies shown in Figure 6a to Figure 6d to control the generation and display order of each frame transition image in the transition motion effect.
作为一种示例,例如手机100上预设的转场动效生成策略中,控制转场动效中各帧转场图像生成及送显顺序的策略可以包括:控制转场动效的第一部分(例如50帧图像)显示第一拍摄模式下的图像、第二部分(例如50帧图像)显示第二拍摄模式下的图像。As an example, for example, in the preset transition motion effect generation strategy on the mobile phone 100, the strategy for controlling the generation and display order of each frame transition image in the transition motion effect may include: controlling the first part of the transition motion effect ( For example, 50 frames of images) display images in the first shooting mode, and the second part (for example, 50 frames of images) displays images in the second shooting mode.
图6a根据本申请实施例示出了一种包括两个部分的转场动效基于预设的转场动效生成策略控制各部分中各帧转场图像的生成及送显的顺序示意图。Fig. 6a shows a schematic diagram of a transition motion effect including two parts based on a preset transition motion effect generation strategy to control the generation and display sequence of each frame transition image in each part according to an embodiment of the present application.
如图6a所示,A 1~A 50例如是基于第一拍摄模式下的最后一帧图像A经特效处理得到的各帧转场图像,A 1~A 50形成转场动效的第一部分。其中A 1为转场动效的第一帧显示图像,A 1~A 50各帧转场图像上的特效程度可以呈渐进变化。例如该特效如果是蒙板遮罩,则A 1至A 50各帧转场图像上的蒙板颜色可以依次由浅至深逐渐变化;该特效如果是模糊处理,则A 1至A 50各帧转场图像的模糊程度可以依次由低度至高度逐渐变化,即逐渐由清晰变模糊的特效效果,在另一些实施例中,该特效也可以是其他形式,在此不做限制。 As shown in FIG. 6 a , A 1 -A 50 are, for example, frames of transition images obtained through special effect processing based on the last frame of image A in the first shooting mode, and A 1 -A 50 form the first part of the transition motion effect. Wherein A 1 is the first frame display image of the transition effect, and the degree of the special effect on each frame of the transition image from A 1 to A 50 can be gradually changed. For example, if the special effect is a mask mask, the mask color on the transition image of each frame from A 1 to A 50 can gradually change from light to dark; The degree of blurring of the field image can gradually change from low to high in turn, that is, a special effect that gradually changes from clear to blurred. In other embodiments, the special effect can also be in other forms, which are not limited here.
继续如图6a所示,B 1~B 50例如是基于第二拍摄模式下的第一帧图像B经特效处理得到的各帧转场图像,B 1~B 50形成转场动效的第二部分。其中B 50为转场动效的最后一帧显示图像,B 1~B 50各帧转场图像上的特效程度可以呈渐进变化。例如该特效如果是蒙板遮罩,则B 1至B 50各帧转场图像上的蒙板颜色可以依次由深至浅逐渐变化;该特效如果是模糊处理,则B 1至B 50各帧转场图像的模糊程度可以逐渐降低,即逐渐由模糊逐渐变清晰的特效效果,在另一些实施例中,该特效也可以是其他形式,在此不做限制。 Continuing as shown in Figure 6a, B 1 to B 50 are, for example, frames of transition images obtained through special effect processing based on the first frame of image B in the second shooting mode, and B 1 to B 50 form the second frame of the transition motion effect. part. Wherein B 50 is the last frame display image of the transition effect, and the degree of the special effect on the transition images of frames B 1 to B 50 can be gradually changed. For example, if the special effect is a mask mask, the mask color on the transition image of each frame from B 1 to B 50 can gradually change from dark to light; if the special effect is blur processing, then each frame from B 1 to B 50 The blurring degree of the transition image can be gradually reduced, that is, a special effect that gradually changes from blurred to clear. In other embodiments, the special effect can also be in other forms, which are not limited here.
在另一些实施例中,图6a所示的A 1~A 50也可以是基于第一拍摄模式下的最后几帧图像处理得到,图6a所示的B 1~B 50也可以是基于第二拍摄模式下的前几帧图像处理得到,在此不做限制。 In some other embodiments, A 1 to A 50 shown in FIG. 6a may also be obtained based on the last few frames of image processing in the first shooting mode, and B 1 to B 50 shown in FIG. 6a may also be obtained based on the second The images of the first few frames in the shooting mode are obtained through processing, and there is no limitation here.
如此,手机100所显示的转场动效的效果则可以是,先显示由清晰逐渐变模糊的第一拍摄模式下的最后一帧图像A、再显示由模糊逐渐变清晰的第二拍摄模式下的第一帧图像B。两种拍摄模式的图像接续显示处,为蒙版颜色最深效果或者高度模糊的效果,即便图像A与图像B的内容差异很大,例如颜色差别很大,接续时由图像A切换为图像B也会留给用户充足的视觉接受时间,图像切换过渡流畅,不会显得生硬或者突兀。In this way, the effect of the transition motion effect displayed on the mobile phone 100 may be to first display the last frame of image A in the first shooting mode that gradually changes from clear to blurred, and then display the image A in the second shooting mode that gradually changes from blurred to clear. The first frame of image B. The images of the two shooting modes are continuously displayed where the mask color is the darkest or the effect is highly blurred. Even if the content of image A and image B is very different, such as the color difference, switching from image A to image B during the continuation will not be difficult. Sufficient time for visual acceptance will be left for the user, and the image switching transition will be smooth without appearing blunt or abrupt.
图6b根据本申请实施例示出了一种包括两个部分的转场动效基于预设的转场动效生成策略调整各部分的转场图像数量后,控制各帧转场图像的生成及送显的顺序示意图。Figure 6b shows a transition motion effect including two parts according to the embodiment of the present application. After adjusting the number of transition images in each part based on the preset transition motion effect generation strategy, control the generation and transmission of transition images in each frame. Schematic diagram of the sequence shown.
如果手机100所处理的A 50生成以及送显时,第二拍摄模式下的部分或全部镜头尚未功能就绪、无法采集图像,参考图6b所示,则手机100上预设的转场动效生成策略可以控制继续基于第一拍摄模式下的图像A生成由模糊逐渐变清晰的图像A 51、A 52…A 70,直至手机100获取到第二拍摄模式下的图像B时,再基于该图像B处理生成转场动效结束部分需要显示的各帧转场图像,例如图6b所示的B 1~B 30。在另一些实施例中,图6b所示的A 51至A 70也可以显示为A 50对应的图像特效,直至手机100获取图像B后,B 1至B 30对应的特效程度可以从A 50对应的程度逐渐由模糊变清晰,在此不做限制。 If the A50 processed by the mobile phone 100 is generated and sent to the display, some or all of the lenses in the second shooting mode are not yet functionally ready to capture images, as shown in FIG. The strategy can control to continue to generate images A 51 , A 52 . Process and generate each frame of transition images that need to be displayed at the end of the transition motion effect, such as B 1 -B 30 shown in FIG. 6 b . In some other embodiments, A 51 to A 70 shown in FIG. 6b can also be displayed as image special effects corresponding to A 50 , until the mobile phone 100 acquires image B, and the special effects corresponding to B 1 to B 30 can be corresponding to A 50 The degree of gradually changes from fuzzy to clear, which is not limited here.
作为另一种示例,例如手机100上预设的转场动效生成策略中,控制转场动效中各帧转场图像生成及送显顺序的策略可以包括:控制转场动效的第一部分(例如30帧图像)基于第一拍摄模式下的图像经特效处理得到、第二部分(例如40帧图像)基于第一拍摄模式下的图像和第二拍摄模式下的图像经拼接+特效处理得到、而第三部分(例如30帧图像)基于第二拍摄模式下的图像经特效处理得到。As another example, for example, in the transition animation generation strategy preset on the mobile phone 100, the strategy for controlling the generation and display order of each frame of the transition image in the transition animation may include: controlling the first part of the transition animation (For example, 30 frames of images) are obtained based on the images in the first shooting mode through special effects processing, and the second part (for example, 40 frames of images) is obtained based on the images in the first shooting mode and the images in the second shooting mode through splicing + special effects processing , and the third part (for example, 30 frames of images) is obtained through special effect processing based on the images in the second shooting mode.
图6c根据本申请实施例示出了一种包括三个部分的转场动效基于预设的转场动效生成策略控制各部分中各帧转场图像的生成及送显的顺序示意图。Fig. 6c is a schematic diagram showing a transition motion effect including three parts based on a preset transition motion effect generation strategy to control the generation and display sequence of each frame transition image in each part according to an embodiment of the present application.
如图6c所示,A 1~A 30例如是基于第一拍摄模式下的最后一帧图像A经特效处理得到的各帧转场图像,作为转场动效的前序部分,即转场动效的第一部分。其中A 1为转场动效的第一帧显示图像,A 1至A 30图像的显示效果可以逐渐由清晰变模糊。 As shown in Figure 6c, A 1 to A 30 are, for example, frame transition images obtained by special effect processing based on the last frame of image A in the first shooting mode, as the preamble of the transition motion effect, that is, the transition motion The first part of the effect. Among them, A 1 is the first frame display image of the transition effect, and the display effect of the images from A 1 to A 30 can gradually change from clear to blurred.
继续如图6c所示,AB 1~AB 40例如是基于第一拍摄模式下的最后一帧图像A、和第二拍摄模式下的 第一帧图像B经拼接+特效处理后得到的各帧转场图像,作为转场动效的中间部分,即转场动效的第二部分。其中,图像A与图像B拼接成图像AB的效果,例如可以参考下文图7c所示的前置全景预览最后一帧图像与后景预览第一帧图像的拼接效果,也可以是其他形式的拼接效果,在此不做限制。AB 1至AB 40图像模糊程度的变化,例如可以是低度模糊→高度模糊→低度模糊的变化效果,其中AB 1图像的模糊程度可以与A 30图像的模糊程度相同。 Continuing as shown in Figure 6c, AB 1 to AB 40 are, for example, based on the last frame of image A in the first shooting mode and the first frame of image B in the second shooting mode after splicing + special effect processing. Field image, as the middle part of the transition effect, that is, the second part of the transition effect. Among them, image A and image B are spliced into the effect of image AB, for example, you can refer to the splicing effect of the last frame image of the front panoramic preview and the first frame image of the background preview shown in Figure 7c below, or other forms of splicing The effect is not limited here. The change of the degree of blurring of the images from AB 1 to AB 40 can be, for example, a change effect of low blur → high blur → low blur, wherein the blur degree of the image of AB 1 can be the same as that of the image of A 30 .
继续如图6c所示,B 1~B 30例如是基于第二拍摄模式下的第一帧图像B经特效处理得到的各帧转场图像,作为转场动效的结束部分,即转场动效的第三部分。其中B 30为转场动效的最后一帧显示图像,B 1至B 30图像的显示效果可以逐渐由模糊变清晰。可以理解,B 1图像的模糊程度可以与AB 40图像的模糊程度相同。 Continuing as shown in Figure 6c, B 1 to B 30 are, for example, frame transition images obtained by special effect processing based on the first frame image B in the second shooting mode, as the end part of the transition motion effect, that is, the transition motion Effective third part. Among them, B 30 is the display image of the last frame of the transition effect, and the display effect of the images from B 1 to B 30 can gradually change from blurred to clear. It will be appreciated that the B 1 image may be blurred to the same extent as the AB 40 image.
在另一些实施例中,图6c所示的A 1~A 30也可以是基于第一拍摄模式下的最后几帧图像处理得到,图6c所示的B 1~B 30也可以是基于第二拍摄模式下的前几帧图像处理得到,AB 1~AB 40则可以是第一拍摄模式下的最后一帧、和第二拍摄模式下的第一帧图像拼接+特效处理得到,在此不做限制。 In other embodiments, A 1 to A 30 shown in FIG. 6c may also be obtained based on the last few frames of image processing in the first shooting mode, and B 1 to B 30 shown in FIG. 6c may also be obtained based on the second The image processing of the first few frames in the shooting mode is obtained, and AB 1 ~ AB 40 can be obtained from the last frame in the first shooting mode and the first frame image stitching + special effects in the second shooting mode, which will not be done here limit.
如此,手机100所显示的转场动效的效果则可以是,先显示由清晰逐渐变模糊的第一拍摄模式下的最后一帧图像A,再显示模糊程度逐渐变高后、再逐渐变低的拼接图像AB,最后显示由模糊逐渐变清晰的第二拍摄模式下的第一帧图像B。如此,也可以使手机100生成的转场动效中图像切换过渡流畅,不会显得生硬或者突兀。In this way, the effect of the transition animation displayed on the mobile phone 100 may be to first display the last frame of image A in the first shooting mode that gradually changes from clear to blurred, and then display that the degree of blur gradually increases and then gradually decreases. The spliced image AB of , and finally shows the first frame of image B in the second shooting mode that gradually becomes clear from blur. In this way, the image switching transition in the transition motion effect generated by the mobile phone 100 can also be made smooth without appearing blunt or abrupt.
图6d根据本申请实施例示出了一种包括三个部分的转场动效基于预设的转场动效生成策略调整各部分的转场图像数量后,控制各帧转场图像的生成及送显的顺序示意图。Figure 6d shows a transition animation effect including three parts according to the embodiment of the present application. After adjusting the number of transition images in each part based on the preset transition animation generation strategy, control the generation and transmission of transition images in each frame. Schematic diagram of the sequence shown.
如果手机100所处理的A 30生成以及送显时,第二拍摄模式下的部分或全部镜头尚未功能就绪、无法采集图像,参考图6d所示,则手机100上预设的转场动效生成策略可以控制继续基于第一拍摄模式下的图像A处理得到图像A 31、A 32…A 50,直至手机100获取到第二拍摄模式下的图像B时,再基于图像A和图像B处理生成转场动效第二部分需要显示的各帧转场图像,例如图6d所示的AB 1至AB 30。进而基于图像B处理生成转场动效结束部分需要显示的各帧转场图像,例如图6d所示的B 1~B 20。在另一些实施例中,图6b所示的A 31至A 50也可以显示为A 30对应的图像特效,直至手机100获取图像B后,AB 1至AB 30以及B 1至B 20对应的模糊程度再从A 30对应的模糊程度开始逐渐由模糊变清晰,在此不做限制。 If the A 30 processed by the mobile phone 100 is generated and sent to the display, some or all of the lenses in the second shooting mode are not yet functionally ready to capture images, as shown in FIG. The strategy can be controlled to continue to process images A 31 , A 32 ... A 50 based on image A in the first shooting mode until the mobile phone 100 acquires image B in the second shooting mode, and then generate conversion images based on image A and image B processing. The second part of the field motion effect needs to display the transition images of each frame, such as AB 1 to AB 30 shown in FIG. 6 d . Furthermore, each frame of transition images to be displayed at the end of the transition motion effect is generated based on image B processing, such as B 1 -B 20 shown in FIG. 6 d . In some other embodiments, A 31 to A 50 shown in FIG. 6 b can also be displayed as image special effects corresponding to A 30 , until the mobile phone 100 acquires image B, the blur corresponding to AB 1 to AB 30 and B 1 to B 20 The degree starts from the blur degree corresponding to A 30 and gradually changes from fuzzy to clear, which is not limited here.
可以理解,在另一些实施例中,手机100上预设的切换拍摄模式的切换时长也可以是其他时长,例如可以是750ms或450ms等。相应地,转场动效的时长也为750ms或450ms,转场动效的视频流中则可以包括75帧图像、45帧图像或者其他帧数量的图像等,在此不做限制。It can be understood that, in some other embodiments, the preset switching duration of the shooting mode on the mobile phone 100 may also be other durations, such as 750ms or 450ms. Correspondingly, the duration of the transition motion effect is also 750ms or 450ms, and the video stream of the transition motion effect may include 75 frames of images, 45 frames of images, or images of other frames, and there is no limitation here.
图7a至图7d根据本申请实施例示出了一些转场动效的预览界面示意图。Fig. 7a to Fig. 7d show some schematic diagrams of the preview interface of transition motion effects according to the embodiment of the present application.
作为示例,以第一拍摄模式为上述图5e所示的前置单摄模式551、第二拍摄模式为前-后双摄模式553为例。As an example, take the first shooting mode as the front single-shot mode 551 shown in FIG. 5e above, and the second shooting mode as the front-rear dual-shot mode 553 as an example.
如图7a所示,切换拍摄模式前,手机100在前置单摄模式551下可以显示前置全景预览界面710。当手机100检测到用户切换拍摄模式的操作时,可以获取前置单摄模式551下拍摄的前置全景预览图像中的最后一帧图像,并将该帧图像处理为转场动效中显示的转场图像。As shown in FIG. 7 a , before switching the shooting mode, the mobile phone 100 may display a front panoramic preview interface 710 in the front single-shot mode 551 . When the mobile phone 100 detects the user's operation of switching the shooting mode, it can acquire the last frame of the front panoramic preview image shot in the front single shot mode 551, and process the frame of the image as the one displayed in the transition effect. Transition image.
如图7b所示,例如手机100对前置全景预览最后一帧图像所进行的处理是添加蒙版遮罩处理,手机100此时显示的切换界面720上,可以显示前置全景预览最后一帧图像由清晰逐渐变得不清晰的特效,这期间添加在该图像上的蒙版颜色可以由浅至深变化。As shown in Figure 7b, for example, the processing of the last frame image of the front panoramic preview by the mobile phone 100 is to add a mask mask, and the switching interface 720 displayed by the mobile phone 100 at this time can display the last frame of the front panoramic preview The special effect that the image changes gradually from clear to unclear, during which the color of the mask added to the image can change from light to dark.
如图7c所示,当手机100获取到第二拍摄模式,即前-后双摄模式553模式下相应的前后置镜头工作后采集的第一帧图像时,可以对该帧图像添加与图7b所示颜色一致的蒙版遮罩效果,过渡到显示前- 后双摄模式553对应的预览界面,即图7c所示的切换界面730。可以理解,图7b和图7c所示的蒙版遮罩效果可以是蒙版颜色最深时的效果,此时手机100所显示的画面最为模糊,在另一些实施例中,图7b至图7c所示的蒙版遮罩效果也可以是蒙版颜色由深至浅变化过程中的某个蒙版遮罩效果,在此不做限制。As shown in Figure 7c, when the mobile phone 100 obtains the second shooting mode, that is, the first frame of image captured after the corresponding front and rear cameras work in the front-rear dual camera mode 553 mode, the frame image can be added to the image shown in Figure 7b The mask mask effect shown in the same color transitions to display the preview interface corresponding to the front-back dual-camera mode 553, that is, the switching interface 730 shown in FIG. 7c. It can be understood that the mask effect shown in Figure 7b and Figure 7c may be the effect when the mask color is the darkest, at this time the picture displayed by the mobile phone 100 is the most blurred, in other embodiments, the mask shown in Figure 7b to Figure 7c The mask mask effect shown can also be a mask mask effect in the process of changing the mask color from dark to light, which is not limited here.
如图7d所示,完成拍摄模式的切换后,手机100则可以显示前-后双摄模式553模式下的双景预览界面740。该双景预览界面740上显示的前景预览,可以与图7c所示的前景前置预览最后一帧图像内容可以相同也可以不同,但此时显示的则是前-后双摄模式553模式下前置镜头当前采集的图像。类似地,该双景预览界面740上显示的后景预览,可以与图7c所示的后景预览第一帧图像的内容可以相同也可以不同,但此时显示的则是前-后双摄模式553模式下后置镜头当前采集的图像。As shown in FIG. 7 d , after switching the shooting mode, the mobile phone 100 may display a dual-view preview interface 740 in the front-rear dual-camera mode 553 . The foreground preview displayed on the dual-view preview interface 740 can be the same as or different from the last frame image content of the foreground front preview shown in FIG. The image currently captured by the front camera. Similarly, the background preview displayed on the dual-view preview interface 740 can be the same as or different from the content of the first frame of the background preview shown in FIG. The image currently captured by the rear camera in mode 553.
图8根据本申请实施例示出了一种手机100的软件结构框图。FIG. 8 shows a software structural block diagram of a mobile phone 100 according to an embodiment of the present application.
手机100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明手机100的软件结构。The software system of the mobile phone 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the software structure of the mobile phone 100 is illustrated by taking the Android system with a layered architecture as an example.
如图8所示,分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,硬件抽象层,以及内核层。As shown in Figure 8, the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some embodiments, the Android system is divided into four layers, which are application program layer, application program framework layer, hardware abstraction layer, and kernel layer from top to bottom.
如图8所示,应用程序层可以包括一系列应用程序包。应用程序包可以包括相机应用。应用程序层又可以分为用户界面(User Interface,又称UI界面)801和应用逻辑802。As shown in Figure 8, the application layer may include a series of application packages. An application package may include a camera application. The application program layer can be further divided into a user interface (User Interface, also called UI interface) 801 and application logic 802 .
其中,相机应用的UI界面801可以包括录像803、多镜录像804等相机功能控件,其中多镜录像功能还可以包括前、后、前-后、后-后以及画中画等拍摄模式。前、后、前-后、后-后以及画中画等拍摄模式例如可以分别对应于上述图5e所示的前置单摄模式551、后置单摄模式552、前-后双摄模式553、后-后双摄模式554以及画中画模式555等。Wherein, the UI interface 801 of the camera application may include camera function controls such as recording 803 and multi-mirror recording 804, wherein the multi-mirror recording function may also include shooting modes such as front, back, front-back, back-back, and picture-in-picture. Shooting modes such as front, rear, front-rear, rear-rear, and picture-in-picture can correspond to, for example, the front single-camera mode 551, rear-camera single-camera mode 552, and front-rear dual-camera mode 553 shown in FIG. 5e. , rear-rear dual camera mode 554 and picture-in-picture mode 555, etc.
相机应用的应用逻辑802可以包括切换控制模块810、多路编码模块820以及转场动效生成模块830。The application logic 802 of the camera application may include a switch control module 810 , a multi-channel encoding module 820 and a transition animation generation module 830 .
其中,切换控制模块810用于响应用户在UI界面801上选择一种相机功能,启动相机开始拍摄视频的操作,以及切换拍摄模式的操作等。切换控制模块810在响应切换拍摄模式的用户操作时,可以向转场动效生成模块830发送相应指令或者信号,以触发生成转场动效。具体可以参考下文中各结构的交互过程描述,在此不做赘述。Wherein, the switching control module 810 is used for responding to the user selecting a camera function on the UI interface 801 , starting the camera to start shooting video, and switching the shooting mode. When the switching control module 810 responds to the user's operation of switching the shooting mode, it can send a corresponding instruction or signal to the transition motion effect generating module 830 to trigger the generation of the transition motion effect. For details, please refer to the description of the interaction process of each structure below, and details are not repeated here.
多路编码模块820用于接收转场动效生成模块830对完成特效处理的图像所发送的编码指令,按照处理后的各帧转场图像的生成及送显顺序将各帧转场图像编码为视频流数据,并编码至拍摄得到的视频文件中。The multi-channel encoding module 820 is used to receive the encoding instruction sent by the transition motion effect generation module 830 for the image that has completed the special effect processing, and encode each frame of the transition image according to the generation and display order of the processed transition image of each frame as The video stream data is encoded into the captured video file.
可以理解,在切换拍摄模式前,多路编码模块820可以接收第一拍摄模式对应建立的摄像头数据送编码的通路传送过来的图像数据进行编码,第一拍摄模式对应建立的这一通路所传送的图像数据例如可以是下述硬件抽象层中的相机设备1所对应的图像数据。切换拍摄模式时,第一拍摄模式对应的通路关闭,多路编码模块820的不再对第一拍摄模式对应的通路图像数据进行编码。当所切换的第二拍摄模式对应的摄像头数据送编码的通路建立完成后,多路编码模块820可以继续对第二拍摄模式对应的通路所传送的图像数据进行编码,第二拍摄模式对应建立的这一通路所传送的图像数据例如可以是下述硬件抽象层中的相机设备2和相机设备3所对应的图像数据。可以理解,多路编码模块820接收转场动效生成模块830的编码指令所进行的编码任务,与各个拍摄模式下基于摄像头采集的图像数据编码生成视频文件所进行的编码任务是不同的。It can be understood that before switching the shooting mode, the multi-channel encoding module 820 can receive and encode the image data transmitted by the channel corresponding to the camera data established in the first shooting mode, and the first shooting mode corresponds to the established channel. The image data may be, for example, the image data corresponding to the camera device 1 in the hardware abstraction layer described below. When the shooting mode is switched, the channel corresponding to the first shooting mode is closed, and the multi-channel encoding module 820 no longer encodes the image data of the channel corresponding to the first shooting mode. After the channel for sending and encoding camera data corresponding to the switched second shooting mode is established, the multi-channel encoding module 820 can continue to encode the image data transmitted by the channel corresponding to the second shooting mode. The image data transmitted by one channel may be, for example, the image data corresponding to the camera device 2 and the camera device 3 in the hardware abstraction layer described below. It can be understood that the encoding task performed by the multi-channel encoding module 820 after receiving the encoding instruction from the transition motion effect generating module 830 is different from the encoding task performed by encoding the image data collected by the camera to generate a video file in each shooting mode.
可以理解,多路编码模块820可以对一个或多个镜头采集的图像经绘制渲染以及特效处理后的各帧 转场图像进行编码处理,在另一些实施例中,编码模块也可以使用单路编码模块或者双路编码模块等,在此不做限制。It can be understood that the multi-channel encoding module 820 can encode the images captured by one or more lenses after rendering and special effect processing of each frame transition image. In some other embodiments, the encoding module can also use single-channel encoding modules or dual-channel encoding modules, etc., are not limited here.
可以理解,在本申请实施例中,可以通过开放图形库(Open Graphics Library,OpenGL)或者针对嵌入式系统的开放图形库(Open Graphics Library for Embedded Systems,OpenGL ES))渲染器对图像进行渲染处理。OpenGL为用于渲染2D、3D图形的跨语言、跨平台的应用程序编程接口。在一些描述中,OpenGL也可能简称为“GL”,相应地,OpenGL ES也可能简称为“GL ES”。可以理解,Android应用程序可以调用OpenGL或OpenGL ES接口来绘制渲染UI界面801。It can be understood that, in the embodiment of the present application, the image can be rendered by an Open Graphics Library (Open Graphics Library, OpenGL) or an Open Graphics Library for Embedded Systems (OpenGL ES) renderer for embedded systems . OpenGL is a cross-language, cross-platform application programming interface for rendering 2D and 3D graphics. In some descriptions, OpenGL may also be referred to simply as "GL", and accordingly, OpenGL ES may also be referred to as "GL ES". It can be understood that the Android application program can call the OpenGL or OpenGL ES interface to draw and render the UI interface 801.
因此可以理解,相机应用的应用逻辑802中的转场动效生成模块830,具体可以包括纹理生成器(Texture Generator)831、渲染线程(Render Thread)832、渲染处理程序(Render Handler)833以及着色器库834等。Therefore, it can be understood that the transition animation generation module 830 in the application logic 802 of the camera application may specifically include a texture generator (Texture Generator) 831, a rendering thread (Render Thread) 832, a rendering processing program (Render Handler) 833 and coloring library 834 etc.
其中,纹理生成器831可以响应于切换控制模块810发来的指令或信号注册图像监听器,并对监听获取的图像提取纹理特征。可以理解,纹理特征是一种全局特征,反映的是图像中同质现象的视觉特征,体现物体表面的具有缓慢变换或周期性变化的表面组织结构排列属性。图像纹理通过像素及其周围空间邻域的灰度分布来表现,即局部纹理信息。另外,局部纹理信息不同程度上的重复性,就是全局纹理信息。因此,每一帧图像都可以提取出与之对应的唯一纹理特征。Wherein, the texture generator 831 may register an image listener in response to an instruction or a signal sent by the switching control module 810, and extract texture features from the image acquired through monitoring. It can be understood that the texture feature is a global feature, which reflects the visual features of homogeneous phenomena in the image, and reflects the slow-changing or periodic-changing surface tissue structure arrangement properties of the object surface. Image texture is represented by the gray distribution of pixels and their surrounding spatial neighborhoods, that is, local texture information. In addition, the repeatability of local texture information to varying degrees is global texture information. Therefore, each frame of image can extract the corresponding unique texture features.
渲染线程832,运行渲染器的线程。可以理解,渲染器通常基于图形应用编程接口(application programming interface,API)来构建,常用的图形API包括OpenGL,因此在一些实施例中,渲染线程832也可以称为GL渲染线程。在切换拍摄模式时,GL渲染线程上运行的渲染器可以获取待渲染显示的图像,作为生成转场动效的素材。The rendering thread 832 is a thread for running the renderer. It can be understood that the renderer is usually built based on a graphics application programming interface (application programming interface, API), and commonly used graphics APIs include OpenGL, so in some embodiments, the rendering thread 832 may also be called a GL rendering thread. When switching the shooting mode, the renderer running on the GL rendering thread can obtain the image to be rendered and displayed as the material for generating the transition effect.
渲染处理程序833则可以由GPU运行,用于对GL渲染线程上获取的图像进行特效或拼接等处理。可以理解,运行在渲染线程832上的渲染器可以调用GPU执行渲染处理程序833,对图像进行处理。The rendering processing program 833 can be run by the GPU, and is used for processing such as special effects or splicing on the images acquired on the GL rendering thread. It can be understood that the renderer running on the rendering thread 832 can call the GPU to execute the rendering processing program 833 to process the image.
着色器库834,用于配合GPU执行着色程序,可以包括多个着色器(Shader)。其中,Shader的本质时一段执行在GPU上的程序,此程序使用OpenGL ES SL语言来编写,因此在一些实施例中,着色器库834所提供的着色器也可以称之为GL ES着色器(GL ES Shader)。在OpenGL ES中常用的Shader包括顶点着色器(vertex shader)、片元着色器(fragment shader)等。The shader library 834 is used to cooperate with the GPU to execute the shader program, and may include multiple shaders (Shader). Wherein, the essence of the Shader is a program executed on the GPU. This program is written in the OpenGL ES SL language, so in some embodiments, the shader provided by the shader library 834 can also be called a GL ES shader ( GL ES Shader). Shaders commonly used in OpenGL ES include vertex shaders, fragment shaders, and more.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图8所示,应用程序框架层可以包括框架层包括相机访问接口(Camera API),相机访问接口是Android推出的一套访问摄像头设备的接口,其采用管道式的设计,使数据流从摄像头流向Surface。相机访问接口包括相机管理(Camera Manager)。相机管理可以用于管理相机设备,通过相机管理可以查询手机100上的相机设备信息,进而得到相机设备对象。相机设备信息例如可以包括相机设备相关的一系列固定参数,例如基础的设置参数和输出格式参数等。As shown in Figure 8, the application framework layer can include the framework layer including the camera access interface (Camera API). The camera access interface is a set of interfaces for accessing the camera device introduced by Android. It adopts a pipeline design to make the data flow from the camera Flow to Surface. The camera access interface includes Camera Manager. Camera management can be used to manage camera devices, through which camera device information on the mobile phone 100 can be queried to obtain camera device objects. The camera device information may include, for example, a series of fixed parameters related to the camera device, such as basic setting parameters and output format parameters.
硬件抽象层,是位于操作系统内核与硬件电路之间的接口层,其目的在于将硬件抽象化。它隐藏了特定平台的硬件接口细节,为操作系统提供虚拟硬件平台,使其具有硬件无关性,可在多种平台上进行移植。在图8中,HAL包括相机硬件抽象层(Camera HAL,又称相机HAL)。The hardware abstraction layer is an interface layer between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform, provides a virtual hardware platform for the operating system, makes it hardware-independent, and can be transplanted on various platforms. In Figure 8, the HAL includes the camera hardware abstraction layer (Camera HAL, also known as the camera HAL).
相机HAL可以包括相机设备1、相机设备2、相机设备3等。可以理解,该相机设备1、相机设备2和相机设备3为抽象的设备,例如可以是抽象的摄像头1、摄像头2、摄像头3等设备。The camera HAL may include camera device 1, camera device 2, camera device 3, and so on. It can be understood that the camera device 1 , the camera device 2 and the camera device 3 are abstract devices, such as abstract devices such as the camera 1 , the camera 2 , and the camera 3 .
内核驱动层是硬件和软件之间的层。内核驱动层至少包含显示驱动,摄像头驱动等。其中,显示驱动可以用于驱动手机100的显示屏194,摄像头驱动可以用于驱动手机100的各个摄像头193。The kernel driver layer is the layer between hardware and software. The kernel driver layer includes at least a display driver, a camera driver, etc. Wherein, the display driver can be used to drive the display screen 194 of the mobile phone 100 , and the camera driver can be used to drive each camera 193 of the mobile phone 100 .
基于图8所示的手机100的软件结构,图9根据本申请实施例示出了一种转场动效生成方法的交互流程示意图。如图9所示,该交互流程涉及图8所示的切换控制模块810、多路编码模块820、以及转场动效生成模块830中的纹理生成器831、渲染线程832、渲染处理程序833以及着色器库834。Based on the software structure of the mobile phone 100 shown in FIG. 8 , FIG. 9 shows a schematic diagram of an interaction process of a method for generating transition motion effects according to an embodiment of the present application. As shown in FIG. 9 , the interaction process involves the switching control module 810 shown in FIG. 8 , the multi-channel encoding module 820 , and the texture generator 831 in the transition motion effect generation module 830 , the rendering thread 832 , the rendering processing program 833 and Shader library 834.
具体地,如图9所示,该流程包括以下步骤:Specifically, as shown in Figure 9, the process includes the following steps:
S01:切换控制模块810执行第一拍摄模式的环境初始化。S01: The switching control module 810 executes environment initialization of the first shooting mode.
示例性地,用户在相机应用的界面(例如上述图5b所示的相机应用的更多功能界面520)上点击多镜录像功能控件,使用多镜录像功能开始拍摄视频时,切换控制模块810可以响应于用户启动多镜录像的操作,触发多镜录像拍摄环境的初始化。开始拍摄视频时,手机100可以采用默认拍摄模式或者用户选择的某种拍摄模式,此时的所采用的拍摄模式即为第一拍摄模式。因此,拍摄环境的初始化,也即是第一拍摄模式下的环境初始化。可以理解,该环境初始化例如可以包括驱动第一拍摄模式对应的摄像头工作以及手机100系统内的绘制渲染环境就绪等。Exemplarily, when the user clicks the multi-camera recording function control on the interface of the camera application (for example, the more functional interface 520 of the camera application shown in FIG. In response to the user's operation of starting the multi-camera video recording, the initialization of the multi-camera video shooting environment is triggered. When starting to shoot a video, the mobile phone 100 may adopt a default shooting mode or a certain shooting mode selected by the user, and the shooting mode adopted at this time is the first shooting mode. Therefore, the initialization of the shooting environment is also the initialization of the environment in the first shooting mode. It can be understood that the environment initialization may include, for example, driving the camera corresponding to the first shooting mode to work, and the drawing and rendering environment in the system of the mobile phone 100 is ready.
作为示例,切换控制模块810例如可以设置在上述图8所示的手机100系统的应用程序层中。在另一些实施例中,切换控制模块810也可以设置在手机等电子设备系统框架的其他层中,例如可以设置在应用程序框架层中以供应用程序层中相机应用的应用逻辑调用,在此不做限制。As an example, the switching control module 810 may be set in the application program layer of the mobile phone 100 system shown in FIG. 8 , for example. In some other embodiments, the switching control module 810 can also be set in other layers of the system framework of electronic devices such as mobile phones, for example, it can be set in the application program framework layer to be called by the application logic of the camera application in the application program layer, here No restrictions.
S02:切换控制模块810向纹理生成器831发送第一拍摄模式的纹理初始化指令。S02: The switching control module 810 sends a texture initialization instruction of the first shooting mode to the texture generator 831 .
示例性地,切换控制模块810在响应用户启动拍摄的操作时,可以向纹理生成器831发送初始化指令,以令纹理生成器831初始化对第一拍摄模式下采集的图像提取纹理的操作环境。Exemplarily, the switching control module 810 may send an initialization command to the texture generator 831 when responding to the user's shooting operation, so that the texture generator 831 initializes an operating environment for extracting textures from images captured in the first shooting mode.
作为示例,纹理生成器831例如可以设置在上述图8所示的手机100系统的应用程序层中。在另一些实施例中,纹理生成器831也可以设置在手机等电子设备系统框架的其他层中,例如可以设置在应用程序框架层中以供应用程序层中相机应用的应用逻辑调用,在此不做限制。As an example, the texture generator 831 may be set in the application layer of the mobile phone 100 system shown in FIG. 8 above. In other embodiments, the texture generator 831 can also be set in other layers of the system framework of electronic devices such as mobile phones, for example, it can be set in the application framework layer to be called by the application logic of the camera application in the application layer. No restrictions.
S03:纹理生成器831计算第一拍摄模式采集的图像所对应的纹理效果。S03: The texture generator 831 calculates the texture effect corresponding to the image captured in the first shooting mode.
示例性地,纹理生成器831完成纹理提取环境的初始化后,可以对第一拍摄模式下采集的图像,计算相应的纹理效果,即提取对应于该图像的纹理特征。Exemplarily, after the texture generator 831 completes the initialization of the texture extraction environment, it may calculate a corresponding texture effect for the image collected in the first shooting mode, that is, extract the texture feature corresponding to the image.
S04:纹理生成器831向渲染线程832更新纹理效果。S04: The texture generator 831 updates the texture effect to the rendering thread 832 .
示例性地,纹理生成器831在完成纹理效果的计算,或者说是完成纹理特征的提取后,可以向渲染线程832发送计算得到的纹理效果参数(即纹理特征参数),以更新当前这一帧图像的纹理效果。Exemplarily, after the texture generator 831 completes the calculation of the texture effect, or in other words, completes the extraction of texture features, it can send the calculated texture effect parameters (ie, texture feature parameters) to the rendering thread 832 to update the current frame The texture effect of the image.
S05:渲染线程832向渲染处理程序833发送初始化渲染环境指令。S05: The rendering thread 832 sends an instruction to initialize the rendering environment to the rendering processing program 833 .
示例性地,渲染线程832接收到纹理生成器831发来的更新纹理效果后,可以向渲染处理程序833发送初始化指令,以令GPU运行渲染处理程序进行渲染环境的初始化。Exemplarily, after receiving the updated texture effect sent by the texture generator 831, the rendering thread 832 may send an initialization instruction to the rendering processing program 833, so that the GPU runs the rendering processing program to initialize the rendering environment.
S06:渲染处理程序833调用着色器库834中相应的着色器执行着色程序。S06: The rendering processing program 833 calls the corresponding shader in the shader library 834 to execute the shader program.
示例性地,GPU运行渲染处理程序833完成渲染环境的初始化后,可以调用着色器库834中相应的着色器,配合GPU运行相应的着色程序。此时,渲染处理程序833可以将已更新纹理效果的帧纹理的位置、颜色、纹理坐标等发送给相应着色器,用于配合GPU执行着色程序。Exemplarily, after the GPU runs the rendering processing program 833 and completes the initialization of the rendering environment, it can call the corresponding shader in the shader library 834 to cooperate with the GPU to run the corresponding shader program. At this point, the rendering processing program 833 may send the position, color, texture coordinates, etc. of the frame texture of the updated texture effect to the corresponding shader, so as to cooperate with the GPU to execute the shader program.
作为示例,着色器库834例如可以设置在上述图8所示的手机100系统的应用程序层中。在另一些实施例中,着色器库834也可以设置在手机等电子设备系统框架的其他层中,例如可以设置在应用程序框架层中以供应用程序层中相机应用的应用逻辑调用,在此不做限制。As an example, the shader library 834 may be set in the application layer of the mobile phone 100 system shown in FIG. 8 above. In some other embodiments, the shader library 834 can also be set in other layers of the system framework of electronic devices such as mobile phones, for example, it can be set in the application framework layer to be called by the application logic of the camera application in the application layer. No restrictions.
S07:纹理生成器831响应于初始化指令,注册图像监听器,并获取第一拍摄模式下的帧图像,提取相应的帧纹理。S07: The texture generator 831 registers an image listener in response to the initialization instruction, acquires frame images in the first shooting mode, and extracts corresponding frame textures.
示例性地,纹理生成器831在执行上述步骤S03至S04时,也可以响应于上述步骤S02接收到的初 始化指令,注册图像监听器。该图像监听器用于监听并第一拍摄模式以及用户请求切换的第二拍摄模式下的图像,以用于生成转场动效。Exemplarily, when the texture generator 831 executes the above steps S03 to S04, it may also register the image listener in response to the initialization instruction received in the above step S02. The image listener is used to monitor and monitor images in the first shooting mode and the second shooting mode requested by the user to generate transition motion effects.
S08:切换控制模块810响应于用户切换拍摄模式的操作,向纹理生成器831发送拍摄模式切换信号。S08: The switching control module 810 sends a shooting mode switching signal to the texture generator 831 in response to the user's operation of switching the shooting mode.
示例性地,用户在相机应用的界面(例如上述图5e所示的拍摄模式选择界面550)上选择不同于当前拍摄模式的另一拍摄模式进行切换时,切换控制模块810可以响应于用户的切换操作,向纹理生成器831发送拍摄模式切换信号。该拍摄模式切换信号用于通知纹理生成器831拍摄模式即将切换。Exemplarily, when the user selects another shooting mode different from the current shooting mode on the interface of the camera application (such as the shooting mode selection interface 550 shown in FIG. operation, sending a shooting mode switching signal to the texture generator 831 . The shooting mode switching signal is used to notify the texture generator 831 that the shooting mode is about to switch.
S09:纹理生成器831获取第一拍摄模式下的一帧图像,提取相应的帧纹理。S09: The texture generator 831 acquires a frame of image in the first shooting mode, and extracts a corresponding frame texture.
示例性地,纹理生成器831接收到拍摄模式切换信号时,可以基于上述步骤S07注册图像监听器,获取第一拍摄模式下的一帧图像,并提取相应图像的帧纹理。可以理解,此处纹理生成器831所获取的第一拍摄模式下的一帧图像,例如可以是第一拍摄模式下的最后一帧图像或者连续的最后几帧图像,所获取的图像将用于生成转场动效,在此不做限制。Exemplarily, when the texture generator 831 receives the shooting mode switching signal, it may register an image listener based on the above step S07, acquire a frame of image in the first shooting mode, and extract the frame texture of the corresponding image. It can be understood that the one frame of image in the first shooting mode acquired by the texture generator 831 here may be, for example, the last frame of image in the first shooting mode or the last several consecutive frames of images, and the acquired image will be used for Generate transition effects, there is no limitation here.
可以理解,每一帧图像对应于的一帧纹理,后续处理中,对各帧纹理所进行的特效处理等,可以理解为对相应帧图像进行的特效处理等。It can be understood that each frame of image corresponds to a frame of texture, and in subsequent processing, the special effect processing performed on each frame of texture can be understood as the special effect processing performed on the corresponding frame image.
S10:纹理生成器831向渲染线程832发送所提取的帧纹理。S10: The texture generator 831 sends the extracted frame texture to the rendering thread 832 .
示例性地,纹理生成器831在获取图像并提取相应图像的帧纹理后,可以向渲染线程832发送所提取的帧纹理,以供渲染线程832上运行的渲染器进行后续相应处理。Exemplarily, after acquiring the image and extracting the frame texture of the corresponding image, the texture generator 831 may send the extracted frame texture to the rendering thread 832 for subsequent corresponding processing by the renderer running on the rendering thread 832 .
S11:渲染线程832获取该帧纹理。S11: The rendering thread 832 acquires the frame texture.
示例性地,渲染线程832接收纹理生成器831发来的帧纹理,该帧纹理即上述步骤S09中对第一拍摄模式下的一帧图像所提取的帧纹理。Exemplarily, the rendering thread 832 receives the frame texture sent by the texture generator 831, and the frame texture is the frame texture extracted from a frame of image in the first shooting mode in the above step S09.
S12:渲染线程832向渲染处理程序833发送该帧纹理,并请求对该帧纹理进行转场动效处理。S12: The rendering thread 832 sends the frame texture to the rendering processing program 833, and requests to perform transition animation processing on the frame texture.
示例性地,渲染线程832在接收纹理生成器831发来的帧纹理后,可以向渲染处理程序833发送该帧纹理,并且渲染线程832还可以请求GPU运行的渲染处理程序833对该帧纹理处理为转场动效中的一帧或多帧图像。Exemplarily, after receiving the frame texture sent by the texture generator 831, the rendering thread 832 can send the frame texture to the rendering processing program 833, and the rendering thread 832 can also request the rendering processing program 833 run by the GPU to process the frame texture One or more frames of images in the transition effect.
可以理解,渲染线程832以及渲染处理程序833的运行并不限于图8所示的应用程序层,实际上渲染线程832以及渲染处理程序833的运行可以涉及应用程序框架层以及内核层中的GPU驱动等部分所执行的处理过程,在此不做限制。渲染线程832以及渲染处理程序833的具体运行过程,可以参考现有技术中渲染进程的执行处理过程,在此不做赘述。It can be understood that the operation of the rendering thread 832 and the rendering processing program 833 is not limited to the application layer shown in FIG. The processing performed by other parts is not limited here. For the specific running process of the rendering thread 832 and the rendering processing program 833 , reference may be made to the execution processing process of the rendering process in the prior art, which will not be repeated here.
S13:渲染处理程序833向着色器库834发送对应于该帧纹理的特效处理参数。S13: The rendering processing program 833 sends the special effect processing parameters corresponding to the texture of the frame to the shader library 834 .
示例性地,GPU所运行的渲染处理程序833中可以预设上述转场动效生成策略,基于该策略,渲染处理程序可以确定对转场动效的每一帧图像的特效处理参数。该特效处理参数例如包括蒙版遮罩的颜色及不透明度参数、模糊处理的模糊程度系数等,还可以包括每一帧图像的纹理信息等。其中,纹理信息则例如可以是各帧图像对应的纹理的位置、颜色以及纹理坐标信息等。渲染处理程序833在确定当前这一帧纹理对应的特效处理参数后,可以发送给着色器库中834中相应的着色器,以用于配合GPU执行着色程序。Exemplarily, the rendering processing program 833 run by the GPU may preset the aforementioned transition motion effect generation strategy, and based on the strategy, the rendering processing program may determine special effect processing parameters for each frame of the transition motion effect. The special effect processing parameters include, for example, color and opacity parameters of the mask, blur degree coefficients of blur processing, etc., and may also include texture information of each frame of image, etc. Wherein, the texture information may be, for example, the position, color and texture coordinate information of the texture corresponding to each frame image. After the rendering processing program 833 determines the special effect processing parameters corresponding to the texture of the current frame, it can send it to the corresponding shader in the shader library 834, so as to cooperate with the GPU to execute the shader program.
可以理解,着色器库834提供相应的着色器配合GPU运行着色程序,对该帧纹理进行特效处理,从而得到具有相应特效的帧纹理,进而生成转场动效中相应位置上显示的一帧图像。It can be understood that the shader library 834 provides corresponding shaders to cooperate with the GPU to run the shader program, and perform special effect processing on the frame texture, so as to obtain a frame texture with corresponding special effects, and then generate a frame of image displayed at the corresponding position in the transition animation .
S14:渲染处理程序833向着色器库834调用相应着色器对该帧纹理进行特效处理,并绘制渲染送显。S14: The rendering processing program 833 calls a corresponding shader to the shader library 834 to perform special effect processing on the frame texture, and draws and renders to the display.
示例性地,GPU所运行的渲染处理程序833向着色器库834发送该帧纹理对应的特效处理参数后,可以调用相应着色器,配合GPU执行着色程序,对当前这一帧纹理进行相应的特效处理,并在处理完成后将相应图像的显示参数发送给界面合成服务(surface flinger)进行送显,即通过界面合成服务(surface flinger)完成与其他图层的合并后作为待显示界面进行显示的过程,在此不做赘述。Exemplarily, after the rendering processing program 833 run by the GPU sends the special effect processing parameters corresponding to the texture of the frame to the shader library 834, the corresponding shader can be called to cooperate with the GPU to execute the shader program to perform corresponding special effects on the texture of the current frame processing, and after the processing is completed, the display parameters of the corresponding image are sent to the interface synthesis service (surface flinger) for display, that is, after the interface synthesis service (surface flinger) completes the merger with other layers, it is displayed as the interface to be displayed The process will not be repeated here.
S15:渲染处理程序833将送显的帧纹理发送给多路编码模块820进行编码,生成转场动效的视频流数据。S15: The rendering processing program 833 sends the frame texture sent for display to the multi-channel encoding module 820 for encoding to generate video stream data for transition effects.
示例性地,在一些实施例中,GPU所运行的渲染处理程序833在完成对当前这一帧图像的纹理完成特效处理后得到的转场图像,也可以通过相应的通路发送给多路编码模块820进行编码,即送编码的过程,以生成转场动效对应的视频流数据。可以理解,多路编码模块820例如可以利用相应的编码器实现对完成处理的帧纹理或帧图像进行压缩编码,编码形成的视频流文件格式例如可以是上述AVC格式等。如上所述,待手机100响应于用户拍摄视频以及切换拍摄模式的操作完成视频拍摄后,编码得到的各段AVC格式的视频流数据可以按照相应的时间戳进行合并封装,形成包含所生成的转场动效的视频文件,封装打包后的视频文件格式例如可以是MP4、或AVI等媒体文件格式,在此不做赘述。Exemplarily, in some embodiments, the transition image obtained after the rendering processing program 833 run by the GPU completes the special effect processing on the texture of the current frame image can also be sent to the multi-channel encoding module through the corresponding channel 820 to encode, that is, to send the encoding process to generate the video stream data corresponding to the transition effect. It can be understood that, for example, the multi-channel encoding module 820 can use a corresponding encoder to compress and encode the processed frame texture or frame image, and the format of the encoded video stream file can be, for example, the above-mentioned AVC format. As mentioned above, after the mobile phone 100 completes video shooting in response to the user’s operation of shooting video and switching shooting modes, the encoded video stream data in AVC format can be combined and packaged according to the corresponding time stamps to form a video file containing the generated video stream data. For video files with field motion effects, the video file format after packaging can be, for example, MP4, or AVI and other media file formats, which will not be described in detail here.
可以理解,在另一些实施例中,对所生成的转场动效也可以不执行本步骤S15的送编码过程,手机100在实施本申请实施例所提供的转场动效生成方法时,可以仅在切换拍摄模式的转场预览界面中显示所生成的转场动效,在此不做限制。It can be understood that, in some other embodiments, the encoding process of step S15 may not be executed for the generated transition animation effect. The generated transition effects are only displayed in the transition preview interface for switching shooting modes, and there is no limitation here.
作为示例,多路编码模块820例如可以设置在上述图8所示的手机100系统的应用程序层中。在另一些实施例中,多路编码模块820也可以设置在手机等电子设备系统框架的其他层中,例如可以设置在应用程序框架层中以供应用程序层中相机应用的应用逻辑调用,在此不做限制。As an example, the multi-channel encoding module 820 may be set in the application program layer of the mobile phone 100 system shown in FIG. 8 , for example. In some other embodiments, the multi-channel encoding module 820 can also be set in other layers of the system framework of electronic devices such as mobile phones, for example, it can be set in the application program framework layer for the application logic call of the camera application in the application program layer. This is not limited.
S16:渲染处理程序833通过渲染线程832、纹理生成器831向切换控制模块810返回第一拍摄模式的图像处理结果。S16: The rendering processing program 833 returns the image processing result of the first shooting mode to the switching control module 810 through the rendering thread 832 and the texture generator 831 .
示例性地,GPU所运行的渲染处理程序833完成当前这一帧纹理或图像的特效处理后,可以通过渲染线程832、纹理生成器831向切换控制模块810返回第一拍摄模式的图像处理结果。例如通过渲染线程832、纹理生成器831向切换控制模块810发送完成处理的返回值。该返回值表明,转场动效中的当前这一帧纹理或图像已处理完成,可以继续进行下一帧图像的处理。Exemplarily, the rendering processing program 833 run by the GPU may return the image processing result of the first shooting mode to the switching control module 810 through the rendering thread 832 and the texture generator 831 after completing the special effect processing of the texture or image of the current frame. For example, the return value of processing completion is sent to the switching control module 810 through the rendering thread 832 and the texture generator 831 . The return value indicates that the current frame of texture or image in the transition animation has been processed, and the processing of the next frame of image can be continued.
可以理解,对于第一拍摄模式下的图像处理成转场动效中相应的若干帧图像的过程,可以通过重复上述步骤S13至S14以及S15的过程,在此不做赘述。It can be understood that for the process of processing the images in the first shooting mode into corresponding frames of images in the transition animation, the process of repeating the above steps S13 to S14 and S15 can be repeated, and details are not repeated here.
S17:纹理生成器831获取第二拍摄模式下的一帧图像,提取相应的帧纹理。S17: The texture generator 831 acquires a frame of image in the second shooting mode, and extracts a corresponding frame texture.
示例性地,在纹理生成器831上注册的图像监听器监听到第二拍摄模式下的第一帧图像时,纹理生成器831可以基于该图像监听器获取第二拍摄模式下的第一帧图像。在另一些实施例中,纹理生成器831在获取第二拍摄模式下的第一帧图像之后,可以继续获取连续的第二帧、第三帧等多帧图像,用于处理为转场动效中的各帧转场图像,在此不做限制。Exemplarily, when the image listener registered on the texture generator 831 monitors the first frame of image in the second shooting mode, the texture generator 831 can acquire the first frame of image in the second shooting mode based on the image listener . In some other embodiments, after acquiring the first frame image in the second shooting mode, the texture generator 831 may continue to acquire continuous second frame, third frame and other multi-frame images for processing as a transition effect The transition images of each frame in are not limited here.
可以理解,纹理生成器831对第二拍摄模式下的图像,提取相应的帧纹理的过程,可以参考上述步骤S09中相关描述,在此不做赘述。It can be understood that, for the process of the texture generator 831 extracting the corresponding frame texture from the image in the second shooting mode, reference may be made to the relevant description in the above step S09 , which will not be repeated here.
S18:纹理生成器831向渲染线程832发送所提取的帧纹理。S18: The texture generator 831 sends the extracted frame texture to the rendering thread 832 .
示例性地,纹理生成器831向渲染线程832发送的所提取的帧纹理,为上述步骤S17中获取的第二拍摄模式下的图像对应的帧纹理。纹理生成器831在获取图像并提取相应图像的帧纹理后,可以向渲染线程832发送所提取的帧纹理,以供渲染线程832上运行的渲染器进行后续相应处理。Exemplarily, the extracted frame texture sent by the texture generator 831 to the rendering thread 832 is the frame texture corresponding to the image in the second shooting mode acquired in the above step S17. After the texture generator 831 acquires the image and extracts the frame texture of the corresponding image, it can send the extracted frame texture to the rendering thread 832 for subsequent corresponding processing by the renderer running on the rendering thread 832 .
S19:渲染线程832获取该帧纹理。S19: The rendering thread 832 acquires the frame texture.
示例性地,渲染线程832所获取的帧纹理,为上述步骤S18中纹理生成器831所发送的第二拍摄模式下的图像对应的帧纹理。Exemplarily, the frame texture acquired by the rendering thread 832 is the frame texture corresponding to the image in the second shooting mode sent by the texture generator 831 in the above step S18.
S20:渲染线程832向渲染处理程序833发送该帧纹理,并请求对该帧纹理进行转场动效处理。S20: The rendering thread 832 sends the frame texture to the rendering processing program 833, and requests to perform transition animation processing on the frame texture.
示例性地,渲染线程832在接收纹理生成器831发来的帧纹理后,可以向渲染处理程序833发送该帧纹理,并且渲染线程832还可以请求GPU运行的渲染处理程序833对该帧纹理处理为转场动效中的一帧或多帧图像。Exemplarily, after receiving the frame texture sent by the texture generator 831, the rendering thread 832 can send the frame texture to the rendering processing program 833, and the rendering thread 832 can also request the rendering processing program 833 run by the GPU to process the frame texture It is one or more frames of images in the transition effect.
S21:渲染处理程序833向着色器库834发送对应于该帧纹理的特效处理参数。S21: The rendering processing program 833 sends the special effect processing parameters corresponding to the texture of the frame to the shader library 834 .
示例性地,渲染处理程序833在确定当前这一帧纹理对应的特效处理参数后,可以发送给着色器库中834中相应的着色器,以用于配合GPU执行着色程序。具体可以参考上述步骤S13中相关描述,在此不做赘述。Exemplarily, after the rendering processing program 833 determines the special effect processing parameters corresponding to the texture of the current frame, it can send them to the corresponding shader in the shader library 834, so as to cooperate with the GPU to execute the shader program. For details, reference may be made to relevant descriptions in the above step S13, and details are not repeated here.
S22:渲染处理程序833向着色器库834调用相应着色器对该帧纹理进行特效处理,并绘制渲染送显。S22: The rendering processing program 833 calls a corresponding shader to the shader library 834 to perform special effect processing on the texture of the frame, and draws and renders to the display.
示例性地,GPU所运行的渲染处理程序833向着色器库834发送该帧纹理对应的特效处理参数后,可以调用相应着色器,配合GPU执行着色程序,对当前这一帧纹理进行相应的特效处理,并在处理完成后将相应图像的显示参数发送给surface flinger进行送显。具体可以参考上述步骤S14中相关描述,在此不做限制。Exemplarily, after the rendering processing program 833 run by the GPU sends the special effect processing parameters corresponding to the texture of the frame to the shader library 834, the corresponding shader can be called to cooperate with the GPU to execute the shader program to perform corresponding special effects on the texture of the current frame Processing, and after the processing is completed, the display parameters of the corresponding image are sent to the surface flinger for display. For details, reference may be made to relevant descriptions in the above step S14, and no limitation is made here.
S23:渲染处理程序833将送显的帧纹理发送给多路编码模块820进行编码,生成转场动效的视频流数据。S23: The rendering processing program 833 sends the frame texture sent for display to the multi-channel encoding module 820 for encoding to generate video stream data for transition effects.
示例性地,在一些实施例中,GPU所运行的渲染处理程序833在完成对当前这一帧图像的纹理完成特效处理后得到的转场图像,也可以通过相应的通路发送给多路编码模块820进行编码,即送编码的过程,以生成转场动效对应的视频流数据。具体可以参考上述步骤S15中相关描述,在此不做赘述。Exemplarily, in some embodiments, the transition image obtained after the rendering processing program 833 run by the GPU completes the special effect processing on the texture of the current frame image can also be sent to the multi-channel encoding module through the corresponding channel 820 to encode, that is, to send the encoding process to generate the video stream data corresponding to the transition effect. For details, reference may be made to relevant descriptions in the above step S15, and details are not repeated here.
可以理解,在另一些实施例中,对所生成的转场动效也可以不执行本步骤S23的送编码过程,手机100在实施本申请实施例所提供的转场动效生成方法时,可以仅在切换拍摄模式的转场预览界面中显示所生成的转场动效,在此不做限制。It can be understood that, in some other embodiments, the encoding process of step S23 may not be executed for the generated transition animation effect. The generated transition effects are only displayed in the transition preview interface for switching shooting modes, and there is no limitation here.
S24:渲染处理程序833通过渲染线程832、纹理生成器831向切换控制模块810返回第二拍摄模式的图像处理结果。S24: The rendering processing program 833 returns the image processing result of the second shooting mode to the switching control module 810 through the rendering thread 832 and the texture generator 831 .
示例性地,GPU所运行的渲染处理程序833完成当前这一帧纹理或图像的特效处理后,可以通过渲染线程832、纹理生成器831向切换控制模块810返回第二拍摄模式的图像处理结果。例如通过渲染线程832、纹理生成器831向切换控制模块810发送完成处理的返回值。该返回值表明,转场动效中的当前这一帧纹理或图像已处理完成,可以继续进行下一帧图像的处理。Exemplarily, the rendering processing program 833 run by the GPU may return the image processing result of the second shooting mode to the switching control module 810 through the rendering thread 832 and the texture generator 831 after completing the special effect processing of the texture or image of the current frame. For example, the return value of processing completion is sent to the switching control module 810 through the rendering thread 832 and the texture generator 831 . The return value indicates that the current frame of texture or image in the transition animation has been processed, and the processing of the next frame of image can be continued.
可以理解,对于第一拍摄模式下的图像处理成转场动效中相应的若干帧图像的过程,可以通过重复上述步骤S21至S22以及S23的过程,在此不做赘述。It can be understood that for the process of processing the images in the first shooting mode into corresponding frames of images in the transition animation, the process of repeating the above steps S21 to S22 and S23 can be repeated, and details are not repeated here.
S25:切换控制模块810向纹理生成器831发送拍摄模式完成切换信号。S25: The switching control module 810 sends a shooting mode switching completion signal to the texture generator 831 .
示例性地,切换控制模块810在接收到第二拍摄模式的图像处理结果后,可以确定已完成拍摄模式的切换,则可以向纹理生成器831发送拍摄模式完成切换信号。Exemplarily, after receiving the image processing result of the second shooting mode, the switching control module 810 may determine that the switching of the shooting mode has been completed, and then may send a shooting mode switching completion signal to the texture generator 831 .
S26:纹理生成器831注销图像监听器。S26: The texture generator 831 cancels the image listener.
示例性地,纹理生成器831在接收到切换控制模块810发来的拍摄模式完成切换信号后,确定不需要在监听获取某个拍摄模式下的图像,此时可以注销相应的图像监听器。Exemplarily, after the texture generator 831 receives the shooting mode switching completion signal from the switching control module 810, it determines that it does not need to monitor and acquire images in a certain shooting mode, and at this time, the corresponding image monitor can be deregistered.
可以理解,在另一些实施例中,纹理生成器831上注册的图像监听器,不仅用于切换拍摄模式时获 取第一拍摄模式和第二拍摄模式下的图像,该图像监听器可以用于在视频拍摄过程中一直监听镜头采集并上传的图像。此种情形下,在完成拍摄模式的切换后,纹理生成器831也可以不注销所注册的图像监听器。该图像监听器在完成拍摄模式的切换后,可以持续获取第二拍摄模式下对应工作的镜头所采集并上传的图像。It can be understood that, in some other embodiments, the image listener registered on the texture generator 831 is not only used to obtain images in the first shooting mode and the second shooting mode when switching the shooting mode, but the image listener can be used to During the video shooting process, the images captured and uploaded by the lens are constantly monitored. In this case, after switching the shooting mode, the texture generator 831 may not cancel the registered image listener. After switching the shooting mode, the image monitor can continuously acquire and upload the images captured and uploaded by the corresponding working lens in the second shooting mode.
在说明书对“一个实施例”或“实施例”的引用意指结合实施例所描述的具体特征、结构或特性被包括在根据本申请实施例公开的至少一个范例实施方案或技术中。说明书中的各个地方的短语“在一个实施例中”的出现不一定全部指代同一个实施例。The reference to "an embodiment" or "an embodiment" in the description means that the specific features, structures or characteristics described in conjunction with the embodiment are included in at least one exemplary implementation or technology disclosed according to the embodiment of the present application. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment.
本申请实施例的公开还涉及用于执行文本中的操作装置。该装置可以专门处于所要求的目的而构造或者其可以包括被存储在计算机中的计算机程序选择性地激活或者重新配置的通用计算机。这样的计算机程序可以被存储在计算机可读介质中,诸如,但不限于任何类型的盘,包括软盘、光盘、CD-ROM、磁光盘、只读存储器(ROM)、随机存取存储器(RAM)、EPROM、EEPROM、磁或光卡、专用集成电路(ASIC)或者适于存储电子指令的任何类型的介质,并且每个可以被耦合到计算机系统总线。此外,说明书中所提到的计算机可以包括单个处理器或者可以是采用针对增加的计算能力的多个处理器涉及的架构。The disclosure of the embodiment of the present application also relates to a device for executing operations in text. This apparatus may be specially constructed for the required purposes or it may comprise a general purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored on a computer readable medium such as, but not limited to, any type of disk, including floppy disk, compact disk, CD-ROM, magneto-optical disk, read-only memory (ROM), random-access memory (RAM) , EPROM, EEPROM, magnetic or optical card, application specific integrated circuit (ASIC), or any type of medium suitable for storing electronic instructions, and each may be coupled to a computer system bus. Furthermore, computers referred to in the specification may comprise a single processor or may be architectures involving multiple processors for increased computing power.
另外,在本说明书所使用的语言已经主要被选择用于可读性和指导性的目的并且可能未被选择为描绘或限制所公开的主题。因此,本申请实施例公开旨在说明而非限制本文所讨论的概念的范围。Additionally, the language used in this specification has been chosen primarily for readability and instructional purposes and may not have been chosen to delineate or limit the subject matter disclosed. Therefore, the embodiments disclosed in this application are intended to illustrate rather than limit the scope of the concepts discussed herein.

Claims (13)

  1. 一种转场动效生成方法,应用于电子设备,其特征在于,包括:A transition motion effect generation method applied to electronic equipment, characterized in that it includes:
    在采用第一拍摄模式进行视频拍摄的过程中,检测到从所述第一拍摄模式切换到第二拍摄模式的第一指令;During video shooting in the first shooting mode, a first instruction to switch from the first shooting mode to the second shooting mode is detected;
    响应于所述第一指令,将视频拍摄模式切换为所述第二拍摄模式,并生成和播放转场动效,其中,所述转场动效在所述第一拍摄模式下拍摄的第一视频部分和在所述第二拍摄模式下拍摄的第二视频部分之间播放,并且所述转场动效包括所述第一视频部分中的第一图像、以及所述第二视频部分中的第二图像。In response to the first instruction, switch the video shooting mode to the second shooting mode, and generate and play a transition animation effect, wherein the transition animation effect is captured in the first shooting mode in the first Play between the video part and the second video part shot in the second shooting mode, and the transition motion effect includes the first image in the first video part and the first image in the second video part second image.
  2. 根据权利要求1所述的方法,其特征在于,所述第一图像为在所述第一拍摄模式下拍摄的最后N帧图像,所述第二图像为在所述第二拍摄模式下拍摄的前M帧图像,其中,N和M为自然数。The method according to claim 1, wherein the first image is the last N frames of images taken in the first shooting mode, and the second image is the last N frame of images taken in the second shooting mode The first M frames of images, where N and M are natural numbers.
  3. 根据权利要求1所述的方法,其特征在于,在所述第一拍摄模式下拍摄所述第一图像采用的摄像头、与在所述第二拍摄模式下拍摄所述第二图像采用的摄像头,是位于所述电子设备不同侧的摄像头。The method according to claim 1, characterized in that, the camera used to shoot the first image in the first shooting mode and the camera used to shoot the second image in the second shooting mode, are cameras located on different sides of the electronic device.
  4. 根据权利要求1所述的方法,其特征在于,通过以下方式生成所述转场动效:The method according to claim 1, wherein the transition animation effect is generated in the following manner:
    根据所述电子设备在第二拍摄模式下生成所述第二视频部分的第一帧图像所需的时间,确定生成的所述转场动效的各个部分的转场图像帧数。According to the time required for the electronic device to generate the first frame image of the second video part in the second shooting mode, determine the generated number of transition image frames of each part of the transition motion effect.
  5. 根据权利要求4所述的方法,其特征在于,所述转场动效包括依次生成的第一转场部分和第二转场部分,其中,The method according to claim 4, wherein the transition motion effect includes a first transition part and a second transition part generated sequentially, wherein,
    所述第一转场部分的各帧转场图像基于所述第一图像生成;Each frame transition image of the first transition part is generated based on the first image;
    所述第二转场部分的各帧转场图像基于所述第二图像生成,或者,所述第二转场部分的各帧转场图像基于所述第一图像与所述第二图像的拼接图像生成。Each frame transition image of the second transition part is generated based on the second image, or each frame transition image of the second transition part is based on the splicing of the first image and the second image Image generation.
  6. 根据权利要求5所述的方法,其特征在于,所述电子设备包括对所述转场动效的第一转场部分预设的转场图像帧数为i、以及对所述转场动效的第二转场部分预设的转场图像帧数为j,并且,The method according to claim 5, wherein the electronic device includes a preset transition image frame number i for the first transition part of the transition motion effect, and The preset transition image frame number of the second transition part is j, and,
    所述根据所述电子设备在第二拍摄模式下生成所述第二视频部分的第一帧图像所需的时间,确定生成的所述转场动效的各个部分的转场图像帧数,包括:According to the time required for the electronic device to generate the first frame image of the second video part in the second shooting mode, determine the number of transition image frames of each part of the transition motion effect generated, including :
    若在第二拍摄模式下生成所述第二视频部分的第一帧图像所需的时间大于生成所述第一转场部分所需的时间,则确定生成的所述转场动效的第一转场部分的转场图像帧数为i+k、以及第二转场部分的转场图像帧数为j-k,其中k<j。If the time required to generate the first frame image of the second video part in the second shooting mode is greater than the time required to generate the first transition part, then determine the generated first transition motion effect The number of transition image frames in the transition part is i+k, and the number of transition image frames in the second transition part is j-k, where k<j.
  7. 根据权利要求4所述的方法,其特征在于,所述转场动效包括依次生成的第三转场部分、第四转场部分和第五转场部分,其中,The method according to claim 4, wherein the transition motion effect includes a third transition part, a fourth transition part and a fifth transition part generated in sequence, wherein,
    所述第三转场部分的各帧转场图像基于所述第一图像生成;Each frame transition image of the third transition part is generated based on the first image;
    所述第四转场部分的各帧转场图像基于所述第一图像与所述第二图像的拼接图像生成;Each frame transition image of the fourth transition part is generated based on the spliced image of the first image and the second image;
    所述第五转场部分的各帧转场图像基于所述第二图像生成。Each frame transition image of the fifth transition part is generated based on the second image.
  8. 根据权利要求7所述的方法,其特征在于,所述电子设备包括对所述转场动效的第三转场部分预设的转场图像帧数为a、对所述转场动效的第四转场部分预设的转场图像帧数为b、以及对所述转场动效的第五转场部分预设的转场图像帧数为c,并且,The method according to claim 7, wherein the electronic device includes a preset transition image frame number for the third transition part of the transition motion effect, and a frame number for the transition motion effect The preset transition image frame number of the fourth transition part is b, and the preset transition image frame number of the fifth transition part of the transition motion effect is c, and,
    所述根据所述电子设备在第二拍摄模式下生成所述第二视频部分的第一帧图像所需的时间,确定生成的所述转场动效的各个部分的转场图像帧数,包括:According to the time required for the electronic device to generate the first frame image of the second video part in the second shooting mode, determine the number of transition image frames of each part of the transition motion effect generated, including :
    若在第二拍摄模式下生成所述第二视频部分的第一帧图像所需的时间大于生成所述第三转场部分所需的时间,则确定生成的所述转场动效的第三转场部分的转场图像帧数为a+x、第四转场部分的转场 图像帧数为b-y、以及第五转场部分的转场图像帧数为c-z,其中x=y+z、并且y<b、z<c。If the time required to generate the first frame image of the second video part in the second shooting mode is greater than the time required to generate the third transition part, determine the third transition motion effect generated The transition image frame number of the transition part is a+x, the transition image frame number of the fourth transition part is b-y, and the transition image frame number of the fifth transition part is c-z, wherein x=y+z, And y<b, z<c.
  9. 根据权利要求1至8中任一项所述的方法,其特征在于,所述转场动效的转场图像基于所述第一图像或所述第二图像添加动态变化效果处理得到。The method according to any one of claims 1 to 8, wherein the transition image of the transition motion effect is obtained by adding a dynamic change effect to the first image or the second image.
  10. 根据权利要求9所述的方法,其特征在于,所述动态变化效果包括下列中的至少一项:The method according to claim 9, wherein the dynamic change effect comprises at least one of the following:
    蒙版遮罩、模糊度渐变以及透明度渐变。Matte masks, blur gradients, and transparency gradients.
  11. 一种电子设备,其特征在于,包括:一个或多个处理器;一个或多个存储器;所述一个或多个存储器存储有一个或多个程序,当一个或者多个程序被所述一个或多个处理器执行时,使得所述电子设备执行权利要求1至10中任一项所述的转场动效生成方法。An electronic device, characterized in that it includes: one or more processors; one or more memories; the one or more memories store one or more programs, when the one or more programs are used by the one or more When executed by a plurality of processors, the electronic device is made to execute the transition motion effect generation method described in any one of claims 1 to 10.
  12. 一种计算机可读存储介质,其特征在于,所述存储介质上存储有指令,所述指令在计算机上执行时使所述计算机执行权利要求1至10中任一项所述的转场动效生成方法。A computer-readable storage medium, characterized in that instructions are stored on the storage medium, and when the instructions are executed on a computer, the computer executes the transition motion effect described in any one of claims 1 to 10 generate method.
  13. 一种计算机程序产品,其特征在于,包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现权利要求1至10中任一项所述的转场动效生成方法。A computer program product, characterized in that it includes a computer program/instruction, and when the computer program/instruction is executed by a processor, the method for generating a transition motion effect according to any one of claims 1 to 10 is implemented.
PCT/CN2022/143304 2022-02-24 2022-12-29 Transition animation generation method, electronic device, and storage medium WO2023160234A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210171604.7A CN114268741B (en) 2022-02-24 2022-02-24 Transition dynamic effect generation method, electronic device, and storage medium
CN202210171604.7 2022-02-24

Publications (1)

Publication Number Publication Date
WO2023160234A1 true WO2023160234A1 (en) 2023-08-31

Family

ID=80833626

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/143304 WO2023160234A1 (en) 2022-02-24 2022-12-29 Transition animation generation method, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN114268741B (en)
WO (1) WO2023160234A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114268741B (en) * 2022-02-24 2023-01-31 荣耀终端有限公司 Transition dynamic effect generation method, electronic device, and storage medium
CN117425065A (en) * 2022-07-06 2024-01-19 荣耀终端有限公司 Shooting method and related equipment
CN115272060A (en) * 2022-08-12 2022-11-01 北京字跳网络技术有限公司 Transition special effect diagram generation method, device, equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2464126A1 (en) * 2010-12-10 2012-06-13 Advanced Digital Broadcast S.A. A system and a method for transforming a 3D video sequence to a 2D video sequence
CN105069827A (en) * 2015-08-19 2015-11-18 北京中科大洋科技发展股份有限公司 Method for processing video transitions through three-dimensional model
CN109451360A (en) * 2018-11-02 2019-03-08 北京亿幕信息技术有限公司 Video transition effects method and engine
CN109688463A (en) * 2018-12-27 2019-04-26 北京字节跳动网络技术有限公司 A kind of editing video generation method, device, terminal device and storage medium
CN109788212A (en) * 2018-12-27 2019-05-21 北京奇艺世纪科技有限公司 A kind of processing method of segmenting video, device, terminal and storage medium
CN110062271A (en) * 2019-04-28 2019-07-26 腾讯科技(成都)有限公司 Method for changing scenes, device, terminal and storage medium
CN111083526A (en) * 2019-12-31 2020-04-28 广州酷狗计算机科技有限公司 Video transition method and device, computer equipment and storage medium
CN113422903A (en) * 2021-06-16 2021-09-21 荣耀终端有限公司 Photographing mode switching method, photographing mode switching apparatus, storage medium, and program product
CN113542802A (en) * 2021-07-09 2021-10-22 北京百度网讯科技有限公司 Video transition method and device
CN113596321A (en) * 2021-06-16 2021-11-02 荣耀终端有限公司 Transition dynamic effect generation method, apparatus, storage medium, and program product
CN114268741A (en) * 2022-02-24 2022-04-01 荣耀终端有限公司 Transition dynamic effect generation method, electronic device, and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109640019B (en) * 2018-12-13 2021-09-07 广州艾美网络科技有限公司 Method for recording and editing long video through mobile terminal
CN110113526A (en) * 2019-04-22 2019-08-09 联想(北京)有限公司 Processing method, processing unit and electronic equipment
CN112702656A (en) * 2020-12-21 2021-04-23 北京达佳互联信息技术有限公司 Video editing method and video editing device
CN112637573A (en) * 2020-12-23 2021-04-09 深圳市尊正数字视频有限公司 Multi-lens switching display method and system, intelligent terminal and storage medium
CN113052119B (en) * 2021-04-07 2024-03-15 兴体(广州)智能科技有限公司 Ball game tracking camera shooting method and system
CN113473005B (en) * 2021-06-16 2022-08-09 荣耀终端有限公司 Shooting transfer live-action insertion method, equipment and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2464126A1 (en) * 2010-12-10 2012-06-13 Advanced Digital Broadcast S.A. A system and a method for transforming a 3D video sequence to a 2D video sequence
CN105069827A (en) * 2015-08-19 2015-11-18 北京中科大洋科技发展股份有限公司 Method for processing video transitions through three-dimensional model
CN109451360A (en) * 2018-11-02 2019-03-08 北京亿幕信息技术有限公司 Video transition effects method and engine
CN109688463A (en) * 2018-12-27 2019-04-26 北京字节跳动网络技术有限公司 A kind of editing video generation method, device, terminal device and storage medium
CN109788212A (en) * 2018-12-27 2019-05-21 北京奇艺世纪科技有限公司 A kind of processing method of segmenting video, device, terminal and storage medium
CN110062271A (en) * 2019-04-28 2019-07-26 腾讯科技(成都)有限公司 Method for changing scenes, device, terminal and storage medium
CN111083526A (en) * 2019-12-31 2020-04-28 广州酷狗计算机科技有限公司 Video transition method and device, computer equipment and storage medium
CN113422903A (en) * 2021-06-16 2021-09-21 荣耀终端有限公司 Photographing mode switching method, photographing mode switching apparatus, storage medium, and program product
CN113596321A (en) * 2021-06-16 2021-11-02 荣耀终端有限公司 Transition dynamic effect generation method, apparatus, storage medium, and program product
CN113542802A (en) * 2021-07-09 2021-10-22 北京百度网讯科技有限公司 Video transition method and device
CN114268741A (en) * 2022-02-24 2022-04-01 荣耀终端有限公司 Transition dynamic effect generation method, electronic device, and storage medium

Also Published As

Publication number Publication date
CN114268741B (en) 2023-01-31
CN114268741A (en) 2022-04-01

Similar Documents

Publication Publication Date Title
WO2023160234A1 (en) Transition animation generation method, electronic device, and storage medium
CN110109636B (en) Screen projection method, electronic device and system
CN109191549B (en) Method and device for displaying animation
CN113473005B (en) Shooting transfer live-action insertion method, equipment and storage medium
KR102474088B1 (en) Method and device for compositing an image
WO2015196937A1 (en) Video recording method and device
US11949978B2 (en) Image content removal method and related apparatus
WO2022262313A1 (en) Picture-in-picture-based image processing method, device, storage medium, and program product
CN113422903A (en) Photographing mode switching method, photographing mode switching apparatus, storage medium, and program product
US20230305864A1 (en) Method for Displaying Plurality of Windows and Electronic Device
WO2022007862A1 (en) Image processing method, system, electronic device and computer readable storage medium
WO2022022019A1 (en) Screen projection data processing method and apparatus
US20230043815A1 (en) Image Processing Method and Electronic Device
CN113596321B (en) Method, device and storage medium for generating transition dynamic effect
CN112004041B (en) Video recording method, device, terminal and storage medium
CN115526787B (en) Video processing method and device
WO2023160295A1 (en) Video processing method and apparatus
CN113099146B (en) Video generation method and device and related equipment
EP4109879A1 (en) Image color retention method and device
WO2022262550A1 (en) Video photographing method and electronic device
CN113891008B (en) Exposure intensity adjusting method and related equipment
CN111294509A (en) Video shooting method, device, terminal and storage medium
WO2024082713A1 (en) Image rendering method and apparatus
CN116048323B (en) Image processing method and electronic equipment
CN117082295B (en) Image stream processing method, device and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22928473

Country of ref document: EP

Kind code of ref document: A1