CN104574473B - Method and device for generating dynamic effect on basis of static image - Google Patents

Method and device for generating dynamic effect on basis of static image Download PDF

Info

Publication number
CN104574473B
CN104574473B CN201410854768.5A CN201410854768A CN104574473B CN 104574473 B CN104574473 B CN 104574473B CN 201410854768 A CN201410854768 A CN 201410854768A CN 104574473 B CN104574473 B CN 104574473B
Authority
CN
China
Prior art keywords
point
pixel
line
picture
characteristic
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Fee Related
Application number
CN201410854768.5A
Other languages
Chinese (zh)
Other versions
CN104574473A (en
Inventor
苗广艺
唐雨
胡金辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
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 Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201410854768.5A priority Critical patent/CN104574473B/en
Publication of CN104574473A publication Critical patent/CN104574473A/en
Priority to PCT/CN2015/095933 priority patent/WO2016107356A1/en
Application granted granted Critical
Publication of CN104574473B publication Critical patent/CN104574473B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)

Abstract

The embodiment of the invention provides a method and device for generating a dynamic effect on the basis of a static image. The method includes the steps of selecting a characteristic region in the static image, wherein the characteristic region comprises characteristic points; determining one or more reference points in the characteristic region; mapping pixel points of the static image to one or more frames of twisted pictures according to the characteristic points or the reference points; generating the dynamic effect on the basis of the one or more frames of twisted images. According to the method and the device, calculation is simple, the method and the device do not need to rely on software development kits or library files or tools of a third party, the rendering generation speed is high, the resource consumption is low, and the cross-platform effect can be easily achieved.

Description

一种基于静态图片生成动态效果的方法和装置A method and device for generating dynamic effects based on static pictures

技术领域technical field

本发明涉及图像处理技术领域,特别是涉及一种基于静态图片生成动态效果的方法和一种基于静态图片生成动态效果的装置。The invention relates to the technical field of image processing, in particular to a method for generating dynamic effects based on static pictures and a device for generating dynamic effects based on static pictures.

背景技术Background technique

随着计算机科技的发展,尤其是移动设备的广泛普及,基于计算机的应用广泛进入人们生活的各个方面。With the development of computer technology, especially the widespread popularization of mobile devices, computer-based applications have widely entered every aspect of people's lives.

基于图片自动生成动画效果,在互联网娱乐方面有很多应用。Automatically generate animation effects based on pictures, and has many applications in Internet entertainment.

现在一般都会采用openGL(Open Graphics Library)接口等开发包或者工具来通过渲染生成,这种方式一方面依赖第三方开发包、库文件或者工具,另一方面对系统配置和资源有特殊要求,因此,消耗资源大、渲染生成速度慢,且不利于跨平台移植。Nowadays, openGL (Open Graphics Library) interface and other development kits or tools are generally used to generate through rendering. On the one hand, this method relies on third-party development kits, library files or tools, and on the other hand, it has special requirements for system configuration and resources. Therefore, , consumes a lot of resources, renders and generates slowly, and is not conducive to cross-platform transplantation.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的一种基于静态图片生成动态效果的方法和相应的一种基于静态图片生成动态效果的装置。In view of the above problems, the present invention is proposed to provide a method for generating dynamic effects based on static pictures and a corresponding device for generating dynamic effects based on static pictures, which overcome the above problems or at least partially solve the above problems.

依据本发明的一个方面,提供了一种基于静态图片生成动态效果的方法,包括:According to one aspect of the present invention, a method for generating dynamic effects based on static pictures is provided, including:

在静态图片中选取特征区域;所述特征区域中具有特征点;Selecting a feature area in a static picture; there are feature points in the feature area;

在所述特征区域中确定一个或多个参考点;determining one or more reference points in the characteristic area;

根据所述特征点和所述一个或多个参考点将所述静态图片的像素点映射到一帧或多帧扭曲图片中;mapping the pixels of the static picture into one or more frames of distorted pictures according to the feature points and the one or more reference points;

基于所述一帧或多帧扭曲图片生成动态效果。A dynamic effect is generated based on the one or more frames of warped pictures.

可选地,所述特征区域包括凸区域,所述特征点包括重心点。Optionally, the feature area includes a convex area, and the feature point includes a center of gravity point.

可选地,所述根据所述特征点和所述一个或多个参考点将所述静态图片的像素点映射到一帧或多帧扭曲图片中的步骤包括:Optionally, the step of mapping the pixels of the static picture to one or more frames of warped pictures according to the feature points and the one or more reference points includes:

生成扭曲图片;generate distorted images;

将在所述特征区域中第一连线上的像素点映射到第二连线上;mapping the pixel points on the first connection line in the feature region to the second connection line;

将所述第二连线上的像素点拷贝到在所述扭曲图片中的相同位置;copying the pixels on the second connection to the same position in the warped picture;

其中,所述第一连线为所述特征点与边缘点之间的连线,所述第二连线为当前参考点与边缘点的连线,所述边缘点为所述特征区域边缘上的坐标点。Wherein, the first connection line is the connection line between the feature point and the edge point, the second connection line is the connection line between the current reference point and the edge point, and the edge point is the line on the edge of the feature area. coordinate point.

可选地,所述将在所述特征区域中第一连线上的像素点映射到第二连线上的步骤包括:Optionally, the step of mapping the pixels on the first connecting line in the feature region to the second connecting line includes:

计算在所述特征区域中第一连线上的像素点,在第一连线上的相对位置;Calculating the relative position of the pixel on the first connecting line in the feature region on the first connecting line;

按照所述相对位置,将所述像素点拷贝到第二连线上。According to the relative position, copy the pixel point to the second connection line.

可选地,所述根据所述特征点和所述一个或多个参考点将所述静态图片的像素点映射到一帧或多帧扭曲图片中的步骤还包括:Optionally, the step of mapping the pixels of the static picture to one or more frames of warped pictures according to the feature points and the one or more reference points further includes:

在所述特征区域外的像素点映射到在所述扭曲图片中的相同位置。Pixels outside the feature region are mapped to the same location in the warped image.

可选地,所述根据所述特征点和所述一个或多个参考点将所述静态图片的像素点映射到一帧或多帧扭曲图片中的步骤还包括:Optionally, the step of mapping the pixels of the static picture to one or more frames of warped pictures according to the feature points and the one or more reference points further includes:

对扭曲图片中位置重叠的像素点进行像素点叠加处理。Perform pixel superposition processing on overlapping pixels in the distorted image.

