WO2022193090A1 - 视频处理方法、电子设备及计算机可读存储介质 - Google Patents

视频处理方法、电子设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2022193090A1
WO2022193090A1 PCT/CN2021/080849 CN2021080849W WO2022193090A1 WO 2022193090 A1 WO2022193090 A1 WO 2022193090A1 CN 2021080849 W CN2021080849 W CN 2021080849W WO 2022193090 A1 WO2022193090 A1 WO 2022193090A1
Authority
WO
WIPO (PCT)
Prior art keywords
image frame
spliced
video
similarity
overlapping
Prior art date
Application number
PCT/CN2021/080849
Other languages
English (en)
French (fr)
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 深圳市大疆创新科技有限公司
Priority to PCT/CN2021/080849 priority Critical patent/WO2022193090A1/zh
Publication of WO2022193090A1 publication Critical patent/WO2022193090A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs

Definitions

  • the present application relates to the field of image processing, and in particular, to a video processing method, an electronic device, and a computer-readable storage medium.
  • the feature of a video with one shot to the end effect is that there is no lens switching, it looks like continuous shooting, and there is no pause and switch during the shooting process, and shooting a video with one shot to the end effect has higher requirements on the user's shooting level. Therefore, when shooting, ordinary users generally shoot multiple videos, and then stitch the multiple videos to obtain a video with a one-shot effect. However, during splicing, due to the movement of the lens and other reasons, the spliced video will have problems such as jitter and discontinuity, and the effect of one shot of the video is not good in the end.
  • the embodiments of the present application provide a video processing method, an electronic device, and a computer-readable storage medium, which aim to solve the problems of jitter and discontinuity in the video obtained by splicing.
  • an embodiment of the present application provides a video processing method, including:
  • the first image frame to be spliced and the second image frame to be spliced are spliced to obtain a target video by splicing the first video and the second video.
  • an embodiment of the present application further provides an electronic device, the electronic device includes a memory and a processor; the memory is used for storing a computer program;
  • the processor is configured to execute the computer program and implement the following steps when executing the computer program:
  • the first image frame to be spliced and the second image frame to be spliced are spliced to obtain a target video by splicing the first video and the second video.
  • embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the above-mentioned video processing method.
  • Embodiments of the present application provide a video processing method, an electronic device, and a computer-readable storage medium.
  • acquiring an overlapping image frame between a first video and a second video and determining the first image frame and the first image frame in the overlapping image frame the similarity between the two image frames, and then determine the first image frame to be spliced and the second image frame to be spliced from at least one overlapping image frame according to the similarity between the first image frame and the second image frame in the overlapping image frames image frame, and finally splicing the first image frame to be spliced with the second image frame to be spliced, to splicing the first video and the second video to obtain the target video, so that a smooth transition between multiple videos can be made to ensure that the video after splicing is smoother , which can effectively reduce the occurrence of image jitter or image jump after splicing multi-segment videos.
  • FIG. 1 is a schematic flowchart of steps of a video processing method provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a scene for implementing the video processing method provided by the embodiment of the present application
  • Fig. 3 is a schematic flow chart of a sub-step of the video processing method in Fig. 1;
  • Fig. 4 is another sub-step schematic flow chart of the video processing method in Fig. 1;
  • FIG. 5 is a schematic block diagram of the structure of an electronic device provided by an embodiment of the present application.
  • FIG. 1 is a schematic flowchart of steps of a video processing method provided by an embodiment of the present application.
  • the video processing method can be applied to electronic equipment for splicing multiple videos, so that the transition between multiple videos can be smooth, ensuring that the spliced video is smoother, and effectively reducing the occurrence of image jitter or image jumping after splicing multiple videos.
  • the electronic device may include a mobile phone, a tablet computer, a notebook computer, a PC computer, or a server, etc.
  • the video processing method includes steps S101 to S105.
  • Step S101 acquiring a first video and a second video, wherein at least part of the image frames of the first video and the second video overlap.
  • the electronic device displays a video splicing page, where the video splicing page displays multiple pieces of video and prompt information, the prompt information is used to prompt the user to select at least part of the image frames of the multiple pieces of video to overlap;
  • the first video and the second video are obtained locally, or the first video and the second video are downloaded from the server or the drone in response to the user's video selection operation on the video splicing page.
  • the drone 100 is connected to the electronic device 200 in communication.
  • the drone 100 includes a body 110 , a power system 120 provided on the body 110 , a photographing device 130 , and a control system (not shown in FIG. 1 ) .
  • the power system 120 is used for providing moving power for the UAV 100
  • the photographing device 130 is used for shooting images or videos.
  • the drone 100 stores a plurality of videos obtained by shooting by the photographing device 130, and the electronic device 200 displays a video splicing page.
  • the video splicing page displays a plurality of videos obtained by the photographing device 130, in response to the user's video selection operation on the video splicing page.
  • the video download request carries the first video identification and the second video identification, after the drone 100 receives the video download request sent by the electronic device 200, based on the first video identification to the
  • the electronic device transmits the first video, and transmits the second video to the electronic device based on the second video identification.
  • the power system 120 may include one or more propellers 121 , one or more motors 122 corresponding to the one or more propellers, and one or more electronic governors (referred to as ESCs for short).
  • the motor 122 is connected between the electronic governor and the propeller 121, and the motor 122 and the propeller 121 are arranged on the body 110 of the UAV 100; the electronic governor is used to receive the driving signal generated by the control system, and provide the driving signal according to the driving signal.
  • Driving current is supplied to the motor 122 to control the rotational speed of the motor 122 .
  • the motor 122 is used to drive the propeller 121 to rotate, thereby providing power for the movement of the UAV 100, and the power enables the UAV 100 to achieve one or more degrees of freedom movement.
  • the drone 100 may rotate about one or more axes of rotation.
  • the above-mentioned rotation axes may include a roll axis, a yaw axis, and a pitch axis.
  • the motor 122 may be a DC motor or an AC motor.
  • the motor 122 may be a brushless motor or a brushed motor.
  • the control system may include a controller and a sensing system.
  • the sensing system is used to measure the attitude information of the movable platform, that is, the position information and state information of the UAV 100 in space, such as three-dimensional position, three-dimensional angle, three-dimensional velocity, three-dimensional acceleration and three-dimensional angular velocity.
  • the sensing system may include at least one of a gyroscope, an ultrasonic sensor, an electronic compass, an inertial measurement unit (Inertial Measurement Unit, IMU), a visual sensor, a global navigation satellite system, a barometer, and other sensors.
  • the global navigation satellite system may be the Global Positioning System (GPS).
  • the controller is used to control the flight of the UAV 100, for example, the flight of the UAV 100 can be controlled according to the attitude information measured by the sensing system. It should be understood that the controller can control the UAV 100 according to pre-programmed instructions.
  • the first video includes 100 image frames
  • the second video includes 150 image frames
  • the 100th image frame in the first video overlaps with the first image frame in the second video
  • the The 100th image frame and the first image frame in the second video are determined as overlapping image frames between the first video and the second video, that is, there is an overlapping image frame between the first video and the second video.
  • the 99th image frame in the first video overlaps with the 1st image frame in the second video, and the 100th image frame in the first video overlaps with the 2nd image frame in the second video
  • the 99th image frame in the first video and the first image frame in the second video are determined as the first overlapping image frame
  • the 100th image frame in the first video and the second image in the second video are determined as the first overlapping image frame.
  • the frame is determined to be the second overlapping image frame, that is, there are two overlapping image frames between the first video and the second video.
  • Step S102 Acquire at least one overlapping image frame between the first video and the second video.
  • the first shooting time of the first video and the second shooting time of the second video are obtained; if the first shooting time is earlier than the second shooting time, the reciprocal first image frames in the first video are obtained. , and acquire a plurality of positive second image frames in the second video; determine the overlapping image frames between the first video and the second video from the plurality of first image frames and the plurality of second image frames.
  • the 96th image frame, 97 image frames, 98 image frames, 99 image frames and 100 image frames get the 1st image frame, the 2nd image frame, the 3rd image frame, the 4th image in the second video frame and 5 image frames, then based on the 96th image frame in the first video, the 97th image frame, the 98th image frame, the 99th image frame, the 100th image frame, the 1st image frame in the second video image frames, the second image frame, the third image frame, the fourth image frame, and the five image frames, determine the overlapping image frames between the first video and the second video.
  • Step S103 Determine the similarity between a first image frame and a second image frame in the overlapping image frames, where the first video includes the first image frame, and the second video includes the second image frame.
  • the first video includes 100 image frames
  • the second video includes 150 image frames
  • the first image frame in the overlapping image frame is the first image frame.
  • the 100th image frame in the video, the second image frame in the overlapping image frame is the first image frame in the second video, then it is determined that the 100th image frame in the first video is the same as the second image frame in the second video. Similarity between 1 image frame.
  • the first video includes 100 image frames
  • the second video includes 150 image frames
  • the first image frame in one overlapping image frame is the first image frame.
  • the 99th image frame in a video, and the second image frame in the overlapping image frame is the first image frame in the second video
  • the first image frame in the other overlapping image frame is the first image frame in the first video
  • the 100th image frame, and the second image frame in the overlapping image frame is the second image frame in the second video, then determine the 99th image frame in the first video and the first image frame in the second video. similarity between image frames, and determining the similarity between the 100th image frame in the first video and the second image frame in the second video.
  • step S103 may include: sub-steps S1031 to S1032.
  • Sub-step S1031 Acquire the shooting angle and brightness information of the first image frame and the second image frame and/or the state information of the target object located in the first image frame and the second image frame.
  • the state information of the target object includes a state identifier, outline, color, and position of the target object in the first image frame or the second image frame, and the state identifier is used to indicate whether the state of the target object is a moving state or a still state state, the target object includes pets, people, buildings, etc.
  • Sub-step S1032 Determine the similarity between the first image frame and the second image frame according to the shooting angle, the brightness information and/or the state information.
  • the first similarity between the first image frame and the second image frame is determined according to the shooting angles of the first image frame and the second image frame; according to the brightness of the first image frame and the second image frame information, determine the second similarity between the first image frame and the second image frame; determine the first image frame and the second image according to the state information of the target object located in the first image frame and the second image frame a third degree of similarity between frames; determining the degree of similarity between the first image frame and the second image frame according to the first degree of similarity, the second degree of similarity and/or the third degree of similarity.
  • the method of determining the similarity between the first image frame and the second image frame may be: The second similarity or the third similarity is determined as the final similarity between the first image frame and the second image frame; or, according to the first similarity and the second similarity, the first image frame and the second image frame are determined or, according to the first similarity and the third similarity, determine the final similarity between the first image frame and the second image frame; or, according to the second similarity and the third similarity, Determine the final similarity between the first image frame and the second image frame; or, determine the final similarity between the first image frame and the second image frame according to the first similarity, the second similarity and the third similarity Spend.
  • the average similarity is determined according to the first similarity, the second similarity and the third similarity, and the average similarity is determined as the final similarity between the first image frame and the second image frame .
  • obtain the first weight coefficient, the second weight coefficient, and the third weight coefficient perform a multiplication operation on the first weight coefficient and the first similarity to obtain the first weighted similarity, and perform a multiplication operation on the second weight coefficient and the second similarity
  • the multiplication operation is performed to obtain the second weighted similarity, the third weighted coefficient and the third similarity are multiplied to obtain the third weighted similarity, and the first weighted similarity, the second weighted similarity and the third weighted similarity are accumulated, Obtain the final similarity between the first image frame and the second image frame.
  • the first weight coefficient, the second weight coefficient, and the third weight coefficient may be set based on actual conditions, which are not specifically limited in this embodiment of the present application, and the difference between the first weight coefficient, the second weight coefficient, and the third weight coefficient
  • the deviation between the shooting angle of the first image frame and the shooting angle of the second image frame is determined, the shooting angle deviation is obtained, and the shooting angle deviation is obtained according to the preset mapping relationship between the shooting angle deviation and the similarity.
  • Angle deviation determine the first similarity between the first image frame and the second image frame; determine the deviation between the brightness of the first image frame and the brightness of the second image frame, obtain the brightness deviation, and determine the brightness according to the preset brightness
  • the mapping relationship between the deviation and the similarity and the brightness deviation determine the second similarity between the first image frame and the second image frame; determine the relationship between the state information of the first image frame and the state information of the second image frame; The deviation is obtained, the state information deviation is obtained, and the third similarity between the first image frame and the second image frame is determined according to the preset mapping relationship between the state information deviation and the similarity and the state information deviation.
  • the first grayscale histogram of the first image frame and the second grayscale histogram of the second image frame are obtained; according to the weight of each grayscale in the first grayscale histogram, the first grayscale histogram The number of pixels corresponding to each grayscale in the figure and the number of pixels corresponding to each grayscale in the second grayscale histogram determine the similarity between the first image frame and the second image frame.
  • Step S104 Determine a first image frame to be spliced and a second image frame to be spliced from the at least one overlapping image frame according to the similarity.
  • the similarity is greater than or equal to the preset similarity; if the similarity is greater than or equal to the preset similarity, the first image frame is determined as the first image to be spliced frame, and the second image frame is determined as the second image frame to be spliced.
  • the preset similarity may be set based on the actual situation, which is not specifically limited in this embodiment of the present application. For example, the preset similarity is 80%.
  • the first video includes 100 image frames
  • the second video includes 150 image frames
  • the first image frame in the overlapping image frame is the first image frame.
  • the 100th image frame in the video, the second image frame in the overlapping image frame is the first image frame in the second video
  • the 100th image frame in the first video is the same as the first image frame in the second video. If the similarity between the two image frames is greater than the preset similarity, the 100th image frame in the first video is determined as the first image frame to be spliced, and the first image frame in the second video is determined as the first image frame to be spliced. Two image frames to be stitched.
  • the target overlapping image frame is determined from the multiple overlapping image frames according to the similarity of the multiple overlapping image frames; the first image frame in the target overlapping image frame is determined. is the first image frame to be spliced, and the second image frame in the target overlapping image frame is determined as the second image frame to be spliced.
  • the method for determining the target overlapping image frame may be: obtaining the maximum similarity among the multiple similarities; and determining the overlapping image frame corresponding to the maximum similarity among the multiple overlapping image frames as the target overlapping image frame. Further, if the maximum similarity is greater than or equal to the preset similarity, the overlapping image frame corresponding to the maximum similarity among the multiple overlapping image frames is determined as the target overlapping image frame.
  • the first video includes 100 image frames
  • the second video includes 150 image frames
  • the first image frame in one overlapping image frame is the first image frame.
  • the 99th image frame in the video, and the second image frame in the overlapping image frame is the first image frame in the second video
  • the first image frame in the other overlapping image frame is the first image frame in the first video.
  • the second image frame in the overlapping image frame is the second image frame in the second video
  • the 99th image frame in the first video and the first image frame in the second video The similarity between them is greater than the similarity between the 100th image frame in the first video and the second image frame in the second video, then the 99th image frame in the first video is determined as the first
  • the image frames are spliced
  • the first image frame in the second video is determined as the second image frame to be spliced.
  • the similarity between the 99th image frame in the first video and the first image frame in the second video is greater than or equal to the preset similarity, and the 100th image frame in the first video is similar to the first image frame in the second video.
  • the similarity between the second image frames in the second video is also greater than or equal to the preset similarity, then the 99th image frame in the first video is determined as the first image frame to be spliced, and the image frame in the second video is determined as the first image frame to be spliced
  • the first image frame in the video is determined as the second image frame to be spliced, or the 100th image frame in the first video is determined as the first image frame to be spliced, and the second image frame in the second video is determined is the second image frame to be spliced.
  • the deviation between the first image frame and the second image frame is determined. ; According to the deviation between the first image frame and the second image frame, the first image frame and/or the second image frame are processed; The processed first image frame is determined as the first image frame to be spliced, and the The second image frame is determined as the second image frame to be spliced; alternatively, the first image frame is determined as the first image frame to be spliced, and the processed second image frame is determined as the second image frame to be spliced; or, the The processed first image frame is determined as the first image frame to be spliced, and the processed second image frame is determined as the second image frame to be spliced.
  • the dissimilar first image frame and the second image frame can be adjusted to be similar to facilitate subsequent video splicing, thereby improving the smoothness of
  • the first attribute information of the first image frame is obtained, and the first attribute information includes the first shooting angle and the first brightness of the first image frame; the second attribute information of the second image frame is obtained, and the second attribute information The information includes the second shooting angle and the second brightness of the second image frame; according to the first attribute information and the second attribute information, the deviation between the first image frame and the second image frame is determined, that is, the difference between the first attribute information and the second image frame is determined.
  • the deviation between the two attribute information, and the deviation between the first attribute information and the second attribute information is determined as the deviation between the first image frame and the second image frame.
  • the first image frame or the second image frame is cropped and/or deformed, so that the processed first image frame and the second image frame have the same shooting angle; and/ Or adjust the brightness of the first image frame or the second image frame according to the brightness deviation, so that the adjusted first image frame and the second image frame have the same brightness.
  • the dissimilar first image frame and the second image frame can be adjusted to be similar to facilitate subsequent video splicing, thereby improving the smoothness of the video.
  • Step S105 splicing the first image frame to be spliced and the second image frame to be spliced to obtain a target video by splicing the first video and the second video.
  • the first image frame to be spliced is the 100th image frame in the first video
  • the second image frame to be spliced is the first image frame in the second video
  • the 100th image frame in the first video Splicing with the first image frame in the second video to obtain the target video by splicing the first video and the second video.
  • the first image frame to be spliced is the 99th image frame in the first video
  • the second image frame to be spliced is the first image frame in the second video
  • the 99th image in the first video is The frame is spliced with the first image frame in the second video to obtain the target video by splicing the first video and the second video.
  • At least one compensation image frame between the first image frame to be spliced and the second image frame to be spliced is determined; the first image frame to be spliced and the second image frame to be spliced are spliced based on the at least one compensation image frame,
  • the target video is obtained by splicing the first video and the second video.
  • step S105 may include: sub-steps S1051 to S1052.
  • Sub-step S1051 determining at least one compensation image frame between the first image frame to be spliced and the second image frame to be spliced;
  • Sub-step S1052 splicing the first image frame to be spliced and the second image frame to be spliced based on the at least one compensation image frame, so as to splicing the first video and the second video to obtain a target video.
  • the first image frame to be spliced and the second image frame to be spliced are input into a preset generative adversarial network to obtain at least one compensation image frame.
  • the preset generative adversarial network is obtained by iteratively training the generative adversarial network based on sample data, and the sample data includes the first sample image, the second sample image, and the marked difference between the first sample image and the second sample image. Compensate image frame.
  • a compensation image frame between the first image frame to be spliced and the second image frame to be spliced can be generated by a preset generative adversarial network, which is convenient for subsequent video splicing.
  • the motion vector of the first image frame relative to the second image frame is determined, that is, the motion trajectory between the first image frame and the second image frame, such as the motion distance and the motion direction, is estimated, so as to establish a subsequent pair of motion vectors.
  • a necessary basis for smooth splicing of the first video and the second video according to the motion vector, at least one compensation image frame between the first image frame to be spliced and the second image frame to be spliced is determined.
  • at least one compensation image frame can be determined according to the motion vector, and evolution compensation is performed on the first image frame according to the at least one compensation image frame, so that the first image frame can be slowly and smoothly transitioned to the first image frame. Two image frames, to achieve smooth splicing of the first image frame and the second image frame.
  • the first image frame and the second image frame are respectively subjected to horizontal deformation and vertical deformation;
  • the horizontal movement distance is to determine the first movement distance of the first image frame in the horizontal direction; according to the vertical movement distance of the longitudinally deformed first image frame relative to the longitudinally deformed second image frame, determine the vertical movement distance of the first image frame.
  • the second movement distance in the direction; the movement vector is determined according to the first movement distance, the second movement distance and the preset deformation ratio.
  • the preset deformation ratio includes a lateral deformation ratio and a longitudinal deformation ratio
  • the lateral deformation ratio and the longitudinal deformation ratio are the same or different.
  • Deformation and longitudinal deformation including: according to the lateral deformation ratio, the first image frame and the second image frame are respectively subjected to lateral deformation to obtain the corresponding first laterally deformed image frame and the second laterally deformed image frame, and the first laterally deformed image frame and The second laterally deformed image frame is parallel in the horizontal direction and the two ends are aligned; the first and second image frames are respectively longitudinally deformed according to the longitudinal deformation ratio to obtain the corresponding first longitudinally deformed image frame and the second longitudinally deformed image frame, the first longitudinally deformed image frame and the second longitudinally deformed image frame are parallel in the vertical direction and both ends are aligned.
  • the original horizontal height of the first image frame is the same as the original horizontal height of the second image frame, and the original vertical height of the first image frame is the same as the original vertical height of the second image frame, so the width of the first horizontally deformed image frame is equal to
  • the width of the second laterally deformed image frame is the same, and the height of the first laterally deformed image frame is the same as the height of the second laterally deformed image frame.
  • the original horizontal height of the first image frame is the same as the original horizontal height of the second image frame, and the original vertical height of the first image frame is the same as the original vertical height of the second image frame, so the width of the first vertically deformed image frame is the same as that of the second image frame.
  • the widths of the longitudinally deformed image frames are the same, and the height of the first longitudinally deformed image frame is the same as the height of the second longitudinally deformed image frame.
  • the above-mentioned X pixels are between the first laterally deformed image frame and the second laterally deformed image frame after moving in the horizontal direction, and when there is no corresponding part in the vertical direction, the first laterally deformed image The total number of pixels moved by the frame.
  • the above-mentioned movement in the horizontal direction may be a horizontal left movement or a horizontal right movement, which is not specifically limited in this embodiment of the present application.
  • the above-mentioned Y pixels are between the first laterally deformed image frame and the second laterally deformed image frame after moving in the vertical direction, and if there is no corresponding part in the horizontal direction, the first longitudinally deformed image The total number of pixels moved by the frame.
  • the above-mentioned movement in the vertical direction may be vertically downward or vertical upward, which is not specifically limited in this embodiment of the present application.
  • the video processing method provided by the above-mentioned embodiment, by acquiring the overlapping image frame between the first video and the second video, and determining the similarity between the first image frame and the second image frame in the overlapping image frame, and then according to the overlapping
  • the similarity between the first image frame and the second image frame in the image frames, the first image frame to be spliced and the second image frame to be spliced are determined from at least one overlapping image frame, and finally the first image frame to be spliced and the image frame to be spliced are determined.
  • the second to-be-spliced image frame is spliced to obtain the target video by splicing the first video and the second video, so that a smooth transition between multiple videos can be performed, ensuring that the spliced video is smoother, and effectively reducing the image jitter or image after splicing of multiple videos. The occurrence of jumps, etc.
  • FIG. 5 is a schematic structural block diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device 300 includes a processor 301 and a memory 302, and the processor 301 and the memory 302 are connected through a bus 303, such as an I2C (Inter-integrated Circuit) bus.
  • a bus 303 such as an I2C (Inter-integrated Circuit) bus.
  • the processor 301 may be a micro-controller unit (Micro-controller Unit, MCU), a central processing unit (Central Processing Unit, CPU) or a digital signal processor (Digital Signal Processor, DSP) or the like.
  • MCU Micro-controller Unit
  • CPU Central Processing Unit
  • DSP Digital Signal Processor
  • the memory 302 may be a Flash chip, a read-only memory (ROM, Read-Only Memory) magnetic disk, an optical disk, a U disk, a mobile hard disk, and the like.
  • ROM Read-Only Memory
  • the memory 302 may be a Flash chip, a read-only memory (ROM, Read-Only Memory) magnetic disk, an optical disk, a U disk, a mobile hard disk, and the like.
  • the processor 301 is used for running the computer program stored in the memory 302, and implements the following steps when executing the computer program:
  • the first image frame to be spliced and the second image frame to be spliced are spliced to obtain a target video by splicing the first video and the second video.
  • the overlapping image frames include a first image frame located in the first video and a second image frame located in the second video, and the processor is implemented to determine the number of images in the overlapping image frames.
  • the similarity between the first image frame and the second image frame is used to achieve:
  • the similarity between the first image frame and the second image frame is determined according to the shooting angle, the brightness information and/or the state information.
  • the state information of the target object includes a state identifier, outline, color, and position of the target object in the first image frame or the second image frame, and the state identifier is used to indicate the Describe whether the state of the target object is a moving state or a static state.
  • the processor determines the similarity between the first image frame and the second image frame according to the shooting angle, the brightness information and the state information, use To achieve:
  • the similarity between the first image frame and the second image frame is determined according to the first similarity, the second similarity and the third similarity.
  • the processor when the processor determines the first image frame to be spliced and the second image frame to be spliced from the at least one overlapping image frame according to the similarity, the processor is configured to implement:
  • the first image frame is determined as the first image frame to be spliced, and the second image frame is determined as the second image frame to be spliced .
  • the processor when the processor determines the first image frame to be spliced and the second image frame to be spliced from the at least one overlapping image frame according to the similarity, the processor is configured to implement:
  • the first image frame in the target overlapping image frame is determined as the first image frame to be spliced
  • the second image frame in the target overlapping image frame is determined as the second image frame to be spliced.
  • the processor when the processor determines a target overlapping image frame from a plurality of the overlapping image frames according to a plurality of the similarities, the processor is configured to:
  • the overlapping image frame corresponding to the maximum similarity among the plurality of overlapping image frames is determined as the target overlapping image frame.
  • the processor determines the overlapped image frame corresponding to the maximum similarity among the multiple overlapped image frames as the target overlapped image frame, the processor is configured to:
  • the overlapping image frame corresponding to the maximum similarity among the plurality of overlapping image frames is determined as the target overlapping image frame.
  • the processor when the processor determines a target overlapping image frame from a plurality of the overlapping image frames according to a plurality of the similarities, the processor is configured to:
  • Any one of the overlapping image frames corresponding to the similarity degree of the plurality of overlapping image frames is greater than or equal to a preset similarity is determined as a target overlapping image frame.
  • the processor is further configured to implement the following steps:
  • the processed first image frame is determined as the first image frame to be spliced
  • the processed second image frame is determined as the second image frame to be spliced.
  • the processor when the processor determines the deviation between the first image frame and the second image frame, the processor is configured to:
  • first attribute information of the first image frame includes a first shooting angle and a first brightness of the first image frame
  • the second attribute information includes a second shooting angle and a second brightness of the second image frame
  • a deviation between the first image frame and the second image frame is determined.
  • the deviation includes at least one of a shooting angle deviation and a brightness deviation, and when the processor processes the first image frame or the second image frame according to the deviation , which is used to implement:
  • the brightness of the first image frame or the second image frame is adjusted, so that the adjusted first image frame and the second image frame have the same brightness.
  • the processor when implementing the splicing of the first image frame to be spliced and the second image frame to be spliced, the processor is used to implement:
  • the first image frame to be spliced and the second image frame to be spliced are spliced to obtain a target video by splicing the first video and the second video.
  • the processor determines at least one compensation image frame between the first image frame to be spliced and the second image frame to be spliced, the processor is configured to:
  • At least one compensation image frame between the first image frame to be spliced and the second image frame to be spliced is determined.
  • the processor determines at least one compensation image frame between the first image frame to be spliced and the second image frame to be spliced, the processor is configured to:
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program includes program instructions, and the processor executes the program instructions to realize the provision of the above embodiments.
  • the steps of the video processing method are described in detail below.
  • the computer-readable storage medium may be an internal storage unit of the electronic device described in any of the foregoing embodiments, such as a hard disk or a memory of the electronic device.
  • the computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the electronic device ) card, Flash Card, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

