WO2020073860A1 - 一种视频裁剪方法及装置 - Google Patents

一种视频裁剪方法及装置 Download PDF

Info

Publication number
WO2020073860A1
WO2020073860A1 PCT/CN2019/109269 CN2019109269W WO2020073860A1 WO 2020073860 A1 WO2020073860 A1 WO 2020073860A1 CN 2019109269 W CN2019109269 W CN 2019109269W WO 2020073860 A1 WO2020073860 A1 WO 2020073860A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
target object
target
video frame
cropped
Prior art date
Application number
PCT/CN2019/109269
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 传线网络科技(上海)有限公司
Publication of WO2020073860A1 publication Critical patent/WO2020073860A1/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/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23412Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs for generating or manipulating the scene composition of objects, e.g. MPEG-4 objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/215Motion-based segmentation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • 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
    • 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
    • H04N21/44008Processing 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 involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30241Trajectory

Definitions

  • the present application relates to the technical field of video processing, in particular to a video cropping method and device.
  • the purpose of the embodiments of the present application is to provide a video cropping method and device, which can enable the cropped video to still display the main content of the original video.
  • embodiments of the present application also provide a video cropping device, the device includes: a position recognition unit for acquiring a target video to be processed, and identifying the position of the target object from the video frame of the target video ; A motion trajectory determination unit for determining the motion trajectory of the target object in the target video based on the identified position of the target object; an image cropping unit for determining the motion trajectory based on the A region image containing the target object is cropped from a video frame of the target video; a cropped video production unit is used to produce a cropped video corresponding to the target object based on the cropped region image.
  • a cropped video of the target object can be produced.
  • the technical solution provided by the embodiment of the present application can track the main objects in the video and dynamically crop the video according to the tracking result, so as to ensure that the main content of the original video can still be displayed in the cropped video.
  • Figure 1 is a schematic diagram of video cropping in the prior art
  • FIG. 5 is a schematic diagram of cropping of an area image in an embodiment of the present application.
  • FIG. 6 is a schematic diagram of functional modules of a video cropping device in an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a video cropping device in an embodiment of the present application.
  • the present application provides a video cropping method, which can be applied to electronic devices with image processing functions. Please refer to FIG. 2, the method may include the following steps.
  • S1 Obtain the target video to be processed, and identify the position of the target object from the video frame of the target video.
  • the target video may be a video adapted to the size of the horizontal screen, and in the target video, various objects may be provided.
  • the various objects may be objects such as human bodies, houses, vehicles, animals, and plants.
  • the objects contained in each video frame of the target video can be detected by existing target detection methods.
  • the target detection method may be, for example, a YOLO (You Only Look) detection method.
  • the YOLO detection network it can include multiple convolutional layers and multiple fully connected layers. Among them, the convolution layer is used to extract image features, and the fully connected layer is used to predict the image position and the category to which the image belongs.
  • the objects contained in each video frame can be identified.
  • the size of the object in the output of YOLO detection network, can be identified by a rectangular frame.
  • the size parameter of each rectangular frame in the detection result can be used as the size parameter of each identified object.
  • the object identification in addition to identifying the size of the object through the rectangular frame, the object identification can also be marked in the detection result.
  • the identifier of the object is used to distinguish the type to which the object belongs. For example, in FIG. 3, "person” may represent a human body, "dog” may represent a dog, and "horse" may represent a horse.
  • the main object in the current picture can be determined according to the content displayed by the target video, and the main object is used as the target object to be tracked subsequently.
  • objects of a specified type can be selected from the detected objects according to the types of objects. For example, if you currently want to track a human body, then the object of the specified type may be a human body, and the corresponding object identifier is "person". Then, among the identified objects, the object whose object identifier is "person" can be retained, and other objects can be filtered out.
  • the selected objects of the specified type may have a larger number, so a target object to be tracked can be determined from the selected objects of the specified type.
  • the user may select one of the objects as the target object to be tracked based on the recognition result. For example, the user can click on an object in the video frame, so that by receiving the selection instruction input by the user, the object pointed to by the selection instruction can be used as the target object.
  • a preset size range may be provided, and the preset size range may have an upper limit value and a lower limit value.
  • the size parameter of the object of the specified type can be compared with the preset size range, and the size parameter can be filtered out of the object of the specified type. Objects outside the preset size range. In this way, what is left behind may be an object with a reasonable size parameter.
  • the position of the target object in the video frame can be further determined.
  • the area occupied by the target object in the video frame may be represented by the rectangular frame in the above embodiment.
  • the area covered by the rectangular frame can be used as the position of the target object in the video frame.
  • the central coordinate of the rectangular frame can also be used as the position of the target object in the video frame.
  • the central coordinate can be obtained by averaging the coordinates of the four vertices of the rectangular frame, for example. .
  • the center coordinate can be used as the center position of the target object in the video frame.
  • S3 Determine the movement trajectory of the target object in the target video according to the identified position of the target object.
  • the recognized positions can be serially connected in series according to the order in which the video frames are arranged in the target video, thereby obtaining The movement trajectory of the target object in the target video.
  • the position of the target object in each video frame may be represented by a central position. Referring to FIG. 4, assuming that there are currently 5 video frames, the center position of the target object in these 5 video frames can be determined separately. The center position can be represented by the center coordinates of the rectangular frame of the target object.
  • (A11, A12) can represent the center coordinates of the target object in the first video frame
  • (A21, A22) can represent the center coordinates of the target object in the second video frame, and so on.
  • 5 discrete center coordinates can be obtained.
  • these center coordinates may be duplicated, so the number of different center coordinates obtained by aggregation may not necessarily be consistent with the total number of video frames.
  • the repeated center coordinates should also correspond to two different video frames.
  • the five discrete center coordinates can be connected in series according to the arrangement order of each video frame in the target video, so as to obtain the movement trajectory of the target object.
  • the target object can also be identified in each video frame of the target video by means of feature matching.
  • an initial video frame may be selected in the target video in advance, and the initial video frame may be, for example, the first video frame of the target video or the first video frame containing the target object.
  • the target object can be identified from the target video, and the characteristic information of the target object can be determined.
  • the characteristic information may be obtained based on pixel values of pixels constituting the target object.
  • the target object can be represented by the area covered by the rectangular frame, then by identifying the pixel value of each pixel in the rectangular frame, and arranging the identified pixel value according to the arrangement order of the pixels, it can constitute the pixel value vector.
  • This vector can be used as the characteristic information of the target object.
  • the video frame located after the initial video frame may be divided into regions, and the pixel value vector of the divided region may be extracted in the same manner, and then the extracted pixel value vector and the The similarity between the vectors of feature information, so that the target object represented by the feature information can be identified in subsequent video frames.
  • the calculated similarity reaches a specified threshold, it can be considered that the currently divided area is also an area containing the target object, thereby identifying the target object from the video frame.
  • the target object represented by the characteristic information can be identified in a specified number of video frames after the initial video frame, and then, according to the technical solution described in the foregoing embodiment, the The positions of the target object identified in the initial video frame and the specified number of video frames, respectively, to construct a movement trajectory of the target object.
  • the center position of the target object may be determined in the initial video frame and the specified number of video frames, respectively, and the center position may be drawn as the movement trajectory of the target object according to the arrangement order of the video frames .
  • the movement direction and movement speed of the target object in the target video may be first calculated, and then the position of the target object may be predicted according to the movement direction and movement speed.
  • a specified number of candidate video frames may be determined in the target video, and these specified number of candidate video frames may be, for example, the first 10 video frames in the target video, and then each candidate The position of the target object is identified in the video frame.
  • the movement direction and the movement speed of the target objects may be determined according to the identified positions of the target objects.
  • the motion direction may be fitted to the identified position of the target object, thereby fitting a motion trajectory, and the direction of the motion trajectory may be the motion direction of the target object.
  • the movement speed of the target object can be calculated through the time span between the video frames and the distance the target object travels in the target video during this time span. Then, according to the moving direction and the moving speed, the position where the target object appears can be predicted in the target video frame located after the candidate video frame. Specifically, the distance moved by the target object in this time span can be calculated according to the time span between the last candidate video frame and the target video frame. Then, the calculated distance can be traveled along the above-mentioned motion direction to determine the predicted position of the target object in the target video frame.
  • the object closest to the predicted position can be found, and the closest object can be used as the actual object in the target video frame of the target object position.
  • the actual position of the target object determined in the target video frame as a continuation of the motion trajectory fitted in the candidate video frame, it is possible to continue drawing the motion trajectory of the target object. That is to say, after the predicted position of the target object is determined, the object located in the specified range of the predicted position in the target video frame and closest to the predicted position can be used as the target object, Then, the movement trajectory of the target object may be constructed according to the position of the target object determined in the target video frame.
  • a new target object may be re-identified from the target video frame, and the movement trajectory of the new target object is determined in the same manner.
  • the movement trajectory of the target object determined in the above manner may appear to fluctuate greatly as the target object moves.
  • the determined motion trajectory can be smoothed.
  • a specified number of video frames adjacent to the current position may be acquired.
  • the four adjacent video frames of the third frame, the fourth frame, and the sixth frame and the seventh frame can be obtained.
  • the center positions of the target objects in the specified number of video frames can be separately obtained, and the average value of the center positions can be calculated.
  • the calculated average value can be used to replace the current position of the target object in the motion trajectory, so that the current position can be determined according to the position of the target object of the adjacent video frame Smoothed. According to the above-mentioned manner, smooth processing can be performed on the positions with large fluctuations in the motion trajectory, and finally the smoothed motion trajectory can be obtained.
  • the trajectory of the constructed target object may be a sequence of central positions composed of individual central positions.
  • the center coordinates of the target object in each video frame may be included.
  • the center position of the current position may be determined in the video frame corresponding to the current position, for example It can be the center coordinate of the rectangular frame of the target object.
  • the region image including the center position may be cropped from the video frame corresponding to the current position.
  • the center position may be at the center of the cropped area image.
  • the above-mentioned preset crop size may be the size required by the vertical video.
  • the center coordinates of the target object can be used as the cropped area image when cropping the area image Center coordinates, so as to ensure that the target object can be located in the center of the cropped area image.
  • S7 Create a cropped video corresponding to the target object according to the cropped area image.
  • the cropped area images may be sequentially sorted according to the arrangement order of the video frames in the target video, so as to obtain the playback sequence with the target video Crop video consistently.
  • the audio data of the target video needs to be completely retained in the cropped video, so the sorted area image and the audio data of the target video can be synthesized into the cropped video.
  • this application also provides a video cutting device, the device includes:
  • a position recognition unit used to acquire the target video to be processed, and identify the position of the target object from the video frame of the target video;
  • a movement trajectory determining unit configured to determine the movement trajectory of the target object in the target video according to the identified position of the target object
  • An image cropping unit configured to crop an area image containing the target object from the video frame of the target video based on the determined motion track
  • the cropped video production unit is configured to produce a cropped video corresponding to the target object according to the cropped area image.
  • the motion trajectory determination unit includes:
  • a candidate position recognition module used to determine a specified number of candidate video frames in the target video, and identify the position of the target object from the candidate video frames;
  • the motion information determination module is used to determine the movement direction and movement speed of the target object according to the identified position of the target object;
  • a position prediction module configured to predict the position where the target object appears in the target video frame located after the candidate video frame according to the movement direction and the movement speed;
  • a target object query module configured to use an object in the target video frame that is within a specified range of the predicted position and is closest to the predicted position as the target object;
  • the movement track construction module is configured to construct the movement track of the target object according to the position of the target object determined in the target video frame.
  • the device further includes:
  • An adjacent video frame acquisition module configured to acquire a specified number of video frames adjacent to the current position for the current position of the target object in the motion track
  • the average value calculation module is used to respectively obtain the center position of the target object in the specified number of video frames, and calculate the average value of the center position;
  • a smoothing module is used to replace the current position of the target object in the motion trajectory with the calculated average value to form a smoothed motion trajectory.
  • the present application also provides a video cropping device.
  • the device includes a memory and a processor.
  • the memory is used to store a computer program.
  • the computer program is executed by the processor, the video cropping described above is implemented. method.
  • the memory may include a physical device for storing information, usually the information is digitized and then stored on a medium using electrical, magnetic, or optical methods.
  • the memory described in this embodiment may further include: a device that uses electrical energy to store information, such as RAM, ROM, etc .; a device that uses magnetic energy to store information, such as hard disk, floppy disk, magnetic tape, magnetic core memory, bubble memory, U disk ; Devices that use optical methods to store information, such as CDs or DVDs.
  • a device that uses electrical energy to store information such as RAM, ROM, etc .
  • a device that uses magnetic energy to store information such as hard disk, floppy disk, magnetic tape, magnetic core memory, bubble memory, U disk
  • Devices that use optical methods to store information such as CDs or DVDs.
  • quantum memory graphene memory, and so on.
  • the processor may be implemented in any suitable manner.
  • the processor may employ, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro) processor, logic gate, switch, dedicated integration Circuit (Application Specific Integrated Circuit, ASIC), programmable logic controller and embedded microcontroller form, etc.
  • computer-readable program code such as software or firmware
  • the technical solution provided by the present application can identify the target object in the target video, thereby determining the position of the target object in the target video.
  • the target object may be an object mainly displayed by the target video. Then, according to the identified position of the target object, the movement trajectory of the target object in the target video can be determined. Then, when cropping the picture from the target video, for each video frame, the region image containing the target object can be cropped from the video frame instead of cropping according to a fixed position. In this way, cropping is performed by following the movement trajectory of the target object, so that each video frame after the cropping can include the content of the target object without losing the content of the target object.
  • a cropped video of the target object can be produced.
  • the technical solution provided by the embodiment of the present application can track the main objects in the video and dynamically crop the video according to the tracking result, so as to ensure that the main content of the original video can still be displayed in the cropped video.
  • the improvement of a technology can be clearly distinguished from the improvement of hardware (for example, the improvement of the circuit structure of diodes, transistors, switches, etc.) or the improvement of software (the improvement of the process flow).
  • hardware for example, the improvement of the circuit structure of diodes, transistors, switches, etc.
  • software the improvement of the process flow.
  • the improvement of many methods and processes can be regarded as a direct improvement of the hardware circuit structure.
  • Designers almost get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by hardware physical modules.
  • a programmable logic device (Programmable Logic Device, PLD) (such as a field programmable gate array (Field Programmable Gate Array, FPGA)) is such an integrated circuit, and its logic function is determined by the user programming the device.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • ABEL Advanced Boolean Expression
  • AHDL AlteraHardwareDescriptionLanguage
  • Confluence CUPL
  • CornellUniversityProgrammingLanguage HDCal
  • JHDL JavaHardwareDescriptionLanguage
  • Lava Lava
  • Lola MyHDL
  • PALASM RHDL
  • VHDL Very-High-Speed Integrated Circuit Hardware Description
  • the method can be logically programmed to enable the server to use logic gates, switches, special integrated circuits, programmable logic controllers and embedded micro-controllers.
  • a server can be regarded as a hardware component, and the units included therein for realizing various functions can also be regarded as a structure within the hardware component.
  • the unit for realizing various functions can be regarded as both a software module of an implementation method and a structure within a hardware component.
  • the application can be described in the general context of computer-executable instructions executed by a computer, such as program modules.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • the present application can also be practiced in distributed computing environments in which remote processing devices connected through a communication network perform tasks.
  • program modules may be located in local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