可选地,所述根据所述特征点和所述一个或多个参考点将所述静态图片的像素点映射到一帧或多帧扭曲图片中的步骤还包括:Optionally, the step of mapping the pixels of the static picture to one or more frames of warped pictures according to the feature points and the one or more reference points further includes:

对扭曲图片中的空白位置进行像素点插值处理。Perform pixel interpolation on empty positions in the distorted image.

可选地,所述基于所述一帧或多帧扭曲图片生成动态效果的步骤包括:Optionally, the step of generating a dynamic effect based on the one or more frames of distorted pictures includes:

采用所述静态图片和所述一帧或多帧扭曲图片生成动态图片。A dynamic picture is generated by using the static picture and the one or more frames of warped pictures.

可选地,所述基于所述一帧或多帧扭曲图片生成动态效果的步骤包括:Optionally, the step of generating a dynamic effect based on the one or more frames of distorted pictures includes:

基于所述特征区域生成动态信息;generating dynamic information based on the feature area;

将所述动态信息和脚本对象写入所述静态图片中,以生成动态交互文件。Writing the dynamic information and script objects into the static picture to generate a dynamic interaction file.

可选地,所述基于所述特征区域生成动态信息的步骤包括:Optionally, the step of generating dynamic information based on the feature region includes:

使用所述特征区域、所述特征点和所述一个或多个参考点生成动态信息。Dynamic information is generated using the feature region, the feature point and the one or more reference points.

根据本发明的另一方面,提供了一种基于静态图片生成动态效果的装置,包括:According to another aspect of the present invention, a device for generating dynamic effects based on static pictures is provided, including:

选取模块,适于在静态图片中选取特征区域;所述特征区域中具有特征点;The selection module is suitable for selecting a feature area in a static picture; there are feature points in the feature area;

确定模块,适于在所述特征区域中确定一个或多个参考点;a determination module adapted to determine one or more reference points in said characteristic area;

映射模块,适于根据所述特征点和所述一个或多个参考点将所述静态图片的像素点映射到一帧或多帧扭曲图片中;A mapping module, adapted to map pixels of the static picture into one or more frames of warped pictures according to the feature points and the one or more reference points;

生成模块,适于基于所述一帧或多帧扭曲图片生成动态效果。A generating module, adapted to generate dynamic effects based on the one or more frames of distorted pictures.

可选地,所述特征区域包括凸区域,所述特征点包括重心点。Optionally, the feature area includes a convex area, and the feature point includes a center of gravity point.

可选地,所述映射模块还适于:Optionally, the mapping module is also suitable for:

生成扭曲图片;generate distorted images;

将在所述特征区域中第一连线上的像素点映射到第二连线上;mapping the pixel points on the first connection line in the feature region to the second connection line;

将所述第二连线上的像素点拷贝到在所述扭曲图片中的相同位置;copying the pixels on the second connection to the same position in the warped image;

其中,所述第一连线为所述特征点与边缘点之间的连线,所述第二连线为当前参考点与边缘点的连线,所述边缘点为所述特征区域边缘上的坐标点。Wherein, the first connection line is the connection line between the feature point and the edge point, the second connection line is the connection line between the current reference point and the edge point, and the edge point is the line on the edge of the feature area. coordinate point.

可选地,所述映射模块还适于:Optionally, the mapping module is also suitable for:

计算在所述特征区域中第一连线上的像素点,在第一连线上的相对位置;Calculating the relative position of the pixel on the first connecting line in the feature region on the first connecting line;

按照所述相对位置,将所述像素点拷贝到第二连线上。According to the relative position, copy the pixel point to the second connection line.

可选地,所述映射模块还适于:Optionally, the mapping module is also suitable for:

在所述特征区域外的像素点映射到在所述扭曲图片中的相同位置。Pixels outside the feature region are mapped to the same location in the warped image.

可选地,所述映射模块还适于:Optionally, the mapping module is also suitable for:

对扭曲图片中位置重叠的像素点进行像素点叠加处理。Perform pixel superposition processing on overlapping pixels in the distorted image.

可选地,所述映射模块还适于:Optionally, the mapping module is also suitable for:

对扭曲图片中的空白位置进行像素点插值处理。Perform pixel interpolation on empty positions in the distorted image.

可选地,所述生成模块还适于:Optionally, the generating module is also suitable for:

采用所述静态图片和所述一帧或多帧扭曲图片生成动态图片。A dynamic picture is generated by using the static picture and the one or more frames of warped pictures.

可选地,所述生成模块还适于:Optionally, the generating module is also suitable for:

基于所述特征区域生成动态信息;generating dynamic information based on the feature area;

将所述动态信息和脚本对象写入所述静态图片中,以生成动态交互文件。Writing the dynamic information and script objects into the static picture to generate a dynamic interaction file.

可选地,所述生成模块还适于:Optionally, the generating module is also suitable for:

使用所述特征区域、所述特征点和所述一个或多个参考点生成动态信息。Dynamic information is generated using the feature region, the feature point and the one or more reference points.

本发明实施例对静态图片的特征区域中,确定一个或多个参考点,以将静态图片的像素点映射到一帧或多帧扭曲图片中,生成动态效果,计算简单、无需依赖第三方开发包、库文件或者工具,渲染生成速度快,对资源消耗少,容易跨平台。In the embodiment of the present invention, one or more reference points are determined in the feature area of the static picture to map the pixels of the static picture to one or more frames of distorted pictures to generate dynamic effects, the calculation is simple, and there is no need to rely on third-party development Packages, library files or tools, rendering and generation are fast, consume less resources, and are easy to cross-platform.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same parts. In the attached picture:

图1示出了根据本发明一个实施例的一种基于静态图片生成动态效果的方法实施例的步骤流程图;Fig. 1 shows a flow chart of the steps of a method embodiment of generating a dynamic effect based on a static picture according to an embodiment of the present invention;

图2示出了根据本发明一个实施例的一种静态图片的示例图;Fig. 2 shows an example diagram of a static picture according to an embodiment of the present invention;

图3示出了根据本发明一个实施例的一种在静态图片中选取特征区域的示例图;Fig. 3 shows an example diagram of selecting a feature region in a static picture according to an embodiment of the present invention;

图4示出了根据本发明一个实施例的一种像素点的映射示例图;FIG. 4 shows an example map of a pixel mapping according to an embodiment of the present invention;

