WO2018176958A1 - 一种随图像中关键点移动的自适应贴图方法和*** - Google Patents

一种随图像中关键点移动的自适应贴图方法和*** Download PDF

Info

Publication number
WO2018176958A1
WO2018176958A1 PCT/CN2017/120135 CN2017120135W WO2018176958A1 WO 2018176958 A1 WO2018176958 A1 WO 2018176958A1 CN 2017120135 W CN2017120135 W CN 2017120135W WO 2018176958 A1 WO2018176958 A1 WO 2018176958A1
Authority
WO
WIPO (PCT)
Prior art keywords
coordinates
point
key
image
texture
Prior art date
Application number
PCT/CN2017/120135
Other languages
English (en)
French (fr)
Inventor
李亮
陈少杰
张文明
Original Assignee
武汉斗鱼网络科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 武汉斗鱼网络科技有限公司 filed Critical 武汉斗鱼网络科技有限公司
Publication of WO2018176958A1 publication Critical patent/WO2018176958A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/20Linear translation of whole images or parts thereof, e.g. panning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/60Rotation of whole images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/24Indexing scheme for image data processing or generation, in general involving graphical user interfaces [GUIs]

Definitions

  • the present invention relates to the field of image processing and, more particularly, to an adaptive mapping method and system that moves with key points in an image.
  • mapping on video images is becoming more and more common.
  • texture is the effect of adding dynamic texture to specific parts of the image.
  • a human face can be referred to as an eye. , nose or mouth
  • the existing mapping method only places the texture at a specific position in the picture.
  • the specific position changes, although the position of the texture changes, the display scale changes without considering the specific position.
  • the shape of the texture will be distorted to a certain extent, which will greatly reduce the display effect of the texture.
  • the present invention provides a method and system for adaptive mapping of key points moving in an image that overcomes the above problems or at least partially solves the above problems.
  • a method of adaptive mapping that moves with key points in an image comprising:
  • an adaptive mapping system that moves with key points in an image, including:
  • the nearby coordinate generating device obtains a certain range of coordinates near the position after the key point is moved according to the coordinate of the key point movement and the scaling factor of the texture;
  • the texture sampling coordinate obtaining means obtains the texture sampling coordinates according to the coordinates of a certain range, the coordinates of the key points, and the scaling factor of the texture in the vicinity of the position after the key point is moved, and displays the texture on the texture sampling coordinates.
  • an adaptive mapping apparatus comprising:
  • At least one processor at least one memory, and a bus;
  • the processor and the memory complete communication with each other through the bus;
  • the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the following methods:
  • a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions when the program instructions are When the computer executes, it can perform the following methods:
  • a non-transitory computer readable storage medium storing computer instructions that cause the computer to perform the following method:
  • the present application proposes an adaptive mapping method and system for moving key points in an image, by locating the position of a key point on a key object in the image, and rotating any point on the image according to the position change after the key point is moved.
  • Matrix transformation obtain the coordinates of the rotation matrix corresponding to the point, ensure that the points on the image move synchronously with the position of the key point, and then move the key point according to the coordinate of the key point and the scaling factor of the texture.
  • a certain range of coordinates near the position, and finally the coordinate of the key point and the scaling factor of the texture are obtained to obtain the texture sampling coordinates of the display texture.
  • the present invention enables the texture to be adaptively moved in the case where the key point on the image is moved, and The user's experience is improved without changing the original display ratio.
  • FIG. 1 is a flow chart of an adaptive mapping method for moving key points in an image according to an embodiment of the present invention
  • step S1 is a flowchart of step S1 in the embodiment of the present invention.
  • step S2 in the embodiment of the present invention.
  • FIG. 4 is a block diagram of an adaptive mapping system that moves with key points in an image according to an embodiment of the present invention
  • FIG. 5 is a structural block diagram of a conversion module according to an embodiment of the present invention.
  • FIG. 6 is a functional block diagram of an adaptive mapping device in an embodiment of the present invention.
  • the present invention provides a mapping method of adaptive rotation that can be rotated with the human face.
  • FIG. 1 is a flowchart of an adaptive mapping method for face rotation according to an embodiment of the present invention. As shown in FIG. 1, the method includes:
  • the present application proposes an adaptive mapping method and system for moving key points in an image, by locating the position of a key point on a key object in the image, and rotating any point on the image according to the position change after the key point is moved.
  • Matrix transformation get the converted coordinates corresponding to the point, and then according to the coordinate of the key point and the scaling factor of the texture, filter the coordinates of a certain range around the position after the key point is moved, and finally combine the coordinates of the key point and the texture of the map.
  • the scaling factor obtains the texture sampling coordinates of the display texture.
  • the present invention enables the texture to be adaptively moved in the case of moving key points on the image without changing the original display ratio, thereby improving the user experience.
  • FIG. 2 is a flowchart of step S1 in the embodiment of the present invention, including:
  • the embodiment of the present invention refers to the coordinates of the image as the world coordinate system, and the coordinate system in which the movable key object in the image is located is referred to as the object coordinate system.
  • the texture is located in the coordinate system of the image, the texture is mapped. It always follows the motion of the object, which is equivalent to the coordinate system of the object. Therefore, in order to ensure the rotation of the texture to adapt to the transformation between the two coordinate systems, the aspect ratio of the image, the distance moved by the key point, and the rotation angle of the key object are required. , Perform a rotation matrix transformation on any point on the image.
  • step S1.3 further includes:
  • the rotation center point is a key point, so-called The key point, to put it simply, is that the texture needs to be aligned at all times, for example, for mapping on the human eye, the key point can be the center point of the region of the human eye (assuming this is the coordinates of the pupil).
  • the rotation center point in the embodiment refers to a key point after the face is moved in the image, and also in the above example, the coordinates of the pupil after the face is moved.
  • the present invention is not limited to the mapping of the human eye, and the present invention is equally applicable to the mapping of other parts of the face, such as the nose, mouth or eyebrows, and will not be described herein.
  • the rotation angle of the face can be calculated from the position of the key points on the human face. For example, the angle between the bridge of the nose and the X-axis in the horizontal direction is calculated, and the calculation formula is not given in detail here. Therefore, in order to ensure that the rotated coordinates coincide with the rotation angle of the face and the shape does not change, the embodiment rotates the coordinates after the first translation according to the rotation angle of the face and the coordinates of the rotation center point. obtain.
  • step S1.3 further includes:
  • the coordinates (x, y) of the point are converted into homogeneous coordinates (x, y, 1), and the homogeneous coordinates are scaled based on the aspect ratio R of the image. Get the scaled coordinates (R*x, y, 1).
  • the homogeneous coordinate is to represent a vector that is originally n-dimensional with an n+1-dimensional vector.
  • the homogeneous coordinates of the two-dimensional point (x, y) are expressed as (hx, hy, h).
  • the homogeneous representation of a vector is not unique, and the different values of the h of the homogeneous coordinates represent the same point, such as homogeneous coordinates (8, 4, 2), (4, 2 , 1) represents two-dimensional points (4, 2).
  • the scaled coordinates are represented by matrix M 1 as:
  • the coordinates of the original rotation center point are the origin coordinates (0, 0), and the coordinates after the translation are assumed to be (D x , D y ), and the sx units are translated in the x-axis direction.
  • the first coordinates of the shifted matrix M 2 is expressed as:
  • the rotated coordinates are represented by a matrix M 3 as:
  • FIG. 3 is a schematic flowchart of step S2 in the embodiment of the present invention. As shown in FIG. 3, step S2 includes:
  • the coordinates after the transformation of the rotation matrix are defined as (dst x , dst y ), and the coordinates of the key points are (center x , center y ), when the coordinates after the rotation
  • the following conditions are satisfied: (center x -resize x *0.5) ⁇ dst x ⁇ (center x +resize x *0.5) and (center y -resize y *0.5) ⁇ dst y ⁇ (center y +resize y *0.5)
  • the coordinate converted by the rotation matrix is used as a coordinate of a certain range near the position after the key point is moved.
  • l represents the length of the longitudinal length of the key object, such as the length of the face
  • w represents the width of the texture
  • h represents the height of the texture
  • r represents the display coefficient
  • W represents the width of the image
  • H represents the height of the image.
  • the step of obtaining texture sampling coordinates according to the coordinate of a certain range, the coordinates of the key points, and the scaling factor of the map located near the position after the movement of the key point further includes:
  • the key point coordinates are (center x , center y )
  • the scaling factor of the texture on the x-axis is resize x
  • the texture is scaled on the y-axis.
  • the coefficient resize y and the texture sampling coordinates are (coord x , coord y ), then:
  • Coord x (near x -center x +resize x *0.5)/resize x ;
  • Coord y (near y -center y +resize y *0.5)/resize y .
  • FIG. 4 is a block diagram of an adaptive mapping system that moves with key points in an image according to an embodiment of the present invention, including:
  • the nearby coordinate generating device obtains a certain range of coordinates near the position after the key point is moved according to the coordinate of the key point movement and the scaling factor of the texture;
  • the texture sampling coordinate obtaining means obtains the texture sampling coordinates according to the coordinates of a certain range, the coordinates of the key points, and the scaling factor of the texture in the vicinity of the position after the key point is moved, and displays the texture on the texture sampling coordinates.
  • a rotation matrix transformation is performed on any point on the image to obtain a rotation matrix conversion corresponding to the point.
  • the coordinates after the image ensure that the points on the image move synchronously with the position of the key point, and then according to the coordinates of the key point and the scaling factor of the texture, the coordinates of a certain range near the position after the key point is moved are filtered, and finally combined.
  • the coordinate of the key point and the scaling factor of the texture obtain the texture sampling coordinates of the display texture.
  • the present invention enables the texture to be adaptively moved when the key points on the image are moved, and the original display ratio is not changed, thereby improving the user. Experience.
  • the conversion coordinate device comprises:
  • a positioning module for acquiring an aspect ratio of an image and locating a position of a key point on a key object in the image
  • the conversion module is configured to perform rotation matrix conversion on any point on the image according to the aspect ratio of the image, the distance moved by the key point, and the rotation angle of the key object, to obtain the converted coordinates corresponding to any point.
  • the coordinates of the image are called the world coordinate system, and the coordinate system of the movable key object in the image is called the object coordinate system.
  • the texture is located in the coordinate system of the image, the texture always follows the object. Movement, which is equivalent to the coordinate system of the object, so in order to ensure the rotation of the texture to adapt to the conversion between the two coordinate systems, the image should be based on the aspect ratio of the image, the distance moved by the key point, and the rotation angle of the key object. Rotate the matrix transformation at any point.
  • FIG. 5 is a structural block diagram of a conversion module in an embodiment of the present invention, including:
  • the first scaling unit is configured to scale the coordinates of the point according to the aspect ratio of the image to any point on the image to obtain the scaled coordinates.
  • the first translation unit is configured to translate the coordinates of the rotation center point from the origin coordinates to the coordinates of the key point, and translate the scaled coordinates according to the moving distance of the key points to obtain the coordinates after the first translation.
  • the rotation center point is a key point, so-called The key point, to put it simply, is that the texture needs to be aligned at all times, for example, for mapping on the human eye, the key point can be the center point of the region of the human eye (assuming this is the coordinates of the pupil).
  • the rotation center point in the embodiment refers to a key point after the face is moved in the image, and also in the above example, the coordinates of the pupil after the face is moved.
  • the present invention is not limited to the mapping of the human eye, and the present invention is equally applicable to the mapping of other parts of the face, such as the nose, mouth or eyebrows, and will not be described herein.
  • the rotation unit is configured to rotate the coordinates after the first translation according to the rotation angle of the key object and the coordinates of the rotation center point, and obtain the rotated coordinates.
  • the rotation angle of the face can be calculated from the position of the key points on the human face. For example, the angle between the bridge of the nose and the X-axis in the horizontal direction is calculated, and the calculation formula is not given in detail here. Therefore, in order to ensure that the rotated coordinates coincide with the rotation angle of the face and the shape does not change, the embodiment rotates the coordinates after the first translation according to the rotation angle of the face and the coordinates of the rotation center point. obtain.
  • a second translation unit configured to translate coordinates of the rotation center point from coordinates of the key point back to the origin coordinates, and translate the scaled coordinates according to the moving distance of the rotation center point to obtain coordinates after the second translation;
  • a second scaling unit configured to scale the coordinates after the second translation back to the original scale to obtain the converted coordinates.
  • the nearby coordinate generation device comprises:
  • a scaling factor acquisition module for obtaining a scaling factor of the texture on the x-axis based on the longitudinal length of the key object, the width of the texture, and the width of the image, and obtaining the texture on the y-axis based on the longitudinal length of the key object, the height of the texture, and the height of the image.
  • the attachment coordinate acquisition module is configured to define (dstx, dsty) the coordinate after the rotation for any one of the rotated coordinates, and the coordinates of the key point are (centerx, centery), and the coordinates after the rotation satisfy the following conditions: Centerx-resizex*0.5) ⁇ dstx ⁇ (centerx+resizex*0.5) and (centery–resizey*0.5) ⁇ dsty ⁇ (centery+resizey*0.5), the rotated coordinates are taken as the position after the key point is moved A certain range of coordinates nearby.
  • the texture sampling coordinate obtaining device is further configured to:
  • Coord x (near x -center x +resize x *0.5)/resize x ;
  • Coord y (near y -center y +resize y *0.5)/resize y .
  • the present invention discloses an adaptive mapping device, as shown in FIG. 6, comprising:
  • the processor 601 and the memory 602 complete communication with each other through the bus 603; the memory 602 stores program instructions executable by the processor 601, and the processor 602 invokes the program instructions to execute the above
  • the methods provided by the method embodiments include, for example:
  • the present invention discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions when the program instructions are When the computer is executed, the computer can perform the methods provided by the foregoing method embodiments, including, for example:
  • the present invention discloses a non-transitory computer readable storage medium storing computer instructions that cause the computer to perform the various method embodiments described above
  • the methods provided include, for example:
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Processing Or Creating Images (AREA)
  • Image Generation (AREA)