本申请实施方式公开了一种视频裁剪方法及装置,其中,所述方法包括:获取待处理的目标视频,并从所述目标视频的视频帧中识别目标对象的位置;根据识别出的所述目标对象的位置,确定所述目标对象在所述目标视频中的运动轨迹;基于确定出的所述运动轨迹,从所述目标视频的视频帧中裁剪出包含所述目标对象的区域图像;根据裁剪出的所述区域图像,制作所述目标对象对应的裁剪视频。本申请提供的技术方案,能够使得裁剪后的视频依然能够展示原版视频的主要内容。

Description

一种视频裁剪方法及装置
本申请要求2018年10月08日递交的申请号为201811167800.7、发明名称为“一种视频裁剪方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及视频处理技术领域,特别涉及一种视频裁剪方法及装置。
背景技术
目前,在移动终端上播放的视频,通常存在横版和竖版两钟版本。由于横版和竖版的分辨率差异较大,同一部视频很难同时满足横版和竖版的播放要求。
当前,为了使得横版视频也能在竖版的场景下具备较好的观赏体验,通常会选择从横版视频中截取一部分画面,从而制作成对应的竖版视频。当前在根据横版视频制作竖版视频时,不可避免地会将横版视频中的部分信息去除。请参阅图1,现有技术中通常是根据竖版视频的画面比例,在横版视频帧的固定位置处(例如屏幕的中心位置)截取出符合竖版画面比例的图像,并将截取得到的图像构成竖版视频。然而,这样的方式可能会导致横版视频中重要的信息丢失,从而使得裁剪后的竖版视频,无法表达横版视频的主要信息。
发明内容
本申请实施方式的目的是提供一种视频裁剪方法及装置,能够使得裁剪后的视频依然能够展示原版视频的主要内容。
为实现上述目的,本申请实施方式提供一种视频裁剪方法,所述方法包括:获取待处理的目标视频,并从所述目标视频的视频帧中识别目标对象的位置;根据识别出的所述目标对象的位置,确定所述目标对象在所述目标视频中的运动轨迹;基于确定出的所述运动轨迹,从所述目标视频的视频帧中裁剪出包含所述目标对象的区域图像;根据裁剪出的所述区域图像,制作所述目标对象对应的裁剪视频。
为实现上述目的,本申请实施方式还提供一种视频裁剪装置,所述装置包括:位置识别单元,用于获取待处理的目标视频,并从所述目标视频的视频帧中识别目标对象的位置;运动轨迹确定单元,用于根据识别出的所述目标对象的位置,确定所述目标对象在所述目标视频中的运动轨迹;图像裁剪单元,用于基于确定出的所述运动轨迹,从所 述目标视频的视频帧中裁剪出包含所述目标对象的区域图像;裁剪视频制作单元,用于根据裁剪出的所述区域图像,制作所述目标对象对应的裁剪视频。
为实现上述目的,本申请实施方式还提供一种视频裁剪装置,所述装置包括存储器和处理器,所述存储器用于存储计算机程序,所述计算机程序被所述处理器执行时,实现上述的视频裁剪方法。
由上可见,本申请提供的技术方案,可以对目标视频中的目标对象进行识别,从而确定出目标对象在目标视频中所处的位置。该目标对象可以是目标视频主要展示的对象。然后,根据识别出的所述目标对象的位置,可以确定目标对象在目标视频中的运动轨迹。那么在从目标视频中裁剪画面时,可以针对每一个视频帧,从视频帧中裁剪出包含目标对象的区域图像,而不是按照固定的位置进行裁剪。这样,通过跟随目标对象的运动轨迹进行裁剪,从而使得裁剪后的各个视频帧中均可以包括目标对象的内容,而不会丢失目标对象的内容。这样,根据裁剪出的区域图像,从而可以制作出该目标对象的裁剪视频。本申请实施方式提供的技术方案,能够针对视频中的主要对象进行跟踪,并根据跟踪结果动态地进行视频裁剪,从而保证裁剪后的视频中依然能够展示原版视频的主要内容。
附图说明
为了更清楚地说明本申请实施方式或现有技术中的技术方案,下面将对实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为现有技术中的视频裁剪示意图;
图2为本申请实施方式中视频裁剪方法的流程示意图;
图3为本申请实施方式中YOLO检测方法的输出示意图;
图4为本申请实施方式中目标对象的运动轨迹构成示意图;
图5为本申请实施方式中区域图像的裁剪示意图;
图6为本申请实施方式中视频裁剪装置的功能模块示意图;
图7为本申请实施方式中视频裁剪装置的结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本申请实施方式中的附图,对本申请实施方式中的技术方案进行清楚、完整地描述,显然,所描述的实施方式仅仅是本申请一部分实施方式,而不是全部的实施方式。基于本申请中的实施方式,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施方式,都应当属于本申请保护的范围。
本申请提供一种视频裁剪方法,所述方法可以应用于具备图像处理功能的电子设备中。请参阅图2,所述方法可以包括以下步骤。
S1:获取待处理的目标视频,并从所述目标视频的视频帧中识别目标对象的位置。
在本实施方式中,所述目标视频可以是适配于横版画面尺寸的视频,在该目标视频中,可以具备各式各样的对象。所述各式各样的对象例如可以是人体、房屋、车辆、动物、植物等物体。在实际应用中,可以通过现有的目标检测方法,检测所述目标视频的各个视频帧中包含的对象。具体地,所述目标检测方法例如可以是YOLO(You Only Look Once)检测方法。在YOLO检测网络中,可以包括多个卷积层以及多个全连接层。其中,卷积层用来提取图像特征,全连接层用来预测图像位置和图像所属的类别。通过YOLO检测方法对目标视频进行逐帧检测后,可以识别出每个视频帧中包含的对象。此外,如图3所示,YOLO检测网络输出的结果中,可以通过矩形框来标识出对象的尺寸。这样,检测结果中各个矩形框的尺寸参数,便可以作为识别出的各个对象的尺寸参数。另外,除了通过矩形框标识出对象的尺寸,在检测结果中还可以标注出对象的标识。该对象的标识用于区分对象所属的类型。例如在图3中,“person”可以表示人体,“dog”可以表示狗,“horse”可以表示马。另外,在检测结果中测还可以标识出对象的置信度。该置信度可以表示矩形框中识别出的对象的概率值。例如在图3中,人体的置信度为0.64,狗的置信度为0.3,马的置信度为0.28。
在一个实施方式中,当检测出目标视频的视频帧中包含的对象之后,可以根据目标视频所展示的内容,确定当前画面中的主要对象,并将该主要对象作为后续需要跟踪的目标对象。具体地,首先可以根据对象的类型,从检测出的对象中筛选出指定类型的对象。例如,当前想要对人体进行跟踪,那么该指定类型的对象便可以是人体,对应的对象标识为“person”。那么,可以在识别出的对象中,保留对象标识为“person”的对象,而过滤掉其它的对象。筛选出的指定类型的对象可能具备较多的数量,因此可以从筛选出的指定类型的对象中,确定一个待追踪的目标对象。
在一个实施方式中,可以通过对视频帧所展示的内容进行分析,从而确定出待追踪 的目标对象。通常而言,视频帧中聚焦的对象往往是视频帧想要展示的主要对象。因此,可以获取当前视频帧的聚焦参数,该聚焦参数可以是用于限定视频帧中某个区域的参数。例如,该聚焦参数可以描绘一个矩形框,并且该聚焦参数可以是该矩形框的两个对角顶点的坐标值。这样,通过该聚焦参数,可以在当前视频帧中确定出限定的区域,然后,可以将所述聚焦参数指向的对象作为所述目标对象。例如,可以识别出该聚焦参数限定的区域,然后将该区域中的对象作为待追踪的目标对象。
在另一个实施方式中,在识别出视频帧中包含的对象之后,用户可以针对识别结果,主要选择其中的一个对象作为待追踪的目标对象。例如,用户可以在视频帧中点击某个对象,这样,通过接收用户输入的选择指令,从而可以将该选择指令指向的对象作为目标对象。
在另一个实施方式中,还可以对视频帧中筛选出的对象的尺寸进行检测。通常而言,尺寸越大,表示在视频帧中越重要,作为视频帧想要展示的主要对象的可能性越高。因此,可以从当前视频帧的所述指定类型的对象中确定所占面积最大的对象,并将所述所占面积最大的对象作为所述目标对象。
在一个实施方式中,考虑到按照对象类型筛选出的对象的数量可能较多,此时可以将过大或者过小的对象过滤,从而减少后续处理的数据量。具体地,可以具备预设尺寸范围,该预设尺寸范围可以具备上限值和下限值。这样,在从检测出的对象中筛选出指定类型的对象之后,可以将指定类型的对象的尺寸参数与该预设尺寸范围进行对比,并且可以从所述指定类型的对象中过滤掉尺寸参数处于预设尺寸范围之外的对象。这样,最终留下的可以是尺寸参数比较合理的对象。
在本实施方式中,在视频帧中确定了目标对象之后,可以进一步地确定目标对象在视频帧中所处的位置。具体地,目标对象在视频帧中所占的区域可以通过上述实施方式中的矩形框来表示。这样,所述矩形框所覆盖的区域便可以作为所述目标对象在视频帧中所处的位置。此外,为了对数据进行简化,还可以将该矩形框的中心坐标作为所述目标对象在视频帧中所处的位置,该中心坐标例如可以通过对矩形框的四个顶点的坐标求平均值得到。该中心坐标便可以作为目标对象在视频帧中的中心位置。
S3:根据识别出的所述目标对象的位置,确定所述目标对象在所述目标视频中的运动轨迹。
在本实施方式中,在识别出所述目标对象在各个视频帧中所处的位置之后,便可以按照视频帧在目标视频中的排列顺序,依次将识别出的这些位置串联起来,从而得到所 述目标对象在目标视频中的运动轨迹。具体地,在实际应用中,为了通过数据来表示所述目标对象的运动轨迹,可以将每个视频帧中所述目标对象的位置利用中心位置来表示。请参阅图4,假设当前有5个视频帧,可以分别确定这5个视频帧中目标对象的中心位置。该中心位置可以通过目标对象的矩形框的中心坐标来表示。例如(A11,A12)可以表示目标对象在第一个视频帧中的中心坐标,(A21,A22)可以表示目标对象在第二个视频帧中的中心坐标,以此类推。通过将这些中心坐标在一个视频帧的区域中进行汇总,便可以得到5个离散的中心坐标。当然,在实际应用中,这些中心坐标可能会出现重复,因此汇总得到的不同的中心坐标的数量可能不一定与视频帧的总数量一致。但需要说明的是,就算两个中心坐标是一致的,由于视频帧的前后顺序不一致,因此重复的中心坐标也应当分别对应两个不同的视频帧。如图4所示,在得到5个离散的中心坐标之后,可以按照各个视频帧在目标视频中的排列顺序,依次将这5个离散的中心坐标串联起来,从而得到目标对象的运动轨迹。
在一个实施方式中,还可以通过特征匹配的方式,在目标视频的各个视频帧中识别出目标对象。具体地,预先可以在目标视频中选择初始视频帧,该初始视频帧例如可以是目标视频的第一个视频帧,或者是包含目标对象的第一个视频帧。通过图像识别的方式,可以从该目标视频中识别出所述目标对象,并可以确定所述目标对象的特征信息。该特征信息可以是基于构成所述目标对象的像素点的像素值得到的。所述目标对象可以通过矩形框覆盖的区域来表示,那么通过识别该矩形框内各个像素点的像素值,并将识别得到的像素值按照像素点的排列顺序进行排列,从而可以构成像素值的向量。该向量便可以作为目标对象的特征信息。后续,可以将位于所述初始视频帧之后的视频帧进行区域划分,并按照相同的方式提取出划分后的区域的像素值向量,然后通过计算提取的像素值向量和上述表征所述目标对象的特征信息的向量之间的相似度,从而可以在后续的视频帧中识别所述特征信息表征的所述目标对象。具体地,当计算的相似度达到指定阈值时,便可以认为当前划分的区域也是包含目标对象的区域,从而从视频帧中识别出目标对象。按照这样的方式,可以在位于所述初始视频帧之后的指定数量的视频帧中,分别识别所述特征信息表征的所述目标对象,然后,可以按照前述实施方式中描述的技术方案,按照在所述初始视频帧和所述指定数量的视频帧中分别识别出的所述目标对象的位置,构建所述目标对象的运动轨迹。具体地,可以在所述初始视频帧和所述指定数量的视频帧中分别确定所述目标对象的中心位置,并将所述中心位置按照视频帧的排列顺序绘制为所述目标对象的运动轨迹。
在另一个实施方式中,还可以先统计出目标对象在目标视频中的运动方向和运动速度,然后根据运动方向和运动速度来预测目标对象的位置。具体地,可以在所述目标视频中确定指定数量的候选视频帧,这些指定数量的候选视频帧例如可以是目标视频中的前10帧视频帧,然后可以按照上述的方式,从各个所述候选视频帧中识别所述目标对象的位置。在识别出这些候选视频帧中目标对象的位置之后,可以根据识别出的所述目标对象的位置,确定所述目标对象的运动方向以及运动速度。具体地,所述运动方向可以通过对识别出的目标对象的位置进行拟合,从而拟合出运动轨迹,该运动轨迹的方向便可以是目标对象的运动方向。此外,通过视频帧之间的时间跨度,以及目标对象在这段时间跨度内在目标视频中行进的距离,可以计算出该目标对象的运动速度。然后,根据所述运动方向和所述运动速度,可以在位于所述候选视频帧之后的目标视频帧中预测所述目标对象出现的位置。具体地,可以根据最后一个候选视频帧与目标视频帧之间的时间跨度,计算出这个时间跨度中目标对象移动的距离。然后,可以沿着上述的运动方向行进计算出的所述距离,从而确定出目标对象在目标视频帧中的预测位置。接着,可以在目标视频帧中,以该预测位置为中心的指定范围内,寻找与该预测位置最接近的对象,并可以将该最接近的对象作为所述目标对象的目标视频帧中的实际位置。这样,通过将在目标视频帧中确定的所述目标对象的实际位置,作为候选视频帧中拟合出的运动轨迹的延续,从而可以继续绘制该目标对象的运动轨迹。也就是说,在确定出目标对象的预测位置之后,可以将所述目标视频帧中位于预测得到的位置的指定范围内,并与预测得到的所述位置距离最近的对象作为所述目标对象,然后,可以根据在所述目标视频帧中确定的所述目标对象的位置,构建所述目标对象的运动轨迹。
在本实施方式中,若在所述目标视频帧中不存在位于预测得到的所述位置的指定范围内的对象,那么表示该目标对象已经不在目标视频帧中展示,该目标对象的运动轨迹已经结束,此时,可以从所述目标视频帧中重新识别新的目标对象,并按照相同的方式确定所述新的目标对象的运动轨迹。
在一个实施方式中,按照上述方式确定出的目标对象的运动轨迹,可能会随着目标对象的移动而出现较大的波动。为了使得运动轨迹尽量平缓,可以对确定出的运动轨迹进行平滑处理。进行平滑处理时,可以将运动轨迹中的当前位置,通过前后的视频帧中目标对象的位置求取平均值来替换。具体地,针对所述运动轨迹中所述目标对象的当前位置,可以获取与所述当前位置相邻的指定数量的视频帧。例如,对于低5帧视频帧的当前位置,可以获取第3帧、第4帧以及第6帧、第7帧这四帧相邻的视频帧。然后可 以分别获取所述目标对象在所述指定数量的视频帧中的中心位置,并计算所述中心位置的平均值。在求得该中心位置的平均值之后,可以利用计算得到的所述平均值替换所述目标对象在所述运动轨迹中的当前位置,从而根据相邻视频帧的目标对象的位置,将当前位置进行了平滑处理。按照上述的方式,可以对运动轨迹中的变化起伏较大的位置进行平滑处理,最终可以得到平滑处理后的的运动轨迹。
S5:基于确定出的所述运动轨迹,从所述目标视频的视频帧中裁剪出包含所述目标对象的区域图像。
在本实施方式中,构建出的目标对象的运动轨迹,可以是由一个个中心位置构成的中心位置序列。在该中心位置序列中,可以包括每个视频帧中,目标对象的中心坐标。这样,在确定出目标对象的运动轨迹之后,针对所述运动轨迹中所述目标对象的当前位置,可以在该当前位置对应的视频帧中,确定所述当前位置的中心位置,该中心位置例如可以是目标对象的矩形框的中心坐标。然后,在按照预设裁剪尺寸进行裁剪时,可以从所述当前位置对应的视频帧中裁剪包含所述中心位置的区域图像。在实际应用中,为了确保目标对象的展示效果,可以将该中心位置处于裁剪后的区域图像的中心。上述的预设裁剪尺寸可以是竖版视频所要求的尺寸。
这样,如图5所示,在确定出当前视频帧中目标对象的中心坐标(黑色填充的实心圆)后,在裁剪区域图像时,可以将目标对象的中心坐标,作为裁剪后的区域图像的中心坐标,从而保证目标对象能够位于裁剪后的区域图像的中心。
S7:根据裁剪出的所述区域图像,制作所述目标对象对应的裁剪视频。
在本实施方式中,针对每个视频帧做出上述的裁剪动作之后,可以按照所述目标视频中视频帧的排列顺序,依次将裁剪得到的区域图像进行排序,从而得到与目标视频的播放顺序一致的裁剪视频。此外,尽管对目标视频的画面进行了裁剪,但目标视频的音频数据需要完全保留至裁剪视频中,因此可以将排序后的区域图像与所述目标视频的音频数据合成为所述裁剪视频。
请参阅图6,本申请还提供一种视频裁剪装置,所述装置包括:
位置识别单元,用于获取待处理的目标视频,并从所述目标视频的视频帧中识别目标对象的位置;
运动轨迹确定单元,用于根据识别出的所述目标对象的位置,确定所述目标对象在所述目标视频中的运动轨迹;
图像裁剪单元,用于基于确定出的所述运动轨迹,从所述目标视频的视频帧中裁剪出包含所述目标对象的区域图像;
裁剪视频制作单元,用于根据裁剪出的所述区域图像,制作所述目标对象对应的裁剪视频。
在一个实施方式中,所述运动轨迹确定单元包括:
候选位置识别模块,用于在所述目标视频中确定指定数量的候选视频帧,并从所述候选视频帧中识别所述目标对象的位置;
运动信息确定模块,用于根据识别出的所述目标对象的位置,确定所述目标对象的运动方向以及运动速度;
位置预测模块,用于根据所述运动方向和所述运动速度,在位于所述候选视频帧之后的目标视频帧中预测所述目标对象出现的位置;
目标对象查询模块,用于将所述目标视频帧中位于预测得到的所述位置的指定范围内,并与预测得到的所述位置距离最近的对象作为所述目标对象;
运动轨迹构建模块,用于根据在所述目标视频帧中确定的所述目标对象的位置,构建所述目标对象的运动轨迹。
在一个实施方式中,所述装置还包括:
相邻视频帧获取模块,用于针对所述运动轨迹中所述目标对象的当前位置,获取与所述当前位置相邻的指定数量的视频帧;
平均值计算模块,用于分别获取所述目标对象在所述指定数量的视频帧中的中心位置,并计算所述中心位置的平均值;
平滑处理模块,用于利用计算得到的所述平均值替换所述目标对象在所述运动轨迹中的当前位置,以构成平滑处理后的的运动轨迹。
请参阅图7,本申请还提供一种视频裁剪装置,所述装置包括存储器和处理器,所述存储器用于存储计算机程序,所述计算机程序被所述处理器执行时,实现上述的视频裁剪方法。
在本实施方式中,所述存储器可以包括用于存储信息的物理装置,通常是将信息数字化后再以利用电、磁或者光学等方法的媒体加以存储。本实施方式所述的存储器又可以包括:利用电能方式存储信息的装置,如RAM、ROM等;利用磁能方式存储信息的装置,如硬盘、软盘、磁带、磁芯存储器、磁泡存储器、U盘;利用光学方式存储信息 的装置,如CD或DVD。当然,还有其他方式的存储器,例如量子存储器、石墨烯存储器等等。
在本实施方式中,所述处理器可以按任何适当的方式实现。例如,所述处理器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式等等。
本说明书实施方式提供的装置,其存储器和处理器实现的具体功能,可以与本说明书中的前述实施方式相对照解释,并能够达到前述实施方式的技术效果,这里便不再赘述。
由上可见,本申请提供的技术方案,可以对目标视频中的目标对象进行识别,从而确定出目标对象在目标视频中所处的位置。该目标对象可以是目标视频主要展示的对象。然后,根据识别出的所述目标对象的位置,可以确定目标对象在目标视频中的运动轨迹。那么在从目标视频中裁剪画面时,可以针对每一个视频帧,从视频帧中裁剪出包含目标对象的区域图像,而不是按照固定的位置进行裁剪。这样,通过跟随目标对象的运动轨迹进行裁剪,从而使得裁剪后的各个视频帧中均可以包括目标对象的内容,而不会丢失目标对象的内容。这样,根据裁剪出的区域图像,从而可以制作出该目标对象的裁剪视频。本申请实施方式提供的技术方案,能够针对视频中的主要对象进行跟踪,并根据跟踪结果动态地进行视频裁剪,从而保证裁剪后的视频中依然能够展示原版视频的主要内容。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程 序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
本领域技术人员也知道,除了以纯计算机可读程序代码方式实现服务器以外,完全可以通过将方法步骤进行逻辑编程来使得服务器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种服务器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的单元也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的单元视为既可以是实现方法的软件模块又可以是硬件部件内的结构。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施方式或者实施方式的某些部分所述的方法。
本说明书中的各个实施方式均采用递进的方式描述,各个实施方式之间相同相似的部分互相参见即可,每个实施方式重点说明的都是与其他实施方式的不同之处。尤其,针对装置的实施方式来说,均可以参照前述方法的实施方式的介绍对照解释。
本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
虽然通过实施方式描绘了本申请,本领域普通技术人员知道,本申请有许多变形和 变化而不脱离本申请的精神,希望所附的权利要求包括这些变形和变化而不脱离本申请的精神。

