WO2024140123A1 - Stop motion animation generation method, electronic device, cloud server, and system - Google Patents

Stop motion animation generation method, electronic device, cloud server, and system

Info

Publication number
WO2024140123A1
WO2024140123A1 PCT/CN2023/137534 CN2023137534W WO2024140123A1 WO 2024140123 A1 WO2024140123 A1 WO 2024140123A1 CN 2023137534 W CN2023137534 W CN 2023137534W WO 2024140123 A1 WO2024140123 A1 WO 2024140123A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
image
processed
annotated
scene
Prior art date
Application number
PCT/CN2023/137534
Other languages
French (fr)
Chinese (zh)
Inventor
贾美霞
黄宸宇
金磊磊
钟伟才
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024140123A1 publication Critical patent/WO2024140123A1/en

Links

Abstract

The present application relates to the technical field of terminals, provides a stop motion animation generation method, an electronic device, a cloud server, and a system, and solves, to a certain extent, the problems that existing stop animation production processes are tedious and have low manufacturing efficiency. The method is applied to an electronic device, and comprises: in response to a first operation of a user, determining a dynamic object; and determining a stop motion animation according to the dynamic object and a video to be processed, wherein said video comprises the dynamic object, and each image frame in the stop motion animation is a video frame in said video.

Description