一种视频处理方法、电子设备及计算机可读存储介质,其中该方法包括:获取第一视频和第二视频,其中,第一视频和第二视频的至少部分图像帧重叠(S101);获取第一视频和第二视频之间的至少一个重叠图像帧(S102);确定重叠图像帧中的第一图像帧与第二图像帧之间的相似度,第一视频包括第一图像帧,第二视频包括所述第二图像帧(S103);根据相似度,从至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧(S104);对第一待拼接图像帧与第二待拼接图像帧进行拼接,以拼接第一视频和第二视频得到目标视频(S105)。该方法能够解决拼接得到视频存在抖动和不连续等问题。

Description

视频处理方法、电子设备及计算机可读存储介质 技术领域
本申请涉及图像处理领域,尤其涉及一种视频处理方法、电子设备及计算机可读存储介质。
背景技术
具有一镜到底效果的视频的特点是没有镜头的切换,看起来像是连续拍摄,拍摄过程中没有停顿和切换,而拍摄具有一镜到底效果的视频对用户的拍摄水平有较高的要求。因此,普通用户在拍摄时,一般会拍摄多段视频,然后对多段视频进行拼接,从而得到具有一镜到底效果的视频。然而,在拼接时,由于镜头的移动等原因,会导致拼接得到视频存在抖动和不连续等问题,视频的一镜到底效果不好。
发明内容
基于此,本申请实施例提供了一种视频处理方法、电子设备及计算机可读存储介质,旨在解决拼接得到视频存在抖动和不连续等问题。
第一方面,本申请实施例提供了一种视频处理方法,包括:
获取第一视频和第二视频,其中,所述第一视频和所述第二视频的至少部分图像帧重叠;
获取所述第一视频和所述第二视频之间的至少一个重叠图像帧;
确定所述重叠图像帧中的第一图像帧与第二图像帧之间的相似度,所述第一视频包括所述第一图像帧,所述第二视频包括所述第二图像帧;
根据所述相似度,从所述至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧;
对所述第一待拼接图像帧与所述第二待拼接图像帧进行拼接,以拼接所述第一视频和所述第二视频得到目标视频。
第二方面,本申请实施例还提供了一种电子设备,所述电子设备包括存储器和处理器;所述存储器用于存储计算机程序;
所述处理器,用于执行所述计算机程序并在执行所述计算机程序时,实现如下步骤:
获取第一视频和第二视频,其中,所述第一视频和所述第二视频的至少部 分图像帧重叠;
获取所述第一视频和所述第二视频之间的至少一个重叠图像帧;
确定所述重叠图像帧中的第一图像帧与第二图像帧之间的相似度,所述第一视频包括所述第一图像帧,所述第二视频包括所述第二图像帧;
根据所述相似度,从所述至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧;
对所述第一待拼接图像帧与所述第二待拼接图像帧进行拼接,以拼接所述第一视频和所述第二视频得到目标视频。
第三方面,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如上所述的视频处理方法。
本申请实施例提供了一种视频处理方法、电子设备及计算机可读存储介质,通过获取第一视频与第二视频之间的重叠图像帧,并确定重叠图像帧中的第一图像帧与第二图像帧之间的相似度,然后根据重叠图像帧中的第一图像帧与第二图像帧之间的相似度,从至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧,最后对第一待拼接图像帧与第二待拼接图像帧进行拼接,以拼接第一视频和第二视频得到目标视频,使得多段视频之间可以平滑过渡,确保拼接后的视频更加平滑,有效减少多段视频拼接后的图像抖动或图像跳变等情况的发生。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种视频处理方法的步骤示意流程图;
图2是实施本申请实施例提供的视频处理方法的一场景示意图;
图3是图1中的视频处理方法的一子步骤示意流程图;
图4是图1中的视频处理方法的另一子步骤示意流程图;
图5是本申请实施例提供的一种电子设备的结构示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。
请参阅图1,图1是本申请实施例提供的一种视频处理方法的步骤示意流程图。该视频处理方法可以应用于电子设备,用于拼接多段视频,使得多段视频之间可以平滑过渡,确保拼接后的视频更加平滑,有效减少多段视频拼接后的图像抖动或图像跳变等情况的发生,电子设备可以包括手机、平板电脑、笔记本电脑、PC电脑,也可以包括服务器等。
如图1所示,该视频处理方法包括步骤S101至步骤S105。
步骤S101、获取第一视频和第二视频,其中,所述第一视频和所述第二视频的至少部分图像帧重叠。
示例性的,电子设备显示视频拼接页面,该视频拼接页面显示有多段视频和提示信息,该提示信息用于提示用户选择的多段视频的至少部分图像帧重叠;响应于用户对视频拼接页面的视频选取操作,从本地获取第一视频和第二视频,或者,响应于用户对视频拼接页面的视频选取操作,从服务器或无人机中下载第一视频和第二视频。
如图2所示,无人机100与电子设备200通信连接,无人机100包括机体110、设于机体110上的动力系统120、拍摄装置130、和控制系统(图1中未示出)。其中,动力系统120用于为无人机100提供移动动力,拍摄装置130用于拍摄图像或视频。无人机100存储有通过拍摄装置130拍摄得到的多段视频,电子设备200显示视频拼接页面,该视频拼接页面显示有拍摄装置130拍摄得到的多段视频,响应于用户对视频拼接页面的视频选取操作,向无人机100发送视频下载请求,该视频下载请求携带有第一视频标识和第二视频标识,无人机100在接收到电子设备200发送的视频下载请求后,基于第一视频标识向 电子设备传输第一视频,并基于第二视频标识向电子设备传输第二视频。
在一实施例中,动力系统120可以包括一个或多个螺旋桨121、与一个或多个螺旋桨相对应的一个或多个电机122、一个或多个电子调速器(简称为电调)。其中,电机122连接在电子调速器与螺旋桨121之间,电机122和螺旋桨121设置在无人机100的机体110上;电子调速器用于接收控制系统产生的驱动信号,并根据驱动信号提供驱动电流给电机122,以控制电机122的转速。电机122用于驱动螺旋桨121旋转,从而为无人机100的移动提供动力,该动力使得无人机100能够实现一个或多个自由度的运动。在某些实施例中,无人机100可以围绕一个或多个旋转轴旋转。例如,上述旋转轴可以包括横滚轴、偏航轴和俯仰轴。应理解,电机122可以是直流电机,也可以交流电机。另外,电机122可以是无刷电机,也可以是有刷电机。
其中,控制系统可以包括控制器和传感系统。传感系统用于测量可移动平台的姿态信息,即无人机100在空间的位置信息和状态信息,例如,三维位置、三维角度、三维速度、三维加速度和三维角速度等。传感系统例如可以包括陀螺仪、超声传感器、电子罗盘、惯性测量单元(Inertial Measurement Unit,IMU)、视觉传感器、全球导航卫星系统和气压计等传感器中的至少一种。例如,全球导航卫星系统可以是全球定位系统(Global Positioning System,GPS)。控制器用于控制无人机100的飞行,例如,可以根据传感系统测量的姿态信息控制无人机100的飞行。应理解,控制器可以按照预先编好的程序指令对无人机100进行控制。
例如,第一视频包括100个图像帧,第二视频包括150个图像帧,第一视频中的第100个图像帧与第二视频中的第1个图像帧重叠,则将第一视频中的第100个图像帧和第二视频中的第1个图像帧确定为第一视频和第二视频之间的重叠图像帧,也即第一视频与第二视频之间存在一个重叠图像帧。
或者,第一视频中的第99个图像帧与第二视频中的第1个图像帧重叠,第一视频中的第100个图像帧与第二视频中的第2个图像帧重叠,则将第一视频中的第99个图像帧与第二视频中的第1个图像帧确定为第一重叠图像帧,将第一视频中的第100个图像帧与第二视频中的第2个图像帧确定为第二重叠图像帧,也即第一视频与第二视频之间存在两个重叠图像帧。
步骤S102、获取所述第一视频和所述第二视频之间的至少一个重叠图像帧。
示例性的,获取第一视频的第一拍摄时刻和第二视频的第二拍摄时刻;若第一拍摄时刻早于第二拍摄时刻,则获取第一视频中的倒数的多个第一图像帧, 并获取第二视频中的正数的多个第二图像帧;从多个第一图像帧和多个第二图像帧中确定第一视频与第二视频之间的重叠图像帧。
例如,第一视频包括100个图像帧,第二视频包括150个图像帧,且第一视频的拍摄时刻早于第二视频的拍摄时刻,则获取第一视频中的第96个图像帧、第97个图像帧、第98个图像帧、第99个图像帧和100个图像帧,获取第二视频中的第1个图像帧、第2个图像帧、第3个图像帧、第4个图像帧和5个图像帧,然后基于第一视频中的第96个图像帧、第97个图像帧、第98个图像帧、第99个图像帧、100个图像帧、第二视频中的第1个图像帧、第2个图像帧、第3个图像帧、第4个图像帧和5个图像帧,确定第一视频与第二视频之间的重叠图像帧。
步骤S103、确定所述重叠图像帧中的第一图像帧与第二图像帧之间的相似度,所述第一视频包括所述第一图像帧,所述第二视频包括所述第二图像帧。
例如,第一视频包括100个图像帧,第二视频包括150个图像帧,且第一视频与第二视频之间仅有一个重叠图像帧,该重叠图像帧中的第一图像帧为第一视频中的第100个图像帧,该重叠图像帧中的第二图像帧为第二视频中的第1个图像帧,则确定第一视频中的第100个图像帧与第二视频中的第1个图像帧之间的相似度。
又例如,第一视频包括100个图像帧,第二视频包括150个图像帧,且第一视频与第二视频之间有两个重叠图像帧,一个重叠图像帧中的第一图像帧为第一视频中的第99个图像帧,且该重叠图像帧中的第二图像帧为第二视频中的第1个图像帧,另一个重叠图像帧中的第一图像帧为第一视频中的第100个图像帧,且该重叠图像帧中的第二图像帧为第二视频中的第2个图像帧,则确定第一视频中的第99个图像帧与第二视频中的第1个图像帧之间的相似度,以及确定第一视频中的第100个图像帧与第二视频中的第2个图像帧之间的相似度。
在一实施例中,如图3所示,步骤S103可以包括:子步骤S1031至S1032。
子步骤S1031、获取所述第一图像帧和所述第二图像帧的拍摄角度、亮度信息和/或位于所述第一图像帧和所述第二图像帧中的目标对象的状态信息。
其中,目标对象的状态信息包括目标对象的状态标识符、轮廓、颜色、在第一图像帧或第二图像帧中的位置,该状态标识符用于指示目标对象的状态是运动状态,还是静止状态,该目标对象包括宠物、人、建筑物等。
子步骤S1032、根据所述拍摄角度、所述亮度信息和/或所述状态信息,确定所述第一图像帧与所述第二图像帧之间的相似度。
在一实施例中,根据第一图像帧和第二图像帧的拍摄角度,确定第一图像帧与第二图像帧之间的第一相似度;根据第一图像帧和第二图像帧的亮度信息,确定第一图像帧与所述第二图像帧之间的第二相似度;根据位于第一图像帧和第二图像帧中的目标对象的状态信息,确定第一图像帧与第二图像帧之间的第三相似度;根据第一相似度、第二相似度和/或第三相似度,确定第一图像帧与第二图像帧之间的相似度。
在一实施例中,根据第一相似度、第二相似度和/或第三相似度,确定第一图像帧与第二图像帧之间的相似度的方式可以为:将第一相似度、第二相似度或第三相似度确定为第一图像帧与第二图像帧之间的最终相似度;或者,根据第一相似度和第二相似度,确定第一图像帧与第二图像帧之间的最终相似度;或者,根据第一相似度和第三相似度,确定第一图像帧与第二图像帧之间的最终相似度;或者,根据第二相似度和第三相似度,确定第一图像帧与第二图像帧之间的最终相似度;或者,根据第一相似度、第二相似度和第三相似度,确定第一图像帧与第二图像帧之间的最终相似度。通过综合考虑图像帧的拍摄角度、所述亮度信息和状态信息,可以提高相似度的准确性。
在一实施例中,根据第一相似度、第二相似度和第三相似度,确定平均相似度,并将该平均相似度确定为第一图像帧与第二图像帧之间的最终相似度。或者,获取第一权重系数、第二权重系数、第三权重系数;对第一权重系数与第一相似度进行乘法运算,得到第一加权相似度,对第二权重系数与第二相似度进行乘法运算,得到第二加权相似度,对第三权重系数与第三相似度进行乘法运算,得到第三加权相似度,累加第一加权相似度、第二加权相似度和第三加权相似度,得到第一图像帧与第二图像帧之间的最终相似度。其中,第一权重系数、第二权重系数、第三权重系数可以基于实际情况进行设置,本申请实施例对此不做具体限定,且第一权重系数、第二权重系数与第三权重系数之和等于1。
在一实施例中,确定第一图像帧的拍摄角度与第二图像帧的拍摄角度之间的偏差,得到拍摄角度偏差,并根据预设的拍摄角度偏差与相似度之间的映射关系和拍摄角度偏差,确定第一图像帧与第二图像帧之间的第一相似度;确定第一图像帧的亮度和第二图像帧的亮度之间的偏差,得到亮度偏差,并根据预设的亮度偏差与相似度之间的映射关系和亮度偏差,确定第一图像帧与第二图像帧之间的第二相似度;确定第一图像帧的状态信息和第二图像帧的状态信息之间的偏差,得到状态信息偏差,并根据预设的状态信息偏差与相似度之间的 映射关系和状态信息偏差,确定第一图像帧与第二图像帧之间的第三相似度。
在一实施例中,获取第一图像帧的第一灰度直方图和第二图像帧的第二灰度直方图;根据第一灰度直方图中各个灰度的权重、第一灰度直方图中各个灰度对应的像素个数及第二灰度直方图中各个灰度对应的像素个数,确定第一图像帧与第二图像帧之间的相似度。
步骤S104、根据所述相似度,从所述至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧。
在一实施例中,在重叠图像帧为一个时,确定相似度是否大于或等于预设相似度;若相似度大于或等于预设相似度,则将第一图像帧确定为第一待拼接图像帧,并将第二图像帧确定为第二待拼接图像帧。其中,预设相似度可基于实际情况进行设置,本申请实施例对此不做具体限定。例如,预设相似度为80%。
例如,第一视频包括100个图像帧,第二视频包括150个图像帧,且第一视频与第二视频之间仅有一个重叠图像帧,该重叠图像帧中的第一图像帧为第一视频中的第100个图像帧,该重叠图像帧中的第二图像帧为第二视频中的第1个图像帧,且第一视频中的第100个图像帧与第二视频中的第1个图像帧之间的相似度大于预设相似度,则将第一视频中的第100个图像帧确定为第一待拼接图像帧,并将第二视频中的第1个图像帧确定为第二待拼接图像帧。
在一实施例中,在重叠图像帧为多个时,根据多个重叠图像帧的相似度,从多个重叠图像帧中确定目标重叠图像帧;将目标重叠图像帧中的第一图像帧确定为第一待拼接图像帧,并将目标重叠图像帧中的第二图像帧确定为第二待拼接图像帧。其中,目标重叠图像帧的确定方式可以为:获取多个相似度中的最大相似度;将多个重叠图像帧中的最大相似度对应的重叠图像帧确定为目标重叠图像帧。进一步地,若最大相似度大于或等于预设相似度,则将多个重叠图像帧中的最大相似度对应的重叠图像帧确定为目标重叠图像帧。
例如,第一视频包括100个图像帧,第二视频包括150个图像帧,且第一视频与第二视频之间有两个重叠图像帧,一个重叠图像帧中的第一图像帧为第一视频中的第99个图像帧,且该重叠图像帧中的第二图像帧为第二视频中的第1个图像帧,另一个重叠图像帧中的第一图像帧为第一视频中的第100个图像帧,且该重叠图像帧中的第二图像帧为第二视频中的第2个图像帧,且第一视频中的第99个图像帧与第二视频中的第1个图像帧之间的相似度大于第一视频中的第100个图像帧与第二视频中的第2个图像帧之间的相似度,则将第一视频中的第99个图像帧确定为第一待拼接图像帧,并将第二视频中的第1个图像 帧确定为第二待拼接图像帧。
又例如,第一视频中的第99个图像帧与第二视频中的第1个图像帧之间的相似度大于或等于预设相似度,且第一视频中的第100个图像帧与第二视频中的第2个图像帧之间的相似度也大于或等于预设相似度,则将第一视频中的第99个图像帧确定为第一待拼接图像帧,并将第二视频中的第1个图像帧确定为第二待拼接图像帧,或者,将第一视频中的第100个图像帧确定为第一待拼接图像帧,并将第二视频中的第2个图像帧确定为第二待拼接图像帧。
在一实施例中,若每个重叠图像帧中的第一图像帧与第二图像帧之间的相似度均小于预设相似度,则确定第一图像帧与第二图像帧之间的偏差;根据第一图像帧与第二图像帧之间的偏差,对第一图像帧和/或第二图像帧进行处理;将处理后的第一图像帧确定为第一待拼接图像帧,并将第二图像帧确定为第二待拼接图像帧;或者,将第一图像帧确定为第一待拼接图像帧,并将处理后的第二图像帧确定为第二待拼接图像帧;或者,将处理后的第一图像帧确定为第一待拼接图像帧,并将处理后的第二图像帧确定为第二待拼接图像帧。通过对第一图像帧和/或第二图像帧进行处理,可以将不相似的第一图像帧与第二图像帧调整为相似,便于后续拼接视频,从而提高视频的平滑性。
在一实施例中,获取第一图像帧的第一属性信息,第一属性信息包括第一图像帧的第一拍摄角度和第一亮度;获取第二图像帧的第二属性信息,第二属性信息包括第二图像帧的第二拍摄角度和第二亮度;根据第一属性信息和第二属性信息,确定第一图像帧与第二图像帧之间的偏差,即确定第一属性信息与第二属性信息之间的偏差,并将第一属性信息与第二属性信息之间的偏差确定为第一图像帧与第二图像帧之间的偏差。通过两个图像帧的属性信息,可以准确的确定两个图像帧之间的偏差。
在一实施例中,根据拍摄角度偏差,对第一图像帧或第二图像帧进行裁剪和/或形变处理,以使处理后的第一图像帧与第二图像帧的拍摄角度相同;和/或根据亮度偏差,调整第一图像帧或第二图像帧的亮度,以使调整后的第一图像帧与第二图像帧的亮度相同。通过对第一图像帧和/或第二图像帧进行处理,可以将不相似的第一图像帧与第二图像帧调整为相似,便于后续拼接视频,从而提高视频的平滑性。
步骤S105、对所述第一待拼接图像帧与所述第二待拼接图像帧进行拼接,以拼接所述第一视频和所述第二视频得到目标视频。
例如,第一待拼接图像帧为第一视频中的第100个图像帧,第二待拼接图 像帧为第二视频中的第1个图像帧,则对第一视频中的第100个图像帧与第二视频中的第1个图像帧进行拼接,以拼接第一视频和第二视频得到目标视频。又例如,第一待拼接图像帧为第一视频中的第99个图像帧,第二待拼接图像帧为第二视频中的第1个图像帧,则对第一视频中的第99个图像帧与第二视频中的第1个图像帧进行拼接,以拼接第一视频和第二视频得到目标视频。
在一实施例中,确定第一待拼接图像帧与第二待拼接图像帧之间的至少一个补偿图像帧;基于至少一个补偿图像帧拼接第一待拼接图像帧与第二待拼接图像帧,以拼接第一视频和第二视频得到目标视频。通过至少一个补偿图像帧拼接第一待拼接图像帧与第二待拼接图像帧,可以进一步地提高拼接得到的视频的平滑性。
在一实施例中,如图4所示,步骤S105可以包括:子步骤S1051至S1052。
子步骤S1051、确定所述第一待拼接图像帧与所述第二待拼接图像帧之间的至少一个补偿图像帧;
子步骤S1052、基于所述至少一个补偿图像帧拼接所述第一待拼接图像帧与所述第二待拼接图像帧,以拼接所述第一视频和所述第二视频得到目标视频。
在一实施例中,将第一待拼接图像帧和第二待拼接图像帧输入预设生成对抗网络,得到至少一个补偿图像帧。其中,预设生成对抗网络为基于样本数据对生成对抗网络进行迭代训练得到的,该样本数据包括第一样本图像、第二样本图像、标注的第一样本图像与第二样本图像之间补偿图像帧。通过预设生成对抗网络可以生成第一待拼接图像帧与第二待拼接图像帧之间的补偿图像帧,便于后续拼接视频。
在一实施例中,确定第一图像帧相对于第二图像帧的运动向量,即估计第一图像帧与第二图像帧之间的运动轨迹,例如运动距离与运动方向等,从而奠定后续对第一视频与第二视频进行平滑拼接的必要基础;根据该运动向量,确定第一待拼接图像帧与第二待拼接图像帧之间的至少一个补偿图像帧。在确定运动向量之后,可以根据该运动向量,确定至少一个补偿图像帧,并根据至少一个补偿图像帧,对第一图像帧进行演化补偿,使得可以由第一图像帧慢慢地平滑过渡为第二图像帧,实现第一图像帧与第二图像帧的平滑拼接。
在一实施例中,基于预设形变比率,对第一图像帧与第二图像帧分别进行横向形变与纵向形变;根据横向形变后的第一图像帧相对于横向形变后的第二图像帧的水平移动距离,确定第一图像帧在水平方向上的第一运动距离;根据纵向形变后的第一图像帧相对于纵向形变后的第二图像帧的垂直移动距离,确 定第一图像帧在垂直方向上的第二运动距离;根据第一运动距离、第二运动距离以及预设形变比率,确定运动向量。
在一实施例中,预设形变比率包括横向形变比率与纵向形变比率,横向形变比率与纵向形变比率相同或者不相同,基于预设形变比率,对第一图像帧与第二图像帧分别进行横向形变与纵向形变,包括:根据横向形变比率对第一图像帧与第二图像帧分别进行横向形变,得到相应的第一横向形变图像帧与第二横向形变图像帧,第一横向形变图像帧与第二横向形变图像帧在水平方向上平行且两端对齐;根据纵向形变比率对第一图像帧与第二图像帧分别进行纵向形变,得到相应的第一纵向形变图像帧与第二纵向形变图像帧,第一纵向形变图像帧与第二纵向形变图像帧在垂直方向上平行且两端对齐。
其中,第一图像帧的原始横向高度与第二图像帧的原始横向高度相同,第一图像帧的原始纵向高度与第二图像帧的原始纵向高度相同,于是第一横向形变图像帧的宽度与第二横向形变图像帧的宽度相同,第一横向形变图像帧的高度与第二横向形变图像帧的高度相同。第一图像帧的原始横向高度与第二图像帧的原始横向高度相同,第一图像帧的原始纵向高度与第二图像帧的原始纵向高度相同,于是第一纵向形变图像帧的宽度与第二纵向形变图像帧的宽度相同,第一纵向形变图像帧的高度与第二纵向形变图像帧的高度相同。
在一实施例中,在根据横向形变后的第一图像帧相对于横向形变后的第二图像帧的水平移动距离,确定第一图像帧在水平方向上的第一运动距离的过程中,可以将第一横向形变图像帧相对于第二横向形变图像帧在水平方向上移动多次,共移动X个像素点,X为正整数,并计算每次移动后的第一横向形变图像帧与第二横向形变图像帧之间在垂直方向上的相对应部分的第一差异值。其中,上述的X个像素点为在水平方向上移动后的第一横向形变图像帧与第二横向形变图像帧之间,在垂直方向上不存在相对应部分的情况下,第一横向形变图像帧总共移动的像素点数。上述在水平方向上的移动可以为水平左移,也可以为水平右移,本申请实施例对此不做具体限制。
在一实施例中,在根据纵向形变后的第一图像帧相对于纵向形变后的第二图像帧的水平移动距离,确定第一图像帧在垂直方向上的第一运动距离的过程中,可以将第一纵向形变图像帧相对于第二纵向形变图像帧在垂直方向上移动多次,共移动Y个像素点,Y为正整数,并计算每次移动后的第一纵向形变图像帧与第二纵向形变图像帧之间在水平方向上的相对应部分的第二差异值。其中,上述的Y个像素点为在垂直方向上移动后的第一横向形变图像帧与第二横 向形变图像帧之间,在水平方向上不存在相对应部分的情况下,第一纵向形变图像帧总共移动的像素点数。上述在垂直方向上的移动可以为垂直向下,也可以为垂直向上,本申请实施例对此不做具体限制。
上述实施例提供的视频处理方法,通过获取第一视频与第二视频之间的重叠图像帧,并确定重叠图像帧中的第一图像帧与第二图像帧之间的相似度,然后根据重叠图像帧中的第一图像帧与第二图像帧之间的相似度,从至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧,最后对第一待拼接图像帧与第二待拼接图像帧进行拼接,以拼接第一视频和第二视频得到目标视频,使得多段视频之间可以平滑过渡,确保拼接后的视频更加平滑,有效减少多段视频拼接后的图像抖动或图像跳变等情况的发生。
请参阅图5,图5是本申请实施例提供的一种电子设备的结构示意性框图。
如图5所示,该电子设备300包括处理器301和存储器302,处理器301和存储器302通过总线303连接,该总线303比如为I2C(Inter-integrated Circuit)总线。
具体地,处理器301可以是微控制单元(Micro-controller Unit,MCU)、中央处理单元(Central Processing Unit,CPU)或数字信号处理器(Digital Signal Processor,DSP)等。
具体地,存储器302可以是Flash芯片、只读存储器(ROM,Read-Only Memory)磁盘、光盘、U盘或移动硬盘等。
其中,所述处理器301用于运行存储在存储器302中的计算机程序,并在执行所述计算机程序时实现如下步骤:
获取第一视频和第二视频,其中,所述第一视频和所述第二视频的至少部分图像帧重叠;
获取所述第一视频和所述第二视频之间的至少一个重叠图像帧;
确定所述重叠图像帧中的第一图像帧与第二图像帧之间的相似度,所述第一视频包括所述第一图像帧,所述第二视频包括所述第二图像帧;
根据所述相似度,从所述至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧;
对所述第一待拼接图像帧与所述第二待拼接图像帧进行拼接,以拼接所述第一视频和所述第二视频得到目标视频。
在一实施例中,所述重叠图像帧包括位于所述第一视频的第一图像帧和位于所述第二视频的第二图像帧,所述处理器在实现确定所述重叠图像帧中的第 一图像帧与第二图像帧之间的相似度时,用于实现:
获取所述第一图像帧和所述第二图像帧的拍摄角度、亮度信息和/或位于所述第一图像帧和所述第二图像帧中的目标对象的状态信息;
根据所述拍摄角度、所述亮度信息和/或所述状态信息,确定所述第一图像帧与所述第二图像帧之间的相似度。
在一实施例中,所述目标对象的状态信息包括所述目标对象的状态标识符、轮廓、颜色、在第一图像帧或第二图像帧中的位置,所述状态标识符用于指示所述目标对象的状态是运动状态,还是静止状态。
在一实施例中,所述处理器在实现根据所述拍摄角度、所述亮度信息和所述状态信息,确定所述第一图像帧与所述第二图像帧之间的相似度时,用于实现:
根据所述第一图像帧和所述第二图像帧的拍摄角度,确定所述第一图像帧与所述第二图像帧之间的第一相似度;
根据所述第一图像帧和所述第二图像帧的亮度信息,确定所述第一图像帧与所述第二图像帧之间的第二相似度;
根据位于所述第一图像帧和所述第二图像帧中的目标对象的状态信息,确定所述第一图像帧与所述第二图像帧之间的第三相似度;
根据所述第一相似度、第二相似度和第三相似度,确定所述第一图像帧与所述第二图像帧之间的所述相似度。
在一实施例中,所述处理器在实现根据所述相似度,从所述至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧时,用于实现:
在所述重叠图像帧为一个时,确定所述相似度是否大于或等于预设相似度;
若所述相似度大于或等于预设相似度,则将所述第一图像帧确定为所述第一待拼接图像帧,并将所述第二图像帧确定为所述第二待拼接图像帧。
在一实施例中,所述处理器在实现根据所述相似度,从所述至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧时,用于实现:
在所述重叠图像帧为多个时,根据多个所述相似度,从多个所述重叠图像帧中确定目标重叠图像帧;
将所述目标重叠图像帧中的第一图像帧确定为所述第一待拼接图像帧,并将所述目标重叠图像帧中的第二图像帧确定为所述第二待拼接图像帧。
在一实施例中,所述处理器在实现根据多个所述相似度,从多个所述重叠图像帧中确定目标重叠图像帧时,用于实现:
获取多个所述相似度中的最大相似度;
将多个所述重叠图像帧中的所述最大相似度对应的重叠图像帧确定为目标重叠图像帧。
在一实施例中,所述处理器在实现将多个所述重叠图像帧中的所述最大相似度对应的重叠图像帧确定为目标重叠图像帧时,用于实现:
若所述最大相似度大于或等于预设相似度,则将多个所述重叠图像帧中的所述最大相似度对应的重叠图像帧确定为目标重叠图像帧。
在一实施例中,所述处理器在实现根据多个所述相似度,从多个所述重叠图像帧中确定目标重叠图像帧时,用于实现:
将多个所述重叠图像帧中的所述相似度大于或等于预设相似度对应的任一所述重叠图像帧确定为目标重叠图像帧。
在一实施例中,所述处理器还用于实现以下步骤:
若所述相似度小于预设相似度,则确定所述第一图像帧与所述第二图像帧之间的偏差;
根据所述偏差,对所述第一图像帧和/或所述第二图像帧进行处理;
将处理后的第一图像帧确定为第一待拼接图像帧,并将所述第二图像帧确定为第二待拼接图像帧;
或者,将所述第一图像帧确定为第一待拼接图像帧,并将处理后的第二图像帧确定为第二待拼接图像帧;
或者,将处理后的第一图像帧确定为第一待拼接图像帧,并将处理后的第二图像帧确定为第二待拼接图像帧。
在一实施例中,所述处理器在实现确定所述第一图像帧与所述第二图像帧之间的偏差时,用于实现:
获取所述第一图像帧的第一属性信息,所述第一属性信息包括所述第一图像帧的第一拍摄角度和第一亮度;
获取所述第二图像帧的第二属性信息,所述第二属性信息包括所述第二图像帧的第二拍摄角度和第二亮度;
根据所述第一属性信息和所述第二属性信息,确定所述第一图像帧与所述第二图像帧之间的偏差。
在一实施例中,所述偏差包括拍摄角度偏差和亮度偏差中的至少一种,所述处理器在实现根据所述偏差,对所述第一图像帧或所述第二图像帧进行处理时,用于实现:
根据所述拍摄角度偏差,对所述第一图像帧或所述第二图像帧进行裁剪和/或形变处理,以使处理后的第一图像帧与第二图像帧的拍摄角度相同;
和/或
根据所述亮度偏差,调整所述第一图像帧或第二图像帧的亮度,以使调整后的第一图像帧与第二图像帧的亮度相同。
在一实施例中,所述处理器在实现对所述第一待拼接图像帧与所述第二待拼接图像帧进行拼接时,用于实现:
确定所述第一待拼接图像帧与所述第二待拼接图像帧之间的至少一个补偿图像帧;
基于所述至少一个补偿图像帧拼接所述第一待拼接图像帧与所述第二待拼接图像帧,以拼接所述第一视频和所述第二视频得到目标视频。
在一实施例中,所述处理器在实现确定所述第一待拼接图像帧与所述第二待拼接图像帧之间的至少一个补偿图像帧时,用于实现:
确定所述第一待拼接图像帧相对于所述第二待拼接图像的运动向量;
根据所述运动向量,确定所述第一待拼接图像帧与所述第二待拼接图像帧之间的至少一个补偿图像帧。
在一实施例中,所述处理器在实现确定所述第一待拼接图像帧与所述第二待拼接图像帧之间的至少一个补偿图像帧时,用于实现:
将所述第一待拼接图像帧和所述第二待拼接图像帧输入预设生成对抗网络,得到所述至少一个补偿图像帧。
需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的电子设备的具体工作过程,可以参考前述视频处理方法实施例中的对应过程,在此不再赘述。
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序中包括程序指令,所述处理器执行所述程序指令,实现上述实施例提供的视频处理方法的步骤。
其中,所述计算机可读存储介质可以是前述任一实施例所述的电子设备的内部存储单元,例如所述电子设备的硬盘或内存。所述计算机可读存储介质也可以是所述电子设备的外部存储设备,例如所述电子设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。
应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例 的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (31)

  1. 一种视频处理方法,其特征在于,包括:
    获取第一视频和第二视频,其中,所述第一视频和所述第二视频的至少部分图像帧重叠;
    获取所述第一视频和所述第二视频之间的至少一个重叠图像帧;
    确定所述重叠图像帧中的第一图像帧与第二图像帧之间的相似度,所述第一视频包括所述第一图像帧,所述第二视频包括所述第二图像帧;
    根据所述相似度,从所述至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧;
    对所述第一待拼接图像帧与所述第二待拼接图像帧进行拼接,以拼接所述第一视频和所述第二视频得到目标视频。
  2. 根据权利要求1所述的视频处理方法,其特征在于,所述重叠图像帧包括位于所述第一视频的第一图像帧和位于所述第二视频的第二图像帧,所述确定所述重叠图像帧中的第一图像帧与第二图像帧之间的相似度,包括:
    获取所述第一图像帧和所述第二图像帧的拍摄角度、亮度信息和/或位于所述第一图像帧和所述第二图像帧中的目标对象的状态信息;
    根据所述拍摄角度、所述亮度信息和/或所述状态信息,确定所述第一图像帧与所述第二图像帧之间的相似度。
  3. 根据权利要求2所述的视频处理方法,其特征在于,所述目标对象的状态信息包括所述目标对象的状态标识符、轮廓、颜色、在第一图像帧或第二图像帧中的位置,所述状态标识符用于指示所述目标对象的状态是运动状态,还是静止状态。
  4. 根据权利要求2所述的视频处理方法,其特征在于,所述根据所述拍摄角度、所述亮度信息和所述状态信息,确定所述第一图像帧与所述第二图像帧之间的相似度,包括:
    根据所述第一图像帧和所述第二图像帧的拍摄角度,确定所述第一图像帧与所述第二图像帧之间的第一相似度;
    根据所述第一图像帧和所述第二图像帧的亮度信息,确定所述第一图像帧与所述第二图像帧之间的第二相似度;
    根据位于所述第一图像帧和所述第二图像帧中的目标对象的状态信息,确定所述第一图像帧与所述第二图像帧之间的第三相似度;
    根据所述第一相似度、第二相似度和第三相似度,确定所述第一图像帧与所述第二图像帧之间的所述相似度。
  5. 根据权利要求1所述的视频处理方法,其特征在于,所述根据所述相似度,从所述至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧,包括:
    在所述重叠图像帧为一个时,确定所述相似度是否大于或等于预设相似度;
    若所述相似度大于或等于预设相似度,则将所述第一图像帧确定为所述第一待拼接图像帧,并将所述第二图像帧确定为所述第二待拼接图像帧。
  6. 根据权利要求1所述的视频处理方法,其特征在于,所述根据所述相似度,从所述至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧,包括:
    在所述重叠图像帧为多个时,根据多个所述相似度,从多个所述重叠图像帧中确定目标重叠图像帧;
    将所述目标重叠图像帧中的第一图像帧确定为所述第一待拼接图像帧,并将所述目标重叠图像帧中的第二图像帧确定为所述第二待拼接图像帧。
  7. 根据权利要求6所述的视频处理方法,其特征在于,所述根据多个所述相似度,从多个所述重叠图像帧中确定目标重叠图像帧,包括:
    获取多个所述相似度中的最大相似度;
    将多个所述重叠图像帧中的所述最大相似度对应的重叠图像帧确定为目标重叠图像帧。
  8. 根据权利要求7所述的视频处理方法,其特征在于,所述将多个所述重叠图像帧中的所述最大相似度对应的重叠图像帧确定为目标重叠图像帧,包括:
    若所述最大相似度大于或等于预设相似度,则将多个所述重叠图像帧中的所述最大相似度对应的重叠图像帧确定为目标重叠图像帧。
  9. 根据权利要求6所述的视频处理方法,其特征在于,所述根据多个所述相似度,从多个所述重叠图像帧中确定目标重叠图像帧,包括:
    将多个所述重叠图像帧中的所述相似度大于或等于预设相似度对应的任一所述重叠图像帧确定为目标重叠图像帧。
  10. 根据权利要求1-9中任一项所述的视频处理方法,其特征在于,所述方法还包括:
    若所述相似度小于预设相似度,则确定所述第一图像帧与所述第二图像帧之间的偏差;
    根据所述偏差,对所述第一图像帧和/或所述第二图像帧进行处理;
    将处理后的第一图像帧确定为第一待拼接图像帧,并将所述第二图像帧确定为第二待拼接图像帧;
    或者,将所述第一图像帧确定为第一待拼接图像帧,并将处理后的第二图像帧确定为第二待拼接图像帧;
    或者,将处理后的第一图像帧确定为第一待拼接图像帧,并将处理后的第二图像帧确定为第二待拼接图像帧。
  11. 根据权利要求10所述的视频处理方法,其特征在于,所述确定所述第一图像帧与所述第二图像帧之间的偏差,包括:
    获取所述第一图像帧的第一属性信息,所述第一属性信息包括所述第一图像帧的第一拍摄角度和第一亮度;
    获取所述第二图像帧的第二属性信息,所述第二属性信息包括所述第二图像帧的第二拍摄角度和第二亮度;
    根据所述第一属性信息和所述第二属性信息,确定所述第一图像帧与所述第二图像帧之间的偏差。
  12. 根据权利要求10所述的视频处理方法,其特征在于,所述偏差包括拍摄角度偏差和亮度偏差中的至少一种,所述根据所述偏差,对所述第一图像帧或所述第二图像帧进行处理,包括:
    根据所述拍摄角度偏差,对所述第一图像帧或所述第二图像帧进行裁剪和/或形变处理,以使处理后的第一图像帧与第二图像帧的拍摄角度相同;
    和/或
    根据所述亮度偏差,调整所述第一图像帧或第二图像帧的亮度,以使调整后的第一图像帧与第二图像帧的亮度相同。
  13. 根据权利要求1-9中任一项所述的视频处理方法,其特征在于,所述对所述第一待拼接图像帧与所述第二待拼接图像帧进行拼接,包括:
    确定所述第一待拼接图像帧与所述第二待拼接图像帧之间的至少一个补偿图像帧;
    基于所述至少一个补偿图像帧拼接所述第一待拼接图像帧与所述第二待拼接图像帧,以拼接所述第一视频和所述第二视频得到目标视频。
  14. 根据权利要求13所述的视频处理方法,其特征在于,所述确定所述第一待拼接图像帧与所述第二待拼接图像帧之间的至少一个补偿图像帧,包括:
    确定所述第一待拼接图像帧相对于所述第二待拼接图像的运动向量;
    根据所述运动向量,确定所述第一待拼接图像帧与所述第二待拼接图像帧之间的至少一个补偿图像帧。
  15. 根据权利要求13所述的视频处理方法,其特征在于,所述确定所述第一待拼接图像帧与所述第二待拼接图像帧之间的至少一个补偿图像帧,包括:
    将所述第一待拼接图像帧和所述第二待拼接图像帧输入预设生成对抗网络,得到所述至少一个补偿图像帧。
  16. 一种电子设备,其特征在于,所述电子设备包括存储器和处理器;
    所述存储器用于存储计算机程序;
    所述处理器,用于执行所述计算机程序并在执行所述计算机程序时,实现如下步骤:
    获取第一视频和第二视频,其中,所述第一视频和所述第二视频的至少部分图像帧重叠;
    获取所述第一视频和所述第二视频之间的至少一个重叠图像帧;
    确定所述重叠图像帧中的第一图像帧与第二图像帧之间的相似度,所述第一视频包括所述第一图像帧,所述第二视频包括所述第二图像帧;
    根据所述相似度,从所述至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧;
    对所述第一待拼接图像帧与所述第二待拼接图像帧进行拼接,以拼接所述第一视频和所述第二视频得到目标视频。
  17. 根据权利要求16所述的电子设备,其特征在于,所述重叠图像帧包括位于所述第一视频的第一图像帧和位于所述第二视频的第二图像帧,所述处理器在实现确定所述重叠图像帧中的第一图像帧与第二图像帧之间的相似度时,用于实现:
    获取所述第一图像帧和所述第二图像帧的拍摄角度、亮度信息和/或位于所述第一图像帧和所述第二图像帧中的目标对象的状态信息;
    根据所述拍摄角度、所述亮度信息和/或所述状态信息,确定所述第一图像帧与所述第二图像帧之间的相似度。
  18. 根据权利要求17所述的电子设备,其特征在于,所述目标对象的状态信息包括所述目标对象的状态标识符、轮廓、颜色、在第一图像帧或第二图像帧中的位置,所述状态标识符用于指示所述目标对象的状态是运动状态,还是静止状态。
  19. 根据权利要求17所述的电子设备,其特征在于,所述处理器在实现根 据所述拍摄角度、所述亮度信息和所述状态信息,确定所述第一图像帧与所述第二图像帧之间的相似度时,用于实现:
    根据所述第一图像帧和所述第二图像帧的拍摄角度,确定所述第一图像帧与所述第二图像帧之间的第一相似度;
    根据所述第一图像帧和所述第二图像帧的亮度信息,确定所述第一图像帧与所述第二图像帧之间的第二相似度;
    根据位于所述第一图像帧和所述第二图像帧中的目标对象的状态信息,确定所述第一图像帧与所述第二图像帧之间的第三相似度;
    根据所述第一相似度、第二相似度和第三相似度,确定所述第一图像帧与所述第二图像帧之间的所述相似度。
  20. 根据权利要求16所述的电子设备,其特征在于,所述处理器在实现根据所述相似度,从所述至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧时,用于实现:
    在所述重叠图像帧为一个时,确定所述相似度是否大于或等于预设相似度;
    若所述相似度大于或等于预设相似度,则将所述第一图像帧确定为所述第一待拼接图像帧,并将所述第二图像帧确定为所述第二待拼接图像帧。
  21. 根据权利要求16所述的电子设备,其特征在于,所述处理器在实现根据所述相似度,从所述至少一个重叠图像帧中确定第一待拼接图像帧和第二待拼接图像帧时,用于实现:
    在所述重叠图像帧为多个时,根据多个所述相似度,从多个所述重叠图像帧中确定目标重叠图像帧;
    将所述目标重叠图像帧中的第一图像帧确定为所述第一待拼接图像帧,并将所述目标重叠图像帧中的第二图像帧确定为所述第二待拼接图像帧。
  22. 根据权利要求21所述的电子设备,其特征在于,所述处理器在实现根据多个所述相似度,从多个所述重叠图像帧中确定目标重叠图像帧时,用于实现:
    获取多个所述相似度中的最大相似度;
    将多个所述重叠图像帧中的所述最大相似度对应的重叠图像帧确定为目标重叠图像帧。
  23. 根据权利要求22所述的电子设备,其特征在于,所述处理器在实现将多个所述重叠图像帧中的所述最大相似度对应的重叠图像帧确定为目标重叠图像帧时,用于实现:
    若所述最大相似度大于或等于预设相似度,则将多个所述重叠图像帧中的所述最大相似度对应的重叠图像帧确定为目标重叠图像帧。
  24. 根据权利要求21所述的电子设备,其特征在于,所述处理器在实现根据多个所述相似度,从多个所述重叠图像帧中确定目标重叠图像帧时,用于实现:
    将多个所述重叠图像帧中的所述相似度大于或等于预设相似度对应的任一所述重叠图像帧确定为目标重叠图像帧。
  25. 根据权利要求16-24中任一项所述的电子设备,其特征在于,所述处理器还用于实现以下步骤:
    若所述相似度小于预设相似度,则确定所述第一图像帧与所述第二图像帧之间的偏差;
    根据所述偏差,对所述第一图像帧和/或所述第二图像帧进行处理;
    将处理后的第一图像帧确定为第一待拼接图像帧,并将所述第二图像帧确定为第二待拼接图像帧;
    或者,将所述第一图像帧确定为第一待拼接图像帧,并将处理后的第二图像帧确定为第二待拼接图像帧;
    或者,将处理后的第一图像帧确定为第一待拼接图像帧,并将处理后的第二图像帧确定为第二待拼接图像帧。
  26. 根据权利要求25所述的电子设备,其特征在于,所述处理器在实现确定所述第一图像帧与所述第二图像帧之间的偏差时,用于实现:
    获取所述第一图像帧的第一属性信息,所述第一属性信息包括所述第一图像帧的第一拍摄角度和第一亮度;
    获取所述第二图像帧的第二属性信息,所述第二属性信息包括所述第二图像帧的第二拍摄角度和第二亮度;
    根据所述第一属性信息和所述第二属性信息,确定所述第一图像帧与所述第二图像帧之间的偏差。
  27. 根据权利要求25所述的电子设备,其特征在于,所述偏差包括拍摄角度偏差和亮度偏差中的至少一种,所述处理器在实现根据所述偏差,对所述第一图像帧或所述第二图像帧进行处理时,用于实现:
    根据所述拍摄角度偏差,对所述第一图像帧或所述第二图像帧进行裁剪和/或形变处理,以使处理后的第一图像帧与第二图像帧的拍摄角度相同;
    和/或
    根据所述亮度偏差,调整所述第一图像帧或第二图像帧的亮度,以使调整后的第一图像帧与第二图像帧的亮度相同。
  28. 根据权利要求16-24中任一项所述的电子设备,其特征在于,所述处理器在实现对所述第一待拼接图像帧与所述第二待拼接图像帧进行拼接时,用于实现:
    确定所述第一待拼接图像帧与所述第二待拼接图像帧之间的至少一个补偿图像帧;
    基于所述至少一个补偿图像帧拼接所述第一待拼接图像帧与所述第二待拼接图像帧,以拼接所述第一视频和所述第二视频得到目标视频。
  29. 根据权利要求28所述的电子设备,其特征在于,所述处理器在实现确定所述第一待拼接图像帧与所述第二待拼接图像帧之间的至少一个补偿图像帧时,用于实现:
    确定所述第一待拼接图像帧相对于所述第二待拼接图像的运动向量;
    根据所述运动向量,确定所述第一待拼接图像帧与所述第二待拼接图像帧之间的至少一个补偿图像帧。
  30. 根据权利要求28所述的电子设备,其特征在于,所述处理器在实现确定所述第一待拼接图像帧与所述第二待拼接图像帧之间的至少一个补偿图像帧时,用于实现:
    将所述第一待拼接图像帧和所述第二待拼接图像帧输入预设生成对抗网络,得到所述至少一个补偿图像帧。
  31. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如权利要求1-15中任一项所述的视频处理方法。
