





技术领域technical field
本发明涉及计算机图形学、统计学和进化计算领域,特别是涉及一种三维卡通人脸生成方法及装置。The invention relates to the fields of computer graphics, statistics and evolutionary calculation, in particular to a method and device for generating a three-dimensional cartoon human face.
背景技术Background technique
在信息化技术迅猛发展的今天,数字娱乐已融入到人们生活的各个角落。近年来,卡通产品吸引了社会各年龄阶层人群的青睐,随着三维虚拟环境技术的发展和普遍应用,三维卡通形象在动漫影视、网络游戏、虚拟社区、辅助教学等领域呈现出越来越广泛的应用。如在Active World、Second Life等虚拟环境中人们想用自身的虚拟卡通形象来代替真实人脸,从而能够很好地营造出轻松愉快的氛围。目前的三维卡通形象主要由美工人员使用Maya、3DS Max等三维建模软件手工制作完成,需要较多的时间和精力,制作成本相应较高,因而通过计算机来生成三维卡通具有重要意义。现有技术中,由计算机生成三维卡通人脸主要包括交互式生成和自动生成两种方法。Today, with the rapid development of information technology, digital entertainment has been integrated into every corner of people's lives. In recent years, cartoon products have attracted the favor of people of all ages in the society. With the development and widespread application of 3D virtual environment technology, 3D cartoon images have become more and more popular in the fields of animation, film and television, online games, virtual communities, and auxiliary teaching. Applications. For example, in virtual environments such as Active World and Second Life, people want to replace real faces with their own virtual cartoon images, so as to create a relaxed and happy atmosphere. The current 3D cartoon images are mainly hand-made by artists using 3D modeling software such as Maya and 3DS Max, which requires more time and energy, and the production cost is relatively high. Therefore, it is of great significance to generate 3D cartoons by computers. In the prior art, computer-generated three-dimensional cartoon faces mainly include two methods: interactive generation and automatic generation.
交互式生成三维卡通人脸,主要是通过人机交互的方式对用户观察出的人脸特征进行夸张来获得生成人脸的三维卡通形象,这种方法由制作者感知照片人脸的特征,然后用各种形状的几何体模型来模拟这些特征,将这些几何体组合起来做出一个抽象的卡通人脸,然后用NURBS曲面进行整体拟和,产生一个完整的人脸。该方法虽然效果较好,但需要一定的艺术相关知识及大量的交互动作。Interactive generation of 3D cartoon faces is mainly to exaggerate the facial features observed by the user through human-computer interaction to obtain a 3D cartoon image of the generated face. Use geometric models of various shapes to simulate these features, combine these geometries to make an abstract cartoon face, and then use NURBS surface for overall fitting to produce a complete human face. Although this method works well, it requires certain art-related knowledge and a lot of interactive actions.
自动生成三维卡通人脸,主要是由计算机提取人脸特征并将其进行夸张来自动生成人脸的三维卡通形象。现有技术中的一种方法首先获得三维真实人脸的平均特征,然后通过将人脸的特征与平均人脸特征进行比较,从而发现个性化的特征,并对该特征进行夸张变形从而获得一定的夸张艺术效果。此方法只能抓住人脸简单的整体特征并进行扩大、缩小等简要的线性变化,不能很好地刻画出人脸特征并将多个特征进行夸张。另一种方法是预定义了一个平均三维真实人脸,首先以两张正交人脸照片重构三维真实人脸,然后比较其和平均人脸的差异,并对该差异进行线性放缩,以此获得夸张效果。该方法只能夸张重建的三维真实人脸的简单特征,不能提取出人脸的多个特征并将这多个特征在整体上进行协调变化。The automatic generation of 3D cartoon faces is mainly to extract the facial features by computer and exaggerate them to automatically generate 3D cartoon images of human faces. A method in the prior art firstly obtains the average features of a three-dimensional real face, and then compares the features of the face with the average features to find personalized features, and exaggerates the features to obtain a certain exaggerated artistic effect. This method can only capture the simple overall features of the face and make simple linear changes such as expansion and shrinkage, but cannot describe the features of the face well and exaggerate multiple features. Another method is to predefine an average 3D real face, first reconstruct the 3D real face with two orthogonal face photos, then compare the difference between it and the average face, and perform linear scaling on the difference, This gives an exaggerated effect. This method can only exaggerate the simple features of the reconstructed 3D real face, but cannot extract multiple features of the face and coordinate and change these multiple features as a whole.
发明内容Contents of the invention
本发明的目的在于提供一种三维卡通人脸生成方法及装置。其能够使得生成的三维卡通人脸既可以得到与定义的三维卡通人脸数据库类似的变形效果,又具有与真实人脸的相似性。The object of the present invention is to provide a method and device for generating a three-dimensional cartoon human face. It can make the generated three-dimensional cartoon human face not only obtain the deformation effect similar to the defined three-dimensional cartoon human face database, but also have the similarity to the real human face.
为实现本发明的目的而提供的一种三维卡通人脸生成方法,包括下列步骤:A kind of three-dimensional cartoon human face generating method provided for realizing the purpose of the present invention comprises the following steps:
步骤100.利用三维卡通人脸数据库和二维真实人脸照片生成与真实人脸相似的三维卡通人脸部件;
步骤200.对所述与真实人脸相似的三维卡通人脸部件进行缩放,并对平移缩放后的与真实人脸相似的三维卡通人脸部件进行三维卡通人脸重建,最后将重建的三维卡通人脸进行插值运算生成最终的三维卡通人脸。Step 200. Scale the 3D cartoon human face parts similar to real human faces, and perform 3D cartoon human face reconstruction on the 3D cartoon human face parts similar to real human faces after translation and zooming, and finally reconstruct the reconstructed The 3D cartoon face is interpolated to generate the final 3D cartoon face.
所述步骤100,包括下列步骤:The
步骤110.建立三维卡通人脸数据库,根据所述三维卡通人脸数据库建立三维卡通人脸部件PCA子空间;Step 110. establish three-dimensional cartoon human face database, set up three-dimensional cartoon human face part PCA subspace according to described three-dimensional cartoon human face database;
步骤120.利用二维真实人脸照片和所述三维卡通人脸部件PCA子空间,生成与真实人脸相似的三维卡通人脸部件。
所述步骤110,包括下列步骤:The step 110 includes the following steps:
步骤111.建立三维卡通人脸数据库并定义三维卡通人脸部件;
步骤112.由所述定义将三维卡通人脸进行拆分,提取三维卡通人脸部件几何信息并进行归一化处理,建立三维卡通人脸部件数据库;
步骤113.将所述三维卡通人脸部件的特征提取出来并分析其主成分,建立三维卡通人脸部件PCA子空间。
所述步骤120,包括下列步骤:The
步骤121.重建与二维真实人脸照片对应的三维真实人脸并按照所述三维卡通人脸部件定义拆分出三维真实人脸部件;
步骤122.将所述三维真实人脸部件在所述三维卡通人脸部件PCA子空间进行投影并进行遗传采样,以获得投影向量;
步骤123.将所述投影向量进行三维还原重建,得到与真实人脸相似的三维卡通人脸部件。
所述步骤200,包括下列步骤:The step 200 includes the following steps:
步骤210.计算所述三维真实人脸部件与所述与真实人脸相似的三维卡通人脸部件在位置和形状上的差异,并根据计算结果对所述与真实人脸相似的三维卡通人脸部件进行平移和缩放;
步骤220.将经过平移和缩放的所述与真实人脸相似的三维卡通人脸部件投影到三维卡通人脸部件PCA子空间得到投影向量,并用投影向量进行三维卡通人脸重建;
步骤230.将重建后的三维卡通人脸进行Kriging插值生成最终的三维卡通人脸。
为实现本发明的目的还提供一种三维卡通人脸生成装置,所述装置,包括:Also provide a kind of three-dimensional cartoon human face generation device for realizing the purpose of the present invention, described device comprises:
三维卡通人脸部件生成模块,用于利用三维卡通人脸数据库和二维真实人脸照片生成与真实人脸相似的三维卡通人脸部件;A three-dimensional cartoon human face component generation module, for utilizing a three-dimensional cartoon human face database and a two-dimensional real human face photo to generate a three-dimensional cartoon human face component similar to a real human face;
三维卡通人脸生成模块,用于对所述三维卡通人脸部件生成模块生成的与真实人脸相似的三维卡通人脸部件进行处理,生成最终的三维卡通人脸。The three-dimensional cartoon human face generation module is used to process the three-dimensional cartoon human face parts similar to the real human face generated by the three-dimensional cartoon human face part generation module to generate the final three-dimensional cartoon human face.
所述三维卡通人脸部件生成模块,包括:The three-dimensional cartoon human face component generation module includes:
子空间生成模块,用于根据三维卡通人脸数据库建立三维卡通人脸部件PCA子空间;Subspace generating module, used for setting up PCA subspace of three-dimensional cartoon human face parts according to three-dimensional cartoon human face database;
比照模块,用于利用二维真实人脸照片和所述子空间生成模块生成的三维卡通人脸部件PCA子空间,生成与真实人脸相似的三维卡通人脸部件。The comparison module is used to generate a three-dimensional cartoon face part similar to a real face by utilizing the two-dimensional real face photo and the three-dimensional cartoon face part PCA subspace generated by the subspace generation module.
所述子空间生成模块,包括:The subspace generation module includes:
数据库生成模块,用于建立三维卡通人脸数据库并定义三维卡通人脸部件;A database generating module, used to establish a three-dimensional cartoon human face database and define three-dimensional cartoon human face parts;
人脸部件处理模块,用于根据所述数据库生成模块定义的三维卡通人脸部件对三维卡通人脸进行处理,建立三维卡通人脸部件数据库;A face parts processing module, configured to process a three-dimensional cartoon face according to the three-dimensional cartoon face parts defined by the database generation module, to establish a three-dimensional cartoon face parts database;
分析模块,用于将所述人脸部件处理模块中的三维卡通人脸部件的特征提取出来并分析其主成分,建立三维卡通人脸部件PCA子空间。The analysis module is used to extract the features of the 3D cartoon face parts in the face part processing module and analyze its principal components to establish the PCA subspace of the 3D cartoon face parts.
所述三维卡通人脸生成模块,包括:The three-dimensional cartoon human face generating module includes:
缩放处理模块,用于对所述与真实人脸相似的三维卡通人脸部件进行平移和缩放;A scaling processing module, configured to translate and scale the three-dimensional cartoon face parts similar to real faces;
三维卡通人脸重建模块,用于将经过所述缩放处理模块平移和缩放的所述与真实人脸相似的三维卡通人脸部件进行投影,重建三维卡通人脸;A three-dimensional cartoon human face reconstruction module, used to project the three-dimensional cartoon human face parts similar to real human faces translated and scaled by the scaling processing module, to reconstruct a three-dimensional cartoon human face;
插值模块,用于将所述三维卡通人脸重建模块重建后的三维卡通人脸进行Kriging插值生成最终的三维卡通人脸。An interpolation module, configured to perform Kriging interpolation on the three-dimensional cartoon face reconstructed by the three-dimensional cartoon face reconstruction module to generate a final three-dimensional cartoon face.
本发明的有益效果在于:The beneficial effects of the present invention are:
1.本发明的一种三维卡通人脸生成方法及装置,采用主成分分析的方法来建立三维卡通人脸部件子空间,这样就可以抓住人脸的局部特征;1. A kind of three-dimensional cartoon human face generation method and device of the present invention adopt the method of principal component analysis to set up three-dimensional cartoon human face part subspace, so just can catch the local feature of human face;
2.本发明的一种三维卡通人脸生成方法及装置,在人脸部件子空间中进行遗传采样来自动实现三维卡通人脸的生成,这样避免了大量的人机交互操作,同时也可以对人脸进行更为精确地形变,相比已有技术仅对真实人脸进行简单地整体拉伸。2. A kind of three-dimensional cartoon human face generation method and device of the present invention carry out genetic sampling in the subspace of human face parts to realize the generation of three-dimensional cartoon human face automatically, thus avoiding a large amount of human-computer interaction operations, and can also The face is deformed more accurately, compared with the existing technology, which only simply stretches the real face as a whole.
附图说明Description of drawings
图1是本发明一种三维卡通人脸生成方法的流程图;Fig. 1 is the flowchart of a kind of three-dimensional cartoon human face generation method of the present invention;
图2是本发明中生成与真实人脸相似的三维卡通人脸部件的流程图;Fig. 2 is the flow chart of generating the three-dimensional cartoon human face parts similar to the real human face among the present invention;
图3是本发明中三维卡通人脸数据库中人脸部件的定义图;Fig. 3 is the definition diagram of face parts in the three-dimensional cartoon face database in the present invention;
图4是本发明中拆分出的三维卡通人脸部件图;Fig. 4 is the three-dimensional cartoon human face part figure that splits out among the present invention;
图5是本发明中利用主成分分析对二维数据进行降维、获得主成分的示意图;Fig. 5 is a schematic diagram of using principal component analysis to reduce the dimensionality of two-dimensional data and obtain principal components in the present invention;
图6是本发明中三维卡通人脸部件融合方法的流程图;Fig. 6 is the flow chart of three-dimensional cartoon face part fusion method among the present invention;
图7是本发明一种三维卡通人脸生成装置的结构示意图。Fig. 7 is a schematic structural diagram of a three-dimensional cartoon face generating device of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明的一种三维卡通人脸生成方法及装置进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the purpose, technical solution and advantages of the present invention clearer, a method and device for generating a three-dimensional cartoon human face of the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.
本发明提供的一种三维卡通人脸生成方法及装置,是通过利用三维卡通人脸和二维真实人脸生成三维卡通人脸部件,再将该三维卡通人脸部件进行融合得到三维卡通人脸。生成的三维卡通人脸既有夸张地变形效果,又具有与真实人脸的相似性。A method and device for generating a three-dimensional cartoon human face provided by the present invention is to generate a three-dimensional cartoon human face part by using a three-dimensional cartoon human face and a two-dimensional real human face, and then fuse the three-dimensional cartoon human face parts to obtain a three-dimensional cartoon human face. The generated 3D cartoon face not only has the exaggerated deformation effect, but also has the similarity to the real face.
下面结合上述目标详细介绍本发明的一种三维卡通人脸生成方法。图1是本发明一种三维卡通人脸生成方法的流程图,如图1所示,所述方法,包括下列步骤:A method for generating a three-dimensional cartoon human face according to the present invention will be described in detail below in conjunction with the above objectives. Fig. 1 is the flowchart of a kind of three-dimensional cartoon human face generation method of the present invention, as shown in Fig. 1, described method comprises the following steps:
步骤100.利用三维卡通人脸数据库和二维真实人脸照片生成与真实人脸相似的三维卡通人脸部件;
步骤200.对所述与真实人脸相似的三维卡通人脸部件进行缩放,并对平移缩放后的与真实人脸相似的三维卡通人脸部件进行三维卡通人脸重建,最后将重建的三维卡通人脸进行插值运算生成最终的三维卡通人脸。Step 200. Scale the 3D cartoon human face parts similar to real human faces, and perform 3D cartoon human face reconstruction on the 3D cartoon human face parts similar to real human faces after translation and zooming, and finally reconstruct the reconstructed The 3D cartoon face is interpolated to generate the final 3D cartoon face.
其中,步骤100中,在三维卡通人脸部件生成方面,本发明采用主成分分析和遗传算法相结合的方法。可在低维子空间采样出优化的投影向量,从而可由此投影向量重建出高维空间中的优化向量即生成出优化的三维卡通部件,因此可协调地对人脸的多个特征进行夸张形变。Wherein, in
图2是本发明中生成与真实人脸相似的三维卡通人脸部件的流程图,如图2所示,所述步骤100,包括下列步骤:Fig. 2 is the flow chart of generating the three-dimensional cartoon human face parts similar to the real human face among the present invention, as shown in Fig. 2, described
步骤110.建立三维卡通人脸数据库,根据所述三维卡通人脸数据库建立三维卡通人脸部件PCA子空间;Step 110. establish three-dimensional cartoon human face database, set up three-dimensional cartoon human face part PCA subspace according to described three-dimensional cartoon human face database;
步骤111.建立三维卡通人脸数据库并定义三维卡通人脸部件;
所述定义三维卡通人脸部件的方法是本领域的公知常识。它是指空间中的三维物体可由构成此物体的顶点,及连接顶点的边,面的拓扑结构来定义。把表示整个三维物体的顶点中的一部分抽提出来,就可以构成三维物体的一个部件。对于三维卡通人脸和三维真实人脸来说,这些部件就是指下巴、左耳朵、右耳朵、左眼睛、右眼睛、嘴巴和鼻子。The method for defining three-dimensional cartoon human face components is common knowledge in the art. It means that a three-dimensional object in space can be defined by the topological structure of the vertices that make up the object, the edges that connect the vertices, and the surfaces. A part of the three-dimensional object can be formed by extracting a part of the vertices representing the entire three-dimensional object. For the three-dimensional cartoon human face and the three-dimensional real human face, these components refer to the chin, the left ear, the right ear, the left eye, the right eye, the mouth and the nose.
较佳地,作为一种可实施方法,本发明中的三维卡通人脸数据库包括100幅三维卡通人脸,那么就有100幅三维卡通下巴、左耳朵、右耳朵、左眼睛、右眼睛、嘴巴和鼻子。Preferably, as an implementable method, the three-dimensional cartoon human face database in the present invention includes 100 three-dimensional cartoon human faces, so there are 100 three-dimensional cartoon chins, left ears, right ears, left eyes, right eyes, mouths and nose.
图3是本发明中三维卡通人脸数据库中人脸部件的定义图。具体到所述三维卡通人脸数据库中的其中一个三维卡通人脸,如图3所示,其三维卡通人脸部件的定义如表1所示。Fig. 3 is a definition diagram of human face parts in the three-dimensional cartoon human face database in the present invention. Specific to one of the three-dimensional cartoon faces in the three-dimensional cartoon face database, as shown in FIG. 3 , the definition of its three-dimensional cartoon face components is shown in Table 1.
表1Table 1
如表1所示,每个三维卡通人脸的顶点数为1337,每个三维卡通人脸部件下巴的顶点数、边数、面数、边界顶点数分别为45、76、32、24,每个三维卡通人脸部件左耳朵的顶点数、边数、面数、边界顶点数分别为94、178、83、21,每个三维卡通人脸部件右耳朵的顶点数、边数、面数、边界顶点数分别为94、178、83、21,每个三维卡通人脸部件左眼睛的顶点数、边数、面数、边界顶点数分别为124、230、106、20,每个三维卡通人脸部件右眼睛的顶点数、边数、面数、边界顶点数分别为124、230、106、20,每个三维卡通人脸部件嘴巴的顶点数、边数、面数、边界顶点数分别为224、418、194、28,每个三维卡通人脸部件鼻子的顶点数、边数、面数、边界顶点数分别为171、320、148、30。As shown in Table 1, the number of vertices of each 3D cartoon face is 1337, and the number of vertices, edges, faces, and border vertices of each 3D cartoon face part chin are 45, 76, 32, and 24, respectively. The number of vertices, the number of edges, the number of faces, and the number of vertices of the border of each three-dimensional cartoon human face part are 94, 178, 83, and 21 respectively, and the number of vertices, the number of edges, and the number of vertices of each three-dimensional cartoon human face part's right ear The number of faces and boundary vertices are respectively 94, 178, 83 and 21, and the number of vertices, edges, faces and border vertices of the left eye of each three-dimensional cartoon face part are respectively 124, 230, 106 and 20. The number of vertices, edges, faces, and border vertices of the right eye of a three-dimensional cartoon face part are 124, 230, 106, and 20 respectively, and the number of vertices, edges, and faces of each three-dimensional cartoon face part's mouth The number of vertices, the number of border vertices are 224, 418, 194, 28 respectively, the number of vertices, the number of edges, the number of faces, and the number of vertices of the border of each three-dimensional cartoon human face part nose are respectively 171, 320, 148, 30.
步骤112.由所述定义将三维卡通人脸进行拆分,提取三维卡通人脸部件几何信息并进行归一化处理,建立三维卡通人脸部件数据库;
图4是本发明中拆分出的三维卡通人脸部件图。如图4所示,根据对三维卡通人脸部件的定义从三维卡通人脸中拆分出三维卡通人脸中下巴、左(右)耳朵、左(右)眼睛、嘴巴和鼻子5种部件。Fig. 4 is a three-dimensional cartoon human face part diagram split in the present invention. As shown in Figure 4, according to the definition of the three-dimensional cartoon human face parts, five parts of the chin, left (right) ear, left (right) eye, mouth and nose are split from the three-dimensional cartoon human face. .
将三维卡通人脸及三维卡通人脸部件的顶点坐标、边关联的顶点序号、面关联的顶点序号等几何信息提取出来,本发明用这些几何信息来表示三维卡通人脸及其部件,并按照顶点对所有三维卡通人脸和三维卡通人脸部件进行归一化操作。Geometric information such as the vertex coordinates of the three-dimensional cartoon human face and the three-dimensional cartoon human face parts, the vertex serial number associated with the edge, and the vertex serial number associated with the face are extracted. The present invention uses these geometric information to represent the three-dimensional cartoon human face and its parts, and Normalize all 3D cartoon faces and 3D cartoon face parts according to vertices.
归一化的目的是将所有的人脸及人脸部件的位置和尺度统一起来,是对数据进行主成分分析(Principal Component Analysis,PCA)的前期预处理步骤。由于原始数据本身在位置和尺度的不规整将导致主成分分析的效果不明显,而进行缩放平移的归一化操作能将原始数据的位置和尺度统一起来,消除原始数据本身外在的差异,从而使得主成分分析更加奏效。归一化的操作就是首先求出三维卡通人脸及人脸部件的最小外接六面体,然后将最小外接六面体的对角线的中点和长度作为标准来对所有的三维卡通人脸及人脸部件都进行平移和缩放,使得位置与尺度统一。The purpose of normalization is to unify the positions and scales of all faces and face parts, which is the pre-processing step of Principal Component Analysis (PCA) on the data. Due to the irregular position and scale of the original data itself, the effect of principal component analysis will not be obvious, and the normalization operation of scaling and translation can unify the position and scale of the original data and eliminate the external differences of the original data itself. This makes the principal component analysis more effective. The operation of normalization is to first find the minimum circumscribed hexahedron of the three-dimensional cartoon face and face parts, and then use the midpoint and length of the diagonal of the minimum circumscribed hexahedron as a standard to compare all three-dimensional cartoon faces and human faces. Parts are translated and scaled to make the position and scale uniform.
步骤113.将所述三维卡通人脸部件的特征提取出来并分析其主成分,建立三维卡通人脸部件PCA子空间;
对三维卡通人脸部件提取主成分;三维卡通下巴、耳朵、眼睛、嘴巴等部件对齐以后是在统一的位置和尺度下的人脸数据,然后再对这些数据进行主成分分析,获得三维卡通人脸部件PCA子空间和主成分。主成分分析是复杂数据降维所广泛采用的方法,在此不再一一赘述。Extract the principal components of the 3D cartoon face parts; after the alignment of the 3D cartoon chin, ears, eyes, mouth and other parts, the face data is in a unified position and scale, and then perform principal component analysis on these data to obtain a 3D cartoon PCA Subspace and Principal Components of Face Parts. Principal component analysis is a widely used method for dimensionality reduction of complex data, so I won’t go into details here.
在建立三维卡通人脸部件PCA子空间以后,既可以起到降维的作用,又可以基于这些主成分来观察样本(本发明中为三维卡通人脸及其部件)之间的空间关系。After the PCA subspace of the three-dimensional cartoon face parts is established, it can not only reduce the dimension, but also observe the spatial relationship between the samples (three-dimensional cartoon face and its parts in the present invention) based on these principal components.
作为一种可实施方式,图5是本发明中利用主成分分析对二维数据进行降维、获得主成分的示意图。其中图5中v1是经过主成分分析后获得的主成分,也即建立了以该直线为坐标的一维子空间,平面中任何一点的都可以在此直线上投影来获得投影坐标,从而用一维坐标即可表示其空间位置。相应地,经过PCA反向计算后可将平面中的任意一点从一维数据恢复其二维数据。与此思想相同,在建立卡通人脸和人脸部件子空间以后,将所有的卡通人脸和人脸部件数据投影到主成分之上,既可以起到降维的作用,又可以基于这些主成分来观察其空间关系。As a possible implementation manner, FIG. 5 is a schematic diagram of using principal component analysis to reduce the dimensionality of two-dimensional data and obtain principal components in the present invention. Among them, v1 in Fig. 5 is the principal component obtained after principal component analysis, that is, a one-dimensional subspace with the line as the coordinate is established, and any point in the plane can be projected on this line to obtain the projected coordinates, thus Its spatial position can be represented by one-dimensional coordinates. Correspondingly, any point in the plane can be restored to its two-dimensional data from one-dimensional data after PCA reverse calculation. With the same idea, after establishing the subspace of cartoon faces and face parts, project all the data of cartoon faces and face parts onto the principal components, which can not only play the role of dimensionality reduction, but also based on These principal components are used to observe their spatial relationships.
步骤120.利用二维真实人脸照片和所述三维卡通人脸部件PCA子空间,生成与真实人脸相似的三维卡通人脸部件;
在PCA子空间进行遗传采样操作,可在低维子空间采样出优化的投影向量,从而可由此投影向量重建出高维空间中的优化向量即生成出优化的三维卡通人脸部件,因此可协调地对人脸的多个特征进行夸张形变。The genetic sampling operation in the PCA subspace can sample the optimized projection vector in the low-dimensional subspace, so that the optimized vector in the high-dimensional space can be reconstructed from the projection vector, that is, the optimized 3D cartoon face parts can be generated. Coordinated exaggerated deformation of multiple features of the human face.
所述步骤120,包括下列步骤:The
步骤121.重建与二维真实人脸照片对应的三维真实人脸并按照所述三维卡通人脸部件定义拆分出三维真实人脸部件;
所述根据二维真实人脸照片重建其对应的三维真实人脸为现有技术,在此不再一一赘述。The reconstruction of the corresponding 3D real face according to the 2D real face photo is a prior art, and will not be repeated here.
步骤122.将所述三维真实人脸部件在所述三维卡通人脸部件PCA子空间进行投影并进行遗传采样,以获得投影向量;
基于三维卡通人脸及三维卡通人脸部件的主成分,将三维真实人脸部件进行投影计算,投影计算公式为:α=PT(X-X),其中:α为投影,P为描述PCA子空间的特征向量矩阵,PT为其矩阵的转置,X为样本,X为样本平均值。得到三维真实人脸部件的投影数据,然后在PCA子空间中采样出优化的投影向量。Based on the three-dimensional cartoon face and the principal components of the three-dimensional cartoon face parts, the projection calculation of the three-dimensional real face parts is carried out, and the projection calculation formula is: α = PT (XX), where: α is the projection, and P is the description PCA The eigenvector matrix of the subspace,PT is the transpose of its matrix, X is the sample, and X is the sample mean. The projection data of the 3D real face parts is obtained, and then the optimized projection vector is sampled in the PCA subspace.
我们采用的优化方法是采用遗传算法(Genetic Algorithm,GA)来实现。遗传算法是本领域技术人员所熟知的,在此不再一一赘述。如前所述,由于基于三维卡通人脸及三维卡通人脸部件形成主成分的采样可以影响到三维卡通人脸与三维卡通人脸部件样本空间的每一维,因此该投影可以反映出协调地进行多种特征的形变。The optimization method we adopt is realized by genetic algorithm (Genetic Algorithm, GA). Genetic algorithms are well known to those skilled in the art, so details will not be repeated here. As mentioned above, since the sampling based on the principal components of 3D cartoon faces and 3D cartoon face parts can affect each dimension of the sample space of 3D cartoon faces and 3D cartoon face parts, the projection can reflect Deform multiple features in a coordinated manner.
本步骤中,所述投影和优化的方法并不限于上述方法,本领域技术人员同样可以通过其他方法实现投影和优化的操作。In this step, the projection and optimization methods are not limited to the above methods, and those skilled in the art can also implement the projection and optimization operations through other methods.
步骤123.将所述投影向量进行三维还原重建,得到与真实人脸相似的三维卡通人脸部件。
利用重建公式X′=X+Pα来得到与真实人脸相似的三维卡通人脸部件,其中X为样本均值,P为描述PCA子空间的特征向量矩阵,α为投影,且X,P和α均已知,X′为重建的结果。Use the reconstruction formula X′=X+Pα to obtain a 3D cartoon face part similar to the real face, where X is the sample mean, P is the feature vector matrix describing the PCA subspace, α is the projection, and X, P and α is known, and X' is the reconstruction result.
所述重建方法,包括但不限于上述方法。The reconstruction methods include but are not limited to the above-mentioned methods.
步骤200中,在三维卡通人脸部件融合方面,本发明采用平移缩放、主成分分析和Kriging插值相结合的方法。通过对上述步骤产生的三维卡通人脸部件进行处理,再融合为三维卡通人脸,并对融合后的三维卡通人脸进行完善,使得生成的三维卡通人脸在整体上更加逼真。In step 200, in terms of fusion of three-dimensional cartoon human face parts, the present invention adopts a method combining translation scaling, principal component analysis and Kriging interpolation. By processing the 3D cartoon human face components generated in the above steps, and then merging them into a 3D cartoon human face, and perfecting the fused 3D cartoon human face, the generated 3D cartoon human face is more realistic as a whole.
图6是本发明中三维卡通人脸部件融合方法的流程图,如图6所示,所述步骤200,包括下列步骤:Fig. 6 is the flow chart of three-dimensional cartoon face part fusion method among the present invention, as shown in Fig. 6, described step 200, comprises the following steps:
步骤210.计算所述三维真实人脸部件与所述与真实人脸相似的三维卡通人脸部件在位置和形状上的差异,并根据计算结果对所述与真实人脸相似的三维卡通人脸部件进行平移和缩放;
以三维真实人脸上的人脸部件的位置和尺度为依据,将生成的三维卡通人脸部件进行平移和缩放。Based on the position and scale of the face parts on the 3D real face, the generated 3D cartoon face parts are translated and scaled.
步骤220.将经过平移和缩放的所述与真实人脸相似的三维卡通人脸部件投影到三维卡通人脸部件PCA子空间得到投影向量,并用投影向量进行三维卡通人脸重建;
所述投影的方法,与步骤122中的方法一致,在此不再一一赘述。The projection method is consistent with the method in
由投影向量获得在PCA子空间的坐标,然后经过PCA反向计算,从低维PCA子空间恢复到样本空间的向量,即可获得具有形变效果的三维卡通人脸部件。The coordinates in the PCA subspace are obtained from the projection vector, and then the PCA reverse calculation is performed to restore the vector from the low-dimensional PCA subspace to the sample space, and then a three-dimensional cartoon face part with deformation effect can be obtained.
步骤230.将重建后的三维卡通人脸进行Kriging插值生成最终的三维卡通人脸。
本步骤中,是以与真实人脸相似的的三维卡通人脸部件为依据,对重建后的三维卡通人脸进行Kriging插值。Kriging插值是一种无偏、误差最小、最优化的基于统计理论的方法,为现有技术。其将待估点v的估计值为n个观察点vi的信息值的线性组合表示。本发明利用此插值方法的估计空间分布的预测误差最小的特点来使得生成的三维卡通人脸在人脸部件上具有卡通的形变效果,在整体上又具有与三维真实人脸的相似性。In this step, Kriging interpolation is performed on the reconstructed 3D cartoon face based on the 3D cartoon face parts similar to the real face. Kriging interpolation is an unbiased, error-minimum, optimal method based on statistical theory, which is a prior art. It expresses the estimated value of the point v to be estimated as a linear combination of the information values of n observation points vi. The present invention utilizes the characteristic of the minimum prediction error of the estimated spatial distribution of the interpolation method to make the generated three-dimensional cartoon human face have a cartoon deformation effect on the human face parts, and have the similarity with the three-dimensional real human face as a whole.
相应于本发明的一种三维卡通人脸生成方法,还提供一种三维卡通人脸生成装置。图7是本发明一种三维卡通人脸生成装置的结构示意图,如图7所示,所述装置,包括:Corresponding to a method for generating a three-dimensional cartoon face of the present invention, a device for generating a three-dimensional cartoon face is also provided. Fig. 7 is the structural representation of a kind of three-dimensional cartoon human face generation device of the present invention, as shown in Fig. 7, described device comprises:
三维卡通人脸部件生成模块1,用于利用三维卡通人脸数据库和二维真实人脸照片生成与真实人脸相似的三维卡通人脸部件;Three-dimensional cartoon human face parts generating module 1, for utilizing three-dimensional cartoon human face database and two-dimensional real human face photos to generate three-dimensional cartoon human face parts similar to real human faces;
三维卡通人脸生成模块2,用于对所述三维卡通人脸部件生成模块1生成的与真实人脸相似的三维卡通人脸部件进行处理,生成最终的三维卡通人脸。The three-dimensional cartoon human
所述三维卡通人脸部件生成模块1,包括:Described three-dimensional cartoon human face part generation module 1, comprises:
子空间生成模块11,用于根据三维卡通人脸数据库建立三维卡通人脸部件PCA子空间;
比照模块12,用于利用二维真实人脸照片和所述子空间生成模块11生成的三维卡通人脸部件PCA子空间,生成与真实人脸相似的三维卡通人脸部件。The
所述子空间生成模块11,包括:The
数据库生成模块111,用于建立三维卡通人脸数据库并定义三维卡通人脸部件;
人脸部件处理模块112,用于根据所述数据库生成模块111定义的三维卡通人脸部件对三维卡通人脸进行处理,建立三维卡通人脸部件数据库;Face
分析模块113,用于将所述人脸部件处理模块112中的三维卡通人脸部件的特征提取出来并分析其主成分,建立三维卡通人脸部件PCA子空间。The
所述三维卡通人脸生成模块2,包括:The three-dimensional cartoon human
缩放处理模块21,用于对所述与真实人脸相似的三维卡通人脸部件进行平移和缩放;
三维卡通人脸重建模块22,用于将经过所述缩放处理模块21平移和缩放的所述与真实人脸相似的三维卡通人脸部件进行投影,重建三维卡通人脸;The three-dimensional cartoon human
插值模块23,用于将所述三维卡通人脸重建模块22重建后的三维卡通人脸进行Kriging插值生成最终的三维卡通人脸。The
本发明的有益效果在于:The beneficial effects of the present invention are:
1.本发明的一种三维卡通人脸生成方法及装置,采用主成分分析的方法来建立三维卡通人脸部件子空间,这样就可以抓住人脸的局部特征;1. A kind of three-dimensional cartoon human face generation method and device of the present invention adopt the method of principal component analysis to set up three-dimensional cartoon human face part subspace, so just can catch the local feature of human face;
2.本发明的一种三维卡通人脸生成方法及装置,在人脸部件子空间中进行遗传采样来自动实现三维卡通人脸的生成,这样避免了大量的人机交互操作,同时也可以对人脸进行更为精确地形变,相比已有技术仅对真实人脸进行简单地整体拉伸。2. A kind of three-dimensional cartoon human face generation method and device of the present invention carry out genetic sampling in the subspace of human face parts to realize the generation of three-dimensional cartoon human face automatically, thus avoiding a large amount of human-computer interaction operations, and can also The face is deformed more accurately, compared with the existing technology, which only simply stretches the real face as a whole.
通过结合附图对本发明具体实施例的描述,本发明的其它方面及特征对本领域的技术人员而言是显而易见的。Other aspects and features of the present invention will be apparent to those skilled in the art by describing specific embodiments of the present invention in conjunction with the accompanying drawings.
以上对本发明的具体实施例进行了描述和说明,这些实施例应被认为其只是示例性的,并不用于对本发明进行限制,本发明应根据所附的权利要求进行解释。The specific embodiments of the present invention have been described and illustrated above, and these embodiments should be considered as exemplary only, and are not used to limit the present invention, and the present invention should be interpreted according to the appended claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNA2009100800453ACN101510317A (en) | 2009-03-17 | 2009-03-17 | Method and apparatus for generating three-dimensional cartoon human face |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNA2009100800453ACN101510317A (en) | 2009-03-17 | 2009-03-17 | Method and apparatus for generating three-dimensional cartoon human face |
| Publication Number | Publication Date |
|---|---|
| CN101510317Atrue CN101510317A (en) | 2009-08-19 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNA2009100800453APendingCN101510317A (en) | 2009-03-17 | 2009-03-17 | Method and apparatus for generating three-dimensional cartoon human face |
| Country | Link |
|---|---|
| CN (1) | CN101510317A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102103756B (en)* | 2009-12-18 | 2012-10-03 | 华为技术有限公司 | Comic exaggeration method, device and system for human face digital image supporting position deflection |
| CN103383778A (en)* | 2013-07-03 | 2013-11-06 | 中国科学院计算技术研究所 | Method and system for generating three-dimensional cartoon faces |
| CN108510583A (en)* | 2018-04-03 | 2018-09-07 | 北京华捷艾米科技有限公司 | The generation method of facial image and the generating means of facial image |
| CN109887070A (en)* | 2019-01-10 | 2019-06-14 | 珠海金山网络游戏科技有限公司 | A kind of virtual face's production method and device |
| CN110420464A (en)* | 2018-07-27 | 2019-11-08 | 腾讯科技(深圳)有限公司 | The determination method, apparatus and readable storage medium storing program for executing of virtual pet figure parameter |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102103756B (en)* | 2009-12-18 | 2012-10-03 | 华为技术有限公司 | Comic exaggeration method, device and system for human face digital image supporting position deflection |
| CN103383778A (en)* | 2013-07-03 | 2013-11-06 | 中国科学院计算技术研究所 | Method and system for generating three-dimensional cartoon faces |
| CN103383778B (en)* | 2013-07-03 | 2016-09-28 | 中国科学院计算技术研究所 | A kind of three-dimensional cartoon human face generating method and system |
| CN108510583A (en)* | 2018-04-03 | 2018-09-07 | 北京华捷艾米科技有限公司 | The generation method of facial image and the generating means of facial image |
| CN108510583B (en)* | 2018-04-03 | 2019-10-11 | 北京华捷艾米科技有限公司 | Face image generation method and face image generation device |
| CN110420464A (en)* | 2018-07-27 | 2019-11-08 | 腾讯科技(深圳)有限公司 | The determination method, apparatus and readable storage medium storing program for executing of virtual pet figure parameter |
| CN110420464B (en)* | 2018-07-27 | 2021-05-04 | 腾讯科技(深圳)有限公司 | Method and device for determining virtual pet image parameters and readable storage medium |
| CN109887070A (en)* | 2019-01-10 | 2019-06-14 | 珠海金山网络游戏科技有限公司 | A kind of virtual face's production method and device |
| Publication | Publication Date | Title |
|---|---|---|
| JP7728858B2 (en) | Fast and deep facial deformation | |
| Han et al. | DeepSketch2Face: a deep learning based sketching system for 3D face and caricature modeling | |
| Chai et al. | Dynamic hair manipulation in images and videos | |
| Wang et al. | High resolution acquisition, learning and transfer of dynamic 3‐D facial expressions | |
| CN103606186B (en) | The virtual hair style modeling method of a kind of image and video | |
| CN112950775A (en) | Three-dimensional face model reconstruction method and system based on self-supervision learning | |
| CN112150638A (en) | Virtual object image synthesis method and device, electronic equipment and storage medium | |
| CN116051696B (en) | Reconstruction method and device of human body implicit model capable of being re-illuminated | |
| Wan et al. | Data-driven facial expression synthesis via Laplacian deformation | |
| Paier et al. | Interactive facial animation with deep neural networks | |
| Yeh et al. | 2.5 D cartoon hair modeling and manipulation | |
| CN117808943B (en) | Three-dimensional cartoon face reconstruction method, device, equipment and storage medium | |
| CN100487732C (en) | Method for generating cartoon portrait based on photo of human face | |
| CN113313631B (en) | Image rendering method and device | |
| CN116843807B (en) | Virtual image generation method, virtual image model training method, virtual image generation device, virtual image model training device and electronic equipment | |
| CN101510317A (en) | Method and apparatus for generating three-dimensional cartoon human face | |
| CN118196268A (en) | Meta-universe digital person rendering method, device, equipment and storage medium | |
| CN113763536A (en) | A 3D Reconstruction Method Based on RGB Image | |
| CN111914595A (en) | A method and device for 3D pose estimation of human hand based on color image | |
| Zhang et al. | Neural modeling of portrait bas-relief from a single photograph | |
| CN116452715A (en) | Dynamic hand rendering method, device and storage medium | |
| Gong et al. | Monocular and Generalizable Gaussian Talking Head Animation | |
| KR100544684B1 (en) | Region-based facial expression animation method | |
| CN114638868B (en) | A method for generating high-resolution 3D face texture in natural scenes | |
| Jiao et al. | NEHand: Enhancing Hand Pose Estimation in the Wild through Synthetic and Motion Capture Datasets |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
| WD01 | Invention patent application deemed withdrawn after publication | Open date:20090819 |