Claims (15)

  1. 一种视频裁剪方法,其特征在于,所述方法包括:
    获取待处理的目标视频,并从所述目标视频的视频帧中识别目标对象的位置;
    根据识别出的所述目标对象的位置,确定所述目标对象在所述目标视频中的运动轨迹;
    基于确定出的所述运动轨迹,从所述目标视频的视频帧中裁剪出包含所述目标对象的区域图像;
    根据裁剪出的所述区域图像,制作所述目标对象对应的裁剪视频。
  2. 根据权利要求1所述的方法,其特征在于,所述目标对象按照以下方式确定:
    检测所述目标视频的视频帧中包含的对象;
    从检测出的对象中筛选出指定类型的对象,并在所述指定类型的对象中确定目标对象。
  3. 根据权利要求2所述的方法,其特征在于,从所述目标视频的视频帧中检测出的对象具备尺寸参数;相应地,在从检测出的对象中筛选出指定类型的对象之后,所述方法还包括:
    从所述指定类型的对象中过滤掉尺寸参数处于预设尺寸范围之外的对象。
  4. 根据权利要求2所述的方法,其特征在于,在所述指定类型的对象中确定目标对象包括:
    接收用户输入的选择指令,并将所述选择指令指向的对象作为所述目标对象;
    或者
    获取当前视频帧的聚焦参数,并将所述聚焦参数指向的对象作为所述目标对象;
    或者
    从当前视频帧的所述指定类型的对象中确定所占面积最大的对象,并将所述所占面积最大的对象作为所述目标对象。
  5. 根据权利要求1所述的方法,其特征在于,确定所述目标对象在所述目标视频中的运动轨迹包括:
    在所述目标视频的初始视频帧中提取所述目标对象的特征信息;
    在位于所述初始视频帧之后的指定数量的视频帧中,识别所述特征信息表征的所述目标对象;
    按照在所述初始视频帧和所述指定数量的视频帧中分别识别出的所述目标对象的 位置,构建所述目标对象的运动轨迹。
  6. 根据权利要求5所述的方法,其特征在于,构建所述目标对象的运动轨迹包括:
    在所述初始视频帧和所述指定数量的视频帧中分别确定所述目标对象的中心位置,并将所述中心位置按照视频帧的排列顺序绘制为所述目标对象的运动轨迹。
  7. 根据权利要求1所述的方法,其特征在于,确定所述目标对象在所述目标视频中的运动轨迹包括:
    在所述目标视频中确定指定数量的候选视频帧,并从所述候选视频帧中识别所述目标对象的位置;
    根据识别出的所述目标对象的位置,确定所述目标对象的运动方向以及运动速度;
    根据所述运动方向和所述运动速度,在位于所述候选视频帧之后的目标视频帧中预测所述目标对象出现的位置;
    将所述目标视频帧中位于预测得到的所述位置的指定范围内,并与预测得到的所述位置距离最近的对象作为所述目标对象;
    根据在所述目标视频帧中确定的所述目标对象的位置,构建所述目标对象的运动轨迹。
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:
    若在所述目标视频帧中不存在位于预测得到的所述位置的指定范围内的对象,从所述目标视频帧中重新识别新的目标对象,并确定所述新的目标对象的运动轨迹。
  9. 根据权利要求1所述的方法,其特征在于,在确定所述目标对象在所述目标视频中的运动轨迹后,所述方法还包括:
    针对所述运动轨迹中所述目标对象的当前位置,获取与所述当前位置相邻的指定数量的视频帧;
    分别获取所述目标对象在所述指定数量的视频帧中的中心位置,并计算所述中心位置的平均值;
    利用计算得到的所述平均值替换所述目标对象在所述运动轨迹中的当前位置,以构成平滑处理后的的运动轨迹。
  10. 根据权利要求1所述的方法,其特征在于,基于确定出的所述运动轨迹,从所述目标视频的视频帧中裁剪出包含所述目标对象的区域图像包括:
    针对所述运动轨迹中所述目标对象的当前位置,确定所述当前位置在所述目标视频的视频帧中对应的中心位置;
    按照预设裁剪尺寸,从所述当前位置对应的视频帧中裁剪包含所述中心位置的区域图像。
  11. 根据权利要求1所述的方法,其特征在于,制作所述目标对象对应的裁剪视频包括:
    按照所述目标视频中视频帧的排列顺序,依次将裁剪得到的区域图像进行排序,并将排序后的区域图像与所述目标视频的音频数据合成为所述裁剪视频。
  12. 一种视频裁剪装置,其特征在于,所述装置包括:
    位置识别单元,用于获取待处理的目标视频,并从所述目标视频的视频帧中识别目标对象的位置;
    运动轨迹确定单元,用于根据识别出的所述目标对象的位置,确定所述目标对象在所述目标视频中的运动轨迹;
    图像裁剪单元,用于基于确定出的所述运动轨迹,从所述目标视频的视频帧中裁剪出包含所述目标对象的区域图像;
    裁剪视频制作单元,用于根据裁剪出的所述区域图像,制作所述目标对象对应的裁剪视频。
  13. 根据权利要求12所述的装置,其特征在于,所述运动轨迹确定单元包括:
    候选位置识别模块,用于在所述目标视频中确定指定数量的候选视频帧,并从所述候选视频帧中识别所述目标对象的位置;
    运动信息确定模块,用于根据识别出的所述目标对象的位置,确定所述目标对象的运动方向以及运动速度;
    位置预测模块,用于根据所述运动方向和所述运动速度,在位于所述候选视频帧之后的目标视频帧中预测所述目标对象出现的位置;
    目标对象查询模块,用于将所述目标视频帧中位于预测得到的所述位置的指定范围内,并与预测得到的所述位置距离最近的对象作为所述目标对象;
    运动轨迹构建模块,用于根据在所述目标视频帧中确定的所述目标对象的位置,构建所述目标对象的运动轨迹。
  14. 根据权利要求12所述的装置,其特征在于,所述装置还包括:
    相邻视频帧获取模块,用于针对所述运动轨迹中所述目标对象的当前位置,获取与所述当前位置相邻的指定数量的视频帧;
    平均值计算模块,用于分别获取所述目标对象在所述指定数量的视频帧中的中心位 置,并计算所述中心位置的平均值;
    平滑处理模块,用于利用计算得到的所述平均值替换所述目标对象在所述运动轨迹中的当前位置,以构成平滑处理后的的运动轨迹。
  15. 一种视频裁剪装置,其特征在于,所述装置包括存储器和处理器,所述存储器用于存储计算机程序,所述计算机程序被所述处理器执行时,实现如权利要求1至11中任一所述的方法。