PCT/CN2021/080849 2021-03-15 2021-03-15 视频处理方法、电子设备及计算机可读存储介质 WO2022193090A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/080849 WO2022193090A1 (zh) 2021-03-15 2021-03-15 视频处理方法、电子设备及计算机可读存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/080849 WO2022193090A1 (zh) 2021-03-15 2021-03-15 视频处理方法、电子设备及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2022193090A1 true WO2022193090A1 (zh) 2022-09-22

Family

ID=83321587

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/080849 WO2022193090A1 (zh) 2021-03-15 2021-03-15 视频处理方法、电子设备及计算机可读存储介质

Country Status (1)

Country Link
WO (1) WO2022193090A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140111605A1 (en) * 2012-10-22 2014-04-24 National Chung Cheng University Low-complexity panoramic image and video stitching method
CN105635602A (zh) * 2015-12-31 2016-06-01 天津大学 一种采用两路视频间亮度和色偏对视频拼接的系统及其调整方法
CN111294644A (zh) * 2018-12-07 2020-06-16 腾讯科技(深圳)有限公司 视频拼接方法、装置、电子设备及计算机存储介质
CN111640187A (zh) * 2020-04-20 2020-09-08 中国科学院计算技术研究所 一种基于插值过渡的视频拼接方法及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140111605A1 (en) * 2012-10-22 2014-04-24 National Chung Cheng University Low-complexity panoramic image and video stitching method
CN105635602A (zh) * 2015-12-31 2016-06-01 天津大学 一种采用两路视频间亮度和色偏对视频拼接的系统及其调整方法
CN111294644A (zh) * 2018-12-07 2020-06-16 腾讯科技(深圳)有限公司 视频拼接方法、装置、电子设备及计算机存储介质
CN111640187A (zh) * 2020-04-20 2020-09-08 中国科学院计算技术研究所 一种基于插值过渡的视频拼接方法及系统