图5A和图5B示出了根据本发明一个实施例的一种扭曲图像的示例图;以及5A and 5B show an example diagram of a distorted image according to an embodiment of the present invention; and

图6示出了根据本发明一个实施例的一种基于静态图片生成动态效果的装置实施例的结构框图。Fig. 6 shows a structural block diagram of an embodiment of an apparatus for generating a dynamic effect based on a static picture according to an embodiment of the present invention.

具体实施方式detailed description

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

参照图1,示出了根据本发明一个实施例的一种基于静态图片生成动态效果的方法实施例的步骤流程图,具体可以包括如下步骤:Referring to FIG. 1 , it shows a flow chart of the steps of a method embodiment of generating a dynamic effect based on a static picture according to an embodiment of the present invention, which may specifically include the following steps:

步骤101,在静态图片中选取特征区域;Step 101, selecting a feature region in a static image;

需要说明的是,本发明实施例可以应用于移动设备中,例如,手机、PDA(PersonalDigital Assistant,个人数字助理)、膝上型计算机、掌上电脑等等,也可以应用于固定设备中,例如,个人电脑(Personal Computer,PC)、笔记本电脑等等,本发明实施例对此不加以限制。It should be noted that the embodiments of the present invention can be applied to mobile devices, such as mobile phones, PDAs (Personal Digital Assistants, personal digital assistants), laptop computers, palmtop computers, etc., and can also be applied to fixed devices, such as, A personal computer (Personal Computer, PC), a notebook computer, etc. are not limited in this embodiment of the present invention.

这些移动设备或固定设备一般可以支持包括Android(安卓)、IOS、WindowsPhone或者windows等的操作系统,通常可以存储静态图片。These mobile devices or fixed devices can generally support operating systems including Android (Android), IOS, WindowsPhone or windows, etc., and can usually store static pictures.

静态图片,可以是相对于动态图片而言的,即不具有动态效果的图片。Static pictures may be relative to dynamic pictures, that is, pictures without dynamic effects.

该静态图片可以包括JPG、JPEG、PNG、BMP等格式,本发明实施例对此不加以限制。The static picture may include formats such as JPG, JPEG, PNG, BMP, etc., which is not limited in this embodiment of the present invention.

在本发明实施例中,可以在静态图片中选取某一个区域作为特征区域,该特征区域可以为多边形、圆形、椭圆型等形状,针对该特征区域中的图像数据进行动态效果的生成。In the embodiment of the present invention, a certain area in the static picture can be selected as the feature area, and the feature area can be in the shape of polygon, circle, ellipse, etc., and dynamic effects are generated for the image data in the feature area.

例如,对于如图2所示的静态图片,可以提供一个如图3所示的椭圆形选择框,用户可以改变该椭圆形的选择框的形状,并选择其对于静态图片的位置,该位置可以确定为特征区域。For example, for a static picture as shown in Figure 2, an elliptical selection box as shown in Figure 3 can be provided, and the user can change the shape of the elliptical selection box and select its position for the static picture, which can be identified as the characteristic region.

其中,所述特征区域中可以具有特征点,用以进行动态效果的生成。Wherein, there may be feature points in the feature area for generating dynamic effects.

在本发明实施例的一种可选示例中,所述特征区域可以包括凸区域,所述特征点可以包括重心点。In an optional example of the embodiment of the present invention, the feature area may include a convex area, and the feature point may include a center of gravity point.

凸区域,从几何上看可以是指图形是往外凸的,没有凹进去的地方。Convex area, from a geometric point of view, can refer to a place where the figure is convex outwards and not concave.

代数上可以这样定义凸区域:集合中任取两个点a、b,有t*a+(1-t)*b仍属于这个集合,其中0<t<1,这个表达式的意思可以是连接两个点a b的直线段还在集合中。Algebraically, a convex area can be defined as follows: any two points a and b in the set, t*a+(1-t)*b still belong to this set, where 0<t<1, the meaning of this expression can be to connect The straight line segment of two points a b is still in the set.

几何上的重心,又称为几何中心,当物体为均质(密度为定值),质心等同于形心,如,三角形三条中线的交点。The geometric center of gravity, also known as the geometric center, when the object is homogeneous (the density is a constant value), the mass center is equal to the centroid, such as the intersection of the three midlines of a triangle.

步骤102,在所述特征区域中确定一个或多个参考点;Step 102, determining one or more reference points in the feature area;

在具体实现中,可以在监听到指定的交互操作事件时,根据指定的交互操作事件确定一个或多个参考点。In a specific implementation, one or more reference points may be determined according to the specified interactive operation event when the specified interactive operation event is monitored.

该交互操作事件可以为由用户进行交互操作所引起的事件。The interactive operation event may be an event caused by a user performing an interactive operation.

通过该交互操作事件的触发,可以使得特征区域进行类似于物理水球的抖动效果(近似装满水的气球),并且其抖动方向和方式是根据用户不同的交互操作而变化的,如手机摇动的方向、屏幕点击的位置等。Through the triggering of the interactive operation event, the feature area can be shaken similar to a physical water polo (approximately filled with water balloons), and its shaking direction and mode are changed according to different user interaction operations, such as shaking of a mobile phone. Orientation, where the screen is tapped, etc.

在一种情形中,该指定的交互操作事件可以包括摇晃事件,则可以按照摇晃事件的摇晃方向,在静态图片的特征区域中选取一个或多个参考点。In one situation, the specified interactive operation event may include a shaking event, and then one or more reference points may be selected in the characteristic area of the static picture according to the shaking direction of the shaking event.

在此种情形中,用户可以通过摇晃进行交互操作。In this case, the user can interact by shaking.

具体而言,可以从操作系统(如Android)的传感器事件接口,监听加速度传感器(如三轴加速度传感器)事件。Specifically, events of an acceleration sensor (such as a three-axis acceleration sensor) may be monitored from a sensor event interface of an operating system (such as Android).

收到加速度传感器变化事件后,分别获取设备在水平、垂直以及空间垂直三个方向的加速度,计算各方向加速度的平方和,并获取其平方根,作为设备移动的综合加速度。After receiving the change event of the acceleration sensor, obtain the acceleration of the device in the three directions of horizontal, vertical and spatial vertical respectively, calculate the sum of the squares of the acceleration in each direction, and obtain its square root as the comprehensive acceleration of the movement of the device.