PCT/CN2019/109269 2018-10-08 2019-09-30 一种视频裁剪方法及装置 WO2020073860A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811167800.7 2018-10-08
CN201811167800.7A CN111010590B (zh) 2018-10-08 2018-10-08 一种视频裁剪方法及装置

Publications (1)

Publication Number Publication Date
WO2020073860A1 true WO2020073860A1 (zh) 2020-04-16

Family

ID=70111152

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/109269 WO2020073860A1 (zh) 2018-10-08 2019-09-30 一种视频裁剪方法及装置

Country Status (2)

Country Link
CN (1) CN111010590B (zh)
WO (1) WO2020073860A1 (zh)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111815645A (zh) * 2020-06-23 2020-10-23 广州筷子信息科技有限公司 一种广告视频画面裁剪的方法和系统
CN112423021A (zh) * 2020-11-18 2021-02-26 北京有竹居网络技术有限公司 视频的处理方法、装置、可读介质和电子设备
CN112508773A (zh) * 2020-11-20 2021-03-16 小米科技(武汉)有限公司 图像处理方法及装置、电子设备、存储介质
CN112967288A (zh) * 2021-02-03 2021-06-15 咪咕文化科技有限公司 一种多媒体数据处理方法、通信设备及可读存储介质
CN114430457A (zh) * 2020-10-29 2022-05-03 北京小米移动软件有限公司 拍摄方法、装置、电子设备和存储介质
CN115037992A (zh) * 2022-06-08 2022-09-09 中央广播电视总台 视频处理方法、装置和存储介质
CN115345855A (zh) * 2022-08-16 2022-11-15 北京百度网讯科技有限公司 视频质量评估的方法、装置、设备以及存储介质

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111601013B (zh) * 2020-05-29 2023-03-31 阿波罗智联(北京)科技有限公司 用于处理视频帧的方法和装置
CN112132836A (zh) * 2020-08-14 2020-12-25 咪咕文化科技有限公司 视频图像裁剪方法、装置、电子设备及存储介质
CN112019768B (zh) * 2020-09-04 2023-03-24 北京奇艺世纪科技有限公司 一种视频生成方法、装置及电子设备
CN112153396B (zh) * 2020-09-14 2023-09-26 北京达佳互联信息技术有限公司 页面展示方法、装置、系统和存储介质
CN112218160A (zh) * 2020-10-12 2021-01-12 北京达佳互联信息技术有限公司 视频转换方法及装置和视频转换设备及存储介质
CN112311966A (zh) * 2020-11-13 2021-02-02 深圳市前海手绘科技文化有限公司 一种短视频中动态镜头制作的方法和装置
CN112541412A (zh) * 2020-11-30 2021-03-23 北京数码视讯技术有限公司 基于视频的目标识别装置和方法
CN113840159A (zh) * 2021-09-26 2021-12-24 北京沃东天骏信息技术有限公司 视频处理方法、装置、计算机系统及可读存储介质
CN114268849A (zh) * 2022-01-29 2022-04-01 北京卡路里信息技术有限公司 视频处理方法及装置
CN114501115B (zh) * 2022-02-12 2023-07-28 北京蜂巢世纪科技有限公司 针对球场录像的裁剪再加工方法、装置、设备及介质
CN116074620B (zh) * 2022-05-27 2023-11-07 荣耀终端有限公司 一种拍摄方法及电子设备

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101051389A (zh) * 2006-04-06 2007-10-10 欧姆龙株式会社 动画编辑装置
CN102075689A (zh) * 2009-11-24 2011-05-25 新奥特(北京)视频技术有限公司 一种快速制作动画的字幕机
CN102074033A (zh) * 2009-11-24 2011-05-25 新奥特(北京)视频技术有限公司 一种动画制作方法和装置
US20140355821A1 (en) * 2013-06-04 2014-12-04 Apple Inc. Object Landmark Detection in Images
CN104484854A (zh) * 2014-12-24 2015-04-01 北京奇虎科技有限公司 人物图片裁剪方法和装置
CN104883628A (zh) * 2014-02-28 2015-09-02 华为软件技术有限公司 一种生成视频浓缩摘要的方法、装置及设备
CN106131529A (zh) * 2016-06-30 2016-11-16 联想(北京)有限公司 一种视频图像处理方法及装置
CN106550283A (zh) * 2015-09-17 2017-03-29 杭州海康威视数字技术股份有限公司 播放视频摘要的方法及装置