Abstract

本发明提供一种随图像中关键点移动的自适应贴图方法和***,其中方法包括:定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换旋转矩阵转换,获得对应该任意一点的旋转矩阵转换后的坐标;根据关键点移动后的坐标与贴图的缩放系数,获得位于关键点移动后的位置附近一定范围的坐标;根据所述位于关键点移动后的位置附近一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标,并在所述贴图采样坐标上显示贴图。本发明使得在人脸旋转的情况下,贴图自适应地进行旋转,并且不改变原有的显示比例,提高了用户的体验。

Description

一种随图像中关键点移动的自适应贴图方法和***
交叉引用
本申请引用于2017年3月28日提交的专利名称为“一种随图像中关键点移动的自适应贴图方法和***”的第201710193044.4号中国专利申请,其通过引用被全部并入本申请。
技术领域
本发明涉及图像处理领域,更具体地,涉及一种随图像中关键点移动的自适应贴图方法和***。
背景技术
随着摄影技术和计算机应用的发展,在视频图像上进行贴图变得越来越普遍,所谓贴图就是在图像中的特定部位加上动态贴图的效果,以人脸为例,特定部位可以指眼睛、鼻子或嘴巴,现有的贴图方法仅仅将贴图放置在画面中的特定位置,当特定位置的发生变化时,虽然贴图的位置也随之变化,但由于没有考虑特定位置的显示比例发生了变化,导致贴图的形状会发生一定程度的扭曲,使得贴图的显示效果大打折扣。
发明内容
本发明提供一种克服上述问题或者至少部分地解决上述问题的随图像中关键点移动的自适应贴图的方法和***。
根据本发明的一个方面,提供一种随图像中关键点移动的自适应贴图的方法,包括:
S1、定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,获得对应该 任意一点的旋转矩阵转换后的坐标;
S2、根据关键点移动后的坐标与贴图的缩放系数,获得位于关键点移动后的位置附近一定范围的坐标;
S3、根据所述位于关键点移动后的位置附近一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标,并在所述贴图采样坐标上显示贴图。
根据本发明的另一个方面,提供一种随图像中关键点移动的自适应贴图***,包括:
转换坐标装置,定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的旋转矩阵转换后的坐标;
附近坐标生成装置,根据关键点移动后的坐标与贴图的缩放系数,获得位于关键点移动后的位置附近一定范围的坐标;
贴图采样坐标获得装置,根据所述位于关键点移动后的位置附近一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标,并在所述贴图采样坐标上显示贴图。
根据本发明的另一个方面,提供一种自适应贴图设备,包括:
至少一个处理器、至少一个存储器和总线;其中,
所述处理器和存储器通过所述总线完成相互间的通信;
所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行如下方法:
S1、定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的旋转矩阵转换后的坐标;
S2、根据关键点移动后的坐标与贴图的缩放系数,获得位于关键点移动后的位置附近一定范围的坐标;
S3、根据所述位于关键点移动后的位置附近一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标,并在所述贴图采样坐标上显示贴图。
根据本发明的另一个方面,提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,能够执行如下方法:
S1、定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的旋转矩阵转换后的坐标;
S2、根据关键点移动后的坐标与贴图的缩放系数,获得位于关键点移动后的位置附近一定范围的坐标;
S3、根据所述位于关键点移动后的位置附近一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标,并在所述贴图采样坐标上显示贴图。
根据本发明的另一个方面,提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行如下方法:
S1、定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的旋转矩阵转换后的坐标;
S2、根据关键点移动后的坐标与贴图的缩放系数,获得位于关键点移动后的位置附近一定范围的坐标;
S3、根据所述位于关键点移动后的位置附近一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标,并在所述贴图采样坐标上显示贴图。
本申请提出一种随图像中关键点移动的自适应贴图方法和***,通过定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,得到对应该点的旋转矩阵转换后的坐标,确保图像上的点都随关键点的位置变化而同步移动,再根据关键点移动后的坐标与贴图的缩放系数,筛选位于关键点移动后的位置附近一定范围的坐标,最后结合关键点的坐标以及贴图的缩放系数,获得显示贴图的贴图采样坐标,本发明使得在图像上关键点移动的情况下,贴图自适应地进行移动,并且不改变原有的显示比例,提高了用户的体验。
附图说明
图1为本发明实施例的一种随图像中关键点移动的自适应贴图方法的流程图;
图2为本发明实施例中步骤S1的流程图;
图3为本发明实施例中步骤S2的流程示意图;
图4为本发明实施例的一种随图像中关键点移动的自适应贴图***的框图;
图5为本发明实施例中转换模块的结构框图;
图6为本发明实施例中的自适应贴图设备的功能框图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有 作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
为了克服现有技术中,贴图不能随人脸的旋转而自适应旋转的问题,本发明提供了一种能够随人脸旋转的自适应旋转的贴图方法。
图1示出了本发明实施例的一种随人脸旋转的自适应贴图方法的流程图,如图1可知,本方法包括:
S1、定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的旋转矩阵转换后的坐标;
S2、根据关键点移动后的坐标与贴图的缩放系数,获得位于关键点移动后的位置附近一定范围的坐标;
S3、根据所述位于关键点移动后的位置附近一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标,并在所述贴图采样坐标上显示贴图。
本申请提出一种随图像中关键点移动的自适应贴图方法和***,通过定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,得到对应该点的转换后的坐标,再根据关键点移动后的坐标与贴图的缩放系数,筛选位于关键点移动后的位置附近一定范围的坐标,最后结合关键点的坐标以及贴图的缩放系数,获得显示贴图的贴图采样坐标,本发明使得在图像上关键点移动的情况下,贴图自适应地进行移动,并且不改变原有的显示比例,提高了用户的体验。
图2示出了本发明实施例中步骤S1的流程图,包括:
S1.1、获取图像的宽高比,定位图像中关键物体上关键点的位置。
需要注意的是,由于常规图像的形状均为长方形,如大部分视频 的宽高比为16:9、4:3、2:1,因此,当图像上的坐标发生旋转时,必然会发生扭曲,最显著的是在有手机观看视频时,手机在横屏模式下或竖屏模型下,字幕上字的宽度不同,因此,为了保证贴图在旋转过程中的形状保持不变,本实施例考虑基于图像的宽高比对任意一点的坐标进行缩放。
S1.2、获取关键点移动的距离以及关键物体的转动角度。
S1.3、根据图像的宽高比、关键点移动的距离以及关键物体的转动角度,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的旋转矩阵转换后的坐标。
需要注意的是,本发明实施例将图像的坐标称之为世界坐标系,将图像中可移动的关键物体所在的坐标系称之为物体坐标系,贴图虽然位于图像的坐标系中,但贴图又始终跟随物体运动,相当于与物体的坐标系具有联系,因此为了保证贴图的旋转适应两个坐标系间的转换,需要根据图像的宽高比、关键点移动的距离以及关键物体的转动角度,对图像上的任意一点进行旋转矩阵转换。
出于使描述清晰易懂的考虑,以下实施例中的关键物体均以人脸为例,但不用来限制本发明的范围。
在一个实施例中,步骤S1.3进一步包括:
S1.3.1、对图像上的任意一点,根据图像的宽高比,对该点的坐标进行缩放,获得缩放后的坐标;
S1.3.2、将旋转中心点的坐标由原点坐标平移至所述关键点的坐标,并根据关键点的移动距离对缩放后的坐标进行平移,获得第一次平移后的坐标。
需要注意的是,如果一个图形D绕某点O旋转α°后,得到的新图形与原图形完全重合,称O为图形D的旋转中心点。为了保证贴图 能够以某个特定位置进行旋转,需要将旋转中心平移至特定位置,以保证旋转后的图像与原图像完全重合,在本发明的应用场景下,旋转中心点即为关键点,所谓的关键点,简单的说,就是贴图需要始终对齐的点,以在人的眼睛上进行贴图为例,关键点可以是人的眼睛的区域的中心点(假设这一点是瞳孔的坐标)。显然,本实施例中所述旋转中心点是指图像中人脸移动后的关键点,同样以上述举例来说,就是人脸移动后瞳孔的坐标。当然,本发明并不局限于对人眼进行贴图,本发明同样适用于对人脸其他部位,例如鼻子、嘴巴或者眉毛的贴图,在此不做赘述。
S1.3.3、根据关键物体的转动角度以及旋转中心点的坐标,对该第一次平移后的坐标进行旋转,获得旋转后的坐标。
需要注意的是,人脸的旋转角度可通过人脸上关键点的位置计算出来,例如,计算鼻梁与水平方向X轴的角度,在此不再详细给出计算公式。因此,为了保证旋转后的坐标与人脸的旋转角度一致且形状不发生改变,本实施例通过根据人脸的旋转角度以及旋转中心点的坐标,对该第一次平移后的坐标进行旋转来获得。
S1.3.4、将旋转中心点的坐标由所述关键点的坐标平移回原点坐标,并根据旋转中心点的移动距离对缩放后的坐标进行平移,获得第二次平移后的坐标。
S1.3.5、将所述第二次平移后的坐标缩放回原比例,获得所述转换后的坐标。
需要注意的是,在完成第二次平移后,将坐标缩放为原比例,即实现了贴图的正确显示。
在一个实施例中,步骤S1.3进一步包括:
S1.3.1、对于图像上的任意一点,将该点的坐标(x,y)转换为齐 次坐标(x,y,1),基于图像的宽高比R,对该齐次坐标进行缩放,获得缩放后的坐标(R*x,y,1)。
需要注意的,齐次坐标就是将一个原本是n维的向量用一个n+1维向量来表示。例如,二维点(x,y)的齐次坐标表示为(hx,hy,h)。由此可以看出,一个向量的齐次表示是不唯一的,齐次坐标的h取不同的值都表示的是同一个点,比如齐次坐标(8,4,2)、(4,2,1)表示的都是二维点(4,2)。引入齐次坐标的目的主要是合并矩阵运算中的乘法和加法,表示为p'=p*M的形式。即它提供了用矩阵运算把二维、三维甚至高维空间中的一个点集从一个坐标系变换到另一个坐标系的有效方法。
缩放后坐标用矩阵M 1表示为:
Figure PCTCN2017120135-appb-000001
S1.3.2、将旋转中心点的坐标由原点坐标(0,0)平移至所述关键点的坐标(D x,D y),并根据关键点的移动距离对缩放后的坐标进行平移,获得第一次平移后的坐标(R*x+D x/R,y+D y,1)。
需要注意的是,在二维坐标中,原旋转中心点的坐标为原点坐标(0,0),假设平移后的坐标为(D x,D y),在x轴方向平移了sx个单位,在y轴方向平移了sy个单位,定义[x,y]为变换前坐标,[X,Y]为变换后坐标。则:X=x+sx;Y=y+sy;用矩阵表示:
Figure PCTCN2017120135-appb-000002
应用到本实施例中,第一次平移后的坐标用矩阵M 2表示为:
Figure PCTCN2017120135-appb-000003
S1.3.3、根据关键物体的转动角度a以及旋转中心点的坐标,对该第一次平移后的坐标进行旋转,获得旋转后的坐标:((R*x+D x/R)*cosa-(y+D y)*sina,(R*x+D x/R)*sina-(y+D y)*cosa,1)。
需要注意的是,设某点与原点连线和X轴夹角为b度,以原点为圆心,逆时针转过a度,原点与该点连线长度为R。[x,y]为变换前坐标,[X,Y]为变换后坐标。则:
x=R*cos(b);y=R*sin(b);
X=R*cos(a+b)=R*cos(a)*cos(b)=R*sin(a)*sin(b)=x*cos(a)-y*sin(a);
Y=R*sin(a+b)=R*sin(a)*cos(b)+R*cos(a)*sin(b)=x*sin(a)+y*cos(a);
用矩阵表示:
Figure PCTCN2017120135-appb-000004
应用到本实施例中,旋转后的坐标用矩阵M 3表示为:
Figure PCTCN2017120135-appb-000005
S1.3.4、将旋转中心点的坐标由所述关键点的坐标平移至原点坐标,并根据旋转中心点平移距离对旋转后的坐标进行平移,获得第二次平移后的坐标:((R*x+D x/R)*cosa-(y+D y)*sina-D x/R,(R*x+D x/R)*sina-(y+D y)*cosa-D y,1)。
需要注意的是,第二次平移后的坐标用矩阵M 4表示为:
Figure PCTCN2017120135-appb-000006
S1.3.5、将所述第二次平移后的坐标缩放回原比例,获得所述转换 后的坐标:((x+D x/R 2)*cosa-(y+D y)*sina-D x/R 2,(x+D x/R 2)*sina-(y+D y)*cosa-D y)。
需要注意的是,转换后的坐标用矩阵M5表示为:
Figure PCTCN2017120135-appb-000007
图3示出了本发明实施例中步骤S2的流程示意图,如图3可知,步骤S2包括:
S2.1、基于关键物体的纵向长度、贴图宽度以及图像的宽度,获得贴图在x轴的缩放系数,基于关键物体的纵向长度、贴图高度以及图像的高度,获得贴图在y轴的缩放系数;
S2.2、对于任意一个旋转矩阵转换后的坐标,定义该旋转矩阵转换后的坐标为(dst x,dst y),关键点的坐标为(center x,center y),当该旋转后的坐标满足以下条件:(center x-resize x*0.5)<dst x≤(center x+resize x*0.5)且(center y–resize y*0.5)<dst y≤(center y+resize y*0.5),则将该旋转矩阵转换后的坐标作为位于关键点移动后的位置附近一定范围的坐标。
在一个可选实施例中,贴图在x轴的缩放系数resize x的表达式为:resize x=l*w/(W*r);贴图在y轴的缩放系数resize y的表达式为:resize y=l*h/(H*r);
其中,l表示关键物体的纵向长度的长度,例如人脸的长度,w表示贴图的宽度,h表示贴图的高度,r表示显示系数,W表示图像的宽度,H表示图像的高度。
在一个可选实施例中,根据所述位于关键点移动后的位置附近一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标的步骤,进一步包括:
定义位于关键点移动后的位置附近一定范围的坐标为(near x,near y),关键点坐标为(center x,center y),贴图在x轴的缩放系数resize x,贴图在y轴的缩放系数resize y,贴图采样坐标为(coord x,coord y),则:
coord x=(near x-center x+resize x*0.5)/resize x
coord y=(near y-center y+resize y*0.5)/resize y
图4示出了本发明实施例的一种随图像中关键点移动的自适应贴图***的框图,包括:
转换坐标装置,定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的旋转矩阵转换后的坐标;
附近坐标生成装置,根据关键点移动后的坐标与贴图的缩放系数,获得位于关键点移动后的位置附近一定范围的坐标;
贴图采样坐标获得装置,根据所述位于关键点移动后的位置附近一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标,并在所述贴图采样坐标上显示贴图。
需要注意的是,本实施例通过定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,得到对应该点的旋转矩阵转换后的坐标,确保图像上的点都随关键点的位置变化而同步移动,再根据关键点移动后的坐标与贴图的缩放系数,筛选位于关键点移动后的位置附近一定范围的坐标,最后结合关键点的坐标以及贴图的缩放系数,获得显示贴图的贴图采样坐标,本发明使得在图像上关键点移动的情况下,贴图自适应地进行移动,并且不改变原有的显示比例,提高了用户的体验。
在一个实施例中,转换坐标装置包括:
定位模块,用于获取图像的宽高比,定位图像中关键物体上关键点的位置;
需要注意的是,由于常规图像的形状均为长方形,如大部分视频的宽高比为16:9、4:3、2:1,因此,当图像上的坐标发生旋转时,必然会发生扭曲,最显著的是在有手机观看视频时,手机在横屏模式下或竖屏模型下,字幕上字的宽度不同,因此,为了保证贴图在旋转过程中的形状保持不变,本实施例考虑基于贴图的宽高比对任意一点的坐标进行缩放。
获取关键点参数模块、用于获取关键点移动的距离以及关键物体的转动角度;以及
转换模块,用于根据图像的宽高比、关键点移动的距离以及关键物体的转动角度,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的转换后的坐标。
需要注意的是,将图像的坐标称之为世界坐标系,将图像中可移动的关键物体所在的坐标系称之为物体坐标系,贴图虽然位于图像的坐标系中,但贴图又始终跟随物体运动,相当于与物体的坐标系具有联系,因此为了保证贴图的旋转适应两个坐标系间的转换,需要根据图像的宽高比、关键点移动的距离以及关键物体的转动角度,对图像上的任意一点进行旋转矩阵转换。
图5示出了本发明实施例中转换模块的结构框图,包括:
第一缩放单元,用于对图像上的任意一点,根据图像的宽高比,对该点的坐标进行缩放,获得缩放后的坐标。
第一平移单元,用于将旋转中心点的坐标由原点坐标平移至所述关键点的坐标,并根据关键点的移动距离对缩放后的坐标进行平移,获得第一次平移后的坐标。
需要注意的是,如果一个图形D绕某点O旋转α°后,得到的新图形与原图形完全重合,称D为旋转对称图形,称O为旋转对称图形D的旋转中心点。为了保证贴图能够以某个特定位置进行旋转,需要将旋转中心平移至特定位置,以保证旋转后的图像与原图像完全重合,在本发明的应用场景下,旋转中心点即为关键点,所谓的关键点,简单的说,就是贴图需要始终对齐的点,以在人的眼睛上进行贴图为例,关键点可以是人的眼睛的区域的中心点(假设这一点是瞳孔的坐标)。显然,本实施例中所述旋转中心点是指图像中人脸移动后的关键点,同样以上述举例来说,就是人脸移动后瞳孔的坐标。当然,本发明并不局限于对人眼进行贴图,本发明同样适用于对人脸其他部位,例如鼻子、嘴巴或者眉毛的贴图,在此不做赘述。
旋转单元,用于根据关键物体的转动角度以及旋转中心点的坐标,对该第一次平移后的坐标进行旋转,获得旋转后的坐标。
需要注意的是,人脸的旋转角度可通过人脸上关键点的位置计算出来,例如,计算鼻梁与水平方向X轴的角度,在此不再详细给出计算公式。因此,为了保证旋转后的坐标与人脸的旋转角度一致且形状不发生改变,本实施例通过根据人脸的旋转角度以及旋转中心点的坐标,对该第一次平移后的坐标进行旋转来获得。
第二平移单元,用于将旋转中心点的坐标由所述关键点的坐标平移回原点坐标,并根据旋转中心点的移动距离对缩放后的坐标进行平移,获得第二次平移后的坐标;以及
第二缩放单元,用于将所述第二次平移后的坐标缩放回原比例,获得所述转换后的坐标。
在一个实施例中,附近坐标生成装置包括:
缩放系数获取模块,用于基于关键物体的纵向长度、贴图宽度以及图像的宽度,获得贴图在x轴的缩放系数,基于关键物体的纵向长 度、贴图高度以及图像的高度,获得贴图在y轴的缩放系数;
附件坐标获取模块,用于对于任意一个旋转后的坐标,定义该旋转后的坐标为(dstx,dsty),关键点的坐标为(centerx,centery),当该旋转后的坐标满足以下条件:(centerx-resizex*0.5)<dstx≤(centerx+resizex*0.5)且(centery–resizey*0.5)<dsty≤(centery+resizey*0.5),则将该旋转后的坐标作为位于关键点移动后的位置附近一定范围的坐标。
在一个具体实施例中,所述贴图采样坐标获得装置进一步用于:
定义位于关键点移动后的位置附近一定范围的坐标为(near x,near y),贴图采样坐标为(coord x,coord y),则:
coord x=(near x-center x+resize x*0.5)/resize x
coord y=(near y-center y+resize y*0.5)/resize y
在一个实施例中,本发明公开一种自适应贴图设备,如图6所示,包括:
至少一个处理器601、至少一个存储器602和总线603;其中,
所述处理器601和存储器602通过所述总线603完成相互间的通信;所述存储器602存储有可被所述处理器601执行的程序指令,所述处理器602调用所述程序指令能够执行上述各方法实施例所提供的方法,例如包括:
S1、定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的旋转矩阵转换后的坐标;
S2、根据关键点移动后的坐标与贴图的缩放系数,获得位于关键点移动后的位置附近一定范围的坐标;
S3、根据所述位于关键点移动后的位置附近一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标,并在所述贴图采样坐标上显示贴图。
在一个实施例中,本发明公开一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法实施例所提供的方法,例如包括:
S1、定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的旋转矩阵转换后的坐标;
S2、根据关键点移动后的坐标与贴图的缩放系数,获得位于关键点移动后的位置附近一定范围的坐标;
S3、根据所述位于关键点移动后的位置附近一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标,并在所述贴图采样坐标上显示贴图。
在一个实施例中,本发明公开了一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行上述各方法实施例所提供的方法,例如包括:
S1、定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的转换后的坐标;
S2、根据关键点移动后的坐标与贴图的缩放系数,获得位于关键点移动后的位置附近一定范围的坐标;
S3、根据所述位于关键点移动后的位置附近一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标,并在所述贴图 采样坐标上显示贴图。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
以上所描述的一种操作数据库的设备等实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。
最后,本申请的方法仅为较佳的实施方案,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (13)

  1. 一种随图像中关键点移动的自适应贴图方法,其特征在于,包括:
    S1、定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的经旋转矩阵转换后的坐标;
    S2、根据关键点移动后的坐标与贴图的缩放系数,获得位于关键点移动后的位置附近一定范围的坐标;
    S3、根据所述位于关键点移动后的位置附近一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标,并在所述贴图采样坐标上显示贴图。
  2. 如权利要求1所述的自适应贴图方法,其特征在于,所述步骤S1进一步包括:
    S1.1、获取图像的宽高比,定位图像中关键物体上关键点的位置;
    S1.2、获取关键点移动的距离以及关键物体的转动角度;以及
    S1.3、根据图像的宽高比、关键点移动的距离以及关键物体的转动角度,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的旋转矩阵转换后的坐标。
  3. 如权利要求2所述的自适应贴图方法,其特征在于,所述步骤S1.3进一步包括:
    S1.3.1、对图像上的任意一点,根据图像的宽高比,对该点的坐标进行缩放,获得缩放后的坐标;
    S1.3.2、将旋转中心点的坐标由原点坐标平移至所述关键点的坐标,并根据关键点的移动距离对缩放后的坐标进行平移,获得第一次平移后的坐标;
    S1.3.3、根据关键物体的转动角度以及旋转中心点的坐标,对该 第一次平移后的坐标进行旋转,获得旋转后的坐标;
    S1.3.4、将旋转中心点的坐标由所述关键点的坐标平移回原点坐标,并根据旋转中心点的移动距离对缩放后的坐标进行平移,获得第二次平移后的坐标;以及
    S1.3.5、将所述第二次平移后的坐标缩放回原比例,获得所述转换后的坐标。
  4. 如权利要求2所述的自适应贴图方法,其特征在于,所述步骤S1.3进一步包括:
    S1.3.1、对于图像上的任意一点,将该点的坐标(x,y)转换为齐次坐标(x,y,1),基于图像的宽高比R,对该齐次坐标进行缩放,获得缩放后的坐标(R*x,y,1);
    S1.3.2、将旋转中心点的坐标由原点坐标(0,0)平移至所述关键点的坐标(D x,D y),并根据关键点的移动距离对缩放后的坐标进行平移,获得第一次平移后的坐标(R*x+D x/R,y+D y,1);
    S1.3.3、根据关键物体的转动角度a以及旋转中心点的坐标,对该第一次平移后的坐标进行旋转,获得旋转后的坐标:((R*x+D x/R)*cosa-(y+D y)*sina,(R*x+D x/R)*sina-(y+D y)*cosa,1);
    S1.3.4、将旋转中心点的坐标由所述关键点的坐标平移至原点坐标,并根据旋转中心点平移距离对旋转后的坐标进行平移,获得第二次平移后的坐标:((R*x+D x/R)*cosa-(y+D y)*sina-D x/R,(R*x+D x/R)*sina-(y+D y)*cosa-D y,1);以及
    S1.3.5、将所述第二次平移后的坐标缩放回原比例,获得所述转换后的坐标:((x+D x/R 2)*cosa-(y+D y)*sina-D x/R 2,(x+D x/R 2)*sina-(y+D y)*cosa-D y)。
  5. 如权利要求1所述的自适应贴图方法,其特征在于,所述步骤S2进一步包括:
    S2.1、基于关键物体的纵向长度、贴图宽度以及图像的宽度,获得贴图在x轴的缩放系数,基于关键物体的纵向长度、贴图高度以及 图像的高度,获得贴图在y轴的缩放系数;
    S2.2、对于任意一个经旋转矩阵转换后的坐标,定义该旋转矩阵转换后的坐标为(dst x,dst y),关键点的坐标为(center x,center y),当该旋转后的坐标满足以下条件:(center x-resize x*0.5)<dst x≤(center x+resize x*0.5)且(center y–resize y*0.5)<dst y≤(center y+resize y*0.5),则将该旋转矩阵转换后的坐标作为位于关键点移动后的位置附近一定范围的坐标;
    其中,所述贴图在x轴的缩放系数resize x的表达式为:resize x=l*w/(W*r);所述贴图在y轴的缩放系数resize y的表达式为:resize y=l*h/(H*r);
    其中,l表示关键物体的纵向长度,w表示贴图的宽度,h表示贴图的高度,r表示显示系数,W表示图像的宽度,H表示图像的高度。
  6. 如权利要求5所述的自适应贴图方法,其特征在于,所述根据所述位于关键点移动后的位置附近一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标的步骤,进一步包括:
    定义位于关键点移动后的位置附近一定范围的坐标为(near x,near y),贴图采样坐标为(coord x,coord y),则:
    coord x=(near x-center x+resize x*0.5)/resize x
    coord y=(near y-center y+resize y*0.5)/resize y
  7. 一种随图像中关键点移动的自适应贴图***,其特征在于,包括:
    转换坐标装置,定位图像中关键物体上关键点的位置,根据所述关键点移动后的位置变化,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的旋转矩阵转换后的坐标;
    附近坐标生成装置,根据关键点移动后的坐标与贴图的缩放系数,获得位于关键点移动后的位置附近一定范围的坐标;
    贴图采样坐标获得装置,根据所述位于关键点移动后的位置附近 一定范围的坐标、关键点的坐标以及贴图的缩放系数,获得贴图采样坐标,并在所述贴图采样坐标上显示贴图。
  8. 如权利要求7所述的自适应贴图***,其特征在于,所述转换坐标装置包括:
    定位模块,用于获取图像的宽高比,定位图像中关键物体上关键点的位置;
    获取关键点参数模块、用于获取关键点移动的距离以及关键物体的转动角度;以及
    转换模块,用于根据图像的宽高比、关键点移动的距离以及关键物体的转动角度,对图像上的任意一点进行旋转矩阵转换,获得对应该任意一点的转换后的坐标。
  9. 如权利要求8所述的自适应贴图***,其特征在于,所述附近坐标生成装置包括:
    缩放系数获取模块,用于基于关键物体的纵向长度、贴图宽度以及图像的宽度,获得贴图在x轴的缩放系数,基于关键物体的纵向长度、贴图高度以及图像的高度,获得贴图在y轴的缩放系数;
    附件坐标获取模块,用于对于任意一个旋转后的坐标,定义该旋转后的坐标为(dstx,dsty),关键点的坐标为(centerx,centery),当该旋转后的坐标满足以下条件:(centerx-resizex*0.5)<dstx≤(centerx+resizex*0.5)且(centery–resizey*0.5)<dsty≤(centery+resizey*0.5),则将该旋转后的坐标作为位于关键点移动后的位置附近一定范围的坐标。
  10. 如权利要求9所述的自适应贴图***,其特征在于,所述贴图采样坐标获得装置进一步用于:
    定义位于关键点移动后的位置附近一定范围的坐标为(near x,near y),贴图采样坐标为(coord x,coord y),则:
    coord x=(near x-center x+resize x*0.5)/resize x
    coord y=(near y-center y+resize y*0.5)/resize y
  11. 一种自适应贴图设备,其特征在于,包括:
    至少一个处理器、至少一个存储器和总线;其中,
    所述处理器和存储器通过所述总线完成相互间的通信;所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行如权利要求1至6任一所述的方法。
  12. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行如权利要求1至6任一所述的方法。
  13. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行如权利要求1至6任一所述的方法。
