The invention relates to a method for replacing characters in video, which includes: determining video resources; determining the replaced persons in video resources; determining the designated persons; acquiring the images of the designated persons; playback each frame of video resources in sequence; for any frame, the playback mode is as follows: if any frame does not contain the images of the replaced persons, the frame will be played directly; if any frame does not contain the images of the replaced persons, the frame will be played directly; When a frame contains the image of the replaced person, the image of the replaced person is replaced by the image of the designated person, and then the frame after replacing the image is played. The method of the present invention determines the image of the replaced person and the designated person in the video resource, and then plays the frame directly when playing each frame, if the frame does not contain the image of the replaced person; if the frame contains the image of the replaced person, the image of the replaced person is replaced by the image of the designated person first, and the frame after replacing the image is replaced, thus realizing the video resource system. The change of the character image after that has enhanced the participatory and interactive nature.
【技术实现步骤摘要】
一种视频中人物的替换方法
本专利技术涉及视频处理
,尤其涉及一种视频中人物的替换方法。
技术介绍
目前如电影、电视、动画、动漫、游戏等视频资源中,人物形象是固定的,即视频资源一经制作完成,人物形象只能为制作时的样子,不可改变。人物形象不可改变的方式呈现人物形象,会降低视频资源的趣味性,使得视频资源与用户之间的参与性和互动性不足。
技术实现思路
(一)要解决的技术问题为了提升视频资源的互动性,本专利技术提供一种视频中人物的替换方法。(二)技术方案为了达到上述目的,本专利技术采用的主要技术方案包括:一种视频中人物的替换方法,所述方法,包括:S101,确定视频资源;S102,确定所述视频资源中被替换人物;S103,确定指定人物;S104,获取所述指定人物的图像;S105,按顺序依次播放视频资源的每一帧;对于任一帧,其播放方式为:若所述任一帧不包含S102中确定的被替换人物的图像,则直接播放该帧;若所述任一帧包含S102中确定的被替换人物的图像,则先将S102中确定的被替换人物的图像替换成S104中获取的所述指定人物的图像,再播放替换图像后的帧。可选地,所述被替换人物为 ...
【技术保护点】
1.一种视频中人物的替换方法,其特征在于,所述方法包括:S101,确定视频资源;S102,确定所述视频资源中被替换人物;S103,确定指定人物;S104,获取所述指定人物的图像;S105,按顺序依次播放视频资源的每一帧;对于任一帧,其播放方式为:若所述任一帧不包含S102中确定的被替换人物的图像,则直接播放该帧;若所述任一帧包含S102中确定的被替换人物的图像,则先将S102中确定的被替换人物的图像替换成S104中获取的所述指定人物的图像,再播放替换图像后的帧。
【技术特征摘要】
1.一种视频中人物的替换方法,其特征在于,所述方法包括:S101,确定视频资源;S102,确定所述视频资源中被替换人物;S103,确定指定人物;S104,获取所述指定人物的图像;S105,按顺序依次播放视频资源的每一帧;对于任一帧,其播放方式为:若所述任一帧不包含S102中确定的被替换人物的图像,则直接播放该帧;若所述任一帧包含S102中确定的被替换人物的图像,则先将S102中确定的被替换人物的图像替换成S104中获取的所述指定人物的图像,再播放替换图像后的帧。2.根据权利要求1所述的方法,其特征在于,所述被替换人物为一个或多个。3.根据权利要求2所述的方法,其特征在于,所述被替换人物为多个时,所述指定人物也为多个;所述被替换人物数量与指定人物数量相同,且所述被替换人物与指定人物一一对应。4.根据权利要求1所述的方法,其特征在于,所述S104包括:从预先存储的图像文件中获取指定人物的图像;或者,从上传的图像文件中获取指定人物的图像;或者,从即时拍摄的图像文件中获取指定人物的图像;所述图像文件为照片,或者,视频。5.根据权利要求1所述的方法,其特征在于,所述将S102中确定的被替换人物的图像替换成S104中获取的所述指定人物的图像包括:对所述指定人物的图像进行处理,使其与S102中确定的被替换人物的图像匹配;将S102中确定的被替换人物的图像替换成处理后的指定人物的图像。6.根据权利要求5所述的方法,其特征在于,对所述指定人物的图像进行处理包括:调整所述指定人物的图像的像素、大小、对比度、亮度。7.根据权利要求6所述的方法,其特征在于,调整所述指定人物的图像的像素包括:S701,根据被替换人物的图像,确定第一像素;S702,根据指定人物的图像,确定第二像素;S703,若第二像素高于第一像素,则将指定人物的图像的像素调整为所述第一像素;若第二像素低于第一像素,则将指定人物的图像的像素调整为第二像素+(第一像素-第二像素)*第二像素/第一像素。8.根据权利要求6所述的方法,其特征在于,调整所述指定人物的图像的大小包括:S8...
【专利技术属性】
技术研发人员:许栋刚,邢丽,张延良,王伟,李林,王静,王娜,刘大鹏,张玲玲,
申请(专利权)人:北京易捷胜科技有限公司,
类型:发明
国别省市:北京,11
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。