Similar Documents

Publication Publication Date Title
Tanskanen et al. Live metric 3D reconstruction on mobile phones
CN109416535B (zh) 基于图像识别的飞行器导航技术
WO2019104571A1 (zh) 图像处理方法和设备
US11265471B2 (en) Gimbal control method, device, gimbal, system, and storage medium
WO2022021027A1 (zh) 目标跟踪方法、装置、无人机、系统及可读存储介质
WO2019227441A1 (zh) 可移动平台的拍摄控制方法和设备
US11272105B2 (en) Image stabilization control method, photographing device and mobile platform
CN111833403B (zh) 用于空间定位的方法和装置
WO2019227384A1 (zh) 一种云台控制方法及云台
EP3835913A1 (en) Control method of handheld gimbal, handheld gimbal, and handheld device
WO2020019106A1 (zh) 云台和无人机控制方法、云台及无人机
WO2018191969A1 (zh) 云台的控制方法及装置
CN113795803A (zh) 无人飞行器的飞行辅助方法、设备、芯片、系统及介质
US20240071018A1 (en) Smooth object correction for augmented reality devices
WO2020019175A1 (zh) 图像处理方法和设备、摄像装置以及无人机
WO2022193090A1 (zh) 视频处理方法、电子设备及计算机可读存储介质
WO2020000423A1 (zh) 云台的控制方法、云台、飞行器和计算机可读存储介质
US20240005517A1 (en) Apparatus and method for monitoring moving target based on complementary gimbal control through displacement partitioning
WO2021217450A1 (zh) 目标跟踪方法、设备及存储介质
TWI726536B (zh) 影像擷取方法及影像擷取設備
US20230343028A1 (en) Method and Device for Improving Comfortability of Virtual Content
TWI694719B (zh) 影像處理方法,電子裝置及非暫態電腦可讀取儲存媒體
WO2021056411A1 (zh) 航线调整方法、地面端设备、无人机、系统和存储介质
WO2022021028A1 (zh) 目标检测方法、装置、无人机及计算机可读存储介质
WO2020014925A1 (zh) 色温调节方法、控制终端和可移动平台

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: 21930686

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21930686

Country of ref document: EP

Kind code of ref document: A1