PCT/CN2017/120135 2017-03-28 2017-12-29 一种随图像中关键点移动的自适应贴图方法和*** WO2018176958A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710193044.4A CN107122774B (zh) 2017-03-28 2017-03-28 一种随图像中关键点移动的自适应贴图方法和***
CN201710193044.4 2017-03-28

Publications (1)

Publication Number Publication Date
WO2018176958A1 true WO2018176958A1 (zh) 2018-10-04

Family

ID=59717365

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/120135 WO2018176958A1 (zh) 2017-03-28 2017-12-29 一种随图像中关键点移动的自适应贴图方法和***

Country Status (2)

Country Link
CN (1) CN107122774B (zh)
WO (1) WO2018176958A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614059A (zh) * 2018-12-19 2019-04-12 森大(深圳)技术有限公司 Gerber文件处理方法、装置及计算机可读存储介质
CN111126344A (zh) * 2019-12-31 2020-05-08 杭州趣维科技有限公司 一种生成人脸额头关键点的方法与***
CN111652918A (zh) * 2020-06-04 2020-09-11 深圳地平线机器人科技有限公司 确定3d脸部模型的方法、装置、介质以及电子设备
CN113487717A (zh) * 2021-07-13 2021-10-08 网易(杭州)网络有限公司 图片处理方法及装置、计算机可读存储介质、电子设备
CN114119684A (zh) * 2020-08-31 2022-03-01 ***通信集团浙江有限公司 基于四面体结构的标记点配准方法
CN114429666A (zh) * 2022-04-06 2022-05-03 深圳市大头兄弟科技有限公司 视频的人脸替换方法、装置、设备及存储介质

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107122774B (zh) * 2017-03-28 2019-12-03 武汉斗鱼网络科技有限公司 一种随图像中关键点移动的自适应贴图方法和***
CN109509140A (zh) * 2017-09-15 2019-03-22 阿里巴巴集团控股有限公司 显示方法及装置
CN109587390B (zh) * 2017-09-29 2021-05-07 腾讯科技(深圳)有限公司 画面渲染方法、画面渲染装置及存储介质
CN107679497B (zh) * 2017-10-11 2023-06-27 山东新睿信息科技有限公司 视频面部贴图特效处理方法及生成***
CN107808372B (zh) * 2017-11-02 2022-01-28 北京奇虎科技有限公司 图像穿越处理方法、装置、计算设备及计算机存储介质
CN108205822B (zh) * 2017-12-13 2020-09-08 中兴通讯股份有限公司 贴图方法及装置
CN108305212A (zh) * 2018-01-09 2018-07-20 武汉斗鱼网络科技有限公司 图像混合方法、存储介质、电子设备及***
CN110020577B (zh) * 2018-01-10 2021-03-16 武汉斗鱼网络科技有限公司 人脸关键点扩展计算方法、存储介质、电子设备及***
CN108921000B (zh) * 2018-04-16 2024-02-06 深圳市深网视界科技有限公司 头部角度标注、预测模型训练、预测方法、设备和介质
CN108846878A (zh) * 2018-06-07 2018-11-20 奇酷互联网络科技(深圳)有限公司 人脸贴图生成方法、装置、可读存储介质及移动终端
CN110378991A (zh) * 2018-11-07 2019-10-25 深圳格调网络运营有限公司 虚拟环境下模型与贴图的匹配方法
CN109819316B (zh) * 2018-12-28 2021-06-01 北京字节跳动网络技术有限公司 处理视频中人脸贴纸的方法、装置、存储介质及电子设备
CN111383170B (zh) * 2018-12-28 2023-08-15 广州市百果园网络科技有限公司 图片关键点的调整方法、装置及终端
CN112489157B (zh) * 2020-12-18 2024-03-19 广州视源电子科技股份有限公司 相框绘制方法、设备及存储介质
CN113687823B (zh) * 2021-07-30 2023-08-01 稿定(厦门)科技有限公司 基于html的四边形区块非线性变换方法及其***

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130083976A1 (en) * 2011-10-03 2013-04-04 Qualcomm Incorporated Image-based head position tracking method and system
CN103090875A (zh) * 2012-11-26 2013-05-08 华南理工大学 一种基于双摄像头的实时实景匹配车载导航方法及装置
CN104881526A (zh) * 2015-05-13 2015-09-02 深圳彼爱其视觉科技有限公司 一种基于3d的物品穿戴方法及眼镜试戴方法
CN104881114A (zh) * 2015-05-13 2015-09-02 深圳彼爱其视觉科技有限公司 一种基于3d眼镜试戴的角度转动实时匹配方法
CN104898832A (zh) * 2015-05-13 2015-09-09 深圳彼爱其视觉科技有限公司 一种基于智能终端的3d实时眼镜试戴方法
CN104899917A (zh) * 2015-05-13 2015-09-09 深圳彼爱其视觉科技有限公司 一种基于3d的物品虚拟穿戴的图片保存和分享方法
CN107122774A (zh) * 2017-03-28 2017-09-01 武汉斗鱼网络科技有限公司 一种随图像中关键点移动的自适应贴图方法和***

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101231658A (zh) * 2008-02-02 2008-07-30 谢亦玲 饰品计算机模拟配戴装置
CN105719351B (zh) * 2014-12-04 2018-09-28 高德软件有限公司 一种显示电子地图的方法和装置
CN105069745A (zh) * 2015-08-14 2015-11-18 济南中景电子科技有限公司 基于普通图像传感器及增强现实技术的带表情变脸***及方法
CN105354876B (zh) * 2015-10-20 2018-10-09 何家颖 一种基于移动终端的实时立体试衣方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130083976A1 (en) * 2011-10-03 2013-04-04 Qualcomm Incorporated Image-based head position tracking method and system
CN103090875A (zh) * 2012-11-26 2013-05-08 华南理工大学 一种基于双摄像头的实时实景匹配车载导航方法及装置
CN104881526A (zh) * 2015-05-13 2015-09-02 深圳彼爱其视觉科技有限公司 一种基于3d的物品穿戴方法及眼镜试戴方法
CN104881114A (zh) * 2015-05-13 2015-09-02 深圳彼爱其视觉科技有限公司 一种基于3d眼镜试戴的角度转动实时匹配方法
CN104898832A (zh) * 2015-05-13 2015-09-09 深圳彼爱其视觉科技有限公司 一种基于智能终端的3d实时眼镜试戴方法
CN104899917A (zh) * 2015-05-13 2015-09-09 深圳彼爱其视觉科技有限公司 一种基于3d的物品虚拟穿戴的图片保存和分享方法
CN107122774A (zh) * 2017-03-28 2017-09-01 武汉斗鱼网络科技有限公司 一种随图像中关键点移动的自适应贴图方法和***

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614059A (zh) * 2018-12-19 2019-04-12 森大(深圳)技术有限公司 Gerber文件处理方法、装置及计算机可读存储介质
CN111126344A (zh) * 2019-12-31 2020-05-08 杭州趣维科技有限公司 一种生成人脸额头关键点的方法与***
CN111126344B (zh) * 2019-12-31 2023-08-01 杭州趣维科技有限公司 一种生成人脸额头关键点的方法与***
CN111652918A (zh) * 2020-06-04 2020-09-11 深圳地平线机器人科技有限公司 确定3d脸部模型的方法、装置、介质以及电子设备
CN111652918B (zh) * 2020-06-04 2023-08-18 深圳地平线机器人科技有限公司 确定3d脸部模型的方法、装置、介质以及电子设备
CN114119684A (zh) * 2020-08-31 2022-03-01 ***通信集团浙江有限公司 基于四面体结构的标记点配准方法
CN114119684B (zh) * 2020-08-31 2023-02-28 ***通信集团浙江有限公司 基于四面体结构的标记点配准方法
CN113487717A (zh) * 2021-07-13 2021-10-08 网易(杭州)网络有限公司 图片处理方法及装置、计算机可读存储介质、电子设备
CN113487717B (zh) * 2021-07-13 2024-02-23 网易(杭州)网络有限公司 图片处理方法及装置、计算机可读存储介质、电子设备
CN114429666A (zh) * 2022-04-06 2022-05-03 深圳市大头兄弟科技有限公司 视频的人脸替换方法、装置、设备及存储介质
CN114429666B (zh) * 2022-04-06 2022-07-01 深圳市大头兄弟科技有限公司 视频的人脸替换方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN107122774A (zh) 2017-09-01
CN107122774B (zh) 2019-12-03