若综合加速度大于设定的加速度阈值,则可以判断监听到摇晃事件,认定用户的摇晃操作进行交互。If the integrated acceleration is greater than the set acceleration threshold, it can be judged that a shaking event is detected, and the user's shaking operation is determined to be interacted with.

在摇晃方向上,可以与摇晃方向相同,也可以与摇晃方向相反,在静态图片的特征区域中选取一个或多个连续分布的参考点。In the shaking direction, it can be the same as the shaking direction or opposite to the shaking direction, and one or more continuously distributed reference points are selected in the feature area of the static picture.

在另一种情形中,该指定的交互操作事件可以包括屏幕点击事件,则按照指向发生屏幕点击事件的方向,在静态图片的特征区域中选取一个或多个参考点。In another situation, the specified interactive operation event may include a screen click event, and one or more reference points are selected in the characteristic area of the static picture according to the direction of the screen click event.

在此种情形中,用户可以通过点击屏幕(如特征区域)进行交互操作。In this case, the user can perform interactive operations by clicking on the screen (such as a feature area).

若监听到屏幕点击事件,则可以按照指向发生屏幕点击事件的方向,如特征区域的中心点/重心点指向发生屏幕点击事件的方向,可以与该方向相同,也可以与该方向相反,在静态图片的特征区域中选取一个或多个连续分布的参考点。If the screen click event is monitored, it can point to the direction of the screen click event. For example, the center point/center of gravity point of the feature area points to the direction of the screen click event, which can be the same as the direction or opposite to the direction. In static Select one or more continuously distributed reference points in the feature area of the image.

当然,上述参考点的确定方式只是作为示例,在实施本发明实施例时,可以根据实际情况设置其他参考点的确定方式,例如,直接指定参考点的位置,本发明实施例对此不加以限制。另外,除了上述参考点的确定方式外,本领域技术人员还可以根据实际需要采用其它参考点的确定方式,本发明实施例对此也不加以限制。Of course, the method of determining the above reference point is only an example. When implementing the embodiment of the present invention, other methods of determining the reference point can be set according to the actual situation, for example, directly specify the position of the reference point, which is not limited in the embodiment of the present invention . In addition, in addition to the above manner of determining the reference point, those skilled in the art may also adopt other manners of determining the reference point according to actual needs, which is not limited in this embodiment of the present invention.

步骤103,根据所述特征点和所述一个或多个参考点将所述静态图片的像素点映射到一帧或多帧扭曲图片中;Step 103, mapping the pixels of the static picture into one or more frames of distorted pictures according to the feature points and the one or more reference points;

在本发明实施例中,可以以特征点为基准,以参考点作为扭曲的幅度参考,对静态图片进行映射,以生成扭曲图片。In the embodiment of the present invention, the static picture may be mapped to generate the warped picture with the feature point as the reference and the reference point as the reference point of the warped magnitude.

静态图片中的特征区域中的像素点可以沿特征点指向参考点的方向映射,造成静态图片的扭曲。当参考点偏离特征点越大,扭曲的幅度可以越大,当参考点偏离特征点越小,扭曲的幅度可以越小,特别地,当特征点与参考点重合时,扭曲图片中可以不产生扭曲。The pixel points in the feature area in the static picture can be mapped along the direction of the feature point pointing to the reference point, resulting in distortion of the still picture. The larger the reference point deviates from the feature point, the larger the distortion can be. When the reference point deviates from the feature point, the smaller the distortion can be. In particular, when the feature point coincides with the reference point, there may be no distortion in the image. distortion.

在本发明的一种可选实施例中,步骤103可以包括如下子步骤:In an optional embodiment of the present invention, step 103 may include the following substeps:

子步骤S11,生成扭曲图片;Sub-step S11, generating a distorted image;

在本发明实施例中,扭曲图片的初始状态可以是空白的。In the embodiment of the present invention, the initial state of the warped picture may be blank.

子步骤S12,将在所述特征区域中第一连线上的像素点映射到第二连线上;Sub-step S12, mapping the pixels on the first connection line in the feature region to the second connection line;

其中,所述第一连线可以为所述特征点与边缘点之间的连线,所述第二连线可以为当前参考点与边缘点的连线,所述边缘点可以为所述特征区域边缘上的坐标点。Wherein, the first connection line may be the connection line between the feature point and the edge point, the second connection line may be the connection line between the current reference point and the edge point, and the edge point may be the feature point Coordinate points on the edge of the region.

本发明实施例中,对于在特征区域中的像素点,可以按照参考点进行映射。In the embodiment of the present invention, the pixel points in the feature region may be mapped according to the reference point.

需要说明的是,若特征区域为凸区域,参考点为特征区域内的像素点,则映射后的像素点可以位于特征区域内,实现特征区域内的像素点在特征区域内进行映射,而不会映射到特征区域外。It should be noted that if the feature area is a convex area and the reference point is a pixel in the feature area, then the mapped pixel can be located in the feature area, so that the pixels in the feature area can be mapped in the feature area without will be mapped outside the feature region.

例如,如图4所示,C0为特征点(如重心点),C1可以为参考点,E可以边缘点,则C0E可以为第一连线,C1E可以为第二连线,本发明实施例中,可以将第一连线C0E上的像素点P0,映射到第二连线C1E上,获得映射到的点P1。For example, as shown in Figure 4, C0 is a feature point (such as a center point), C1 can be a reference point, and E can be an edge point, then C0E can be the first connection line, and C1E can be the second connection line. In the embodiment of the present invention , the pixel point P0 on the first connection line C0E can be mapped to the second connection line C1E to obtain the mapped point P1.

在本发明实施例的一种可选示例中,子步骤S12可以包括如下子步骤:In an optional example of the embodiment of the present invention, substep S12 may include the following substeps:

子步骤S121,计算在所述特征区域中第一连线上的像素点,在第一连线上的相对位置;Sub-step S121, calculating the relative position of the pixel on the first connecting line in the feature region on the first connecting line;

子步骤S122,按照所述相对位置,将所述像素点拷贝到第二连线上。Sub-step S122, copying the pixel point to the second connection line according to the relative position.

在实际应用中,可以以比例关系表达像素点的相对位置。In practical applications, the relative positions of pixels can be expressed in a proportional relationship.