Family Cites Families (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6394557B2 (en) * 1998-05-15 2002-05-28 Intel Corporation Method and apparatus for tracking an object using a continuously adapting mean shift
US6654506B1 (en) * 2000-01-25 2003-11-25 Eastman Kodak Company Method for automatically creating cropped and zoomed versions of photographic images
CN100407798C (zh) * 2005-07-29 2008-07-30 北京大学 三维几何建模系统和方法
JP4352430B2 (ja) * 2006-09-06 2009-10-28 国際航業株式会社 空中写真データの作成方法と空中写真データセット
JP4715909B2 (ja) * 2008-12-04 2011-07-06 ソニー株式会社 画像処理装置及び方法、画像処理システム、並びに、画像処理プログラム
JP5247731B2 (ja) * 2009-01-06 2013-07-24 株式会社テンヨー ピース集合体、及びピース配列計算システム
JP5347890B2 (ja) * 2009-10-09 2013-11-20 ソニー株式会社 画像処理装置および方法、並びにプログラム
CN101945210B (zh) * 2010-09-29 2012-07-25 无锡中星微电子有限公司 运动跟踪预测方法
JP2013172446A (ja) * 2012-02-23 2013-09-02 Sony Corp 情報処理装置、端末装置、撮像装置、情報処理方法、及び撮像装置における情報提供方法
US8594488B1 (en) * 2012-03-13 2013-11-26 Google Inc. Methods and systems for video retargeting using motion saliency
JP2013239961A (ja) * 2012-05-16 2013-11-28 Sony Corp 動画撮像装置、動画像電子ズーム方法
EP2730941B1 (en) * 2012-11-07 2017-02-22 Terma A/S A method of estimating a local plot density in a radar system; a plot density estimator and a radar system with a plot density estimator
CN103234529B (zh) * 2013-03-26 2015-09-02 深圳市朗诚实业有限公司 一种运动轨迹测试方法及设备
WO2015041641A1 (en) * 2013-09-18 2015-03-26 Intel Corporation Automated image cropping and sharing
CN105632170A (zh) * 2014-11-26 2016-06-01 安徽中杰信息科技有限公司 一种基于Mean Shift跟踪算法的交通流检测方法
US10600169B2 (en) * 2015-03-26 2020-03-24 Sony Corporation Image processing system and image processing method
EP3285476A4 (en) * 2015-04-14 2018-09-19 Sony Corporation Image processing device, image processing method, and image processing system
CN105957106B (zh) * 2016-04-26 2019-02-22 湖南拓视觉信息技术有限公司 三维目标跟踪的方法和装置
CN106228112B (zh) * 2016-07-08 2019-10-29 深圳市优必选科技有限公司 人脸检测跟踪方法及机器人头部转动控制方法和机器人
CN106228575B (zh) * 2016-07-21 2019-05-10 广东工业大学 融合卷积神经网络及贝叶斯滤波器的跟踪方法及系统
CN106447697B (zh) * 2016-10-09 2018-10-26 湖南穗富眼电子科技有限公司 一种基于动平台的特定动目标快速跟踪方法
CN108416800A (zh) * 2018-03-13 2018-08-17 青岛海信医疗设备股份有限公司 目标跟踪方法及装置、终端、计算机可读存储介质
CN108447021B (zh) * 2018-03-19 2021-06-08 河北工业大学 基于分块和逐帧优化的视频缩放方法

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101051389A (zh) * 2006-04-06 2007-10-10 欧姆龙株式会社 动画编辑装置
CN102075689A (zh) * 2009-11-24 2011-05-25 新奥特(北京)视频技术有限公司 一种快速制作动画的字幕机
CN102074033A (zh) * 2009-11-24 2011-05-25 新奥特(北京)视频技术有限公司 一种动画制作方法和装置
US20140355821A1 (en) * 2013-06-04 2014-12-04 Apple Inc. Object Landmark Detection in Images
CN104883628A (zh) * 2014-02-28 2015-09-02 华为软件技术有限公司 一种生成视频浓缩摘要的方法、装置及设备
CN104484854A (zh) * 2014-12-24 2015-04-01 北京奇虎科技有限公司 人物图片裁剪方法和装置
CN106550283A (zh) * 2015-09-17 2017-03-29 杭州海康威视数字技术股份有限公司 播放视频摘要的方法及装置
CN106131529A (zh) * 2016-06-30 2016-11-16 联想(北京)有限公司 一种视频图像处理方法及装置

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111815645A (zh) * 2020-06-23 2020-10-23 广州筷子信息科技有限公司 一种广告视频画面裁剪的方法和系统
CN111815645B (zh) * 2020-06-23 2021-05-11 广州筷子信息科技有限公司 一种广告视频画面裁剪的方法和系统
CN114430457A (zh) * 2020-10-29 2022-05-03 北京小米移动软件有限公司 拍摄方法、装置、电子设备和存储介质
CN114430457B (zh) * 2020-10-29 2024-03-08 北京小米移动软件有限公司 拍摄方法、装置、电子设备和存储介质
CN112423021A (zh) * 2020-11-18 2021-02-26 北京有竹居网络技术有限公司 视频的处理方法、装置、可读介质和电子设备
CN112423021B (zh) * 2020-11-18 2022-12-06 北京有竹居网络技术有限公司 视频的处理方法、装置、可读介质和电子设备
US11922597B2 (en) 2020-11-18 2024-03-05 Beijing Youzhuju Network Technology Co., Ltd. Video processing method and apparatus, readable medium, and electronic device
CN112508773A (zh) * 2020-11-20 2021-03-16 小米科技(武汉)有限公司 图像处理方法及装置、电子设备、存储介质
CN112508773B (zh) * 2020-11-20 2024-02-09 小米科技(武汉)有限公司 图像处理方法及装置、电子设备、存储介质
CN112967288A (zh) * 2021-02-03 2021-06-15 咪咕文化科技有限公司 一种多媒体数据处理方法、通信设备及可读存储介质
CN115037992A (zh) * 2022-06-08 2022-09-09 中央广播电视总台 视频处理方法、装置和存储介质
CN115345855A (zh) * 2022-08-16 2022-11-15 北京百度网讯科技有限公司 视频质量评估的方法、装置、设备以及存储介质

Also Published As

Publication number Publication date
CN111010590B (zh) 2022-05-17
CN111010590A (zh) 2020-04-14

Similar Documents

Publication Publication Date Title
WO2020073860A1 (zh) 一种视频裁剪方法及装置
US10134165B2 (en) Image distractor detection and processing
US20200058075A1 (en) Method and apparatus for obtaining vehicle loss assessment image, server and terminal device
KR101706365B1 (ko) 이미지 세그멘테이션 방법 및 이미지 세그멘테이션 장치
US10284789B2 (en) Dynamic generation of image of a scene based on removal of undesired object present in the scene
KR20230013243A (ko) 프레임에서 타겟 오브젝트를 위한 고정된 크기 유지
EP3084577B1 (en) Selection and tracking of objects for display partitioning and clustering of video frames
CN103353935B (zh) 一种用于智能家居系统的3d动态手势识别方法
Yu et al. Trajectory-based ball detection and tracking in broadcast soccer video
WO2021051604A1 (zh) Osd的文字区域的识别方法、装置及存储介质
US20150220776A1 (en) Identification of a gesture
WO2021203801A1 (zh) 一种行人重识别方法、装置及电子设备和存储介质
US20130342636A1 (en) Image-Based Real-Time Gesture Recognition
CN104508680B (zh) 改善之视讯追踪
CN108596098B (zh) 人体部件的解析方法、系统、设备和存储介质
KR20180018561A (ko) 이미지 영역을 선택 및 추적함으로써 비디오를 확대축소하기 위한 장치 및 방법
US10922531B2 (en) Face recognition method
WO2021031954A1 (zh) 对象数量确定方法、装置、存储介质与电子设备
CN111241872B (zh) 视频图像遮挡方法及装置
CN110287877B (zh) 视频目标的处理方法及装置
WO2019222889A1 (zh) 一种图像特征提取方法及装置
CN113128368B (zh) 一种人物交互关系的检测方法、装置及系统
WO2023045183A1 (zh) 图像处理
WO2017081839A1 (ja) 移動体追跡方法、移動体追跡装置、およびプログラム
CN112752158A (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: 19871151

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

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 25/08/2021)