Similar Documents

Publication Publication Date Title
WO2018176958A1 (zh) 一种随图像中关键点移动的自适应贴图方法和***
US11645801B2 (en) Method for synthesizing figure of virtual object, electronic device, and storage medium
WO2022002032A1 (zh) 图像驱动模型训练、图像生成
US20180204052A1 (en) A method and apparatus for human face image processing
CN110517214B (zh) 用于生成图像的方法和装置
CN108769517A (zh) 一种基于增强现实进行远程辅助的方法与设备
WO2023019974A1 (zh) 文档图像的矫正方法、装置、电子设备和存储介质
US20220358675A1 (en) Method for training model, method for processing video, device and storage medium
CN109754464B (zh) 用于生成信息的方法和装置
WO2023035531A1 (zh) 文本图像超分辨率重建方法及其相关设备
CN115147265B (zh) 虚拟形象生成方法、装置、电子设备和存储介质
CN115668300A (zh) 利用纹理解析的对象重建
WO2018113339A1 (zh) 一种投影图构建方法及装置
JP2021523455A (ja) 顔に対する射影歪み補正
WO2022016996A1 (zh) 图像处理方法、装置、电子设备及计算机可读存储介质
US9196096B2 (en) 3D-consistent 2D manipulation of images
US11170550B2 (en) Facial animation retargeting using an anatomical local model
CN112528707A (zh) 图像处理方法、装置、设备及存储介质
US10768692B2 (en) Systems and methods for capturing and rendering hand skeletons over documents images for telepresence
US20240046554A1 (en) Presenting virtual representation of real space using spatial transformation
CN112734628B (zh) 一种经三维转换后的跟踪点的投影位置计算方法及***
CN108171802B (zh) 一种云端与终端结合实现的全景增强现实实现方法
US11663752B1 (en) Augmented reality processing device and method
CN112465692A (zh) 图像处理方法、装置、设备及存储介质
US20240096000A1 (en) Method, device, and computer program product for rendering image

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17902963

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17902963

Country of ref document: EP

Kind code of ref document: A1