例如,在一个示例中,如图4所示,线段C0P0与线段C0E的比值,作为比例R,可以作为像素点P0在第一连线C0E上的相对位置。根据比例R,求得线段C1E上的点P1,使得线段C1P1与第二连线C1E的比值为R。For example, in one example, as shown in FIG. 4 , the ratio of the line segment C0P0 to the line segment C0E, as the ratio R, can be used as the relative position of the pixel point P0 on the first connection line C0E. According to the ratio R, the point P1 on the line segment C1E is obtained, so that the ratio of the line segment C1P1 to the second connecting line C1E is R.

当然,在本发明实施例还可以采用其他包含像素点的线段与第一连线之间比例表达相对位置,本发明实施例对此不加以限制。Certainly, in the embodiment of the present invention, the ratio between other line segments including pixel points and the first connection line may also be used to express the relative position, which is not limited in the embodiment of the present invention.

子步骤S13,将所述第二连线上的像素点拷贝到在所述扭曲图片中的相同位置;Sub-step S13, copying the pixel points on the second connection line to the same position in the warped picture;

若确定了第二连线上像素点的位置,则可以将其拷贝到扭曲图片中的相同位置,进行图像的扭曲映射。If the position of the pixel on the second connection line is determined, it can be copied to the same position in the warped picture to perform warped mapping of the image.

在本发明的一种可选实施例中,步骤103还可以包括如下子步骤:In an optional embodiment of the present invention, step 103 may also include the following substeps:

子步骤S14,在所述特征区域外的像素点映射到在所述扭曲图片中的相同位置。In sub-step S14, the pixels outside the feature area are mapped to the same position in the warped picture.

本发明实施例中,如果静态图片上像素点在凸特征区域外,则可以直接拷贝到扭曲图片上对应的相同位置,不产生扭曲。In the embodiment of the present invention, if the pixel on the static picture is outside the convex feature area, it can be directly copied to the corresponding same position on the distorted picture without distortion.

当然,本发明实施例也可以不对特征区域外的像素点进行映射,仅基于特征区域中的像素点进行映射,本发明实施例对此不加以限制。Of course, the embodiment of the present invention may not map the pixels outside the feature area, but only perform mapping based on the pixels in the feature area, which is not limited in the embodiment of the present invention.

在本发明的一种可选实施例中,步骤103还可以包括如下子步骤:In an optional embodiment of the present invention, step 103 may also include the following substeps:

子步骤S15,对扭曲图片中位置重叠的像素点进行像素点叠加处理。Sub-step S15, performing pixel point superposition processing on the overlapping pixels in the distorted image.

在本发明实施例中,由于静态图片进行映射产生扭曲,在扭曲图片中像素点较为集中的区域,可能会产生像素点的位置重叠的情形。In the embodiment of the present invention, since the still image is distorted by mapping, the positions of the pixels may overlap in areas where the pixels of the distorted image are more concentrated.

针对像素点的位置重叠的情形,本发明实施例可以进行像素点叠加处理。For the situation where the positions of pixels overlap, the embodiment of the present invention can perform pixel superposition processing.

例如,若应用RGB色彩模式,则可以通过对像素点的红(R)、绿(G)、蓝(B)三个颜色通道的变化以及它们相互之间的叠加来得到各式各样的颜色的。For example, if the RGB color mode is applied, various colors can be obtained by changing the three color channels of red (R), green (G), and blue (B) of pixels and superimposing them with each other. of.

当然,为了进一步减少计算量,也可以从叠加的像素点中选取一个像素点(如随机选取像素点、选取最后拷贝到该位置的像素点)作为该位置的像素点,还可以采用其他方式选取该位置的像素点,本发明实施例对此不加以限制。Of course, in order to further reduce the amount of calculation, a pixel point can also be selected from the superimposed pixels (such as randomly selecting a pixel point, selecting the last pixel point copied to this position) as the pixel point at this position, and other methods can also be used to select The pixel at this position is not limited in this embodiment of the present invention.

在本发明的一种可选实施例中,步骤103还可以包括如下子步骤:In an optional embodiment of the present invention, step 103 may also include the following substeps:

子步骤S16,对扭曲图片中的空白位置进行像素点插值处理。Sub-step S16, perform pixel point interpolation processing on the blank positions in the distorted picture.

在本发明实施例中,由于静态图片进行映射产生扭曲,在扭曲图片中像素点较为稀疏的区域,可能会由某些像素点没有被赋值(即没有像素点映射到该位置,该位置的像素点为原始状态,如白色),产生空白位置的情形。In the embodiment of the present invention, due to the distortion caused by the mapping of the static image, in the area where the pixels in the distorted image are relatively sparse, some pixels may not be assigned a value (that is, no pixel is mapped to this position, and the pixel at this position point is in its original state, such as white), resulting in a blank position situation.

针对扭曲图片中的空白位置的情形,本发明实施例可以进行像素点插值处理,以补全扭曲图片。For the blank position in the distorted picture, the embodiment of the present invention may perform pixel interpolation processing to complement the distorted picture.

例如,对于没有被赋值的像素点Px,选取距离它最近的已经赋值的像素点Py(如上方的像素点、下方的像素点、左侧的像素点、右侧的像素点等),将像素点Py的值赋给像素点Px。For example, for a pixel Px that has not been assigned a value, select the nearest assigned pixel Py (such as the upper pixel, the lower pixel, the left pixel, the right pixel, etc.), and the pixel The value of the point Py is assigned to the pixel point Px.

在实际应用中,当参考点(如图4所示的C1)移动到某一个位置的时候,可以根据参考点(如图4所示的C1)的位置映射出一张扭曲图片,随着参考点(如图4所示的C1)移动到不同的位置,扭曲图片也发生变化,扭曲图片可以连续播放,从而形成动画效果。In practical applications, when the reference point (C1 as shown in Figure 4) moves to a certain position, a distorted picture can be mapped out according to the position of the reference point (C1 as shown in Figure 4). When the point (C1 shown in FIG. 4) moves to different positions, the distorted picture also changes, and the distorted picture can be played continuously, thereby forming an animation effect.

如图5A所示,若参考点(如图4所示的C1)在特征点(如图4所示的C0)的左侧,则特征图像中整体可以往左侧扭曲;图5B所示,若参考点在特征点(如图4所示的C0)的右侧,则特征图像中整体可以往右侧扭曲。As shown in Figure 5A, if the reference point (C1 as shown in Figure 4) is on the left side of the feature point (C0 as shown in Figure 4), the entire feature image can be distorted to the left; as shown in Figure 5B, If the reference point is on the right side of the feature point (C0 as shown in FIG. 4 ), the entire feature image can be distorted to the right.