一种定格动画生成方法、电子设备、云端服务器及系统Stop-motion animation generation method, electronic device, cloud server and system
本申请要求于2022年12月29日提交国家知识产权局、申请号为202211711630.0、申请名称为“一种定格动画生成方法、电子设备、云端服务器及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on December 29, 2022, with application number 202211711630.0 and application name “A stop-motion animation generation method, electronic device, cloud server and system”, the entire contents of which are incorporated by reference in this application.
技术领域Technical Field
本申请涉及终端技术领域,尤其涉及一种定格动画生成方法、电子设备、云端服务器及系统。The present application relates to the field of terminal technology, and in particular to a stop-motion animation generation method, electronic equipment, cloud server and system.
背景技术Background technique
定格动画又可以称为逐帧动画,被广泛应用于商业广告、宣传片、电影短片以及手工创作等领域。常见的可以通过以下两种方式生成定格动画,一种是根据逐帧拍摄多帧精准的图像合成定格动画;另一种是首先拍摄完整的视频,然后采用人工剪辑对拍摄的视频进行剪辑生成定格动画。从上述两种定格动画的生成方法中不难看出,现有的定格动画的制作过程较为繁琐复杂,定格动画的制作效率较低。Stop-motion animation, also known as frame-by-frame animation, is widely used in commercials, promotional videos, short films, and handmade creations. There are two common ways to generate stop-motion animation: one is to synthesize stop-motion animation by shooting multiple frames of accurate images frame by frame; the other is to first shoot a complete video, and then use manual editing to edit the shot video to generate a stop-motion animation. It is not difficult to see from the above two stop-motion animation generation methods that the existing stop-motion animation production process is relatively cumbersome and complicated, and the stop-motion animation production efficiency is low.
发明内容Summary of the invention
本申请提供一种定格动画生成方法、电子设备、云端服务器及系统,一定程度上解决了现有的定格动画制作过程繁琐、制作效率低的问题。The present application provides a stop-motion animation generation method, electronic device, cloud server and system, which to a certain extent solve the problems of complicated production process and low production efficiency of existing stop-motion animation.
为达到上述目的,本申请采用如下技术方案:In order to achieve the above objectives, this application adopts the following technical solutions:
第一方面,本申请提供一种定格动画生成方法,应用于电子设备,该方法包括:In a first aspect, the present application provides a stop-motion animation generation method, which is applied to an electronic device, and the method comprises:
响应于用户的第一操作,确定动态对象;In response to a first operation by a user, determining a dynamic object;
根据所述动态对象和待处理视频确定定格动画,所述待处理视频包括所述动态对象,所述定格动画中的每一帧图像为所述待处理视频中的视频帧。A stop-motion animation is determined according to the dynamic object and a video to be processed, wherein the video to be processed includes the dynamic object, and each frame image in the stop-motion animation is a video frame in the video to be processed.
基于本申请提供的定格动画生成方法,在生成定格动画的过程中,基于用户指定的动态对象即可从待处理视频中自动生成与动态对象对应的定格动画,无需人工剪辑也无需单独拍摄每一帧图像,可以基于已经拍摄的待处理视频自动生成对应的定格动画,缩短了定格动画的制作周期,提高了定格动画的制作效率。Based on the stop-motion animation generation method provided by the present application, in the process of generating the stop-motion animation, the stop-motion animation corresponding to the dynamic object can be automatically generated from the video to be processed based on the dynamic object specified by the user, without the need for manual editing or separate shooting of each frame of the image. The corresponding stop-motion animation can be automatically generated based on the video to be processed that has been shot, thereby shortening the production cycle of the stop-motion animation and improving the production efficiency of the stop-motion animation.
在第一方面的一种可能的实施方式中,所述响应于用户的第一操作,确定动态对象,包括:In a possible implementation of the first aspect, determining the dynamic object in response to a first operation of the user includes:
获取所述待处理视频;Obtaining the video to be processed;
显示所述待处理视频中的多个第一标注图像,每个所述第一标注图像中标注有至少一个对象;Displaying a plurality of first annotated images in the video to be processed, each of the first annotated images being annotated with at least one object;
响应于所述第一操作,从每个所述第一标注图像中标注的所述至少一个对象中确定所述动态对象。In response to the first operation, the dynamic object is determined from the at least one object annotated in each of the first annotated images.
在第一方面的一种可能的实施方式中,所述显示所述待处理视频中的多个第一标注图像,包括:In a possible implementation of the first aspect, displaying the plurality of first annotated images in the video to be processed includes:
确定所述待处理视频中的多个拍摄场景;Determining multiple shooting scenes in the video to be processed;
对每个拍摄场景进行抽帧处理,得到与每个所述拍摄场景对应的场景图像;Performing frame extraction processing on each shooting scene to obtain a scene image corresponding to each shooting scene;
对每个所述场景图像进行对象识别,得到与每个所述场景图像分别对应的所述第一标注图像。Object recognition is performed on each of the scene images to obtain the first annotated image corresponding to each of the scene images.
基于上述可能的实施方式,当待处理视频为预先已经拍摄的视频时,电子设备在获取到待处理视频后,用户可以从与待处理视频对应的多个第一标注图像选择对应的动态对象,便于后续根据每个第一标注图像的动态对象生成对应的定格动画,降低了待处理视频中其他噪声对定格动画的干扰,提高了生成定格动画的准确性。此外,相较于确定与待处理视频对应的每个视频帧中的动态对象,上述可能的实施方式还可以缩短动态对象的确定时间,加快了定格动画的生成速度。Based on the above possible implementations, when the video to be processed is a video that has been shot in advance, after the electronic device obtains the video to be processed, the user can select the corresponding dynamic object from multiple first annotated images corresponding to the video to be processed, so as to facilitate the subsequent generation of the corresponding stop-motion animation according to the dynamic object of each first annotated image, thereby reducing the interference of other noises in the video to be processed on the stop-motion animation and improving the accuracy of generating the stop-motion animation. In addition, compared with determining the dynamic object in each video frame corresponding to the video to be processed, the above possible implementations can also shorten the determination time of the dynamic object and speed up the generation speed of the stop-motion animation.
可选地,所述响应于用户的第一操作,确定动态对象,包括:Optionally, in response to a first operation of the user, determining the dynamic object includes:
获取所述待处理视频;Obtaining the video to be processed;
显示所述待处理视频的每个视频帧,每个所述视频帧中标注有至少一个对象; Display each video frame of the video to be processed, each of the video frames being marked with at least one object;
响应于用户的第一操作,从每个所述视频帧的所述至少一个对象中确定所述动态对象。In response to a first operation of a user, the dynamic object is determined from the at least one object in each of the video frames.
在第一方面的一种可能的实施方式中,所述显示所述待处理视频中的多个第一标注图像,包括:In a possible implementation of the first aspect, displaying the plurality of first annotated images in the video to be processed includes:
在拍摄所述待处理视频的过程中,当检测到拍摄场景从第一场景变化为第二场景时,从已拍摄视频片段中获取与所述第一场景对应的视频帧序列;In the process of shooting the video to be processed, when it is detected that the shooting scene changes from the first scene to the second scene, a video frame sequence corresponding to the first scene is acquired from the shot video clips;
对所述视频帧序列进行抽帧处理,得到与所述第一场景对应的场景图像;Performing frame extraction processing on the video frame sequence to obtain a scene image corresponding to the first scene;
对所述场景图像进行对象识别,得到所述第一场景的所述第一标注图像。Object recognition is performed on the scene image to obtain the first annotated image of the first scene.
基于上述可能的实施方式,可以在电子设备中设置定格动画拍摄模式,进一步丰富了定格动画的拍摄模式。在定格动画拍摄模式下,若电子设备检测到拍摄场景更新,则根据拍摄场景更新前的视频帧确定对应的场景图像,以从场景图像的至少一个对象中快速确定动态对象,实现对待处理视频的快速处理,提高定格动画的拍摄效率。Based on the above possible implementations, a stop-motion animation shooting mode can be set in the electronic device, further enriching the stop-motion animation shooting mode. In the stop-motion animation shooting mode, if the electronic device detects that the shooting scene is updated, the corresponding scene image is determined according to the video frame before the shooting scene is updated, so as to quickly determine the dynamic object from at least one object in the scene image, realize the rapid processing of the video to be processed, and improve the shooting efficiency of the stop-motion animation.
在第一方面的一种可能的实施方式中,所述显示所述待处理视频中的多个第一标注图像,包括:In a possible implementation of the first aspect, displaying the plurality of first annotated images in the video to be processed includes:
向云端服务器发送所述待处理视频;Sending the video to be processed to a cloud server;
接收所述云端服务器发送的多个所述第一标注图像;Receiving the plurality of first annotated images sent by the cloud server;
显示多个所述第一标注图像。A plurality of the first annotated images are displayed.
在第一方面的一种可能的实施方式中,所述响应于用户的第一操作,确定动态对象,包括:In a possible implementation of the first aspect, determining the dynamic object in response to a first operation of the user includes:
获取第一图像,所述第一图像中包括至少一个对象;Acquire a first image, wherein the first image includes at least one object;
根据所述第一图像显示第二标注图像,所述第二标注图像中标注有所述至少一个对象;displaying a second annotated image according to the first image, wherein the second annotated image is annotated with the at least one object;
响应于所述第一操作,从所述至少一个对象中确定所述动态对象。In response to the first operation, the dynamic object is determined from the at least one object.
在第一方面的一种可能的实施方式中,所述根据所述第一图像显示第二标注图像,包括:In a possible implementation of the first aspect, displaying the second annotated image according to the first image includes:
对所述第一图像进行对象识别,得到标注有至少一个对象的所述第二标注图像;Performing object recognition on the first image to obtain the second annotated image annotated with at least one object;
显示所述第二标注图像。The second annotated image is displayed.
基于上述可能的实施方式,在待处理视频拍摄之前,可以先根据获取的第一图像确定动态对象,然后在拍摄待处理视频的过程中,电子设备即可根据确定的动态对象对拍摄的待处理视频进行处理,当待处理视频拍摄完毕后,电子设备就可以快速生成与动态对象对应的定格动画,提升了定格动画的拍摄效率。Based on the above possible implementation methods, before shooting the video to be processed, the dynamic object can be determined based on the acquired first image. Then, during the process of shooting the video to be processed, the electronic device can process the shot video to be processed according to the determined dynamic object. When the shooting of the video to be processed is completed, the electronic device can quickly generate a stop-motion animation corresponding to the dynamic object, thereby improving the shooting efficiency of the stop-motion animation.
在第一方面的一种可能的实施方式中,所述根据所述第一图像显示第二标注图像,包括:In a possible implementation of the first aspect, displaying the second annotated image according to the first image includes:
向云端服务器发送所述第一图像;Sending the first image to a cloud server;
接收所述云端服务器发送的与所述第一图像对应的所述第二标注图像;receiving the second annotated image corresponding to the first image and sent by the cloud server;
显示所述第二标注图像。The second annotated image is displayed.
在第一方面的一种可能的实施方式中,所述第一操作为聚焦操作,所述响应于用户的第一操作,确定动态对象,包括:In a possible implementation of the first aspect, the first operation is a focusing operation, and determining the dynamic object in response to the first operation of the user includes:
获取第一图像,第一图像中包括至少一个对象;Acquire a first image, wherein the first image includes at least one object;
响应于用户在所述第一图像上的所述聚焦操作,从所述至少一个对象中确定所述第一图像中的所述动态对象。In response to the focusing operation of the user on the first image, the dynamic object in the first image is determined from the at least one object.
在第一方面的一种可能的实施方式中,所述第一图像为所述待处理视频拍摄之前拍摄的图像,或者为所述待处理视频中的图像。In a possible implementation of the first aspect, the first image is an image captured before the video to be processed is captured, or is an image in the video to be processed.
在第一方面的一种可能的实施方式中,所述根据所述动态对象和待处理视频确定定格动画,包括:In a possible implementation manner of the first aspect, determining the stop-motion animation according to the dynamic object and the video to be processed includes:
确定所述待处理视频中与所述动态对象的每个动作对应的多帧图像;Determine a plurality of frames of images corresponding to each action of the dynamic object in the video to be processed;
分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列;Performing frame extraction processing on the multiple frames of images corresponding to each of the actions respectively to obtain a key frame sequence corresponding to each of the actions;
根据每个所述动作的对应所述关键帧序列生成所述定格动画。The stop-motion animation is generated according to the key frame sequence corresponding to each of the actions.
在第一方面的一种可能的实施方式中,所述方法还包括:In a possible implementation of the first aspect, the method further includes:
若所述关键帧序列的所述第一关键帧中存在干扰对象,则消除所述第一关键帧中的所述干扰对象。 If an interfering object exists in the first key frame of the key frame sequence, the interfering object in the first key frame is eliminated.
在第一方面的一种可能的实施方式中,所述消除所述第一关键帧中的所述干扰对象,包括:In a possible implementation manner of the first aspect, eliminating the interference object in the first key frame includes:
根据所述第一关键帧在所述关键帧序列的相邻帧中与所述干扰对象对应的区域,消除所述第一关键帧中的所述干扰对象。The interfering object in the first key frame is eliminated according to a region of the first key frame corresponding to the interfering object in adjacent frames of the key frame sequence.
在第一方面的一种可能的实施方式中,所述分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列,包括:In a possible implementation of the first aspect, the performing frame extraction processing on the multiple frames of images corresponding to each of the actions to obtain a key frame sequence corresponding to each of the actions includes:
根据每个所述动作对应的所述多帧图像中与所述动态对象对应区域的像素均值,确定与每个所述动作对应的所述关键帧序列。The key frame sequence corresponding to each action is determined according to the pixel average value of the area corresponding to the dynamic object in the multiple frames of images corresponding to each action.
示例性的,可以将每个所述动作对应的所述多帧图像中绝对偏差最小的图像确定为与所述多帧图像对应的所述关键帧,根据每个所述动作对应的所述关键帧确定与每个所述动作对应的关键帧序列。Exemplarily, the image with the smallest absolute deviation in the multiple frames of images corresponding to each action can be determined as the key frame corresponding to the multiple frames of images, and the key frame sequence corresponding to each action can be determined based on the key frame corresponding to each action.
在第一方面的一种可能的实施方式中,所述根据所述动态对象和待处理视频确定定格动画,包括:In a possible implementation manner of the first aspect, determining the stop-motion animation according to the dynamic object and the video to be processed includes:
向云端服务器发送所述动态对象指示信息;Sending the dynamic object indication information to a cloud server;
接收所述定格动画。The stop motion animation is received.
在第一方面的一种可能的实施方式中,所述根据所述动态对象和待处理视频确定定格动画,包括:In a possible implementation manner of the first aspect, determining the stop-motion animation according to the dynamic object and the video to be processed includes:
向云端服务器发送所述动态对象指示信息和所述待处理视频;Sending the dynamic object indication information and the video to be processed to a cloud server;
接收所述定格动画。The stop motion animation is received.
基于该可能的实施方式,在实际应用中,可以在相机中设置定格动画拍摄模式,在用户选择定格动画拍摄模式后,即可在该模式下拍摄定格动画,不仅扩展了生成定格动画的方式,相较于现有技术需要人工对待处理视频进行剪辑而生成定格动画的方法,极大地减少了人工对待处理视频的处理,提高了定格动画的制作效率。Based on this possible implementation, in actual applications, a stop-motion animation shooting mode can be set in the camera. After the user selects the stop-motion animation shooting mode, the stop-motion animation can be shot in this mode. This not only expands the way of generating stop-motion animation, but also greatly reduces the manual processing of the video to be processed, compared with the prior art method of generating stop-motion animation by manually editing the video to be processed, thereby improving the production efficiency of the stop-motion animation.
第二方面,本申请实施例提供一种定格动画生成方法,应用于云端服务器,所述方法包括:In a second aspect, an embodiment of the present application provides a stop-motion animation generation method, which is applied to a cloud server, and the method includes:
接收电子设备发送的与动态对象对应的指示信息和待处理视频,根据所述指示信息确定所述动态对象;receiving indication information corresponding to a dynamic object and a video to be processed sent by an electronic device, and determining the dynamic object according to the indication information;
确定待处理视频中与所述动态对象的每个动作对应的多帧图像;Determine a plurality of frames of images corresponding to each action of the dynamic object in the video to be processed;
分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列;Performing frame extraction processing on the multiple frames of images corresponding to each of the actions respectively to obtain a key frame sequence corresponding to each of the actions;
根据每个所述动作的对应所述关键帧序列生成定格动画;generating a stop-motion animation according to the key frame sequence corresponding to each of the actions;
向电子设备发送所述定格动画。The stop-motion animation is transmitted to an electronic device.
在第二方面的一种可能的实施方式中,所述接收电子设备发送的与动态对象对应的指示信息和待处理视频,包括:In a possible implementation manner of the second aspect, the receiving the indication information corresponding to the dynamic object and the video to be processed sent by the electronic device includes:
接收所述电子设备发送的所述待处理视频;Receiving the video to be processed sent by the electronic device;
向所述电子设备发送从所述待处理视频中确定的多个第一标注图像,每个所述第一标注图像中标注有至少一个对象;Sending a plurality of first annotated images determined from the video to be processed to the electronic device, each of the first annotated images being annotated with at least one object;
接收所述电子设备发送的从每个所述第一标注图像中标注的所述至少一个对象中确定的与所述动态对象对应的所述指示信息。The indication information corresponding to the dynamic object determined from the at least one object annotated in each of the first annotated images is received and sent by the electronic device.
在第二方面的一种可能的实施方式中,所述多个所述第一标注图像的确定方法,包括:In a possible implementation of the second aspect, the method for determining the plurality of first annotated images includes:
确定所述待处理视频中的多个拍摄场景;Determining multiple shooting scenes in the video to be processed;
对每个拍摄场景进行抽帧处理,得到与每个所述拍摄场景对应的场景图像;Performing frame extraction processing on each shooting scene to obtain a scene image corresponding to each shooting scene;
对每个所述场景图像进行对象识别,得到与每个所述场景图像分别对应的所述第一标注图像。Object recognition is performed on each of the scene images to obtain the first annotated image corresponding to each of the scene images.
在第二方面的一种可能的实施方式中,所述多个所述第一标注图像的确定方法,包括:In a possible implementation manner of the second aspect, the method for determining the plurality of first annotated images includes:
在拍摄所述待处理视频的过程中,当检测到拍摄场景从第一场景变化为第二场景时,从已拍摄视频片段中获取与所述第一场景对应的视频帧序列;In the process of shooting the video to be processed, when it is detected that the shooting scene changes from the first scene to the second scene, a video frame sequence corresponding to the first scene is acquired from the shot video clips;
对所述视频帧序列进行抽帧处理,得到与所述第一场景对应的场景图像;Performing frame extraction processing on the video frame sequence to obtain a scene image corresponding to the first scene;
对所述场景图像进行对象识别,得到所述第一场景的所述第一标注图像。Object recognition is performed on the scene image to obtain the first annotated image of the first scene.
在第二方面的一种可能的实施方式中,所述接收电子设备发送的与动态对象对应的指示信息, 包括:In a possible implementation manner of the second aspect, the receiving electronic device sends indication information corresponding to the dynamic object, include:
接收电子设备发送的第一图像,所述第一图像中包括至少一个对象;Receiving a first image sent by an electronic device, wherein the first image includes at least one object;
根据所述第一图像确定第二标注图像,所述第二标注图像中标注有所述至少一个对象;determining a second annotated image according to the first image, wherein the second annotated image is annotated with the at least one object;
向所述电子设备发送与所述第一图像对应的所述第二标注图像;Sending the second annotated image corresponding to the first image to the electronic device;
接收所述电子设备发送的从所述至少一个对象中确定的所述动态对象的所述指示信息。The indication information of the dynamic object determined from the at least one object is received and sent by the electronic device.
在第二方面的一种可能的实施方式中,所述根据所述第一图像确定第二标注图像,包括:In a possible implementation of the second aspect, determining the second annotated image according to the first image includes:
对所述第一图像进行对象识别,得到所述第二标注图像。Perform object recognition on the first image to obtain the second annotated image.
在第二方面的一种可能的实施方式中,所述接收电子设备发送的与动态对象对应的指示信息,包括:In a possible implementation manner of the second aspect, the receiving indication information corresponding to the dynamic object sent by the electronic device includes:
接收所述电子设备发送的第一图像中所述动态对象的所述指示信息。Receive the indication information of the dynamic object in the first image sent by the electronic device.
在第二方面的一种可能的实施方式中,所述第一图像为所述待处理视频拍摄之前拍摄的图像,或者为所述待处理视频中的图像。In a possible implementation of the second aspect, the first image is an image captured before the video to be processed is captured, or is an image in the video to be processed.
在第二方面的一种可能的实施方式中,所述方法还包括:In a possible implementation manner of the second aspect, the method further includes:
若所述关键帧序列的第一关键帧中存在干扰对象,则消除所述第一关键帧中的所述干扰对象。If an interfering object exists in a first key frame of the key frame sequence, the interfering object in the first key frame is eliminated.
在第二方面的一种可能的实施方式中,所述消除所述第一关键帧中的所述干扰对象,包括:In a possible implementation manner of the second aspect, eliminating the interference object in the first key frame includes:
根据所述第一关键帧在所述关键帧序列的相邻帧中与所述干扰对象对应的区域,消除所述第一关键帧中的所述干扰对象。The interfering object in the first key frame is eliminated according to a region of the first key frame corresponding to the interfering object in adjacent frames of the key frame sequence.
在第二方面的一种可能的实施方式中,所述分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列,包括:In a possible implementation of the second aspect, the performing frame extraction processing on the multiple frames of images corresponding to each of the actions to obtain a key frame sequence corresponding to each of the actions includes:
根据每个所述动作对应的所述多帧图像中与所述动态对象对应区域的像素均值,确定与每个所述动作对应的所述关键帧序列。The key frame sequence corresponding to each action is determined according to the pixel average value of the area corresponding to the dynamic object in the multiple frames of images corresponding to each action.
示例性的,可以将每个所述动作对应的所述多帧图像中绝对偏差最小的图像确定为与所述多帧图像对应的所述关键帧,根据每个所述动作对应的所述关键帧确定与每个所述动作对应的关键帧序列。Exemplarily, the image with the smallest absolute deviation in the multiple frames of images corresponding to each of the actions can be determined as the key frame corresponding to the multiple frames of images, and the key frame sequence corresponding to each of the actions can be determined based on the key frames corresponding to each of the actions.
第三方面,本申请实施例提供一种电子设备,该电子设备包括:In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:
动态对象确定单元,用于响应于用户的第一操作,确定动态对象;a dynamic object determining unit, configured to determine a dynamic object in response to a first operation of a user;
定格动画确定单元,用于根据所述动态对象和待处理视频确定定格动画,所述待处理视频包括所述动态对象,所述定格动画中的每一帧图像为所述待处理视频中的视频帧。The stop-motion animation determining unit is used to determine the stop-motion animation according to the dynamic object and the video to be processed, wherein the video to be processed includes the dynamic object, and each frame image in the stop-motion animation is a video frame in the video to be processed.
在第三方面的一种可能的实施方式中,所述动态对象确定单元,还用于:In a possible implementation manner of the third aspect, the dynamic object determining unit is further configured to:
获取所述待处理视频;Obtaining the video to be processed;
显示所述待处理视频中的多个第一标注图像,每个所述第一标注图像中标注有至少一个对象;Displaying a plurality of first annotated images in the video to be processed, each of the first annotated images being annotated with at least one object;
响应于用户的第一操作,从每个所述第一标注图中标注的所述至少一个对象中确定所述动态对象。In response to a first operation of a user, the dynamic object is determined from the at least one object annotated in each of the first annotated images.
在第三方面的一种可能的实施方式中,所述显示所述待处理视频中的多个第一标注图像,包括:In a possible implementation manner of the third aspect, displaying the plurality of first annotated images in the video to be processed includes:
确定所述待处理视频中的多个拍摄场景;Determining multiple shooting scenes in the video to be processed;
对每个拍摄场景进行抽帧处理,得到与每个所述拍摄场景对应的场景图像;Performing frame extraction processing on each shooting scene to obtain a scene image corresponding to each shooting scene;
对每个所述场景图像进行对象识别,得到与每个所述场景图像分别对应的所述第一标注图像。Object recognition is performed on each of the scene images to obtain the first annotated image corresponding to each of the scene images.
在第三方面的一种可能的实施方式中,所述显示所述待处理视频中的多个第一标注图像,包括:In a possible implementation manner of the third aspect, displaying the plurality of first annotated images in the video to be processed includes:
在拍摄所述待处理视频的过程中,当检测到拍摄场景从第一场景变化为第二场景时,从已拍摄视频片段中获取与所述第一场景对应的视频帧序列;In the process of shooting the video to be processed, when it is detected that the shooting scene changes from the first scene to the second scene, a video frame sequence corresponding to the first scene is acquired from the shot video clips;
对所述视频帧序列进行抽帧处理,得到与所述第一场景对应的场景图像;Performing frame extraction processing on the video frame sequence to obtain a scene image corresponding to the first scene;
对所述场景图像进行对象识别,得到所述第一场景的所述第一标注图像。Object recognition is performed on the scene image to obtain the first annotated image of the first scene.
在第三方面的一种可能的实施方式中,所述显示所述待处理视频中的多个第一标注图像,包括:In a possible implementation manner of the third aspect, displaying the plurality of first annotated images in the video to be processed includes:
向云端服务器发送所述待处理视频; Sending the video to be processed to a cloud server;
接收所述云端服务器发送的多个所述第一标注图像;Receiving the plurality of first annotated images sent by the cloud server;
显示多个所述第一标注图像。A plurality of the first annotated images are displayed.
在第三方面的一种可能的实施方式中,所述动态对象确定单元,还用于:In a possible implementation manner of the third aspect, the dynamic object determining unit is further configured to:
获取第一图像,所述第一图像中包括至少一个对象;Acquire a first image, wherein the first image includes at least one object;
根据所述第一图像显示第二标注图像,所述第二标注图像中标注有所述至少一个对象;displaying a second annotated image according to the first image, wherein the second annotated image is annotated with the at least one object;
响应于用户的所述第一操作,从所述至少一个对象中确定所述动态对象。In response to the first operation of the user, the dynamic object is determined from the at least one object.
在第三方面的一种可能的实施方式中,所述根据所述第一图像显示第二标注图像,包括:In a possible implementation of the third aspect, displaying the second annotated image according to the first image includes:
对所述第一图像进行对象识别,得到所述第二标注图像;Performing object recognition on the first image to obtain the second annotated image;
显示所述第二标注图像。The second annotated image is displayed.
在第三方面的一种可能的实施方式中,所述根据所述第一图像显示第二标注图像,包括:In a possible implementation of the third aspect, displaying the second annotated image according to the first image includes:
向云端服务器发送所述第一图像;Sending the first image to a cloud server;
接收所述云端服务器发送的与所述第一图像对应的第二标注图像;Receiving a second annotated image corresponding to the first image and sent by the cloud server;
显示所述第二标注图像。The second annotated image is displayed.
在第三方面的一种可能的实施方式中,所述第一操作为聚焦操作,所述响应于用户的第一操作,确定动态对象,包括:In a possible implementation of the third aspect, the first operation is a focusing operation, and determining the dynamic object in response to the first operation of the user includes:
获取第一图像,第一图像中包括至少一个对象;Acquire a first image, wherein the first image includes at least one object;
响应于用户在所述第一图像上的所述聚焦操作,从所述至少一个对象中确定所述第一图像中的所述动态对象。In response to the focusing operation of the user on the first image, the dynamic object in the first image is determined from the at least one object.
在第三方面的一种可能的实施方式中,所述第一图像为所述待处理视频拍摄之前拍摄的图像,或者为所述待处理视频中的图像。In a possible implementation of the third aspect, the first image is an image captured before the video to be processed is captured, or is an image in the video to be processed.
在第三方面的一种可能的实施方式中,所述定格动画确定单元,还用于:In a possible implementation manner of the third aspect, the stop-motion animation determination unit is further configured to:
确定所述待处理视频中与所述动态对象的每个动作对应的多帧图像;Determine a plurality of frames of images corresponding to each action of the dynamic object in the video to be processed;
分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列;Performing frame extraction processing on the multiple frames of images corresponding to each of the actions respectively to obtain a key frame sequence corresponding to each of the actions;
根据每个所述动作的对应所述关键帧序列生成所述定格动画。The stop-motion animation is generated according to the key frame sequence corresponding to each of the actions.
在第三方面的一种可能的实施方式中,所述方法还包括:In a possible implementation manner of the third aspect, the method further includes:
若所述关键帧序列的所述第一关键帧中存在干扰对象,则消除所述第一关键帧中的所述干扰对象。If an interfering object exists in the first key frame of the key frame sequence, the interfering object in the first key frame is eliminated.
在第三方面的一种可能的实施方式中,所述消除所述第一关键帧中的所述干扰对象,包括:In a possible implementation manner of the third aspect, the eliminating the interference object in the first key frame includes:
根据所述第一关键帧在所述关键帧序列的相邻帧中与所述干扰对象对应的区域,消除所述第一关键帧中的所述干扰对象。The interfering object in the first key frame is eliminated according to a region of the first key frame corresponding to the interfering object in adjacent frames of the key frame sequence.
在第三方面的一种可能的实施方式中,所述分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列,包括:In a possible implementation manner of the third aspect, the performing frame extraction processing on the multiple frames of images corresponding to each of the actions to obtain a key frame sequence corresponding to each of the actions includes:
根据每个所述动作对应的所述多帧图像中与所述动态对象对应区域的像素均值,确定与每个所述动作对应的所述关键帧序列。The key frame sequence corresponding to each action is determined according to the pixel average value of the area corresponding to the dynamic object in the multiple frames of images corresponding to each action.
在第三方面的一种可能的实施方式中,所述根据所述动态对象和待处理视频确定定格动画,包括:In a possible implementation manner of the third aspect, determining the stop-motion animation according to the dynamic object and the video to be processed includes:
向云端服务器发送所述动态对象的指示信息;Sending indication information of the dynamic object to a cloud server;
接收所述定格动画。The stop motion animation is received.
在第三方面的一种可能的实施方式中,所述根据所述动态对象和待处理视频确定定格动画,包括:In a possible implementation manner of the third aspect, determining the stop-motion animation according to the dynamic object and the video to be processed includes:
向云端服务器发送所述动态对象的指示信息和所述待处理视频;Sending the indication information of the dynamic object and the video to be processed to a cloud server;
接收所述定格动画。The stop motion animation is received.
第四方面,本申请实施例提供一种云端服务器,该云端服务器包括:In a fourth aspect, an embodiment of the present application provides a cloud server, the cloud server comprising:
接收单元,用于接收电子设备发送的与动态对象对应的指示信息和待处理视频,根据所述指示信息确定所述动态对象;A receiving unit, configured to receive indication information corresponding to a dynamic object and a video to be processed sent by an electronic device, and determine the dynamic object according to the indication information;
确定单元,用于确定待处理视频中与所述动态对象的每个动作对应的多帧图像; A determination unit, used to determine a plurality of frames of images corresponding to each action of the dynamic object in the video to be processed;
处理单元,用于分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列;A processing unit, used for performing frame extraction processing on the multiple frames of images corresponding to each of the actions, to obtain a key frame sequence corresponding to each of the actions;
生成单元,用于根据每个所述动作的对应所述关键帧序列生成定格动画;A generating unit, configured to generate a stop-motion animation according to the key frame sequence corresponding to each of the actions;
发送单元,用于向电子设备发送所述定格动画。The sending unit is used to send the stop-motion animation to an electronic device.
在第四方面的一种可能的实施方式中,所述接收单元,还用于:In a possible implementation manner of the fourth aspect, the receiving unit is further configured to:
接收电子设备发送的所述待处理视频;Receiving the video to be processed sent by the electronic device;
向所述电子设备发送从所述待处理视频中确定的多个第一标注图像,每个所述第一标注图像中标注有至少一个对象;Sending a plurality of first annotated images determined from the video to be processed to the electronic device, each of the first annotated images being annotated with at least one object;
接收所述电子设备发送的从每个所述第一标注图像中标注的所述至少一个对象中确定的所述动态对象的所述指示信息。The indication information of the dynamic object determined from the at least one object annotated in each of the first annotated images is received and sent by the electronic device.
在第四方面的一种可能的实施方式中,所述多个所述第一标注图像的确定方法,包括:In a possible implementation manner of the fourth aspect, the method for determining the plurality of first annotated images includes:
确定所述待处理视频中的多个拍摄场景;Determining multiple shooting scenes in the video to be processed;
对每个拍摄场景进行抽帧处理,得到与每个所述拍摄场景对应的场景图像;Performing frame extraction processing on each shooting scene to obtain a scene image corresponding to each shooting scene;
对每个所述场景图像进行对象识别,得到与每个场景图像分别对应的所述第一标注图像。Object recognition is performed on each of the scene images to obtain the first annotated image corresponding to each of the scene images.
在第四方面的一种可能的实施方式中,所述多个所述第一标注图像的确定方法,包括:In a possible implementation manner of the fourth aspect, the method for determining the plurality of first annotated images includes:
在拍摄所述待处理视频的过程中,当检测到拍摄场景从第一场景变化为第二场景时,从已拍摄视频片段中获取与所述第一场景对应的视频帧序列;In the process of shooting the video to be processed, when it is detected that the shooting scene changes from the first scene to the second scene, a video frame sequence corresponding to the first scene is acquired from the shot video clips;
对所述视频帧序列进行抽帧处理,得到与所述第一场景对应的场景图像;Performing frame extraction processing on the video frame sequence to obtain a scene image corresponding to the first scene;
对所述场景图像进行对象识别,得到所述第一场景的所述第一标注图像。Object recognition is performed on the scene image to obtain the first annotated image of the first scene.
在第四方面的一种可能的实施方式中,所述接收单元,还用于:In a possible implementation manner of the fourth aspect, the receiving unit is further configured to:
接收电子设备发送的第一图像,所述第一图像中包括至少一个对象;Receiving a first image sent by an electronic device, wherein the first image includes at least one object;
根据所述第一图像确定第二标注图像,所述第二标注图像中标注有所述至少一个对象;determining a second annotated image according to the first image, wherein the second annotated image is annotated with the at least one object;
向所述电子设备发送与所述第一图像对应的第二标注图像;Sending a second annotated image corresponding to the first image to the electronic device;
接收所述电子设备发送的从所述至少一个对象中确定的所述动态对象的所述指示信息。The indication information of the dynamic object determined from the at least one object is received and sent by the electronic device.
在第四方面的一种可能的实施方式中,所述接收单元,还用于:In a possible implementation manner of the fourth aspect, the receiving unit is further configured to:
接收所述电子设备发送的第一图像中所述动态对象的所述指示信息。Receive the indication information of the dynamic object in the first image sent by the electronic device.
在第四方面的一种可能的实施方式中,所述根据所述第一图像确定第二标注图像,包括:In a possible implementation manner of the fourth aspect, determining the second annotated image according to the first image includes:
对所述第一图像进行对象识别,得到所述第二标注图像。Perform object recognition on the first image to obtain the second annotated image.
在第四方面的一种可能的实施方式中,所述第一图像为所述待处理视频拍摄之前拍摄的图像,或者为所述待处理视频中的图像。In a possible implementation of the fourth aspect, the first image is an image captured before the video to be processed is captured, or is an image in the video to be processed.
在第四方面的一种可能的实施方式中,该云端服务器还包括:In a possible implementation manner of the fourth aspect, the cloud server further includes:
消除单元,用于若所述关键帧序列的第一关键帧中存在干扰对象,则消除所述第一关键帧中的所述干扰对象。The eliminating unit is configured to eliminate the interfering object in the first key frame of the key frame sequence if there is an interfering object in the first key frame.
在第四方面的一种可能的实施方式中,所述消除单元,还用于:In a possible implementation manner of the fourth aspect, the elimination unit is further used to:
根据所述第一关键帧在所述关键帧序列的相邻帧中与所述干扰对象对应的区域,消除所述第一关键帧中的所述干扰对象。The interfering object in the first key frame is eliminated according to a region of the first key frame corresponding to the interfering object in adjacent frames of the key frame sequence.
在第四方面的一种可能的实施方式中,所述分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列,包括:In a possible implementation manner of the fourth aspect, the performing frame extraction processing on the multiple frames of images corresponding to each of the actions to obtain a key frame sequence corresponding to each of the actions includes:
根据每个所述动作对应的所述多帧图像中与所述动态对象对应区域的像素均值,确定与每个所述动作对应的所述关键帧序列。The key frame sequence corresponding to each action is determined according to the pixel average value of the area corresponding to the dynamic object in the multiple frames of images corresponding to each action.
第五方面,本申请实施例提供一种电子设备,包括:处理器,所述处理器用于运行存储器中存储的计算机程序,以实现第一方面或第一方面的任一可能的实现方式中的方法。In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a processor, wherein the processor is used to run a computer program stored in a memory to implement the method in the first aspect or any possible implementation manner of the first aspect.
第六方面,本申请实施例提供一种云端服务器,包括:处理器,处理器用于运行存储器中存储的计算机程序,以实现第二方面或第二方面的任一可能的实现方式中的方法。In a sixth aspect, an embodiment of the present application provides a cloud server, comprising: a processor, the processor being used to run a computer program stored in a memory to implement the method in the second aspect or any possible implementation manner of the second aspect.
第七方面,本申请提供一种定格动画生成系统,该定格动画生成系统包括第五方面所述的电子设备,和/或第六方面所述的云端服务器。In a seventh aspect, the present application provides a stop-motion animation generation system, which includes the electronic device described in the fifth aspect and/or the cloud server described in the sixth aspect.
第八方面,本申请提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序, 计算机程序被处理器执行时实现第一方面至第二方面的任一可能的实现方式中的方法。In an eighth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method in any possible implementation manner of the first aspect to the second aspect is implemented.
第九方面,本申请提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行第一方面至第二方面的任一可能的实现方式中的方法。In a ninth aspect, the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device executes the method in any possible implementation of the first to second aspects.
本申请提供的第二方面至第九方面的技术效果可以参见上述第一方面的各个可能的实现方式的技术效果,此处不再赘述。The technical effects of the second to ninth aspects provided in the present application can refer to the technical effects of the various possible implementation methods of the first aspect mentioned above, and will not be repeated here.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本申请实施例提供的一种电子设备的结构示意图。FIG1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
图2为本申请实施例提供的一种电子设备的软件结构示意图。FIG. 2 is a schematic diagram of a software structure of an electronic device provided in an embodiment of the present application.
图3-1至图3-4为本申请实施例提供的一种定格动画生成方法的一个实施例的流程图。FIG. 3-1 to FIG. 3-4 are flow charts of an embodiment of a stop-motion animation generation method provided in an embodiment of the present application.
图4至图8为本申请实施例提供的一种定格动画生成方法对应的场景示意图。4 to 8 are schematic diagrams of scenes corresponding to a stop-motion animation generation method provided in an embodiment of the present application.
图9为本申请实施例提供的另一种定格动画生成方法的一个实施例的交互示意图。FIG. 9 is an interactive schematic diagram of an embodiment of another stop-motion animation generation method provided in an embodiment of the present application.
图10为本申请实施例提供的另一种定格动画生成方法的另一个实施例的交互示意图。FIG. 10 is an interactive schematic diagram of another embodiment of another stop-motion animation generation method provided in an embodiment of the present application.
图11为本申请实施例提供的另一种定格动画生成方法的又一个实施例的交互示意图。FIG. 11 is an interactive schematic diagram of yet another embodiment of another stop-motion animation generation method provided in an embodiment of the present application.
图12为本申请实施例提供的一种与定格动画生成方法对应的电子设备的结构框图。FIG. 12 is a structural block diagram of an electronic device corresponding to a stop-motion animation generation method provided in an embodiment of the present application.
图13为本申请实施例提供的一种与定格动画生成方法对应的云端服务器的结构框图。FIG13 is a structural block diagram of a cloud server corresponding to a stop-motion animation generation method provided in an embodiment of the present application.
具体实施方式Detailed ways
定格动画又可以称为逐帧动画,被广泛应用于商业广告、宣传片、电影短片以及手工创作等领域。定格动画的制作一般可以采用以下两种方式,第一种方式是:人工逐帧拍摄多帧精准的图像,然后根据上述多帧精准的图像合成定格动画。利用这种方式制作定格动画需要前期拍摄大量精准的图像,拍摄过程繁琐复杂,延长了定格动画的制作周期,降低定格动画的制作效率。Stop-motion animation, also known as frame-by-frame animation, is widely used in commercials, promotional videos, short films, and handmade creations. There are generally two ways to make stop-motion animation. The first way is to manually shoot multiple frames of precise images frame by frame, and then synthesize the stop-motion animation based on the multiple frames of precise images. Using this method to make stop-motion animation requires shooting a large number of precise images in the early stage. The shooting process is cumbersome and complicated, which prolongs the production cycle of stop-motion animation and reduces the production efficiency of stop-motion animation.
第二种方式是:预先拍摄完整的视频,然后再对拍摄的视频进行人工剪辑以形成定格动画。利用这种方式制作定格动画前期需要拍摄视频,后期需要人工参与视频剪辑,使得定格动画的制作复杂化,这种方式同样存在定格动画制作周期长,制作效率低的问题。The second method is to shoot a complete video in advance, and then manually edit the video to form a stop-motion animation. Using this method to make a stop-motion animation requires shooting a video in the early stage, and manual video editing is required in the later stage, which makes the production of stop-motion animation complicated. This method also has the problems of long production cycle and low production efficiency.
因此,针对上述问题,本申请提供一种定格动画生成方法,在生成定格动画的过程中,基于用户指定的动态对象即可从待处理视频中自动生成与动态对象对应的定格动画,无需人工对视频进行剪辑也无需单独拍摄每一帧图像,缩短了定格动画的制作周期,提高了定格动画的制作效率。Therefore, in response to the above-mentioned problems, the present application provides a stop-motion animation generation method. In the process of generating the stop-motion animation, the stop-motion animation corresponding to the dynamic object can be automatically generated from the video to be processed based on the dynamic object specified by the user. There is no need to manually edit the video or shoot each frame of the image separately, which shortens the production cycle of the stop-motion animation and improves the production efficiency of the stop-motion animation.
下面结合本申请实施例中的附图以及相关实施例,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请以下各实施例中,“至少一个”、“一个或多个”是指一个或两个以上(包含两个)。术语“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。The technical solutions in the embodiments of the present application are described below in conjunction with the drawings and related embodiments in the embodiments of the present application. Among them, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear indication to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and/or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character "/" generally indicates that the associated objects before and after are in a "or" relationship.
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。术语“连接”包括直接连接和间接连接,除非另外说明。“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
在本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.
本申请实施例提供的定格动画生成方法可以应用于电子设备。电子设备可以是手机、平板电 脑、可穿戴设备、AR设备、VR设备、笔记本电脑、超级移动个人计算机(Ultra-Mobile Personal Computer,UMPC)、上网本、个人数字助理(Personal Digital Assistant,PDA)、车载设备、智慧屏、云端服务器等,本申请实施例对电子设备的具体类型不作任何限制。The stop-motion animation generation method provided in the embodiment of the present application can be applied to electronic devices. The electronic device can be a mobile phone, a tablet computer, or a The present invention relates to a computer system that can be used for the production of electronic devices, such as computers, wearable devices, AR devices, VR devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), vehicle-mounted devices, smart screens, cloud servers, etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
参见图1,为本申请提供的一种电子设备100的结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器131,通用串行总线(Universal Serial Bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(Subscriber Identification Module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。Referring to FIG. 1 , it is a schematic diagram of the structure of an electronic device 100 provided in the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 131, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a Subscriber Identification Module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
作为举例,当电子设备100为手机或平板电脑时,可以包括图示中的全部部件,也可以仅包括图示中的部分部件。For example, when the electronic device 100 is a mobile phone or a tablet computer, it may include all the components shown in the figure, or may include only some of the components shown in the figure.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(Application Processor,AP),调制解调处理器,图形处理器(Graphics Processing Unit,GPU),图像信号处理器(Image Signal Processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(Digital Signal Processor,DSP),基带处理器,和/或神经网络处理器(Neural-network Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated in one or more processors.
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(Inter-integrated Circuit,I2C)接口,集成电路内置音频(Inter-integrated Circuit Sound,I2S)接口,脉冲编码调制(Pulse Code Modulation,PCM)接口,通用异步收发传输器(Universal Asynchronous Receiver/Transmitter,UART)接口,移动产业处理器接口(Mobile Industry Processor Interface,MIPI),通用输入输出(General-Purpose Input/Output,GPIO)接口,用户标识模块(Subscriber Identity Module,SIM)接口,和/或通用串行总线(Universal Serial Bus,USB)接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an Inter-integrated Circuit (I2C) interface, an Inter-integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver/Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a General-Purpose Input/Output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接 收电池142和/或充电管理模块140的输入,为处理器110,内部存储器131,外部存储器接口120,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电、阻抗)等参数。The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charging management module 140 to power the processor 110, the internal memory 131, the external memory interface 120, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, and battery health status (leakage, impedance).
在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。In some other embodiments, the power management module 141 may also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 may also be disposed in the same device.
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。The mobile communication module 150 can provide solutions for wireless communications including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1.
在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。In some embodiments, at least some functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 may be disposed in the same device as at least some modules of the processor 110.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(Wireless Fidelity,Wi-Fi)网络),蓝牙(BlueTooth,BT),全球导航卫星系统(Global Navigation Satellite System,GNSS),调频(Frequency Modulation,FM),近距离无线通信技术(Near Field Communication,NFC),红外技术(Infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as Wireless Fidelity (Wi-Fi) network), Bluetooth (BlueTooth, BT), Global Navigation Satellite System (Global Navigation Satellite System, GNSS), Frequency Modulation (Frequency Modulation, FM), Near Field Communication (Near Field Communication, NFC), Infrared (Infrared, IR) and the like applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify the signal, and convert it into electromagnetic waves for radiation via the antenna 2.
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。无线通信技术可以包括全球移动通讯系统(Global System for Mobile Communications,GSM),通用分组无线服务(General Packet Radio Service,GPRS),码分多址接入(Code Division Multiple Access,CDMA),宽带码分多址(Wideband Code Division Multiple Access,WCDMA),时分码分多址(Time-Division Code Division Multiple Access,TD-SCDMA),长期演进(Long Term Evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。GNSS可以包括全球卫星定位系统(Global Positioning System,GPS),全球导航卫星系统(Global Navigation Satellite System,GLONASS),北斗卫星导航系统(Beidou Navigation Satellite System,BDS),准天顶卫星系统(Quasi-Zenith Satellite System,QZSS)和/或星基增强系统(Satellite Based Augmentation Systems,SBAS)。In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technology. GNSS can include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the Beidou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS) and/or the Satellite Based Augmentation Systems (SBAS).
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏194用于显示图像,视频等。例如本申请实施例中的APP的图标、文件夹、文件夹名称等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(Liquid Crystal Display,LCD), 有机发光二极管(Organic Light-Emitting Diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(Active-Matrix Organic Light Emitting Diode,AMOLED),柔性发光二极管(Flex Light-Emitting Diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(Quantum Dot Light Emitting Diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos, etc. For example, icons, folders, folder names, etc. of the APP in the embodiment of the present application. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). Organic Light-Emitting Diode (OLED), Active-Matrix Organic Light Emitting Diode or Active-Matrix Organic Light Emitting Diode (AMOLED), Flexible Light-Emitting Diode (FLED), Miniled, MicroLed, Micro-oLed, Quantum Dot Light Emitting Diodes (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。镜头的焦段可以用于表示摄像头的取景范围,镜头的焦段越小,表示镜头的取景范围越大。感光元件可以是电荷耦合器件(Charge Coupled Device,CCD)或互补金属氧化物半导体(Complementary Metal-Oxide-Semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The focal length of the lens can be used to indicate the camera's field of view. The smaller the focal length of the lens, the larger the lens's field of view. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format.
在本申请中,电子设备100可以包括2个或2个以上焦段的摄像头193。In the present application, the electronic device 100 may include cameras 193 with 2 or more focal lengths.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(Moving Picture Experts Group,MPEG)1,MPEG1,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG1, MPEG3, MPEG4, etc.
NPU为神经网络(Neural-Network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
在本申请实施例中,NPU或其他处理器可以用于对电子设备100存储的视频中的图像进行分析处理等操作。In an embodiment of the present application, the NPU or other processors may be used to perform operations such as analyzing and processing images in a video stored in the electronic device 100.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
内部存储器131可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器110通过运行存储在内部存储器131的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器131可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)。The internal memory 131 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 131. The internal memory 131 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.).
此外,内部存储器131可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(Universal Flash Storage,UFS)等。In addition, the internal memory 131 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (Universal Flash Storage, UFS), etc.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
音频模块170用于将数字音频信号转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used to convert digital audio signals into analog audio signals for output, and is also used to convert analog audio inputs into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话,例如扬声器可以播放本申请实施例提供的比对分析结果。The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A. For example, the speaker can play the comparison analysis results provided in the embodiment of the present application.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。 The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(Open mobile Terminal Platform,OMTP)标准接口,美国蜂窝电信工业协会(Cellular Telecommunications Industry Association of the USA,CTIA)标准接口。The earphone interface 170D is used to connect a wired earphone. The earphone interface 170D may be the USB interface 130, or may be a 3.5 mm Open Mobile Terminal Platform (OMTP) standard interface or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or separated from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
参见图2,为本申请实施例的电子设备的软件结构示意图。电子设备中的操作系统可以是安卓(Android)系统,微软窗口系统(Windows),苹果移动操作系统(iOS)或者鸿蒙系统(Harmony OS)等。在此,以电子设备的操作系统为鸿蒙系统为例进行说明。See Figure 2, which is a schematic diagram of the software structure of an electronic device in an embodiment of the present application. The operating system in the electronic device may be an Android system, a Microsoft Windows system, an Apple mobile operating system (iOS) or a Harmony OS, etc. Here, the operating system of the electronic device is taken as an example for explanation.
在一些实施例中,可将鸿蒙系统分为四层,包括内核层、系统服务层、框架层以及应用层,层与层之间通过软件接口通信。In some embodiments, the Hongmeng system can be divided into four layers, including the kernel layer, the system service layer, the framework layer, and the application layer, and the layers communicate with each other through software interfaces.
如图2所示,内核层包括内核抽象层(Kernel Abstract Layer,KAL)和驱动子系统。KAL下包括多个内核,如Linux系统的内核Linux Kernel、轻量级物联网系统内核LiteOS等。驱动子系统则可以包括硬件驱动框架(Hardware Driver Foundation,HDF)。硬件驱动框架能够提供统一外设访问能力和驱动开发、管理框架。多内核的内核层可以根据系统的需求选择相应的内核进行处理。As shown in Figure 2, the kernel layer includes the kernel abstract layer (KAL) and the driver subsystem. KAL includes multiple kernels, such as the Linux kernel of the Linux system and the LiteOS kernel of the lightweight IoT system. The driver subsystem can include the hardware driver framework (HDF). The hardware driver framework can provide unified peripheral access capabilities and a driver development and management framework. The kernel layer of multiple kernels can select the corresponding kernel for processing according to the needs of the system.
系统服务层是鸿蒙系统的核心能力集合,系统服务层通过框架层对应用程序提供服务。该层可包括系统基本能力子系统集、基础软件服务子系统集、增强软件服务子系统集以及硬件服务子系统集。The system service layer is the core capability set of the Hongmeng system, and provides services to applications through the framework layer. This layer may include the system basic capability subsystem set, the basic software service subsystem set, the enhanced software service subsystem set, and the hardware service subsystem set.
系统基本能力子系统集为分布式应用在鸿蒙系统的设备上的运行、调度、迁移等操作提供了基础能力。可包括分布式软总线、分布式数据管理、分布式任务调度、方舟多语言运行时、公共基础库、多模输入、图形、安全、人工智能(Artificial Intelligence,AI)、用户程序框架等子系统。其中,方舟多语言运行时提供了C或C++或JavaScript(JS)多语言运行时和基础的系统类库,也可以为使用方舟编译器静态化的Java程序(即应用程序或框架层中使用Java语言开发的部分)提供运行时。The system basic capability subsystem set provides basic capabilities for the operation, scheduling, migration and other operations of distributed applications on devices of Hongmeng system. It may include distributed soft bus, distributed data management, distributed task scheduling, Ark multi-language runtime, public basic library, multi-mode input, graphics, security, artificial intelligence (AI), user program framework and other subsystems. Among them, Ark multi-language runtime provides C or C++ or JavaScript (JS) multi-language runtime and basic system class library, and can also provide runtime for Java programs statically compiled by Ark compiler (that is, the part developed in Java language in the application or framework layer).
基础软件服务子系统集为鸿蒙系统提供公共的、通用的软件服务。可包括事件通知、电话、多媒体、面向X设计(Design For X,DFX)、MSDP&DV等子系统。The basic software service subsystem set provides public and general software services for the Hongmeng system, including event notification, telephone, multimedia, Design For X (DFX), MSDP&DV and other subsystems.
增强软件服务子系统集为鸿蒙系统提供针对不同设备的、差异化的能力增强型软件服务。可包括智慧屏专有业务、穿戴专有业务、物联网(Internet of Things,IoT)专有业务子系统组成。 The enhanced software service subsystem set provides the Hongmeng system with differentiated capability-enhanced software services for different devices, including smart screen proprietary services, wearable proprietary services, and Internet of Things (IoT) proprietary service subsystems.
硬件服务子系统集为鸿蒙系统提供硬件服务。可包括位置服务、生物特征识别、穿戴专有硬件服务、IoT专有硬件服务等子系统。The hardware service subsystem set provides hardware services for the Hongmeng system, including location services, biometric recognition, wearable proprietary hardware services, IoT proprietary hardware services and other subsystems.
框架层为鸿蒙系统应用开发提供了Java、C、C++、JS等多语言的用户程序框架和能力(Ability)框架,两种用户界面(User Interface,UI)框架(包括适用于Java语言的Java UI框架、适用于JS语言的JS UI框架),以及各种软硬件服务对外开放的多语言框架应用程序接口(Application Programming Interface,API)。根据系统的组件化裁剪程度,鸿蒙系统设备支持的API也会有所不同。The framework layer provides multi-language user program frameworks and capability frameworks in Java, C, C++, JS, and other languages for Hongmeng system application development, two user interface (UI) frameworks (including the Java UI framework for Java language and the JS UI framework for JS language), and multi-language framework application programming interfaces (APIs) open to various software and hardware services. Depending on the degree of componentization of the system, the APIs supported by Hongmeng system devices will also vary.
应用层包括系统应用和第三方应用(或称为扩展应用)。系统应用可包括桌面、控制栏、设置、电话等电子设备默认安装的应用程序。扩展应用可以是由电子设备的制造商开发设计的、非必要的应用,如电子设备管家、换机迁移、便签、天气等应用程序。而第三方非系统应用则可以是由其他厂商开发,但是可以在鸿蒙系统中运行应用程序,如游戏、导航、社交或购物等应用程序。The application layer includes system applications and third-party applications (or extended applications). System applications may include applications installed by default on electronic devices such as the desktop, control bar, settings, and phone. Extended applications can be non-essential applications developed and designed by the manufacturer of the electronic device, such as electronic device managers, device migration, notes, weather, and other applications. Third-party non-system applications can be developed by other manufacturers, but can run applications in the Hongmeng system, such as games, navigation, social or shopping applications.
提供后台运行任务的能力以及统一的数据访问抽象。PA主要为FA提供支持,例如作为后台服务提供计算能力,或作为数据仓库提供数据访问能力。基于FA或PA开发的应用,能够实现特定的业务功能,支持跨设备调度与分发,为用户提供一致、高效的应用体验。Provides the ability to run tasks in the background and unified data access abstraction. PA mainly provides support for FA, such as providing computing power as a background service, or providing data access capabilities as a data warehouse. Applications developed based on FA or PA can implement specific business functions, support cross-device scheduling and distribution, and provide users with a consistent and efficient application experience.
多个运行鸿蒙系统的电子设备之间可以通过分布式软总线、分布式设备虚拟化、分布式数据管理和分布式任务调度实现硬件互助和资源共享。Multiple electronic devices running the Hongmeng system can achieve hardware mutual assistance and resource sharing through distributed soft bus, distributed device virtualization, distributed data management and distributed task scheduling.
本申请提供的定格动画生成方法可以由电子设备执行,也可以由电子设备和云端服务器协同执行,下面结合本申请实施例中的附图以及相关实施例,以上述两种应用方式为例,对本申请实施例提供的定格动画生成方法进行示例性的说明。The stop-motion animation generation method provided in the present application can be executed by an electronic device, or can be executed collaboratively by an electronic device and a cloud server. The following, in combination with the drawings and related embodiments in the embodiments of the present application, takes the above two application methods as examples to exemplarily illustrate the stop-motion animation generation method provided in the embodiments of the present application.
首先针对电子设备执行的方式进行示例性的说明。First, an exemplary description is given of the execution method of the electronic device.
如图3-1至图3-4所示为本申请实施例提供的一种定格动画生成方法的一个实施例的流程图,参见图3-1,该定格动画生成方法包括:FIG. 3-1 to FIG. 3-4 are flowcharts of an embodiment of a stop-motion animation generation method provided in an embodiment of the present application. Referring to FIG. 3-1 , the stop-motion animation generation method includes:
301,响应于用户的第一操作,确定动态对象。301 : In response to a first operation of a user, determine a dynamic object.
在本申请实施例中,动态对象也可以称为目标对象,即指定格动画中运动状态或者自身形态发生变化的对象。第一操作可以是用于确定动态对象的至少一个确定操作,其中,确定操作可以是语音控制操作、触控选择操作、隔空手势控制操作或者物理按键选择操作等等。In the embodiment of the present application, the dynamic object may also be referred to as the target object, that is, the object whose motion state or shape changes in the specified frame animation. The first operation may be at least one determination operation for determining the dynamic object, wherein the determination operation may be a voice control operation, a touch selection operation, an air gesture control operation, or a physical button selection operation, etc.
在一个示例中,参见图3-2,确定动态对象的方法可以包括:3011a,获取到待处理视频。3012a,显示待处理视频中的多个第一标注图像,每个第一标注图像中标注有至少一个对象。3013a,响应于第一操作,从每个第一标注图像中标注的至少一个对象中确定动态对象。In one example, referring to FIG. 3-2 , the method for determining a dynamic object may include: 3011a, acquiring a video to be processed. 3012a, displaying a plurality of first annotated images in the video to be processed, each of which is annotated with at least one object. 3013a, in response to a first operation, determining a dynamic object from at least one object annotated in each of the first annotated images.
在该示例中,待处理视频是指用于生成定格动画的视频片段。所谓的待处理视频可以是指预先已经拍摄的完整视频;也可以是指在拍摄上述视频片段的过程中的部分视频,其中,部分视频可以理解为实时拍摄的视频。In this example, the video to be processed refers to a video clip used to generate a stop motion animation. The so-called video to be processed can refer to a complete video that has been shot in advance; it can also refer to a partial video in the process of shooting the above video clip, where the partial video can be understood as a video shot in real time.
待处理视频的获取方式包括但不限于直接从电子设备的视频存储模块中获取待处理视频。例如,如图4所示,在该电子设备显示屏的显示界面上设置有待处理视频的添加控件,用户点击添加控件后,跳转至电子设备的视频存储模块中,用户选择待处理视频并点击上传控件后,用户选择的待处理视频将会被添加成功,并在显示界面上显示待处理视频。The method of obtaining the video to be processed includes but is not limited to directly obtaining the video to be processed from the video storage module of the electronic device. For example, as shown in FIG4 , an add control for the video to be processed is set on the display interface of the electronic device display screen. After the user clicks the add control, it jumps to the video storage module of the electronic device. After the user selects the video to be processed and clicks the upload control, the video to be processed selected by the user will be added successfully, and the video to be processed will be displayed on the display interface.
为了保证从待处理视频中确定的动态对象的准确度和完整度,应理解,在一个可能的实施方式中,当获取到的待处理视频为预先拍摄的完整视频时,可以获取该待处理视频的每个视频帧,然后对每个视频帧中的至少一个对象进行识别,得到与该待处理视频对应的标注有至少一个对象的多个第一标注图像,然后检测用户对每个第一标注图像的至少一个对象的第一操作,从每个第一标注图像中标注的至少一个对象中确定动态对象。其中,对每个视频帧中的至少一个对象进行识别的方法包括但不限于区域卷积神经网络(Region CNN,R-CNN)、基于区域的快速卷积网络(Fast Region-based Convolutional Network,Fast R-CNN)等目标检测识别算法。In order to ensure the accuracy and completeness of the dynamic objects determined from the video to be processed, it should be understood that in a possible implementation, when the acquired video to be processed is a complete video shot in advance, each video frame of the video to be processed can be acquired, and then at least one object in each video frame can be identified to obtain a plurality of first annotated images corresponding to the video to be processed and annotated with at least one object, and then the user's first operation on at least one object in each first annotated image is detected, and the dynamic object is determined from at least one object annotated in each first annotated image. Among them, the method for identifying at least one object in each video frame includes but is not limited to target detection and recognition algorithms such as region convolutional neural network (Region CNN, R-CNN), region-based fast convolutional network (Fast Region-based Convolutional Network, Fast R-CNN), etc.
示例性的,如图5所示的界面,假设获取到与待处理视频对应的9个视频帧,对每个视频帧进行对象识别,以第一个视频帧为例,对第一个视频帧中的至少一个对象进行识别,当检测到“辣椒”对象时,可以获取第一个视频帧中与该“辣椒”对象对应的检测框的中心坐标,该中心坐标用于 指示“辣椒”对象,可以在第一个视频帧的“辣椒”对象上显示该中心坐标,这样就形成了与第一个视频帧对应的第一标注图像,然后参考上述步骤对其他各个视频帧中的至少一个对象进行识别,以获取与待处理视频的9个视频帧对应的第一标注图像。用户可以点击每个第一标注图像中至少一个对象上的中心坐标,以确定每个第一标注图像中的动态对象。Exemplarily, as shown in the interface of FIG5 , assume that 9 video frames corresponding to the video to be processed are obtained, and object recognition is performed on each video frame. Taking the first video frame as an example, at least one object in the first video frame is recognized. When the "pepper" object is detected, the center coordinates of the detection box corresponding to the "pepper" object in the first video frame can be obtained. The center coordinates are used Indicate the "chili" object, and display the center coordinates on the "chili" object of the first video frame, so that the first annotated image corresponding to the first video frame is formed, and then refer to the above steps to identify at least one object in each of the other video frames to obtain the first annotated images corresponding to the 9 video frames of the video to be processed. The user can click on the center coordinates of at least one object in each first annotated image to determine the dynamic object in each first annotated image.
为了加快待处理视频中动态对象的确定速度,在另一个可能的实施方式中,当获取到的待处理视频为预先拍摄的完整视频时,也可以将预先拍摄的完整视频划分为多个拍摄场景,对每个拍摄场景进行抽帧处理,得到与每个拍摄场景对应的场景图像,然后对每个场景图像进行对象识别,得到与每个场景图像分别对应的第一标注图像,响应于用户的第一操作,从每个第一标注图像的至少一个对象中确定动态对象。In order to speed up the determination of dynamic objects in the video to be processed, in another possible implementation, when the acquired video to be processed is a complete video shot in advance, the complete video shot in advance can also be divided into multiple shooting scenes, and each shooting scene is subjected to frame extraction processing to obtain a scene image corresponding to each shooting scene, and then object recognition is performed on each scene image to obtain a first annotated image corresponding to each scene image, and in response to a first operation of the user, a dynamic object is determined from at least one object in each first annotated image.
不难理解的,可以根据视频帧之间的相似性将预先拍摄的视频划分为多个拍摄场景。例如,获取预先拍摄的视频中的每个视频帧的像素值,对比各个视频帧之间的像素值差异,可以将像素值差异较小的两个视频帧确定为同一个拍摄场景中的视频帧,将像素值差异较大的两个视频帧确定为不同拍摄场景中的视频帧。具体的,若相邻两个视频帧之间的像素值差小于第一预设阈值,则确定两个视频帧相似;反之,若相邻两个视频帧之间的像素值差大于或等于第一预设阈值,则确定两个视频帧不相似,将所述两个视频帧中前一个视频帧和前一个视频帧之前的至少一个视频帧确定为一个拍摄场景,以此,可以得到与已经拍摄的视频对应的多个拍摄场景,每个拍摄场景可以对应至少一个视频帧。It is not difficult to understand that the pre-shot video can be divided into multiple shooting scenes according to the similarity between the video frames. For example, the pixel value of each video frame in the pre-shot video is obtained, and the pixel value difference between each video frame is compared. The two video frames with smaller pixel value difference can be determined as video frames in the same shooting scene, and the two video frames with larger pixel value difference can be determined as video frames in different shooting scenes. Specifically, if the pixel value difference between two adjacent video frames is less than a first preset threshold, the two video frames are determined to be similar; conversely, if the pixel value difference between two adjacent video frames is greater than or equal to the first preset threshold, the two video frames are determined to be dissimilar, and the previous video frame and at least one video frame before the previous video frame of the two video frames are determined as a shooting scene. In this way, multiple shooting scenes corresponding to the video that has been shot can be obtained, and each shooting scene can correspond to at least one video frame.
将预先拍摄的视频划分为多个拍摄场景后,对每个拍摄场景进行抽帧处理,得到与每个拍摄场景对应的场景图像。例如,可以随机抽取每个拍摄场景中的一个视频帧作为与该拍摄场景对应的场景图像;或者,也可以从每个拍摄场景中抽取对象最多的视频帧作为与每个拍摄场景对应的场景图像;亦或者,还可以将每个拍摄场景的至少一个视频帧中绝对偏差最小的视频帧确定为与拍摄场景对应的场景图像。After the pre-shot video is divided into a plurality of shooting scenes, each shooting scene is subjected to frame extraction processing to obtain a scene image corresponding to each shooting scene. For example, a video frame in each shooting scene may be randomly extracted as the scene image corresponding to the shooting scene; or, a video frame with the most objects may be extracted from each shooting scene as the scene image corresponding to each shooting scene; or, a video frame with the smallest absolute deviation in at least one video frame of each shooting scene may be determined as the scene image corresponding to the shooting scene.
得到与每个拍摄场景对应的场景图像后,对每个场景图像中的至少一个对象进行识别,以获取与每个场景图像分别对应的第一标注图像,之后,基于用户的第一操作,从每个第一标注图像的至少一个对象中确定动态对象。获取第一标注图像的方法与前一可能实施方式中获取第一标注图像的方法相同,在此将不再赘述。After obtaining the scene image corresponding to each shooting scene, at least one object in each scene image is identified to obtain a first annotated image corresponding to each scene image, and then, based on the first operation of the user, a dynamic object is determined from at least one object in each first annotated image. The method for obtaining the first annotated image is the same as the method for obtaining the first annotated image in the previous possible implementation manner, and will not be repeated here.
需要说明的是,待处理视频除了可以是预先已经拍摄的完整视频,待处理视频还可以是实时拍摄的视频(多张视频帧或图像)。示例性的,以如图6所示的显示界面为例,用户点击“相机”图标后显示拍摄界面,然后用户左右滑动以在拍摄界面中选择定格动画的拍摄模式,当用户点击“拍摄”控件后开始拍摄待处理视频。该示例中,可以在拍摄待处理视频的过程中,当检测到拍摄的视频帧中拍摄场景更新时,获取拍摄场景更新前的视频帧;对拍摄场景更新前的视频帧进行抽帧处理,得到与拍摄场景更新前的视频帧对应的场景图像;对上述场景图像进行对象识别,得到标注有至少一个对象的第一标注图像,响应于用户的第一操作,从每个第一标注图像中的至少一个对象中确定动态对象。It should be noted that, in addition to being a complete video that has been shot in advance, the video to be processed can also be a video shot in real time (multiple video frames or images). Exemplarily, taking the display interface shown in Figure 6 as an example, the user clicks the "camera" icon to display the shooting interface, and then the user slides left and right to select the stop motion shooting mode in the shooting interface. When the user clicks the "shoot" control, the video to be processed begins to be shot. In this example, during the process of shooting the video to be processed, when it is detected that the shooting scene is updated in the captured video frame, the video frame before the shooting scene is updated is obtained; the video frame before the shooting scene is updated is subjected to frame extraction processing to obtain a scene image corresponding to the video frame before the shooting scene is updated; the above scene image is subjected to object recognition to obtain a first annotated image annotated with at least one object, and in response to the user's first operation, a dynamic object is determined from at least one object in each first annotated image.
结合实际应用场景,在拍摄待处理视频的过程中,拍摄场景更新的原因可能是视频帧中对象的增加、对象的减少、至少一个对象的运动状态或形态发生变化等等。In combination with actual application scenarios, during the process of shooting a video to be processed, the reason for updating the shooting scene may be an increase in objects in the video frame, a decrease in objects, a change in the motion state or shape of at least one object, and so on.
在拍摄待处理视频的过程中,若检测到拍摄场景从第一场景变化为第二场景,则可以从已拍摄视频片段中获取与第一场景对应的视频帧序列,也就是说,如果检测到拍摄场景更新,那么可以从已经拍摄的视频片段中获取拍摄场景更新前的视频帧序列。其中,拍摄场景是否更新可以根据以下几种方式确定,本申请不作具体限定。比如,可以对每个视频帧进行对象识别,根据对象识别结果确定拍摄场景是否更新。当然也可以对比已拍摄的视频片段中相邻视频帧之间的相似性来判断拍摄场景是否更新等等。In the process of shooting the video to be processed, if it is detected that the shooting scene changes from the first scene to the second scene, the video frame sequence corresponding to the first scene can be obtained from the shot video clip. That is to say, if it is detected that the shooting scene is updated, the video frame sequence before the shooting scene is updated can be obtained from the shot video clip. Among them, whether the shooting scene is updated can be determined according to the following methods, which are not specifically limited in this application. For example, object recognition can be performed on each video frame, and whether the shooting scene is updated can be determined based on the object recognition result. Of course, the similarity between adjacent video frames in the shot video clip can also be compared to determine whether the shooting scene is updated, etc.
获取到与第一场景对应的视频帧序列后,可以将视频帧序列中的多个视频帧确定为一个拍摄场景,然后从该拍摄场景的至少一个视频帧中确定该拍摄场景的场景图像,以便对场景图像进行对象识别,得到标注有至少一个对象的第一标注图像,进而确定该场景图像中的动态对象。应理解,从拍摄场景中的至少一个视频帧中确定场景图像的方法可以参见上述当待处理视频为已经拍摄的视频时,确定与每个拍摄场景对应的场景图像的方法进行理解,在此将不再赘述。 After obtaining a video frame sequence corresponding to the first scene, multiple video frames in the video frame sequence can be determined as a shooting scene, and then a scene image of the shooting scene can be determined from at least one video frame of the shooting scene, so as to perform object recognition on the scene image, obtain a first annotated image annotated with at least one object, and then determine the dynamic object in the scene image. It should be understood that the method of determining the scene image from at least one video frame in the shooting scene can be understood by referring to the above method of determining the scene image corresponding to each shooting scene when the video to be processed is a video that has been shot, and will not be repeated here.
在另一示例中,参见图3-3,确定动态对象的方法也可以包括:3011b,获取第一图像,第一图像中包括至少一个对象。3012b,根据第一图像显示第二标注图像,第二标注图像中显示有至少一个对象。3013b,响应于用户的第一操作,从至少一个对象中确定动态对象。In another example, referring to FIG. 3-3 , the method for determining a dynamic object may also include: 3011b, acquiring a first image, wherein the first image includes at least one object. 3012b, displaying a second annotated image according to the first image, wherein the second annotated image displays at least one object. 3013b, determining a dynamic object from the at least one object in response to a first operation of a user.
应理解,第一图像可以是在拍摄待处理视频之前拍摄的图像。以图6所示的界面为例,用户点击“相机”图标后显示拍摄界面,然后用户在拍摄界面选择拍摄模式为拍照,当用户点击“拍摄”控件后即可得到第一图像,电子设备根据获取到的第一图像确定动态对象后,用户可以左右滑动拍摄模式以选择定格动画的拍摄模式,以便用户点击“拍摄”控件开始拍摄待处理视频。It should be understood that the first image may be an image captured before the video to be processed is captured. Taking the interface shown in FIG6 as an example, the user clicks the “camera” icon to display the capture interface, and then the user selects the capture mode as photo shooting in the capture interface. When the user clicks the “shoot” control, the first image can be obtained. After the electronic device determines the dynamic object based on the acquired first image, the user can slide the capture mode left and right to select the stop motion animation capture mode, so that the user clicks the “shoot” control to start capturing the video to be processed.
若待处理视频是已经拍摄的完整视频,则第一图像也可以是待处理视频中的图像。例如,待处理视频存在100个视频帧,第一图像可以是第一个视频帧。又如,待处理视频为时长100分钟的视频,第一图像可以是第1秒时对应的图像,或者前1分钟对应的图像。If the video to be processed is a complete video that has been shot, the first image may also be an image in the video to be processed. For example, if the video to be processed has 100 video frames, the first image may be the first video frame. For another example, if the video to be processed is a video with a duration of 100 minutes, the first image may be the image corresponding to the first second, or the image corresponding to the first minute.
在电子设备获取到第一图像后,可以对第一图像进行对象识别,根据对象识别结果得到标注有至少一个对象的第二标注图像,然后响应于用户的第一操作,从标注有至少一个对象的第二标注图像中确定动态对象。第二标注图像的确定方法可以参考上一示例中第一标注图像的确定方法,在此不再赘述。After the electronic device acquires the first image, it can perform object recognition on the first image, obtain a second annotated image annotated with at least one object according to the object recognition result, and then determine the dynamic object from the second annotated image annotated with at least one object in response to the user's first operation. The method for determining the second annotated image can refer to the method for determining the first annotated image in the previous example, and will not be repeated here.
在其他示例中,参见图3-4,确定动态对象的方法还可以包括:3011c,获取第一图像,第一图像中包括至少一个对象。3012c,响应于用户在第一图像中的聚焦操作,从至少一个对象中确定第一图像中的动态对象。In other examples, referring to FIG3-4, the method for determining a dynamic object may further include: 3011c, acquiring a first image, wherein the first image includes at least one object. 3012c, in response to a user's focusing operation on the first image, determining a dynamic object in the first image from the at least one object.
应理解,在该示例中,第一操作即聚焦操作,当电子设备检测到用户的聚焦操作时,根据聚焦操作确定第一图像中的动态对象。It should be understood that, in this example, the first operation is a focusing operation, and when the electronic device detects the focusing operation of the user, the dynamic object in the first image is determined according to the focusing operation.
作为示例而非限定的,如图7所示的拍摄界面,假设第一图像即是与该拍摄界面对应的图像,在用户点击第一图像中与辣椒对应的显示屏幕区域后,触发聚焦操作,在电子设备检测到聚焦操作后,根据聚焦操作将该第一图像中的辣椒确定为动态对象。As an example but not limitation, for the shooting interface shown in Figure 7, assuming that the first image is the image corresponding to the shooting interface, after the user clicks on the display screen area corresponding to the pepper in the first image, a focusing operation is triggered. After the electronic device detects the focusing operation, the pepper in the first image is determined as a dynamic object based on the focusing operation.
以上几种可能的示例中仅为举例说明,本申请不限定第一操作的具体内容,也不限定动态对象的具体确定方法。确定动态对象后,即可根据动态图像和待处理视频进一步确定定格动画。The above several possible examples are only for illustration, and the present application does not limit the specific content of the first operation, nor the specific method for determining the dynamic object. After determining the dynamic object, the stop motion animation can be further determined according to the dynamic image and the video to be processed.
302,根据动态对象和待处理视频确定定格动画,待处理视频包括动态对象,定格动画中的每一帧图像为待处理视频中的视频帧。302 , determining a stop-motion animation according to the dynamic object and the video to be processed, where the video to be processed includes the dynamic object, and each frame of the stop-motion animation is a video frame in the video to be processed.
应理解,可以从待处理视频中确定与动态对象的每个动作对应的多帧图像,分别对每个动作对应的多帧图像进行抽帧处理,得到与每个动作对应的关键帧序列,根据每个动作的对应关键帧序列生成定格动画。It should be understood that multiple frames of images corresponding to each action of the dynamic object can be determined from the video to be processed, and frame extraction can be performed on the multiple frames corresponding to each action to obtain a key frame sequence corresponding to each action, and a stop-motion animation can be generated based on the corresponding key frame sequence of each action.
示例性的,假设待处理视频包括100个视频帧,可以分别计算100个视频帧中每相邻两个视频帧之间的帧间像素值差异,将像素值相同(或者帧间像素值差异小于预设阈值)的视频帧确定为动态对象的一个动作,以此从100个视频帧中确定每个动作对应的多帧图像;或者,将动态对象和待处理视频输入至动作分类模型中进行处理,输出得到待处理视频中定格对象的多个动作,然后根据多个动作确定与每个动作对应的多帧图像。Exemplarily, assuming that the video to be processed includes 100 video frames, the inter-frame pixel value difference between each two adjacent video frames in the 100 video frames can be calculated respectively, and the video frames with the same pixel value (or the inter-frame pixel value difference is less than a preset threshold) are determined as an action of the dynamic object, thereby determining multiple frame images corresponding to each action from the 100 video frames; or, the dynamic object and the video to be processed are input into the action classification model for processing, and multiple actions of the frozen object in the video to be processed are output, and then the multiple frame images corresponding to each action are determined based on the multiple actions.
本实施例中,从待处理视频中识别出与动态对象的每个动作对应的多帧图像后,可以获取每个动作对应的多帧图像中与动态对象对应区域的像素均值,根据上述像素均值确定与每个动作对应的关键帧序列。In this embodiment, after identifying multiple frames of images corresponding to each action of the dynamic object from the video to be processed, the pixel mean of the area corresponding to the dynamic object in the multiple frames of images corresponding to each action can be obtained, and the key frame sequence corresponding to each action can be determined based on the above pixel mean.
在实际应用过程中,可以在获取到每个动作对应的多帧图像中与动态对象对应区域的像素均值之后,对比每个动作对应的多帧图像与像素均值之间的差异,将绝对偏差最小的图像确定为与每个动作对应的关键帧,根据每个动作的关键帧确定待处理视频中的关键帧序列,连接关键帧序列生成定格动画。不难理解,绝对偏差可以是每帧图像中与动态对象对应区域的像素值与根据多帧图像中与动态对象对应区域的像素值确定的平均值之间的差值。In actual application, after obtaining the pixel mean of the area corresponding to the dynamic object in the multi-frame images corresponding to each action, the difference between the multi-frame images corresponding to each action and the pixel mean can be compared, and the image with the smallest absolute deviation can be determined as the key frame corresponding to each action. The key frame sequence in the video to be processed is determined according to the key frame of each action, and the key frame sequence is connected to generate a stop motion animation. It is not difficult to understand that the absolute deviation can be the difference between the pixel value of the area corresponding to the dynamic object in each frame image and the average value determined according to the pixel value of the area corresponding to the dynamic object in the multi-frame images.
另外,也可以在确定与每个动作对应的多帧图像的像素值的平均值之后,对比每个动作对应的多帧图像中每帧图像的像素值与平均值之间的差值,将差值最小或者小于预设阈值的图像确定为与动作对应的关键帧。例如,假设从待处理视频中识别到与辣椒的某一切割动作对应的4帧图像,第1帧图像对应的像素值为a,第2帧图像对应的像素值为b,第3帧图像对应的像素值为c,第4帧图像对应的像素值为d,则与该切割动作对应的4帧图像的像素值均值为(a+b+c+d)/4, 第1帧图像与均值之间的差值为a-(a+b+c+d)/4,第2帧图像与均值之间的差值为b-(a+b+c+d)/4,第3帧图像与均值之间的差值为c-(a+b+c+d)/4,第4帧图像与均值之间的差值为d-(a+b+c+d)/4,可以将与差值最小对应的图像确定为该切割动作的关键帧。In addition, after determining the average value of the pixel values of the multiple frames corresponding to each action, the difference between the pixel value of each frame in the multiple frames corresponding to each action and the average value can be compared, and the image with the smallest difference or less than a preset threshold value can be determined as the key frame corresponding to the action. For example, assuming that 4 frames of images corresponding to a certain cutting action of peppers are identified from the video to be processed, the pixel value corresponding to the first frame is a, the pixel value corresponding to the second frame is b, the pixel value corresponding to the third frame is c, and the pixel value corresponding to the fourth frame is d, then the average pixel value of the 4 frames corresponding to the cutting action is (a+b+c+d)/4, The difference between the first frame image and the mean is a-(a+b+c+d)/4, the difference between the second frame image and the mean is b-(a+b+c+d)/4, the difference between the third frame image and the mean is c-(a+b+c+d)/4, and the difference between the fourth frame image and the mean is d-(a+b+c+d)/4. The image corresponding to the smallest difference can be determined as the key frame of the cutting action.
基于上述定格动画生成方法,在生成定格动画的过程中,响应于用户的第一操作确定了该定格动画中的动态对象,电子设备即可根据动态对象从待处理视频生成与动态对象对应的定格动画,无需人工提前拍摄大量的图像或者对待处理视频进行人工剪辑,简化了定格动画的制作过程,提高了定格动画的制作效率。Based on the above-mentioned stop-motion animation generation method, in the process of generating the stop-motion animation, in response to the user's first operation, the dynamic object in the stop-motion animation is determined, and the electronic device can generate a stop-motion animation corresponding to the dynamic object from the video to be processed according to the dynamic object. There is no need to manually shoot a large number of images in advance or manually edit the video to be processed, which simplifies the production process of the stop-motion animation and improves the production efficiency of the stop-motion animation.
在一种可能的实施方式中,在定格动画生成后,用户还可以对生成的定格动画进行自定义编辑,以生成新的定格动画。其中,用户对定格动画的自定义编辑可以是向定格动画中增加至少一帧图像。例如,定格动画中的第1帧图像对应待处理视频中第1秒的视频帧,定格动画中的第2帧图像对应待处理视频中第10秒的视频帧,那么用户可以从待处理视频帧第1秒至第10秒的视频帧选取一帧或多帧视频帧添加至定格动画的第1帧图像和第2帧图像之间。In a possible implementation, after the stop-motion animation is generated, the user can also perform custom editing on the generated stop-motion animation to generate a new stop-motion animation. The user's custom editing of the stop-motion animation can be to add at least one frame of image to the stop-motion animation. For example, the first frame of image in the stop-motion animation corresponds to the video frame at the first second of the video to be processed, and the second frame of image in the stop-motion animation corresponds to the video frame at the tenth second of the video to be processed. Then, the user can select one or more video frames from the video frames at the first second to the tenth second of the video to be processed and add them between the first frame of image and the second frame of image of the stop-motion animation.
用户对定格动画的自定义编辑也可以是从生成的定格动画中删除一帧或多帧图像。例如,基于本申请实施例提供的定格动画生成方法生成的定格动画包括100帧图像,其中,与某一动作对应的图像占比较大,那么用户可以从与该动作对应的图像中选择并删除多帧图像,以降低与该动作对应的图像在定格动画中的占比。The user's custom editing of the stop-motion animation can also be to delete one or more frames of images from the generated stop-motion animation. For example, the stop-motion animation generated by the stop-motion animation generation method provided in the embodiment of the present application includes 100 frames of images, among which the images corresponding to a certain action account for a large proportion. Then the user can select and delete multiple frames of images from the images corresponding to the action to reduce the proportion of the images corresponding to the action in the stop-motion animation.
用户对定格动画的自定义编辑还可以是对定格动画中的一帧或多帧图像进行替换或修改。应理解,替换可以是指利用待处理视频(或者与动态对象的每个动作对应的多帧图像)中的一帧或多帧图像覆盖定格动画中的一帧或多帧图像;修改可以是指对定格动画中的至少一帧图像在颜色对比度、曝光度、滤镜、文字以及特效等方面的完善。The user's customized editing of the stop-motion animation can also be to replace or modify one or more frames of images in the stop-motion animation. It should be understood that replacement can refer to overwriting one or more frames of images in the stop-motion animation with one or more frames of images in the video to be processed (or multiple frames of images corresponding to each action of the dynamic object); modification can refer to the improvement of at least one frame of the stop-motion animation in terms of color contrast, exposure, filters, text, special effects, etc.
在实际应用中,用户对定格动画的自定义编辑亦可以是切换或者移动定格动画中的至少一帧图像在定格动画中的位置等等。In practical applications, the user's customized editing of the stop-motion animation may also be switching or moving the position of at least one frame of the stop-motion animation in the stop-motion animation, and so on.
此外,生成的定格动画是基于用户确定的动态对象从待处理视频中得到的,因此,可以根据用户选择的不同动态对象从待处理视频中得到与动态对象对应的定格动画,即使待处理视频中存在噪声干扰,也不影响生成与动态对象对应的定格动画,换言之,在待处理视频中存在噪声干扰的情况下无需重新拍摄待处理视频,利用本申请提供的定格动画生成方法即可生成于用户确定的动态对象对应的定格动画,避免了因待处理视频中存在噪声干扰而需要重复获取待处理视频的问题,缩短了定格动画的制作周期,进一步提高了定格动画的制作效率。In addition, the generated stop-motion animation is obtained from the video to be processed based on the dynamic object determined by the user. Therefore, the stop-motion animation corresponding to the dynamic object can be obtained from the video to be processed according to the different dynamic objects selected by the user. Even if there is noise interference in the video to be processed, it will not affect the generation of the stop-motion animation corresponding to the dynamic object. In other words, when there is noise interference in the video to be processed, there is no need to re-shoot the video to be processed. The stop-motion animation generation method provided in the present application can be used to generate the stop-motion animation corresponding to the dynamic object determined by the user, thereby avoiding the problem of repeatedly obtaining the video to be processed due to noise interference in the video to be processed, shortening the production cycle of the stop-motion animation, and further improving the production efficiency of the stop-motion animation.
为了降低待处理视频中可能存在的噪声干扰(如干扰对象)对定格动画准确度的影响,可选地,获取到分别与每个动作的对应关键帧序列后,还可以对每个关键帧中的对象进行识别,若关键帧序列中的第一关键帧中存在干扰对象,则可以先消除第一关键帧中的干扰对象,再连接关键帧序列生成定格动画。或者,从关键帧序列中直接删除存在干扰对象的第一关键帧,连接关键帧序列中除第一关键帧之外的其他关键帧以生成定格动画。In order to reduce the influence of noise interference (such as interfering objects) that may exist in the video to be processed on the accuracy of the stop-motion animation, optionally, after obtaining the key frame sequence corresponding to each action, the object in each key frame can also be identified. If there is an interfering object in the first key frame in the key frame sequence, the interfering object in the first key frame can be eliminated first, and then the key frame sequence can be connected to generate the stop-motion animation. Alternatively, the first key frame with the interfering object is directly deleted from the key frame sequence, and the other key frames in the key frame sequence except the first key frame are connected to generate the stop-motion animation.
在实际应用中,干扰对象可以是针对不同应用领域而预先定义的,也可以是用户从待处理视频中确定的。In practical applications, the interference objects may be pre-defined for different application fields, or may be determined by the user from the video to be processed.
应理解,当待处理视频为预先已经拍摄的视频时,干扰对象可以是指除了动态对象之外的其他对象。若第一关键帧中存在干扰对象,则可以根据第一关键帧在关键帧序列的相邻帧中与干扰对象对应的区域,推理存在干扰对象的第一关键帧中与干扰对象对应区域的内容,以消除第一关键帧中的干扰对象。It should be understood that when the video to be processed is a video that has been shot in advance, the interference object may refer to an object other than a dynamic object. If there is an interference object in the first key frame, the content of the area corresponding to the interference object in the first key frame where the interference object exists can be inferred based on the area corresponding to the interference object in the adjacent frames of the key frame sequence of the first key frame, so as to eliminate the interference object in the first key frame.
其中,相邻帧是与存在干扰对象的第一关键帧相邻的关键帧。假设存在干扰对象的关键帧为第N帧关键帧,那么与第N帧关键帧相邻的关键帧可以是第N-1帧关键帧和/或第N+1帧关键帧,也可以是第N-x帧关键帧和/或第N+y帧关键帧,其中,x≥0,y≥0,x与y的具体取值可以根据实际关键帧的数量进行确定,本申请不作限定。Among them, the adjacent frame is the key frame adjacent to the first key frame with the interference object. Assuming that the key frame with the interference object is the Nth frame key frame, the key frame adjacent to the Nth frame key frame can be the N-1th frame key frame and/or the N+1th frame key frame, or the N-xth frame key frame and/or the N+yth frame key frame, wherein x≥0, y≥0, and the specific values of x and y can be determined according to the actual number of key frames, and this application does not limit it.
比如,以图8所示的界面为例,假设对关键帧中的各个对象进行识别过程中,确定第5帧关键帧中存在“人手”这一干扰对象,可以获取与第5帧关键帧相邻的第4帧关键帧和第6帧关键帧,确定第4帧关键帧和第6帧关键帧中与干扰对象对应的第一区域和第二区域,假设第一区域和第二区域中各个像素点的取值均为255,那么根据第一区域和第二区域可以推测第5帧关键帧中干 扰对象所在区域的各个像素点的取值也为255。那么可以将第5帧关键帧中干扰对象所在区域的各个像素点更新为255,以消除第5帧关键帧中的干扰对象。For example, taking the interface shown in FIG8 as an example, assuming that during the process of identifying the objects in the key frames, it is determined that there is an interference object "human hand" in the key frame 5, the key frames 4 and 6 adjacent to the key frame 5 can be obtained, and the first area and the second area corresponding to the interference object in the key frames 4 and 6 can be determined. Assuming that the values of each pixel in the first area and the second area are both 255, then based on the first area and the second area, it can be inferred that the interference object in the key frame 5 The value of each pixel point in the area where the disturbing object is located is also 255. Then, each pixel point in the area where the disturbing object is located in the fifth key frame can be updated to 255 to eliminate the disturbing object in the fifth key frame.
不难理解的,消除第一关键帧中干扰对象的方法包括但不限于更新干扰对象所在区域内的像素点的具体取值,或者获取相邻关键帧中与干扰对象对应区域的图像以覆盖存在干扰对象的第一关键帧中干扰对象对应的区域等等。本申请对此不作具体限定。It is not difficult to understand that the method of eliminating the interfering object in the first key frame includes but is not limited to updating the specific values of the pixels in the area where the interfering object is located, or obtaining the image of the area corresponding to the interfering object in the adjacent key frame to cover the area corresponding to the interfering object in the first key frame where the interfering object exists, etc. This application does not make specific limitations on this.
可选地,以如图6所示的界面为例,用户在拍摄界面选择定格动画拍摄模式,点击“拍摄”控件后开始拍摄待处理视频,在拍摄待处理视频的过程中,若电子设备检测到新增对象,则电子设备可以直接显示第一指示信息,该第一指示信息用于确定新增对象是否为干扰对象。响应于用户对上述第一指示信息的确认,若新增对象是干扰对象,则可以从已拍摄的待处理视频中删除存在干扰对象的至少一个视频帧。反之,若新增对象不是干扰对象,则可以继续拍摄待处理视频。Optionally, taking the interface shown in FIG6 as an example, the user selects the stop-motion shooting mode in the shooting interface, clicks the "shoot" control to start shooting the video to be processed, and during the shooting of the video to be processed, if the electronic device detects a newly added object, the electronic device can directly display a first indication information, and the first indication information is used to determine whether the newly added object is an interference object. In response to the user's confirmation of the above-mentioned first indication information, if the newly added object is an interference object, at least one video frame containing the interference object can be deleted from the already shot video to be processed. On the contrary, if the newly added object is not an interference object, the video to be processed can continue to be shot.
可选地,若电子设备检测到新增对象,且新增对象为干扰对象,则电子设备可以停止将拍摄范围内的采集的图像添加至待处理视频中,当在检测范围内未检测到干扰对象时,继续拍摄待处理视频。Optionally, if the electronic device detects a new object and the new object is an interference object, the electronic device may stop adding the captured images within the shooting range to the video to be processed, and continue shooting the video to be processed when no interference object is detected within the detection range.
或者,若电子设备检测到新增对象,且新增对象为干扰对象,则电子设备停止拍摄待处理视频,并显示例如“是否继续拍摄待处理视频”的确认信息,响应于用户对确认信息的确认后,再继续拍摄待处理视频。Alternatively, if the electronic device detects a new object and the new object is an interference object, the electronic device stops shooting the video to be processed and displays a confirmation message such as "Do you want to continue shooting the video to be processed?", and continues shooting the video to be processed in response to the user's confirmation of the confirmation message.
可以理解的,上述几种可选的方式仅为本申请实施例可执行的部分示例,在实际拍摄待处理视频的过程中,还可能存在其它操作或者各种操作的变形。It can be understood that the above-mentioned optional methods are only some examples that can be executed in the embodiments of the present application. In the actual process of shooting the video to be processed, there may be other operations or variations of various operations.
下面针对电子设备和云端服务器协同执行的方式进行示例性的说明。The following is an exemplary description of the collaborative execution between the electronic device and the cloud server.
如图9所示为本申请实施例提供的一种定格动画生成方法的一个实施例的流程图,参见图9,该定格动画生成方法应用于云端服务器,包括以下步骤901至步骤906:FIG. 9 is a flowchart of an embodiment of a stop-motion animation generation method provided in an embodiment of the present application. Referring to FIG. 9 , the stop-motion animation generation method is applied to a cloud server, and includes the following steps 901 to 906:
901,电子设备向云端服务器发送第一图像中动态对象的指示信息和待处理视频。901, the electronic device sends indication information of the dynamic object in the first image and the video to be processed to the cloud server.
在该实施例中,第一图像可以为待处理视频拍摄之前拍摄的图像,或者为待处理视频中的图像。指示信息可以是第一图像中动态对象的位置信息。云端服务器可以直接接收电子设备发送的第一图像中动态对象的指示信息,根据动态对象的指示信息确定第一图像中的动态对象。示例性的,电子设备可以对拍摄范围内的对象进行检测,以图7所示的拍摄界面为例,电子设备在拍摄范围内检测到“辣椒”对象,在用户点击拍摄界面中与辣椒对应的显示屏幕区域后,触发对拍摄界面中动态对象的聚焦操作,将该拍摄界面中与选择操作对应的位置信息确定为动态对象的指示信息,云端服务器接收到电子设备发送的拍摄界面中动态对象的位置信息后,可以根据位置信息确定拍摄界面中的动态对象。In this embodiment, the first image may be an image taken before the video to be processed is shot, or an image in the video to be processed. The indication information may be the position information of the dynamic object in the first image. The cloud server may directly receive the indication information of the dynamic object in the first image sent by the electronic device, and determine the dynamic object in the first image according to the indication information of the dynamic object. Exemplarily, the electronic device may detect objects within the shooting range. Taking the shooting interface shown in FIG. 7 as an example, the electronic device detects the "pepper" object within the shooting range. After the user clicks on the display screen area corresponding to the pepper in the shooting interface, the focusing operation on the dynamic object in the shooting interface is triggered, and the position information corresponding to the selection operation in the shooting interface is determined as the indication information of the dynamic object. After the cloud server receives the position information of the dynamic object in the shooting interface sent by the electronic device, the dynamic object in the shooting interface may be determined according to the position information.
在其他示例中,指示信息也可以是第一图像中动态对象的标识信息。可以理解为,对第一图像中的对象进行检测,得到第一图像中分别与至少一个对象对应的标识,响应于用户的第一操作,从至少一个对象对应的标识中确定动态对象的标识,电子设备将第一图像中动态对象的标识信息发送给云端服务器,云端服务器在接收到标识信息后,根据标识信息确定动态对象。例如,对第一图像中的对象进行检测,得到第一图像中包括“辣椒”对象、“西红柿”对象以及“盘子”对象,其中,“辣椒”、“西红柿”以及“盘子”分别标识第一图像中的各个对象,响应于用户的第一操作,从至少一个对象对应的标识中选择动态对象的标识为“辣椒”标识,即将该“辣椒”确定为动态对象的标识信息,在云端服务器接收到“辣椒”这一标识信息后,即可确定动态对象为辣椒。In other examples, the indication information may also be identification information of a dynamic object in the first image. It can be understood that the object in the first image is detected to obtain identifications corresponding to at least one object in the first image, and in response to the first operation of the user, the identification of the dynamic object is determined from the identification corresponding to at least one object, and the electronic device sends the identification information of the dynamic object in the first image to the cloud server, and the cloud server determines the dynamic object according to the identification information after receiving the identification information. For example, the object in the first image is detected to obtain a "pepper" object, a "tomato" object, and a "plate" object in the first image, wherein "pepper", "tomato" and "plate" respectively identify the objects in the first image, and in response to the first operation of the user, the identification of the dynamic object is selected from the identification corresponding to at least one object as the "pepper" identification, that is, the "pepper" is determined as the identification information of the dynamic object, and after the cloud server receives the identification information of "pepper", it can be determined that the dynamic object is pepper.
902,云端服务器根据指示信息确定动态对象。902, the cloud server determines the dynamic object according to the indication information.
903,云端服务器确定待处理视频中与动态对象的每个动作对应的多帧图像。903, the cloud server determines multiple frames of images corresponding to each action of the dynamic object in the video to be processed.
904,云端服务器分别对每个动作对应的多帧图像进行抽帧处理,得到与每个动作对应的关键帧序列。904 , the cloud server performs frame extraction processing on the multiple frames of images corresponding to each action to obtain a key frame sequence corresponding to each action.
905,云端服务器根据每个动作的对应关键帧序列生成定格动画。905 , the cloud server generates a stop-motion animation according to the corresponding key frame sequence of each action.
906,云端服务器向电子设备发送定格动画。906 , the cloud server sends the stop-motion animation to the electronic device.
应理解,云端服务器根据动态对象和待处理视频生成定格动画后,将生成的定格动画发送至电子设备,电子设备接收到定格动画后,用户可以在如图4所示的界面查看生成的定格动画,也可以在电子设备的视频存储模块中查看生成的定格动画。 It should be understood that after the cloud server generates a stop-motion animation based on the dynamic object and the video to be processed, the generated stop-motion animation is sent to the electronic device. After the electronic device receives the stop-motion animation, the user can view the generated stop-motion animation in the interface shown in Figure 4, or can view the generated stop-motion animation in the video storage module of the electronic device.
若待处理视频时已经预先拍摄的视频,则可以如图10所示的方法得到定格动画,参见图10,该定格动画生成方法具体包括以下步骤1001至步骤1011:If the video to be processed is a video that has been pre-shot, a stop-motion animation can be obtained by the method shown in FIG10 . Referring to FIG10 , the stop-motion animation generation method specifically includes the following steps 1001 to 1011:
1001,电子设备向云端服务器发送待处理视频。1001, the electronic device sends the video to be processed to the cloud server.
应理解,待处理视频为预先已经拍摄的视频。以图4所示的界面为例,在该电子设备显示屏的显示界面上设置有待处理视频的添加控件,用户点击添加控件后,跳转至电子设备的视频存储模块中,用户选择待处理视频并点击上传控件后,电子设备向云端服务器发送待处理视频。It should be understood that the video to be processed is a video that has been shot in advance. Taking the interface shown in FIG4 as an example, an add control for the video to be processed is set on the display interface of the electronic device display screen. After the user clicks the add control, it jumps to the video storage module of the electronic device. After the user selects the video to be processed and clicks the upload control, the electronic device sends the video to be processed to the cloud server.
1002,云端服务器确定待处理视频中的多个第一标注图像,每个第一标注图像中标注有至少一个对象。1002. The cloud server determines a plurality of first annotated images in the video to be processed, each of which is annotated with at least one object.
示例性的,云端服务器在接收到电子设备发送的待处理视频后,可以获取与待处理视频对应的多个视频帧,对每个视频帧中的至少一个对象进行识别,得到标注有至少一个对象的第一标注图像,并将多个第一标注图像发送至电子设备。或者,云端服务器在接收到电子设备发送的待处理视频后,还可以先将待处理视频划分为多个拍摄场景,对每个拍摄场景进行抽帧处理,得到与每个拍摄场景对应的场景图像,然后对每个场景图像进行对象识别,得到标注有至少一个对象的第一标注图像,接着将多个第一标注图像发送至电子设备。Exemplarily, after receiving the video to be processed sent by the electronic device, the cloud server can obtain multiple video frames corresponding to the video to be processed, identify at least one object in each video frame, obtain a first annotated image marked with at least one object, and send the multiple first annotated images to the electronic device. Alternatively, after receiving the video to be processed sent by the electronic device, the cloud server can first divide the video to be processed into multiple shooting scenes, perform frame extraction processing on each shooting scene, obtain a scene image corresponding to each shooting scene, and then perform object recognition on each scene image to obtain a first annotated image marked with at least one object, and then send the multiple first annotated images to the electronic device.
1003,云端服务器向电子设备发送多个第一标注图像。1003. The cloud server sends a plurality of first annotated images to the electronic device.
1004,电子设备显示多个第一标注图像。1004. The electronic device displays a plurality of first annotated images.
电子设备接收到多个第一标注图像后,在显示界面显示多个第一标注图像,以便用户从每个第一标注图像中标注的至少一个对象中确定动态对象。After receiving the multiple first annotated images, the electronic device displays the multiple first annotated images on a display interface so that the user can determine the dynamic object from at least one object annotated in each first annotated image.
1005,电子设备响应于用户的第一操作,从每个第一标注图像中标注的至少一个对象中确定动态对象。1005 : In response to a first operation of the user, the electronic device determines a dynamic object from at least one object annotated in each first annotated image.
1006,电子设备向云端服务器发送从每个第一标注图像中标注的至少一个对象中确定的动态对象的指示信息。1006 , the electronic device sends, to the cloud server, indication information of a dynamic object determined from at least one object annotated in each first annotated image.
云端服务器接收到电子设备发送的从每个第一标注图像中标注的至少一个对象中确定的动态对象的指示信息之后,根据每个第一标注图像中动态对象的指示信息确定每个第一标注图像中的动态对象。After receiving the indication information of the dynamic object determined from at least one object annotated in each first annotated image sent by the electronic device, the cloud server determines the dynamic object in each first annotated image according to the indication information of the dynamic object in each first annotated image.
1007,云端服务器根据指示信息确定动态对象;1007, the cloud server determines the dynamic object according to the indication information;
云端服务器接收到电子设备发送的动态对象的指示信息后,可以根据指示信息确定待处理视频中的动态对象。After receiving the indication information of the dynamic object sent by the electronic device, the cloud server can determine the dynamic object in the video to be processed according to the indication information.
1008,云端服务器确定待处理视频中与动态对象的每个动作对应的多帧图像。1008. The cloud server determines multiple frames of images corresponding to each action of the dynamic object in the video to be processed.
1009,分别对每个动作对应的多帧图像进行抽帧处理,得到与每个动作对应的关键帧序列。1009 , perform frame extraction processing on multiple frames of images corresponding to each action to obtain a key frame sequence corresponding to each action.
1010,根据每个动作的对应关键帧序列生成定格动画。At 1010 , a stop-motion animation is generated according to a corresponding key frame sequence of each action.
1011,向电子设备发送定格动画。1011, sending a stop motion animation to an electronic device.
上述步骤1001至步骤1011可以参照步骤301至步骤302的定格动画生成方法以及上述步骤901至步骤906的定格动画生成方法进行理解,在此不再赘述。The above steps 1001 to 1011 can be understood with reference to the stop-motion animation generation method of steps 301 to 302 and the stop-motion animation generation method of steps 901 to 906, and will not be described in detail here.
基于上述实施方式,当待处理视频为预先已经拍摄的视频时,在获取到待处理视频后,用户可以从与待处理视频对应的多个第一标注图像选择对应的动态对象,便于后续根据每个第一标注图像的动态对象生成与待处理视频对应的定格动画,降低了待处理视频中其他噪声对定格动画的干扰,提高了生成定格动画的准确性。Based on the above implementation, when the video to be processed is a video that has been shot in advance, after obtaining the video to be processed, the user can select the corresponding dynamic object from multiple first annotated images corresponding to the video to be processed, so as to facilitate the subsequent generation of a stop-motion animation corresponding to the video to be processed according to the dynamic objects of each first annotated image, thereby reducing the interference of other noises in the video to be processed on the stop-motion animation and improving the accuracy of generating the stop-motion animation.
为了扩展实际应用中定格动画的拍摄模式,待处理视频还可以是实时拍摄的视频,这样可以在拍摄待处理视频之前先确定动态对象,然后根据确定的动态对象和实时拍摄的视频生成定格动画。如图11所示为本申请实施例提供的又一种定格动画生成方法的另一个实施例的流程图,参见图11,该定格动画生成方法以下步骤1101至步骤1111包括:In order to expand the shooting mode of stop-motion animation in practical applications, the video to be processed can also be a video shot in real time, so that the dynamic object can be determined before shooting the video to be processed, and then the stop-motion animation can be generated according to the determined dynamic object and the video shot in real time. As shown in FIG11, a flowchart of another embodiment of a stop-motion animation generation method provided in an embodiment of the present application is shown in FIG11. The following steps 1101 to 1111 of the stop-motion animation generation method include:
1101,电子设备向云端服务器发送第一图像,第一图像中包括至少一个对象。1101. An electronic device sends a first image to a cloud server, where the first image includes at least one object.
应理解,第一图像可以是在拍摄待处理视频之前拍摄的图像。以图6所示的界面为例,用户点击“相机”图标后显示拍摄界面,然后用户在拍摄界面选择拍摄模式为拍照,当用户点击“拍摄”控件后即可得到在拍摄待处理视频之前拍摄的图像。It should be understood that the first image can be an image taken before shooting the video to be processed. Taking the interface shown in Figure 6 as an example, the user clicks the "camera" icon to display the shooting interface, and then the user selects the shooting mode as photo shooting in the shooting interface. When the user clicks the "shoot" control, the image taken before shooting the video to be processed can be obtained.
1102,云端服务器根据第一图像确定第二标注图像,第二标注图像中标注有至少一个对象。 1102. The cloud server determines a second annotated image according to the first image, where at least one object is annotated in the second annotated image.
云端服务器接收到电子设备发送的第一图像后,可以对第一图像中的对象进行识别,得到与第一图像对应的标注有至少一个对象的第二标注图像。After receiving the first image sent by the electronic device, the cloud server can identify the object in the first image to obtain a second annotated image corresponding to the first image and annotated with at least one object.
1103,云端服务器向电子设备发送与第一图像对应的第二标注图像。1103. The cloud server sends a second annotated image corresponding to the first image to the electronic device.
1104,在电子设备上显示第二标注图像。1104, display a second annotated image on the electronic device.
1105,响应于用户的第一操作,从至少一个对象中确定动态对象的指示信息。1105 , in response to a first operation of the user, determine indication information of a dynamic object from at least one object.
1106,电子设备向云端服务器发送动态对象的指示信息和待处理视频。1106. The electronic device sends the indication information of the dynamic object and the video to be processed to the cloud server.
仍以图6所示的界面为例,待处理视频为实时拍摄的视频,即用户在拍摄界面中选择定格动画的拍摄模式后,点击“拍摄”控件后开始拍摄到的视频。Still taking the interface shown in FIG. 6 as an example, the video to be processed is a video shot in real time, that is, the video shot after the user selects the stop-motion animation shooting mode in the shooting interface and clicks the “shoot” control.
1107,云端服务器根据指示信息确定动态对象;1107, the cloud server determines the dynamic object according to the indication information;
1108,云端服务器确定待处理视频中与动态对象的每个动作对应的多帧图像。1108. The cloud server determines multiple frames of images corresponding to each action of the dynamic object in the video to be processed.
云端服务器接收到电子设备发送的动态对象的指示信息和待处理视频后,可以根据动态对象的指示信息确定待处理视频中的动态对象,之后,从待处理视频中确定与动态对象的每个动作对应的多帧图像。After receiving the indication information of the dynamic object and the video to be processed sent by the electronic device, the cloud server can determine the dynamic object in the video to be processed according to the indication information of the dynamic object, and then determine multiple frames of images corresponding to each action of the dynamic object from the video to be processed.
1109,云端服务器分别对每个动作对应的多帧图像进行抽帧处理,得到与每个动作对应的关键帧序列。1109, the cloud server extracts frames of the multiple frames corresponding to each action to obtain a key frame sequence corresponding to each action.
1110,云端服务器根据每个动作的对应关键帧序列生成定格动画。At 1110 , the cloud server generates a stop-motion animation according to a corresponding key frame sequence of each action.
1111,云端服务器向电子设备发送定格动画。1111, the cloud server sends the stop-motion animation to the electronic device.
上述步骤1101至步骤1111可以参照步骤301至步骤302的定格动画生成方法以及上述步骤901至步骤906的定格动画生成方法进行理解,在此不再赘述。The above steps 1101 to 1111 can be understood by referring to the stop-motion animation generation method of steps 301 to 302 and the stop-motion animation generation method of steps 901 to 906, which will not be described in detail here.
基于上述实施方式,在待处理视频拍摄之前,可以先根据获取的第一图像确定动态对象,然后在拍摄待处理视频的过程中,可以根据确定的动态对象对拍摄的待处理视频进行处理,当待处理视频拍摄完毕后能够快速成对应的定格动画,不仅丰富了定格动画的拍摄模式,而且加速了对待处理视频的处理,提升了定格动画的拍摄效率。Based on the above implementation, before shooting the video to be processed, the dynamic object can be determined based on the acquired first image, and then in the process of shooting the video to be processed, the shot video to be processed can be processed according to the determined dynamic object. When the video to be processed is shot, it can be quickly turned into a corresponding stop-motion animation, which not only enriches the shooting mode of the stop-motion animation, but also speeds up the processing of the video to be processed and improves the shooting efficiency of the stop-motion animation.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
对应于上文实施例所述的定格动画生成方法,图12是本申请实施例提供的一种电子设备1200的示意性框图。图12所示的电子设备1200包括动态对象确定单元1210和定格动画确定单元1220。Corresponding to the stop-motion animation generation method described in the above embodiment, FIG12 is a schematic block diagram of an electronic device 1200 provided in an embodiment of the present application. The electronic device 1200 shown in FIG12 includes a dynamic object determination unit 1210 and a stop-motion animation determination unit 1220 .
动态对象确定单元1210,用于响应于用户的第一操作,确定动态对象;The dynamic object determining unit 1210 is configured to determine a dynamic object in response to a first operation of a user;
定格动画确定单元1220,用于根据所述动态对象和待处理视频确定定格动画,所述待处理视频包括所述动态对象,所述定格动画中的每一帧图像为所述待处理视频中的视频帧。The stop-motion animation determining unit 1220 is used to determine the stop-motion animation according to the dynamic object and the video to be processed, wherein the video to be processed includes the dynamic object, and each frame image in the stop-motion animation is a video frame in the video to be processed.
可选地,所述动态对象确定单元1210,还用于:获取所述待处理视频;显示所述待处理视频中的多个第一标注图像,每个所述第一标注图像中标注有至少一个对象;响应于用户的第一操作,从每个所述第一标注图像中标注的所述至少一个对象中确定所述动态对象。Optionally, the dynamic object determination unit 1210 is further used to: obtain the video to be processed; display multiple first annotated images in the video to be processed, each of the first annotated images annotated with at least one object; and determine the dynamic object from the at least one object annotated in each of the first annotated images in response to a first operation of the user.
可选地,所述显示所述待处理视频中的多个第一标注图像,包括:确定所述待处理视频中的多个拍摄场景;对每个拍摄场景进行抽帧处理,得到与每个所述拍摄场景对应的场景图像;对每个所述场景图像进行对象识别,得到与每个场景图像分别对应的所述第一标注图像。Optionally, displaying multiple first annotated images in the video to be processed includes: determining multiple shooting scenes in the video to be processed; performing frame extraction processing on each shooting scene to obtain a scene image corresponding to each of the shooting scenes; performing object recognition on each of the scene images to obtain the first annotated images corresponding to each scene image.
可选地,所述显示所述待处理视频中的多个第一标注图像,包括:在拍摄所述待处理视频的过程中,当检测拍摄场景从第一场景变化为第二场景时,从已拍摄的视频片段中获取与所述第一场景对应的视频帧序列;Optionally, displaying the plurality of first annotated images in the video to be processed includes: in the process of shooting the video to be processed, when detecting that the shooting scene changes from a first scene to a second scene, acquiring a video frame sequence corresponding to the first scene from a shot video clip;
对所述视频帧序列进行抽帧处理,得到与所述第一场景对应的场景图像;Performing frame extraction processing on the video frame sequence to obtain a scene image corresponding to the first scene;
对所述场景图像进行对象识别,得到与所述第一场景对应的标注有至少一个对象的所述第一标注图像。Object recognition is performed on the scene image to obtain the first annotated image corresponding to the first scene and annotated with at least one object.
可选地,所述显示所述待处理视频中的多个第一标注图像,包括:向云端服务器发送所述待处理视频;接收所述云端服务器发送的多个所述第一标注图像,显示多个所述第一标注图像。Optionally, displaying the multiple first annotated images in the video to be processed includes: sending the video to be processed to a cloud server; receiving the multiple first annotated images sent by the cloud server, and displaying the multiple first annotated images.
可选地,所述动态对象确定单元1210,还用于:获取第一图像,第一图像中包括至少一个对象;根据所述第一图像显示第二标注图像,所述第二标注图像中标注有至少一个对象;响应于用户的第一操作,从所述至少一个对象中确定所述动态对象。 Optionally, the dynamic object determination unit 1210 is further used to: acquire a first image, the first image including at least one object; display a second annotated image based on the first image, the second annotated image annotated with at least one object; and determine the dynamic object from the at least one object in response to a first operation of a user.
可选地,所述根据所述第一图像显示第二标注图像,包括:Optionally, displaying a second annotated image according to the first image includes:
对所述第一图像进行对象识别,得到所述第二标注图像;Performing object recognition on the first image to obtain the second annotated image;
显示所述第二标注图像。The second annotated image is displayed.
可选地,所述根据所述第一图像显示第二标注图像,包括:Optionally, displaying a second annotated image according to the first image includes:
向云端服务器发送所述第一图像;Sending the first image to a cloud server;
接收所述云端服务器发送的与所述第一图像对应的第二标注图像;Receiving a second annotated image corresponding to the first image and sent by the cloud server;
显示所述第二标注图像。The second annotated image is displayed.
可选地,所述第一操作为聚焦操作,所述响应于用户的第一操作,确定动态对象,包括:Optionally, the first operation is a focusing operation, and determining the dynamic object in response to the first operation of the user includes:
获取第一图像,第一图像中包括至少一个对象;Acquire a first image, wherein the first image includes at least one object;
响应于用户在所述第一图像上的所述聚焦操作,从所述至少一个对象中确定所述第一图像中的所述动态对象。In response to the focusing operation of the user on the first image, the dynamic object in the first image is determined from the at least one object.
可选地,所述第一图像为所述待处理视频拍摄之前拍摄的图像,或者为所述待处理视频中的图像。Optionally, the first image is an image captured before the video to be processed is captured, or is an image in the video to be processed.
可选地,所述定格动画确定单元1220,还用于:Optionally, the stop-motion animation determination unit 1220 is further configured to:
确定所述待处理视频中与所述动态对象的每个动作对应的多帧图像;Determine a plurality of frames of images corresponding to each action of the dynamic object in the video to be processed;
分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列;Performing frame extraction processing on the multiple frames of images corresponding to each of the actions respectively to obtain a key frame sequence corresponding to each of the actions;
根据每个所述动作的对应所述关键帧序列生成所述定格动画。The stop-motion animation is generated according to the key frame sequence corresponding to each of the actions.
可选地,所述方法还包括:Optionally, the method further comprises:
若所述关键帧序列的所述第一关键帧中存在干扰对象,则消除所述第一关键帧中的所述干扰对象。If an interfering object exists in the first key frame of the key frame sequence, the interfering object in the first key frame is eliminated.
可选地,所述消除所述第一关键帧中的所述干扰对象,包括:Optionally, eliminating the interfering object in the first key frame includes:
根据所述第一关键帧在关键帧序列的相邻帧中与所述干扰对象对应的区域,消除所述第一关键帧中的所述干扰对象。The interfering object in the first key frame is eliminated according to a region of the first key frame corresponding to the interfering object in adjacent frames of a key frame sequence.
可选地,所述分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列,包括:Optionally, the performing frame extraction processing on the multiple frames of images corresponding to each of the actions to obtain a key frame sequence corresponding to each of the actions includes:
根据每个所述动作对应的所述多帧图像中与所述动态对象对应区域的像素均值,确定与每个所述动作对应的所述关键帧序列。The key frame sequence corresponding to each action is determined according to the pixel average value of the area corresponding to the dynamic object in the multiple frames of images corresponding to each action.
可选地,所述根据所述动态对象和待处理视频确定定格动画,包括:Optionally, determining the stop-motion animation according to the dynamic object and the video to be processed includes:
向云端服务器发送所述动态对象的指示信息;Sending indication information of the dynamic object to a cloud server;
接收所述定格动画。The stop motion animation is received.
可选地,所述根据所述动态对象和待处理视频确定定格动画,包括:Optionally, determining the stop-motion animation according to the dynamic object and the video to be processed includes:
向云端服务器发送所述动态对象的指示信息和所述待处理视频;Sending the indication information of the dynamic object and the video to be processed to a cloud server;
接收所述定格动画。The stop motion animation is received.
图13是本申请实施例提供的一种云端服务器1300的示意性框图。图13所示的云端服务器1300包括接收单元1310、确定单元1320、处理单元1330、生成单元1340以及发送单元1350。Fig. 13 is a schematic block diagram of a cloud server 1300 provided in an embodiment of the present application. The cloud server 1300 shown in Fig. 13 includes a receiving unit 1310, a determining unit 1320, a processing unit 1330, a generating unit 1340 and a sending unit 1350.
接收单元1310,用于接收电子设备发送的与动态对象对应的指示信息和待处理视频,根据所述指示信息确定所述动态对象;确定单元1320,用于确定待处理视频中与所述动态对象的每个动作对应的多帧图像;处理单元1330,用于分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列;生成单元1340,用于根据每个所述动作的对应所述关键帧序列生成定格动画;发送单元1350,用于向电子设备发送所述定格动画。The receiving unit 1310 is used to receive indication information and a video to be processed corresponding to a dynamic object sent by an electronic device, and determine the dynamic object according to the indication information; the determining unit 1320 is used to determine a plurality of frames of images corresponding to each action of the dynamic object in the video to be processed; the processing unit 1330 is used to perform frame extraction processing on the plurality of frames of images corresponding to each action, respectively, to obtain a key frame sequence corresponding to each action; the generating unit 1340 is used to generate a stop-motion animation according to the key frame sequence corresponding to each action; and the sending unit 1350 is used to send the stop-motion animation to the electronic device.
可选地,所述接收单元1310,还用于:接收电子设备发送的所述待处理视频;向所述电子设备发送从所述待处理视频中确定的多个第一标注图像,每个所述第一标注图像中标注有至少一个对象;接收所述电子设备发送的从每个所述第一标注图像中标注的所述至少一个对象中确定的所述动态对象的指示信息。Optionally, the receiving unit 1310 is further used to: receive the video to be processed sent by an electronic device; send a plurality of first annotated images determined from the video to be processed to the electronic device, each of the first annotated images being annotated with at least one object; and receive indication information of the dynamic object determined from the at least one object annotated in each of the first annotated images sent by the electronic device.
可选地,所述多个所述第一标注图像的确定方法,包括:确定所述待处理视频中的多个拍摄场景;对每个拍摄场景进行抽帧处理,得到与每个所述拍摄场景对应的场景图像;对每个所述场 景图像进行对象识别,得到与每个场景图像分别对应的所述第一标注图像。Optionally, the method for determining the plurality of first annotated images comprises: determining a plurality of shooting scenes in the video to be processed; performing frame extraction processing on each shooting scene to obtain a scene image corresponding to each shooting scene; The object recognition is performed on the scene image to obtain the first annotated image corresponding to each scene image.
可选地,所述多个所述第一标注图像的确定方法,包括:在拍摄所述待处理视频的过程中,当检测到拍摄场景从第一场景变化为第二场景时,从已拍摄视频片段中获取与所述第一场景对应的视频帧序列;对所述视频帧序列进行抽帧处理,得到与所述第一场景对应的场景图像;对所述场景图像进行对象识别,得到所述第一场景的所述第一标注图像。Optionally, the method for determining the multiple first annotated images includes: in the process of shooting the video to be processed, when it is detected that the shooting scene changes from a first scene to a second scene, obtaining a video frame sequence corresponding to the first scene from the shot video clip; performing frame extraction processing on the video frame sequence to obtain a scene image corresponding to the first scene; and performing object recognition on the scene image to obtain the first annotated image of the first scene.
可选地,所述接收单元1310,还用于:接收电子设备发送的第一图像,第一图像中包括至少一个对象;根据所述第一图像确定第二标注图像,所述第二标注图像中标注有至少一个对象;向所述电子设备发送与所述第一图像对应的第二标注图像;接收所述电子设备发送的从所述至少一个对象中确定的所述动态对象的指示信息。Optionally, the receiving unit 1310 is further used to: receive a first image sent by an electronic device, the first image including at least one object; determine a second annotated image based on the first image, the second annotated image annotated with at least one object; send a second annotated image corresponding to the first image to the electronic device; and receive indication information of the dynamic object determined from the at least one object sent by the electronic device.
可选地,所述根据所述第一图像确定第二标注图像,包括:对所述第一图像进行对象识别,得到所述第二标注图像。Optionally, determining the second annotated image according to the first image includes: performing object recognition on the first image to obtain the second annotated image.
可选地,所述第一图像为所述待处理视频拍摄之前拍摄的图像,或者为所述待处理视频中的图像。Optionally, the first image is an image captured before the video to be processed is captured, or is an image in the video to be processed.
可选地,所述接收单元1310,还用于:接收电子设备发送的第一图像中所述动态对象的指示信息。Optionally, the receiving unit 1310 is further used to: receive indication information of the dynamic object in the first image sent by the electronic device.
可选地,云端服务器1300还包括:消除单元,用于若所述第一关键帧中存在干扰对象,则消除所述第一关键帧中的所述干扰对象。Optionally, the cloud server 1300 further includes: an elimination unit, configured to eliminate the interference object in the first key frame if there is an interference object in the first key frame.
可选地,所述消除单元,还用于:根据所述第一关键帧在关键帧序列的相邻帧中与所述干扰对象对应的区域,消除所述第一关键帧中的所述干扰对象。Optionally, the eliminating unit is further configured to eliminate the interfering object in the first key frame according to a region of the first key frame that corresponds to the interfering object in adjacent frames of a key frame sequence.
可选地,所述处理单元1330,还用于:根据每个所述动作对应的所述多帧图像中与所述动态对象对应区域的像素均值,确定与每个所述动作对应的所述关键帧序列。Optionally, the processing unit 1330 is further used to determine the key frame sequence corresponding to each of the actions according to the pixel mean of the area corresponding to the dynamic object in the multiple frames of images corresponding to each of the actions.
应理解,装置实施例的描述可以参考上述对电子设备以及定格动画生成方法实施例的相关描述,其实现原理与技术效果与上述方法实施例类似,此处不再赘述。It should be understood that the description of the device embodiment can refer to the above-mentioned description of the electronic device and the stop-motion animation generation method embodiment. Its implementation principle and technical effects are similar to those of the above-mentioned method embodiment and will not be repeated here.
基于上述各个实施例提供的方法,本申请实施例还提供以下内容:Based on the methods provided in the above embodiments, the embodiments of the present application also provide the following contents:
本申请实施例提供了一种计算机程序产品,该程序产品包括程序,当该程序被电子设备运行时,使得电子设备上述各实施例中示出的定格动画生成方法。An embodiment of the present application provides a computer program product, which includes a program. When the program is executed by an electronic device, the electronic device implements the stop-motion animation generation method shown in the above embodiments.
本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时实现上述各个实施例中示出的定格动画生成方法。An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the stop-motion animation generation method shown in the above embodiments is implemented.
本申请实施例提供一种芯片,该芯片包括存储器和处理器,该处理器执行存储器中存储的计算机程序,以实现控制上述电子设备执行上述各个实施例中示出的定格动画生成方法。An embodiment of the present application provides a chip, which includes a memory and a processor. The processor executes a computer program stored in the memory to control the above-mentioned electronic device to execute the stop-motion animation generation method shown in the above-mentioned embodiments.
应理解,本申请实施例中提及的处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that the processor mentioned in the embodiments of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
还应理解,本申请实施例中提及的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM).
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模 块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art will clearly understand that for the convenience and brevity of description, only the above-mentioned functional units, modules and The division of blocks is illustrated by way of example. In practical applications, the above-mentioned functions can be distributed to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的系统实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the system embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到大屏设备的任何实体或装置、记录介质、计算机存储器、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to a large-screen device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
最后应说明的是:以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。 Finally, it should be noted that the above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims (31)

  1. 一种定格动画生成方法,其特征在于,应用于电子设备,所述方法包括:A stop-motion animation generation method, characterized in that it is applied to an electronic device, the method comprising:
    响应于用户的第一操作,确定动态对象;In response to a first operation by a user, determining a dynamic object;
    根据所述动态对象和待处理视频确定定格动画,所述待处理视频包括所述动态对象,所述定格动画中的每一帧图像为所述待处理视频中的视频帧。A stop-motion animation is determined according to the dynamic object and a video to be processed, wherein the video to be processed includes the dynamic object, and each frame image in the stop-motion animation is a video frame in the video to be processed.
  2. 根据权利要求1所述的方法,其特征在于,所述响应于用户的第一操作,确定动态对象,包括:The method according to claim 1, wherein determining the dynamic object in response to the first operation of the user comprises:
    获取所述待处理视频;Obtaining the video to be processed;
    显示所述待处理视频中的多个第一标注图像,每个所述第一标注图像中标注有至少一个对象;Displaying a plurality of first annotated images in the video to be processed, each of the first annotated images being annotated with at least one object;
    响应于所述第一操作,从每个所述第一标注图像中标注的所述至少一个对象中确定所述动态对象。In response to the first operation, the dynamic object is determined from the at least one object annotated in each of the first annotated images.
  3. 根据权利要求2所述的方法,其特征在于,所述显示所述待处理视频中的多个第一标注图像,包括:The method according to claim 2, characterized in that the displaying of the plurality of first annotated images in the video to be processed comprises:
    确定所述待处理视频中的多个拍摄场景;Determining multiple shooting scenes in the video to be processed;
    对每个拍摄场景进行抽帧处理,得到与每个所述拍摄场景对应的场景图像;Performing frame extraction processing on each shooting scene to obtain a scene image corresponding to each shooting scene;
    对每个所述场景图像进行对象识别,得到与每个所述场景图像分别对应的所述第一标注图像。Object recognition is performed on each of the scene images to obtain the first annotated image corresponding to each of the scene images.
  4. 根据权利要求2所述的方法,其特征在于,所述显示所述待处理视频中的多个第一标注图像,包括:The method according to claim 2, characterized in that the displaying of the plurality of first annotated images in the video to be processed comprises:
    在拍摄所述待处理视频的过程中,当检测到拍摄场景从第一场景变化为第二场景时,从已拍摄视频片段中获取与所述第一场景对应的视频帧序列;In the process of shooting the video to be processed, when it is detected that the shooting scene changes from the first scene to the second scene, a video frame sequence corresponding to the first scene is acquired from the shot video clips;
    对所述视频帧序列进行抽帧处理,得到与所述第一场景对应的场景图像;Performing frame extraction processing on the video frame sequence to obtain a scene image corresponding to the first scene;
    对所述场景图像进行对象识别,得到所述第一场景的所述第一标注图像。Object recognition is performed on the scene image to obtain the first annotated image of the first scene.
  5. 根据权利要求2所述的方法,其特征在于,所述显示所述待处理视频中的多个第一标注图像,包括:The method according to claim 2, characterized in that the displaying of the plurality of first annotated images in the video to be processed comprises:
    向云端服务器发送所述待处理视频;Sending the video to be processed to a cloud server;
    接收所述云端服务器发送的多个所述第一标注图像;Receiving the plurality of first annotated images sent by the cloud server;
    显示多个所述第一标注图像。A plurality of the first annotated images are displayed.
  6. 根据权利要求1所述的方法,其特征在于,所述响应于用户的第一操作,确定动态对象,包括:The method according to claim 1, wherein determining the dynamic object in response to the first operation of the user comprises:
    获取第一图像,所述第一图像中包括至少一个对象;Acquire a first image, wherein the first image includes at least one object;
    根据所述第一图像显示第二标注图像,所述第二标注图像中标注有所述至少一个对象;displaying a second annotated image according to the first image, wherein the second annotated image is annotated with the at least one object;
    响应于所述第一操作,从所述至少一个对象中确定所述动态对象。In response to the first operation, the dynamic object is determined from the at least one object.
  7. 根据权利要求6所述的方法,其特征在于,所述根据所述第一图像显示第二标注图像,包括:The method according to claim 6, characterized in that displaying the second annotated image according to the first image comprises:
    对所述第一图像进行对象识别,得到所述第二标注图像;Performing object recognition on the first image to obtain the second annotated image;
    显示所述第二标注图像。The second annotated image is displayed.
  8. 根据权利要求6所述的方法,其特征在于,所述根据所述第一图像显示第二标注图像,包括:The method according to claim 6, characterized in that displaying the second annotated image according to the first image comprises:
    向云端服务器发送所述第一图像;Sending the first image to a cloud server;
    接收所述云端服务器发送的与所述第一图像对应的所述第二标注图像;receiving the second annotated image corresponding to the first image and sent by the cloud server;
    显示所述第二标注图像。The second annotated image is displayed.
  9. 根据权利要求1所述的方法,其特征在于,所述第一操作为聚焦操作,所述响应于用户的第一操作,确定动态对象,包括:The method according to claim 1, wherein the first operation is a focusing operation, and determining the dynamic object in response to the first operation of the user comprises:
    获取第一图像,所述第一图像中包括至少一个对象;Acquire a first image, wherein the first image includes at least one object;
    响应于用户在所述第一图像上的所述聚焦操作,从所述至少一个对象中确定所述动态对象。In response to the focusing operation of the user on the first image, the dynamic object is determined from the at least one object.
  10. 根据权利要求6-9任一项所述的方法,其特征在于,所述第一图像为所述待处理视频拍摄 之前拍摄的图像,或者为所述待处理视频中的图像。The method according to any one of claims 6 to 9, characterized in that the first image is captured by the video to be processed The image captured previously, or the image in the video to be processed.
  11. 根据权利要求1-10任一项所述的方法,其特征在于,所述根据所述动态对象和待处理视频确定定格动画,包括:The method according to any one of claims 1 to 10, characterized in that the step of determining the stop motion animation according to the dynamic object and the video to be processed comprises:
    确定所述待处理视频中与所述动态对象的每个动作对应的多帧图像;Determine a plurality of frames of images corresponding to each action of the dynamic object in the video to be processed;
    分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列;Performing frame extraction processing on the multiple frames of images corresponding to each of the actions respectively to obtain a key frame sequence corresponding to each of the actions;
    根据每个所述动作的对应所述关键帧序列生成所述定格动画。The stop-motion animation is generated according to the key frame sequence corresponding to each of the actions.
  12. 根据权利要求11所述的方法,其特征在于,所述方法还包括:The method according to claim 11, characterized in that the method further comprises:
    若所述关键帧序列的第一关键帧中存在干扰对象,则消除所述第一关键帧中的所述干扰对象。If an interfering object exists in a first key frame of the key frame sequence, the interfering object in the first key frame is eliminated.
  13. 根据权利要求12所述的方法,其特征在于,所述消除所述第一关键帧中的所述干扰对象,包括:The method according to claim 12, characterized in that eliminating the interfering object in the first key frame comprises:
    根据所述第一关键帧在所述关键帧序列的相邻帧中与所述干扰对象对应的区域,消除所述第一关键帧中的所述干扰对象。The interfering object in the first key frame is eliminated according to a region of the first key frame corresponding to the interfering object in adjacent frames of the key frame sequence.
  14. 根据权利要求11-13任一项所述方法,其特征在于,所述分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列,包括:The method according to any one of claims 11 to 13, characterized in that the step of performing frame extraction processing on the multiple frames of images corresponding to each of the actions to obtain a key frame sequence corresponding to each of the actions comprises:
    根据每个所述动作对应的所述多帧图像中与所述动态对象对应区域的像素均值,确定与每个所述动作对应的所述关键帧序列。The key frame sequence corresponding to each action is determined according to the pixel average value of the area corresponding to the dynamic object in the multiple frames of images corresponding to each action.
  15. 根据权利要求5所述的方法,其特征在于,所述根据所述动态对象和待处理视频确定定格动画,包括:The method according to claim 5, characterized in that the step of determining the stop motion animation according to the dynamic object and the video to be processed comprises:
    向云端服务器发送所述动态对象指示信息;Sending the dynamic object indication information to a cloud server;
    接收所述定格动画。The stop motion animation is received.
  16. 根据权利要求8或9所述的方法,其特征在于,所述根据所述动态对象和待处理视频确定定格动画,包括:The method according to claim 8 or 9, characterized in that the step of determining the stop motion animation according to the dynamic object and the video to be processed comprises:
    向云端服务器发送所述动态对象的指示信息和所述待处理视频;Sending the indication information of the dynamic object and the video to be processed to a cloud server;
    接收所述定格动画。The stop motion animation is received.
  17. 一种定格动画生成方法,其特征在于,应用于云端服务器,所述方法包括:A stop-motion animation generation method, characterized in that it is applied to a cloud server, and the method comprises:
    接收电子设备发送的动态对象的指示信息和待处理视频,根据所述指示信息确定所述动态对象;Receiving indication information of a dynamic object and a video to be processed sent by an electronic device, and determining the dynamic object according to the indication information;
    确定待处理视频中与所述动态对象的每个动作对应的多帧图像;Determine a plurality of frames of images corresponding to each action of the dynamic object in the video to be processed;
    分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列;Performing frame extraction processing on the multiple frames of images corresponding to each of the actions respectively to obtain a key frame sequence corresponding to each of the actions;
    根据每个所述动作的对应所述关键帧序列生成定格动画;generating a stop-motion animation according to the key frame sequence corresponding to each of the actions;
    向电子设备发送所述定格动画。The stop-motion animation is transmitted to an electronic device.
  18. 根据权利要求17所述的方法,其特征在于,所述接收电子设备发送的动态对象的指示信息和待处理视频,包括:The method according to claim 17, characterized in that the step of receiving the indication information of the dynamic object and the video to be processed sent by the electronic device comprises:
    接收所述电子设备发送的所述待处理视频;Receiving the video to be processed sent by the electronic device;
    向所述电子设备发送从所述待处理视频中确定的多个第一标注图像,每个所述第一标注图像中标注有至少一个对象;Sending a plurality of first annotated images determined from the video to be processed to the electronic device, each of the first annotated images being annotated with at least one object;
    接收所述电子设备发送的从每个所述第一标注图像中标注的所述至少一个对象中确定的所述动态对象的所述指示信息。The indication information of the dynamic object determined from the at least one object annotated in each of the first annotated images is received and sent by the electronic device.
  19. 根据权利要求18所述的方法,其特征在于,所述多个所述第一标注图像的确定方法,包括:The method according to claim 18, characterized in that the method for determining the plurality of first annotated images comprises:
    确定所述待处理视频中的多个拍摄场景;Determining multiple shooting scenes in the video to be processed;
    对每个拍摄场景进行抽帧处理,得到与每个所述拍摄场景对应的场景图像;Performing frame extraction processing on each shooting scene to obtain a scene image corresponding to each shooting scene;
    对每个所述场景图像进行对象识别,得到与每个所述场景图像分别对应的所述第一标注图像。Object recognition is performed on each of the scene images to obtain the first annotated image corresponding to each of the scene images.
  20. 根据权利要求18所述的方法,其特征在于,所述多个所述第一标注图像的确定方法,包括: The method according to claim 18, characterized in that the method for determining the plurality of first annotated images comprises:
    在拍摄所述待处理视频的过程中,当检测到拍摄场景从第一场景变化为第二场景时,从已拍摄视频片段中获取与所述第一场景对应的视频帧序列;In the process of shooting the video to be processed, when it is detected that the shooting scene changes from the first scene to the second scene, a video frame sequence corresponding to the first scene is acquired from the shot video clips;
    对所述视频帧序列进行抽帧处理,得到与所述第一场景对应的场景图像;Performing frame extraction processing on the video frame sequence to obtain a scene image corresponding to the first scene;
    对所述场景图像进行对象识别,得到所述第一场景的所述第一标注图像。Object recognition is performed on the scene image to obtain the first annotated image of the first scene.
  21. 根据权利要求17所述的方法,其特征在于,所述接收电子设备发送的动态对象的指示信息,包括:The method according to claim 17, wherein the receiving the indication information of the dynamic object sent by the electronic device comprises:
    接收所述电子设备发送的第一图像,所述第一图像中包括至少一个对象;Receiving a first image sent by the electronic device, wherein the first image includes at least one object;
    根据所述第一图像确定第二标注图像,所述第二标注图像中标注有所述至少一个对象;determining a second annotated image according to the first image, wherein the second annotated image is annotated with the at least one object;
    向所述电子设备发送与所述第一图像对应的所述第二标注图像;Sending the second annotated image corresponding to the first image to the electronic device;
    接收所述电子设备发送的从所述至少一个对象中确定的所述动态对象的所述指示信息。The indication information of the dynamic object determined from the at least one object is received and sent by the electronic device.
  22. 根据权利要求21所述的方法,其特征在于,所述根据所述第一图像确定第二标注图像,包括:The method according to claim 21, characterized in that determining the second annotated image according to the first image comprises:
    对所述第一图像进行对象识别,得到所述第二标注图像。Perform object recognition on the first image to obtain the second annotated image.
  23. 根据权利要求17所述的方法,其特征在于,所述接收电子设备发送的与动态对象对应的指示信息,包括:The method according to claim 17, wherein the receiving the indication information corresponding to the dynamic object sent by the electronic device comprises:
    接收所述电子设备发送的第一图像中所述动态对象的所述指示信息。Receive the indication information of the dynamic object in the first image sent by the electronic device.
  24. 根据权利要求21-23任一项所述的方法,其特征在于,所述第一图像为所述待处理视频拍摄之前拍摄的图像,或者为所述待处理视频中的图像。The method according to any one of claims 21 to 23 is characterized in that the first image is an image taken before the video to be processed is shot, or is an image in the video to be processed.
  25. 根据权利要求17-24任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 17 to 24, characterized in that the method further comprises:
    若所述关键帧序列的第一关键帧中存在干扰对象,则消除所述第一关键帧中的所述干扰对象。If an interfering object exists in a first key frame of the key frame sequence, the interfering object in the first key frame is eliminated.
  26. 根据权利要求25所述的方法,其特征在于,所述消除所述第一关键帧中的所述干扰对象,包括:The method according to claim 25, characterized in that eliminating the interfering object in the first key frame comprises:
    根据所述第一关键帧在所述关键帧序列的相邻帧中与所述干扰对象对应的区域,消除所述第一关键帧中的所述干扰对象。The interfering object in the first key frame is eliminated according to a region of the first key frame corresponding to the interfering object in adjacent frames of the key frame sequence.
  27. 根据权利要求17-26任一项所述方法,其特征在于,所述分别对每个所述动作对应的所述多帧图像进行抽帧处理,得到与每个所述动作对应的关键帧序列,包括:The method according to any one of claims 17 to 26, characterized in that the step of performing frame extraction processing on the multiple frames of images corresponding to each of the actions to obtain a key frame sequence corresponding to each of the actions comprises:
    根据每个所述动作对应的所述多帧图像中与所述动态对象对应区域的像素均值,确定与每个所述动作对应的所述关键帧序列。The key frame sequence corresponding to each action is determined according to the pixel average value of the area corresponding to the dynamic object in the multiple frames of images corresponding to each action.
  28. 一种电子设备,其特征在于,包括:处理器,所述处理器用于运行存储器中存储的计算机程序,以实现如权利要求1至16任一项所述的方法。An electronic device, characterized in that it comprises: a processor, wherein the processor is used to run a computer program stored in a memory to implement the method according to any one of claims 1 to 16.
  29. 一种云端服务器,其特征在于,包括:处理器,所述处理器用于运行存储器中存储的计算机程序,以实现如权利要求17至27任一项所述的方法。A cloud server, characterized in that it comprises: a processor, wherein the processor is used to run a computer program stored in a memory to implement the method according to any one of claims 17 to 27.
  30. 一种定格动画生成系统,其特征在于,包括:至少一个如权利要求28所述的电子设备和/或如权利要求29所述的云端服务器。A stop-motion animation generation system, characterized in that it comprises: at least one electronic device as described in claim 28 and/or a cloud server as described in claim 29.
  31. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至27任一项所述的方法。 A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the method according to any one of claims 1 to 27.
PCT/CN2023/137534 2022-12-29 2023-12-08 Stop motion animation generation method, electronic device, cloud server, and system WO2024140123A1 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211711630.0 2022-12-29

Publications (1)

Publication Number Publication Date
WO2024140123A1 true WO2024140123A1 (en) 2024-07-04

Family

ID=

Similar Documents

Publication Publication Date Title
CN111132234B (en) Data transmission method and corresponding terminal
WO2021143269A1 (en) Photographic method in long focal length scenario, and mobile terminal
CN109981885B (en) Method for presenting video by electronic equipment in incoming call and electronic equipment
WO2021047567A1 (en) Callback stream processing method and device
WO2022148319A1 (en) Video switching method and apparatus, storage medium, and device
US20230105934A1 (en) Cross-Device Allocation Method for Service Element, Terminal Device, and Storage Medium
WO2023241209A9 (en) Desktop wallpaper configuration method and apparatus, electronic device and readable storage medium
WO2023273543A1 (en) Folder management method and apparatus
CN113473013A (en) Display method and device for beautifying effect of image and terminal equipment
US20230273902A1 (en) File Opening Method and Device
CN113703894A (en) Display method and display device of notification message
WO2023029916A1 (en) Annotation display method and apparatus, terminal device, and readable storage medium
WO2023000746A1 (en) Augmented reality video processing method and electronic device
WO2024140123A1 (en) Stop motion animation generation method, electronic device, cloud server, and system
CN118279444A (en) Stop-motion animation generation method, electronic equipment, cloud server and system
WO2021227847A1 (en) Method and apparatus for applying file
US20230247085A1 (en) Terminal device interaction method and apparatus
WO2024078236A1 (en) Recording control method, electronic device, and medium
WO2024037542A1 (en) Touch input method, system, electronic device, and storage medium
CN116709018B (en) Zoom bar segmentation method and electronic equipment
WO2024022154A1 (en) Method for determining device user, and related apparatus
WO2024078238A1 (en) Video-recording control method, electronic device and medium
WO2024078275A1 (en) Image processing method and apparatus, electronic device and storage medium
CN117667559A (en) Method for monitoring frame loss and electronic equipment
CN113672563A (en) File application method and device