进一步地,若参考点的位置根据指定的交互操作事件确定,则参考点可以从特征点的位置出发,沿指定的交互操作事件对应的方向(如摇晃事件的摇晃方向、指向发生屏幕点击事件的方向)在特征点两侧分布,最终与特征点重合,则特征区域映射出的扭曲图片可以沿指定的交互操作事件对应的方向来回扭曲,产生抖动效果,并最终静止。Furthermore, if the position of the reference point is determined according to the specified interactive operation event, then the reference point can start from the position of the feature point and move along the direction corresponding to the specified interactive operation event (such as the shaking direction of the shaking event, pointing to the location where the screen click event occurs). Direction) is distributed on both sides of the feature point, and finally coincides with the feature point, then the distorted image mapped by the feature area can be twisted back and forth along the direction corresponding to the specified interaction event, resulting in a shaking effect, and finally stops.

例如,如图4所示,参考点C1沿着经过重心点C0的X轴方向上做震荡移动,参考点C1每移动到一个位置就会生成一个扭曲图片,扭曲图片逐帧播放,可以产生如图5A和图5B所示的特征区域内的图像表现出左右震动的动态效果。For example, as shown in Figure 4, the reference point C1 oscillates along the X-axis passing through the center of gravity point C0. Every time the reference point C1 moves to a position, a distorted picture will be generated, and the distorted picture will be played frame by frame. The image in the characteristic area shown in FIG. 5A and FIG. 5B exhibits a dynamic effect of vibrating left and right.

步骤104,基于所述一帧或多帧扭曲图片生成动态效果。Step 104, generating a dynamic effect based on the one or more frames of distorted pictures.

需要说明的是,该动态效果可以在当前进行生成,也可以在后进行驱动,本发明实施例对此不加以限制。It should be noted that the dynamic effect may be generated currently or driven later, which is not limited in this embodiment of the present invention.

在本发明的一种可选实施例中,步骤104可以包括如下子步骤:In an optional embodiment of the present invention, step 104 may include the following substeps:

子步骤S21,采用所述静态图片和所述一帧或多帧扭曲图片生成动态图片。Sub-step S21, using the static picture and the one or more frames of warped pictures to generate a dynamic picture.

在本发明实施例中,可以保存一帧静态图片,以及,一帧或多帧包括该特征区域的扭曲图片,生成动态图片,例如GIF。In the embodiment of the present invention, one frame of static picture can be saved, and one or more frames of distorted pictures including the feature area can be saved to generate dynamic pictures, such as GIF.

相对于传统的GIF,由于减少了扭曲图片以外的图像数据的存储,可以减少动态图片的体积大小。Compared with the traditional GIF, since the storage of image data other than the distorted picture is reduced, the size of the dynamic picture can be reduced.

在本发明的一种可选实施例中,步骤104可以包括如下子步骤:In an optional embodiment of the present invention, step 104 may include the following substeps:

子步骤S31,基于所述特征区域生成动态信息;Sub-step S31, generating dynamic information based on the feature area;

动态信息可以为将静态图片的特征区域映射到一帧或多帧扭曲图像的配置信息,例如XML(Extensible Markup Language,可扩展的标识语言)、json(Javascript ObjectNotation,数据交换语言)等。The dynamic information can be configuration information for mapping the feature area of a static picture to one or more frames of distorted images, such as XML (Extensible Markup Language, Extensible Markup Language), json (Javascript ObjectNotation, data exchange language) and the like.

以json设计的配置信息的示例可以如下:An example of configuration information designed in json can be as follows:

在本发明实施例的一种可选示例中,子步骤S31可以包括如下子步骤:In an optional example of the embodiment of the present invention, substep S31 may include the following substeps:

子步骤S311,使用所述特征区域、所述特征点和所述一个或多个参考点生成动态信息。Sub-step S311, using the feature area, the feature point and the one or more reference points to generate dynamic information.

在本发明实施例中,可以将特征区域、特征点和一个或多个参考点生成动态信息,以支持基于参考点的动态效果的生成。In the embodiment of the present invention, dynamic information may be generated from the feature area, the feature point and one or more reference points, so as to support the generation of dynamic effects based on the reference points.

子步骤S32,将所述动态信息和脚本对象写入所述静态图片中,以生成动态交互文件。Sub-step S32, writing the dynamic information and the script object into the static image to generate a dynamic interaction file.

在本发明实施例中,可以将动态信息、脚本对象(如JS脚本)写入静态图片中,可以传输到网络或者给其他用户、也可以进行存储。In the embodiment of the present invention, dynamic information and script objects (such as JS scripts) can be written into static pictures, and can be transmitted to the network or to other users, and can also be stored.

在读取该脚本对象后,可以使用脚本对象按照该动态信息对该静态图片进行映射,以产生逐帧变化的动态效果。After the script object is read, the script object can be used to map the static picture according to the dynamic information, so as to generate a dynamic effect that changes frame by frame.

本发明实施例对静态图片的特征区域中,确定一个或多个参考点,以将静态图片的像素点映射到一帧或多帧扭曲图片中,生成动态效果,计算简单、无需依赖第三方开发包、库文件或者工具,渲染生成速度快,对资源消耗少,容易跨平台。In the embodiment of the present invention, one or more reference points are determined in the feature area of the static picture to map the pixels of the static picture to one or more frames of distorted pictures to generate dynamic effects, the calculation is simple, and there is no need to rely on third-party development Packages, library files or tools, rendering and generation are fast, consume less resources, and are easy to cross-platform.

对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。For the method embodiment, for the sake of simple description, it is expressed as a series of action combinations, but those skilled in the art should know that the embodiment of the present invention is not limited by the described action order, because according to the embodiment of the present invention , certain steps may be performed in other order or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

参照图6,示出了根据本发明一个实施例的一种基于静态图片生成动态效果的装置实施例的结构框图,具体可以包括如下模块:Referring to FIG. 6 , it shows a structural block diagram of an embodiment of a device for generating dynamic effects based on static pictures according to an embodiment of the present invention, which may specifically include the following modules:

选取模块601,适于在静态图片中选取特征区域;所述特征区域中具有特征点;The selection module 601 is adapted to select a feature area in a static picture; there are feature points in the feature area;

确定模块602,适于在所述特征区域中确定一个或多个参考点;A determination module 602, adapted to determine one or more reference points in the characteristic area;

映射模块603,适于根据所述特征点和所述一个或多个参考点将所述静态图片的像素点映射到一帧或多帧扭曲图片中;A mapping module 603, adapted to map pixels of the static picture into one or more frames of warped pictures according to the feature points and the one or more reference points;

生成模块604,适于基于所述一帧或多帧扭曲图片生成动态效果。The generation module 604 is adapted to generate a dynamic effect based on the one or more frames of distorted pictures.

在本发明实施例的一种可选示例中,所述特征区域可以包括凸区域,所述特征点可以包括重心点。In an optional example of the embodiment of the present invention, the feature area may include a convex area, and the feature point may include a center of gravity point.

在本发明的一种可选实施例中,所述映射模块604还可以适于:In an optional embodiment of the present invention, the mapping module 604 may also be adapted to:

生成扭曲图片;generate distorted images;

将在所述特征区域中第一连线上的像素点映射到第二连线上;mapping the pixel points on the first connection line in the feature region to the second connection line;

将所述第二连线上的像素点拷贝到在所述扭曲图片中的相同位置;copying the pixels on the second connection to the same position in the warped picture;

其中,所述第一连线为所述特征点与边缘点之间的连线,所述第二连线为当前参考点与边缘点的连线,所述边缘点为所述特征区域边缘上的坐标点。Wherein, the first connection line is the connection line between the feature point and the edge point, the second connection line is the connection line between the current reference point and the edge point, and the edge point is the line on the edge of the feature area. coordinate point.

在本发明的一种可选实施例中,所述映射模块604还可以适于:In an optional embodiment of the present invention, the mapping module 604 may also be adapted to:

计算在所述特征区域中第一连线上的像素点,在第一连线上的相对位置;Calculating the relative position of the pixel on the first connecting line in the feature region on the first connecting line;

按照所述相对位置,将所述像素点拷贝到第二连线上。According to the relative position, copy the pixel point to the second connection line.

在本发明的一种可选实施例中,所述映射模块604还可以适于:In an optional embodiment of the present invention, the mapping module 604 may also be adapted to:

在所述特征区域外的像素点映射到在所述扭曲图片中的相同位置。Pixels outside the feature region are mapped to the same location in the warped image.

在本发明的一种可选实施例中,所述映射模块604还可以适于:In an optional embodiment of the present invention, the mapping module 604 may also be adapted to:

对扭曲图片中位置重叠的像素点进行像素点叠加处理。Perform pixel superposition processing on overlapping pixels in the distorted image.

在本发明的一种可选实施例中,所述映射模块604还可以适于:In an optional embodiment of the present invention, the mapping module 604 may also be adapted to:

对扭曲图片中的空白位置进行像素点插值处理。Perform pixel interpolation on empty positions in the distorted image.

在本发明的一种可选实施例中,所述生成模块605还可以适于:In an optional embodiment of the present invention, the generating module 605 may also be adapted to:

采用所述静态图片和所述一帧或多帧扭曲图片生成动态图片。A dynamic picture is generated by using the static picture and the one or more frames of warped pictures.

在本发明的一种可选实施例中,所述生成模块605还可以适于:In an optional embodiment of the present invention, the generating module 605 may also be adapted to:

基于所述特征区域生成动态信息;generating dynamic information based on the feature area;

将所述动态信息和脚本对象写入所述静态图片中,以生成动态交互文件。Writing the dynamic information and script objects into the static picture to generate a dynamic interaction file.

在本发明的一种可选实施例中,所述生成模块605还可以适于:In an optional embodiment of the present invention, the generating module 605 may also be adapted to:

使用所述特征区域、所述特征点和所述一个或多个参考点生成动态信息。Dynamic information is generated using the feature region, the feature point and the one or more reference points.

对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的基于静态图片生成动态效果的设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of some or all of the components in the device for generating dynamic effects based on static pictures according to embodiments of the present invention Function. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

Claims (18)

1. it is a kind of based on static images generate dynamic effect method, including:
The selected characteristic region in static images;There is in the characteristic area characteristic point;
One or more reference points are determined in the characteristic area;
The pixel of the static images is mapped to by a frame or many according to the characteristic point and one or more of reference points In frame distortion picture;
Dynamic effect is generated based on a frame or multiframe distortion picture;
It is described that the pixel of the static images is mapped to by a frame according to the characteristic point and one or more of reference points Or the step in multiframe distortion picture includes:
Generate distortion picture;
Pixel on the first line in the characteristic area is mapped on the second line;
Copy the pixel on second line to same position in the distortion picture;
Wherein, first line is the line between the characteristic point and marginal point, and second line is current reference point With the line of marginal point, the marginal point is the coordinate points on the characteristic area edge.
2. the method for claim 1, it is characterised in that the characteristic area includes convex domain, and the characteristic point includes Focus point.
3. the method for claim 1, it is characterised in that the pixel by the first line in the characteristic area The step that point is mapped on the second line includes:
Calculate the pixel in the characteristic area on the first line, the relative position on the first line;
According to the relative position, the pixel is copied on the second line.
4. the method for claim 1, it is characterised in that described according to the characteristic point and one or more of references Step during the pixel of the static images is mapped to a frame or multiframe distortion picture by point also includes:
Pixel outside the characteristic area is mapped to the same position in the distortion picture.
5. the method for claim 1, it is characterised in that described according to the characteristic point and one or more of references Step during the pixel of the static images is mapped to a frame or multiframe distortion picture by point also includes:
Pixel to distorting location overlap in picture carries out pixel overlap-add procedure.
6. the method for claim 1, it is characterised in that described according to the characteristic point and one or more of references Step during the pixel of the static images is mapped to a frame or multiframe distortion picture by point also includes:
Pixel interpolation processing is carried out to distorting the blank position in picture.
7. the method as described in any one of claim 1-6, it is characterised in that described based on a frame or multiframe distortion picture The step of generating dynamic effect includes:
Dynamic picture is generated using the static images and a frame or multiframe distortion picture.
8. the method as described in any one of claim 1-6, it is characterised in that described based on a frame or multiframe distortion picture The step of generating dynamic effect includes:
Multidate information is generated based on the characteristic area;
The multidate information and scripting object are write in the static images, to generate dynamic interaction file.
9. method as claimed in claim 8, it is characterised in that described the step of generate multidate information based on the characteristic area Including:
Multidate information is generated using the characteristic area, the characteristic point and one or more of reference points.
10. it is a kind of based on static images generate dynamic effect device, including:
Module is chosen, the selected characteristic region in static images is suitable to;There is in the characteristic area characteristic point;
Determining module, is suitable to one or more reference points are determined in the characteristic area;
Mapping block, is suitable to reflect the pixel of the static images according to the characteristic point and one or more of reference points It is mapped in a frame or multiframe distortion picture;
Generation module, is suitable to generate dynamic effect based on a frame or multiframe distortion picture;
The mapping block is further adapted for:
Generate distortion picture;
Pixel on the first line in the characteristic area is mapped on the second line;
Copy the pixel on second line to same position in the distortion picture;
Wherein, first line is the line between the characteristic point and marginal point, and second line is current reference point With the line of marginal point, the marginal point is the coordinate points on the characteristic area edge.
11. devices as claimed in claim 10, it is characterised in that the characteristic area includes convex domain, the characteristic point bag Include focus point.
12. devices as claimed in claim 10, it is characterised in that the mapping block is further adapted for:
Calculate the pixel in the characteristic area on the first line, the relative position on the first line;
According to the relative position, the pixel is copied on the second line.
13. devices as claimed in claim 10, it is characterised in that the mapping block is further adapted for:
Pixel outside the characteristic area is mapped to the same position in the distortion picture.
14. devices as claimed in claim 10, it is characterised in that the mapping block is further adapted for:
Pixel to distorting location overlap in picture carries out pixel overlap-add procedure.
15. devices as claimed in claim 10, it is characterised in that the mapping block is further adapted for:
Pixel interpolation processing is carried out to distorting the blank position in picture.
16. devices as described in any one of claim 10-15, it is characterised in that the generation module is further adapted for:
Dynamic picture is generated using the static images and a frame or multiframe distortion picture.
17. devices as described in any one of claim 10-15, it is characterised in that the generation module is further adapted for:
Multidate information is generated based on the characteristic area;
The multidate information and scripting object are write in the static images, to generate dynamic interaction file.
18. devices as claimed in claim 17, it is characterised in that the generation module is further adapted for:
Multidate information is generated using the characteristic area, the characteristic point and one or more of reference points.
CN201410854768.5A 2014-12-31 2014-12-31 Method and device for generating dynamic effect on basis of static image Expired - Fee Related CN104574473B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410854768.5A CN104574473B (en) 2014-12-31 2014-12-31 Method and device for generating dynamic effect on basis of static image
PCT/CN2015/095933 WO2016107356A1 (en) 2014-12-31 2015-11-30 Static picture-based dynamic interaction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410854768.5A CN104574473B (en) 2014-12-31 2014-12-31 Method and device for generating dynamic effect on basis of static image

Publications (2)

Publication Number Publication Date
CN104574473A CN104574473A (en) 2015-04-29
CN104574473B true CN104574473B (en) 2017-04-12

Family

ID=53090439

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410854768.5A Expired - Fee Related CN104574473B (en) 2014-12-31 2014-12-31 Method and device for generating dynamic effect on basis of static image

Country Status (1)

Country Link
CN (1) CN104574473B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016107356A1 (en) * 2014-12-31 2016-07-07 北京奇虎科技有限公司 Static picture-based dynamic interaction method and device
CN105405155A (en) * 2015-10-21 2016-03-16 努比亚技术有限公司 Information processing method and mobile terminal
CN109361880A (en) 2018-11-30 2019-02-19 三星电子(中国)研发中心 A kind of method and system showing the corresponding dynamic picture of static images or video
CN111464699B (en) * 2020-04-02 2022-10-04 北京小米移动软件有限公司 Call background display method, device and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101061502A (en) * 2004-09-28 2007-10-24 高通股份有限公司 Magnification and pinching of two-dimensional images

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102411791B (en) * 2010-09-19 2013-09-25 三星电子(中国)研发中心 Method and equipment for changing static image into dynamic image
RU2481640C1 (en) * 2011-12-01 2013-05-10 Корпорация "Самсунг Электроникс Ко., Лтд" Method and system of generation of animated art effects on static images
CN103473799B (en) * 2013-09-02 2016-09-14 腾讯科技(深圳)有限公司 The method for dynamically processing of a kind of picture and device, terminal unit

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101061502A (en) * 2004-09-28 2007-10-24 高通股份有限公司 Magnification and pinching of two-dimensional images

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
手机360搜索玩图抖动使用教程;西西小熊;《http://www.cr173.com/html/38305_1.html》;20140805;1-6页 *

Also Published As

Publication number Publication date
CN104574473A (en) 2015-04-29

Similar Documents

Publication Publication Date Title
CN104571887B (en) Static picture based dynamic interaction method and device
US10810781B2 (en) Systems and methods for displaying representative images
KR101952983B1 (en) System and method for layering using tile-based renderers
US20140043340A1 (en) Animation Transitions and Effects in a Spreadsheet Application
CN104574484B (en) A kind of method and apparatus producing picture dynamic effect based on interactive operation
WO2017024964A1 (en) Object-associated image quick preview method and device
KR20140030098A (en) Animated page turning
CN104574473B (en) Method and device for generating dynamic effect on basis of static image
US9955065B2 (en) Dynamic motion path blur user interface
US20230401764A1 (en) Image processing method and apparatus, electronic device and computer readable medium
CN108255546A (en) A kind of implementation method and device of data loading animation
US20160063670A1 (en) Dynamic Motion Path Blur Kernel
CN111127469A (en) Thumbnail display method, device, storage medium and terminal
WO2024001360A1 (en) Green screen matting method and apparatus, and electronic device
US20160035068A1 (en) Dynamic Motion Path Blur Techniques
WO2023071571A9 (en) Sound effect display method and terminal device
JP6364066B2 (en) Graphic processing using multiple primitives
CN104574483A (en) Method and device for generating customizable dynamic graphs
CN103336818B (en) Method and device for alignment after webpage zoom on electronic equipment
CN103324741B (en) A kind of webpage zoom on electronic equipment and the method and apparatus of alignment
WO2016107356A1 (en) Static picture-based dynamic interaction method and device
US20190213767A1 (en) Augmented reality and virtual reality engine at the object level for virtual desktop infrastucture
CN103324738A (en) Method and device for webpage zooming and aligning on electronic equipment
KR101630257B1 (en) 3D image providing system and providing method thereof
AU2017213546A1 (en) Face painting on a single image with an underlying 3d model

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170412

Termination date: 20211231

CF01 Termination of patent right due to non-payment of annual fee