CN107615337A - A kind of three-dimensional scalp electroacupuncture method and device - Google Patents

A kind of three-dimensional scalp electroacupuncture method and device Download PDF

Info

Publication number
CN107615337A
CN107615337A CN201680025609.1A CN201680025609A CN107615337A CN 107615337 A CN107615337 A CN 107615337A CN 201680025609 A CN201680025609 A CN 201680025609A CN 107615337 A CN107615337 A CN 107615337A
Authority
CN
China
Prior art keywords
hair
point
head model
key point
template
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.)
Granted
Application number
CN201680025609.1A
Other languages
Chinese (zh)
Other versions
CN107615337B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN107615337A publication Critical patent/CN107615337A/en
Application granted granted Critical
Publication of CN107615337B publication Critical patent/CN107615337B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects

Abstract

A kind of three-dimensional scalp electroacupuncture method and device, can not meet the quick reuse of hair template the problem of higher for solving hair template reuse complexity.Method includes:Determine hair to be created 3D head models and default reference head model between the first coordinate conversion relation, and the second coordinate conversion relation between determination 3D head models and default 3D hairs template, it is based on the first coordinate conversion relation and the second coordinate conversion relation that 3D head models is registering with the progress of 3D hairs template;3D hairs template and reference head model match;When detecting that the 3D hair templates after registration have zone errors, deformation is carried out to the hair in the zone errors of 3D hair templates using RBF RBF, with the region that corrects a mistake;Zone errors include not blocking the head cortical region of 3D head models or the non-head cortical region of the root of hair regional occlusion 3D head models in 3D hair templates completely in 3D hair templates.

Description

A kind of three-dimensional scalp electroacupuncture method and device Technical field
This application involves 3-D image processing and computer graphics techniques field more particularly to a kind of three-dimensional scalp electroacupuncture method and devices.
Background technique
With microprocessor (Advanced RISC Machines, referred to as: the ARM) continuous improvement of performance, three-dimensional (3D) personage of high quality based on mobile phone, which rebuilds, has become reality, and by the favor of major cell phone manufacturer and users.The hair of people is very important part in personal portrait and digital character animation, and the creation of hair can significantly increase the sense of reality of virtual role in virtual image and entertainment applications.Therefore, become the critical issue for needing to solve in 3D personage's reconstruction process for the scalp electroacupuncture of 3D role.
The scheme of 3D scalp electroacupuncture is broadly divided into two classes, and one kind is forming hair modeling, and another kind of is that Hair model reuses.Wherein forming hair modeling is the 3D scalp electroacupuncture method of current mainstream, such method is mainly by manually come the creation of implementation model, usually one piece of hair tonic region is chosen on the scalp of existing headform, then the direction of growth, length, crimpness etc. of the region hair are set, the Hair model that this method is created that can accurately fit together with headform, but it can take a substantial amount of time, and need complicated artificial participation.For the 3D faceform that mobile phone reconstructs, if generating corresponding 3D Hair model using manual mode, the time of the computing resource and consumption that occupy is unacceptable for a user.
Hair model reuse refers to creates new hair style similar with existing Hair model on different 3D actor models.The prior art carries out Hair model reuse in the following way: one or more 3D hair templates are stored in advance, hair image and 3D head model are faced in reception, it is then based on the characteristics of facing hair image and 3D head model is combined to carry out deformation process to 3D hair template, to generate true 3D Hair model.
To 3D hair template carry out deformation process when, define first 3D hair template key point and The region divided according to key point;Then the hair shape of hair image is faced in detection;The hair shape that will test is divided into normal part and individual character part, and wherein normal part finger sends out part similar between Different Individual, and individual character part finger sends out the part to differ greatly between Different Individual;Approximate processing carried out to the individual character part that marks off, the hair piece of pairing approximation treated individual character part carries out forming hair modeling;In conjunction with 3D head model, the boundary key point of defined 3D Hair model is matched with the boundary for marking off the normal part come, 3D interpolation of data is carried out to matched results area;Each 3D hair piece after forming hair is modeled is combined with 3D interpolation of data result, generates true 3D Hair model.
Deformation process is carried out to 3D hair template in the prior art to need 3D Hair model being projected as 2D form, the key point of selection is 2D form, then 2D key point is matched with the normal part and individual character part for facing hair image, therefore the prior art is limited to the testing result of 2D key point, 2D key point and faces the normal part of hair image and the matching precision of individual character part and the modeling for hair individual character part, so that hair template reuse complexity is higher, it is unable to satisfy the quick reuse of hair template.
Summary of the invention
The application provides a kind of three-dimensional scalp electroacupuncture method and device, for solving the problem of the higher quick reuse for being unable to satisfy hair template of hair template reuse complexity of the existing technology.
In a first aspect, this application provides a kind of three-dimensional scalp electroacupuncture method, method includes:
Determine the first coordinate conversion relation between the 3D head model and preset reference head model of hair to be created, and the second coordinate conversion relation between the determining 3D head model and preset 3D hair template, it is then based on first coordinate conversion relation and the second coordinate conversion relation and is registrated the 3D head model with the 3D hair template;Wherein, the preset 3D hair template and the preset reference head model match;There are when zone errors for the 3D hair template after detecting registration, deformation is carried out to the hair in the zone errors of the 3D hair template using radial basis function RBF, to correct the zone errors, wherein, the region of the non-scalp layer of 3D head model is stated in the root of hair regional occlusion residence that the zone errors include the region for not sheltering from the scalp layer of the 3D head model in the 3D hair template completely or root of hair point in the 3D hair template is constituted.
Through the above scheme, it can quickly be that 3D head model in the relatively low terminal of storage capacity, computing capability constructs the 3D Hair model with intact fitting effect, the sense of reality of the 3D Hair model constructed can match in excellence or beauty in the Hair model generated using forming hair modeling method, but eliminate a large amount of man-machine interactively and operation time;Compared with existing Hair model reuse technology, without being limited to the testing result of 2D key point, being also not limited to 2D key point and facing the normal part of hair image and the matching precision of individual character part, the modeling without being directed to hair individual character part in the application, the Hair model that the reusability of 3D hair template can be effectively improved, and constructed can more precisely retain the appearance of prototype hair.
In a kind of possible design, determine the first coordinate transformation relation between the 3D head model and preset reference head model of hair to be created, and the second coordinate transformation relation between the determining 3D head model and preset 3D hair template, and be registrated the 3D head model with the 3D hair template based on first coordinate transformation relation and the second coordinate transformation relation, it can be accomplished in that
Determine the facial key point of the 3D head model of hair to be created and the facial key point of scalp layer key point and determining preset reference head model;The facial key point of the 3D head model is matched with the facial key point of the reference head model, obtains facial match point pair;Then according to the facial match point pair, the first coordinate conversion relation between the 3D head model and the reference head model is determined;According to first coordinate conversion relation, three-dimensional coordinate of the 3D hair template in target-based coordinate system is obtained, wherein the target-based coordinate system is the coordinate system where the 3D head model;The scalp layer key point of root of hair point and the 3D head model Jing Guo the transformed 3D hair template of the first coordinate conversion relation is matched, root of hair matching double points are obtained;According to the root of hair matching double points, the second coordinate conversion relation between the 3D head model and the 3D hair template is determined;According to second coordinate conversion relation, the 3D hair template is registrated with the 3D head model.
In above-mentioned design, the first coordinate conversion relation and the second coordinate conversion relation are determined by the root of hair point of the facial key point and scalp layer key point of 3D head model and the facial key point of reference head model and 3D hair template, calculation amount can be reduced, so as to apply on the relatively low terminal device of storage capacity and computing capability.
It is described that deformation is carried out to the hair in the zone errors of the 3D hair template using radial basis function RBF in a kind of possible design, it can be accomplished in that
It is executed respectively for each hair in the zone errors of the 3D hair template as follows: selecting at least three three-dimensional coordinate point in each hair as the first key point, and determine that every one first key point constitutes hair matching double points in match point of the nearest neighbor point as every one first key point of the 3D head model scalp layer, and by the corresponding match point of every one first key point by nearest neighbor point algorithm;Using hair matching double points as the input parameter of radial basis function, deformation is carried out to each hair.
It wherein, may include the root of hair point and hair tip point of each hair in first key point.
In above-mentioned design, the first key point of selection is matched with the coordinate points in scalp layer using nearest neighbor point algorithm, matching is accurate and calculation amount is small.
It is described that deformation is carried out to the hair in the zone errors of the 3D hair template using radial basis function RBF in a kind of possible design, it can be accomplished in that
It is executed respectively for each hair in the zone errors of the 3D hair template as follows: selecting at least three three-dimensional coordinate point in each hair as the second key point, and determine that the corresponding match point of every one second key point in match point of the nearest neighbor point as every one second key point of the 3D head model scalp layer, and is constituted hair matching double points by every one second key point in second key point of at least three by nearest neighbor point algorithm;Use hair matching double points to input parameter as radial basis function, deformation is carried out to each hair;Each hair after deformation is divided at least two parts, it is executed respectively for each section hair as follows: using at least three three-dimensional coordinate point in each section hair as third key point, and using the nearest neighbor point of each third key point in each section hair as the match point of each third key point in the three-dimensional coordinate point of the scalp layer in the 3D head model, and the corresponding match point of each third key point is constituted into segmentation hair matching double points;Deformation is carried out to each section hair using the segmentation hair matching double points as the input parameter of radial basis function.
It wherein, may include root of hair point in each hair and hair tip point in second key point;It may include two endpoints of each section hair in the third key point.
It is described that deformation is carried out to the hair in the zone errors of the 3D hair template using radial basis function RBF in a kind of possible design, comprising:
It is executed respectively for each hair in the zone errors of the 3D hair template as follows: each hair is divided at least two parts, and executed respectively for each section hair as follows: using at least three three-dimensional coordinate point in each section hair as the 4th key point, and using the nearest neighbor point of every one the 4th key point in each section hair as the match point of every one the 4th key point in the three-dimensional coordinate point of the scalp layer in the 3D head model, and the corresponding match point of every one the 4th key point is constituted into segmentation hair matching double points;Deformation is carried out to each section hair using the segmentation hair matching double points as the input parameter of radial basis function.
Wherein, the third key point may include two endpoints of each section hair.
Second aspect, this application provides a kind of three-dimensional scalp electroacupuncture device, device includes:
First determination unit, the first coordinate conversion relation between 3D head model and preset reference head model for determining hair to be created;
Second determination unit, for determining the second coordinate conversion relation between the 3D head model and preset 3D hair template, wherein the preset 3D hair template and the preset reference head model match;
Registration unit, determines first coordinate conversion relation and second coordinate conversion relation for unit based on the determination, and the 3D head model is registrated with the 3D hair template;
Detection unit, for detecting the 3D hair template after being registrated with the presence or absence of zone errors;
Deformation unit, for using radial basis function RBF to detect the detection unit, the hair in the zone errors of the 3D hair template carries out deformation, to correct the zone errors, wherein, the region of the non-scalp layer of 3D head model is stated in the root of hair regional occlusion residence that the zone errors include the region for not sheltering from the scalp layer of the 3D head model in the 3D hair template completely or root of hair point in the 3D hair template is constituted.
Through the above scheme, it can quickly be that 3D head model in the relatively low terminal of storage capacity, computing capability constructs the 3D Hair model with intact fitting effect, the sense of reality of the 3D Hair model constructed can match in excellence or beauty in the Hair model generated using forming hair modeling method, but eliminate a large amount of people Industry and traffic is mutually and operation time;Compared with existing Hair model reuse technology, without being limited to the testing result of 2D key point, being also not limited to 2D key point and facing the normal part of hair image and the matching precision of individual character part, the modeling without being directed to hair individual character part in the application, the Hair model that the reusability of 3D hair template can be effectively improved, and constructed can more precisely retain the appearance of prototype hair.
In a kind of possible design, first determination unit is specifically used for: determining the facial key point and scalp layer key point of the 3D head model of hair to be created;Determine the facial key point of preset reference head model;The facial key point of the 3D head model is matched with the facial key point of the reference head model, obtains facial match point pair;According to the facial match point pair, the first coordinate conversion relation between the 3D head model and the reference head model is determined;The registration unit, for obtaining three-dimensional coordinate of the 3D hair template in target-based coordinate system according to first coordinate conversion relation, wherein the target-based coordinate system is the coordinate system where the 3D head model;Second determination unit, is specifically used for: matching to the scalp layer key point of root of hair point and the 3D head model Jing Guo the transformed 3D hair template of the first coordinate conversion relation, obtains root of hair matching double points;According to the root of hair matching double points, the second coordinate conversion relation between the 3D head model and the 3D hair template is determined;The registration unit, for according to second coordinate conversion relation, the 3D hair template to be registrated with the 3D head model.
In a kind of possible design, the deformation unit, it is specifically used for: is executed respectively for each hair in the zone errors of the 3D hair template as follows: selecting at least three three-dimensional coordinate point in each hair as the first key point, and determine that every one first key point constitutes hair matching double points in match point of the nearest neighbor point as every one first key point of the 3D head model scalp layer, and by the corresponding match point of every one first key point by nearest neighbor point algorithm;Using hair matching double points as the input parameter of radial basis function, deformation is carried out to each hair.
It wherein, may include the root of hair point and hair tip point of each hair in first key point.
In a kind of possible design, the deformation unit, it is specifically used for: is executed respectively for each hair in the zone errors of the 3D hair template as follows: selecting at least three three-dimensional coordinate point in each hair as the second key point, and determines that described at least three second is closed by nearest neighbor point algorithm The corresponding match point of every one second key point and is constituted hair matching double points in match point of the nearest neighbor point as every one second key point of the 3D head model scalp layer by every one second key point in key point;Use hair matching double points to input parameter as radial basis function, deformation is carried out to each hair;Each hair after deformation is divided at least two parts, it is executed respectively for each section hair as follows: using at least three three-dimensional coordinate point in each section hair as third key point, and using the nearest neighbor point of each third key point in each section hair as the match point of each third key point in the three-dimensional coordinate point of the scalp layer in the 3D head model, and the corresponding match point of each third key point is constituted into segmentation hair matching double points;Deformation is carried out to each section hair using the segmentation hair matching double points as the input parameter of radial basis function.
It wherein, may include root of hair point in each hair and hair tip point in second key point;It may include two endpoints of each section hair in the third key point.
In a kind of possible design, the deformation unit, it is specifically used for: is executed respectively for each hair in the zone errors of the 3D hair template as follows: each hair is divided at least two parts, and executed respectively for each section hair as follows: using at least three three-dimensional coordinate point in each section hair as the 4th key point, and using the nearest neighbor point of every one the 4th key point in each section hair as the match point of every one the 4th key point in the three-dimensional coordinate point of the scalp layer in the 3D head model, and the corresponding match point of every one the 4th key point is constituted into segmentation hair matching double points;Deformation is carried out to each section hair using the segmentation hair matching double points as the input parameter of radial basis function.
Wherein, the third key point may include two endpoints of each section hair.
The third aspect, present invention also provides a kind of three-dimensional scalp electroacupuncture devices characterized by comprising communication interface, memory and processor.The communication interface, for configuring the 3D head model, preset reference head model and preset 3D hair template of hair to be created, the preset reference head model and preset 3D hair template match;The memory, the program code executed for storing the processor;The processor, it is specific to execute the performed operation of any one design in first aspect for executing the program code of the memory storage.
Fourth aspect, present invention also provides a kind of computer-readable storages for storing one or more programs Medium, one or more of programs include instruction, and described instruction executes the electronic equipment according to the arbitrarily devised operation of first aspect when being included the electronic equipment execution of multiple application programs.
Detailed description of the invention
Fig. 1 is the facial key point schematic diagram of the 3D head model of selection provided by the present application;
Fig. 2 is the facial key point schematic diagram of the reference head model of selection provided by the present application;
Fig. 3 is the scalp layer key point schematic diagram of the 3D head model of selection provided by the present application;
Fig. 4 is the matched point correspondence schematic diagram of key point of 3D hair template provided by the present application;
Fig. 5 is hair provided by the present application by the whole deformation schematic diagram to part;
Fig. 6 is a kind of three-dimensional scalp electroacupuncture method flow diagram provided by the present application;
Fig. 7 is 3D hair template provided by the present application and 3D head model method for registering flow chart;
Fig. 8 is a kind of three-dimensional scalp electroacupuncture method schematic diagram provided by the present application;
Fig. 9 is a kind of three-dimensional scalp electroacupuncture schematic device provided by the present application;
Figure 10 is another three-dimensional scalp electroacupuncture schematic device provided by the present application;
Figure 11 is three-dimensional scalp electroacupuncture effect diagram provided by the present application.
Specific embodiment
In order to keep the purposes, technical schemes and advantages of the application clearer, the application is described in further detail below in conjunction with attached drawing, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, all other embodiment obtained by those of ordinary skill in the art without making creative efforts, shall fall in the protection scope of this application.
The application provides a kind of three-dimensional scalp electroacupuncture method and device, for solving the problem of the higher quick reuse for being unable to satisfy hair template of hair template reuse complexity of the existing technology.Wherein, method and apparatus are that based on the same inventive concept, since the principle that method and device solves the problems, such as is similar, the implementation of apparatus and method can be with cross-reference, and overlaps will not be repeated.
This application can be applied to the relatively low terminals of storage capacity, computing capability, naturally it is also possible to answer With storage capacity, the higher electronic equipment of computing capability, the application is not especially limited this.
One embodiment of three-dimensional scalp electroacupuncture method provided by the present application includes:
Three-dimensional (3D) head model of hair to be created can be prepared in advance, which can be divided into three-dimensional scalp layer region and three-dimensional non-hair layer region.All three-dimensional coordinate points for constituting this 3D head model constitute 3D head model point set.Two subsets, including three-dimensional scalp layer region point set and three-dimensional non-hair layer region point set can be divided into the point concentration of 3D head model.
Three-dimensional non-scalp layer region point concentrates the region for including all face feature points and being fenced up by the face mask that these points are formed, ear to chin area.It can also include the index number of each face feature point in the corresponding information of three-dimensional (3D) head model, and the index number of these face feature points is recorded in three-dimensional non-scalp layer region point and is concentrated.Other is three-dimensional scalp layer region, can mark forehead, temples, the characteristic point in ear week, left and right almost symmetry on the profile of three-dimensional scalp layer region.Can certainly correct cortex characteristic point be indexed number, and be recorded in three-dimensional scalp layer region point concentration.
Be prepared in advance 3D hair template in the application, and it corresponds to a reference head model, i.e. the 3D hair template matches for reference head model construction, 3D hair template with reference head model.3D hair template and reference head model can be one be stored in advance in 3D Hair model library.It is corresponding in the 3D Hair model library to store multiple 3D hair templates and reference head model, one can be selected in 3D hair template library by user in advance.All three-dimensional coordinate points for constituting this reference head model constitute reference head model point set, and all three-dimensional coordinate points for constituting this 3D hair template constitute 3D hair template point set.
Three-dimensional scalp electroacupuncture device determines the 3D head model of hair to be created and the first coordinate correspondence relationship of preset reference head model.
Specifically, when determining the first coordinate correspondence relationship, it is first determined the facial key point of the 3D head model of hair to be created, the scalp layer key point of the 3D head model;And determine the facial key point of reference head model, and matched to obtain facial match point pair with the facial key point of reference head model to the facial key point of the 3D head model.
In the application, in facial key point, the scalp layer key point of the 3D head model for the 3D head model for determining hair to be created, it can be accomplished in that
The facial key point of determining 3D head model can be divided into two classes: the first kind is facial key point, may include eye areas, nasal area, mouth region, chin region etc.;Second class is scalp layer key point, may include forehead region, back side of head region, ear root of hair region etc..For example, as shown in Figure 1, determine 3D head model facial key point include 39, R1~R39.
Existing feature extraction mode can be used when determining key point, it can also manually choose, certainly it can also be and establishing the facial key point and scalp layer key point that 3D head model has had determined, it can also select a part of characteristic point as facial key point in the index number for the face feature point that three-dimensional non-scalp layer region point is concentrated, select a part of characteristic point as scalp layer key point in the index number for the scalp layer characteristic point that three-dimensional scalp layer region point is concentrated.
In the application, mode can be ordered the same using with the facial key of 3D head model is determined in the facial key point for determining reference head model that 3D hair template is based on, the facial key point of determining reference head model may include eye areas, nasal area, mouth region, chin region etc..As shown in Fig. 2, the facial key point of the reference head model determined includes 39, A1~A39.Existing feature extraction mode can be used when determining key point, can also manually be chosen, be can also be the facial key point having had determined when establishing reference head model certainly.
After determining the facial key point of facial key point and reference head model of the 3D head model, three-dimensional scalp electroacupuncture device matches the facial key point of the 3D head model with the facial key point of reference head model to obtain facial match point pair.
Since the facial key point to the 3D head model is identical as the mode that the facial key point of reference head model selects, can be matched to obtain facial match point pair based on index number, it can also be with artificial selection facial match point pair.For example, Fig. 1 and key point shown in Fig. 2 matching rear face matching double points include: R1-A1, R2-A2, R6-A6, R7-A7, R10-A10, R13-A13, R14-A14, R19-A19, R20-A20, R33-A33.
Three-dimensional scalp electroacupuncture device is according to the first coordinate conversion relation between the facial match point 3D head model described determination and reference head model.
When it is implemented, using facial match point to the first coordinate conversion relation calculated between 3D head model and reference head model.Wherein the first coordinate conversion relation s.R.t include scaling relationship, rotation relationship with And translation relation.Wherein, scaling relationship indicates that zoom factor s is realized by s, and rotation relationship realizes that translation relation is realized by translation vector t by spin matrix R.
Assume that the central point in 3D Hair model is the origin of world coordinate system in the application.Zoom factor s is then calculated by following formula (1):
Wherein, x in formula, y, what z was indicated is the coordinate of the corresponding facial key point of facial key point centering 3D head model, in formulaWhat is indicated is the coordinate of the corresponding facial key point of facial key point centering reference head model, and n indicates the total quantity of facial key point pair.
Method to calculate spin matrix R, translation vector t in the following way:
First unify scale before calculating R, t, first the coordinate of 3D head model and reference head model and all characteristic points of 3D hair template can be normalized.Then using facial key point to and singular value decomposition (English: Singular Value Decomposition, referred to as: SVD) algorithm calculate R, t.
Assuming that matched face key point is to respectively XiAnd Yi, then the definition of essential matrix E such as formula (2):
Assuming that the outer ginseng of 3D head model is P=[I | 0], I indicates canonical matrix, i.e., canonical matrix when not rotating, 0 indicates not translate.The outer ginseng of reference head model is P '=[R | t], then the essential matrix E such as formula (3) between 3D head model and 3D hair template:
E=[t]xR formula (3)
Essential matrix E is subjected to SVD, such as formula (4) can be obtained:
E=U diag (1,1,0) VTFormula (4)
The outer ginseng P ' of so 3D hair template has following four kinds of possible selections:
P '=[UWVT|u3];[UWVT|-u3];[UWTVT|u3];[UWTVT|-u3];
Wherein
The optional one group facial key point matched verifies four kinds of probable values to P ', and unique correct solution can be determined from four different solutions.Assuming that P '=[UWVT|u3] it is correct solution, then R=UWVT, t=u3
After obtaining above-mentioned first coordinate conversion relation s.R.t, according to first coordinate conversion relation, three-dimensional coordinate of the preset 3D hair template in target-based coordinate system is obtained.Wherein, the target-based coordinate system is the coordinate system where the 3D head model.
When it is implemented, all three-dimensional coordinate points for including can be concentrated to be coordinately transformed 3D hair template point by rotation-scaling-translation sequence.
In the application, due to 3D hair template be based on reference head modelling at, therefore the coordinate system that 3D hair template and reference head model use is identical, therefore three-dimensional coordinate of the preset 3D hair template in target-based coordinate system can be obtained by reference to the first coordinate conversion relation between head model and 3D head model, i.e., concentrate the three-dimensional coordinate for all three-dimensional coordinate points for including to be transformed into 3D hair template coordinate system corresponding three-dimensional coordinate 3D hair template point.
Three-dimensional scalp electroacupuncture device is determined by the second coordinate conversion relation between the transformed 3D hair template of the first coordinate conversion relation and 3D head model.
Specifically, when determining the second coordinate conversion relation, determine the root of hair point Jing Guo the transformed 3D hair template of the first coordinate conversion relation, and the root of hair point Jing Guo the transformed 3D hair template of the first coordinate conversion relation is matched with the scalp layer key point of the 3D head model, obtain root of hair matching double points.
Wherein, 3D hair template can be divided into two kinds of models, and one is hair models, be referred to as line model;Another kind is non-hair model, is referred to as body Model.Hair model refer to 3D hair template be in the form of more hairs existing for, every hair is made of multiple points.There is a root of hair point for every hair of hair model.Non- hair model refer to 3D hair template be by way of multiple hair zones existing for, i.e., 3D hair template can be divided into multiple hair zones, it is believed that be located at a hair Every hair shape similarity in region is higher.Point that the scalp layer of 3D hair template and 3D head model collides can be determined by collision detection algorithm as root of hair point for non-hair model, several root of hair points of 3D hair template are referred to shown in Fig. 3.
When specific implementation, when being matched to obtain root of hair matching double points with the scalp layer key point of the 3D head model to the root of hair point in the 3D hair template, the root of hair point in the 3D hair template can be matched to obtain root of hair matching double points with the scalp layer key point of the 3D head model by nearest neighbor point algorithm.Nearest neighbor point algorithm can be any algorithm of existing offer, and details are not described herein by the application.
Three-dimensional scalp electroacupuncture device determines the second coordinate conversion relation between the 3D head model and the 3D hair template according to the root of hair matching double points.
When it is implemented, calculating the second coordinate conversion relation s.R.t between 3D head model and 3D hair template using the root of hair matching double points.Circular is identical as the mode of above-mentioned the first coordinate conversion relation of calculating, and details are not described herein by the application.
Three-dimensional scalp electroacupuncture device is registrated according to second coordinate conversion relation, by the 3D hair template with the 3D head model.
It, may there are zone errors in 3D Hair model after registration after being registrated the 3D hair template with the 3D head model above by the second coordinate conversion relation due to the difference between 3D head model and reference head model.State the region of the non-scalp layer of 3D head model in the root of hair regional occlusion residence that zone errors include the region for not sheltering from the scalp layer of the 3D head model in the 3D hair template completely or root of hair point in the 3D hair template is constituted.Therefore, when the non-scalp layer of 3D head model is stated in the root of hair regional occlusion residence for determining that the root of hair point in the scalp layer or the 3D hair template that the 3D hair template does not shelter from the 3D head model completely is constituted, deformation is carried out to the hair in the zone errors of the 3D hair template using radial basis function RBF, until the root of hair region that the root of hair point in the scalp layer and the 3D hair template that deformed 3D hair template shelters from the 3D head model completely is constituted does not shelter from the non-scalp layer of the 3D head model.
When determining above-mentioned zone errors, can with but be not limited only to be accomplished in that
Using light projecting algorithm from the geometric center point of 3D head model to constituting each three-dimensional coordinate point divergent-ray of 3D hair template, if investing the ray in some region before encountering 3D head model first Encounter 3D hair template area, then the hair in the region has wrong hiding relation in 3D hair template.
It, can be for the deformation of the every hair progress in the zone errors of the 3D hair template on the whole or by the whole deformation to part or the deformation of part when carrying out deformation to the 3D hair template using radial basis function RBF.
For by it is whole to local deformation, in the specific implementation, performed the following operations respectively for every hair.It is illustrated by taking hair A as an example in the application, other hairs can be implemented in a manner of for hair A.
Whole deformation includes:
1), select at least three three-dimensional coordinate point in hair A as key point, it is illustrated for 3 in the application, such as 3 three-dimensional coordinate points a1, a5, a9 in hair A shown in Fig. 4, a1 is hair tip point, a9 is root of hair point, and a5 is then any one other three-dimensional coordinate point.By nearest neighbor point algorithm determine each key point 3D head model scalp layer nearest neighbor point as each key point match point and the corresponding match point of each key point is constituted into hair matching double points;Wherein the corresponding match point in 3D head model scalp layer of key point a1 is b1, and the corresponding match point in 3D head model scalp layer of key point a5 is b5, and the corresponding match point in 3D head model scalp layer of key point a9 is b9.In Fig. 4, a1~a9 is matched to the part of 3D head model scalp layer in B expression hair A.Use hair matching double points to input parameter as radial basis function, deformation is carried out to the hair A.
Local deformation includes:
It 2) is, at least two parts by hair A points.For being divided to hair A for two parts, as shown in figure 4, being divided to hair A for two parts A1 and A2.Select at least three three-dimensional coordinate point for key point in each part, 3 in A1 key point a1, a3, a5,3 key points in A2 are a5, a7 and a9.Then nearest neighbor point algorithm is used to determine that the nearest neighbor point of each key point at least three key point in each part constitutes segmentation hair matching double points as match point, and by each key point and its corresponding match point in the three-dimensional coordinate point of the scalp layer of the 3D head model.The corresponding match point of a1, a3, a5 is b1, b3, b5, and the corresponding match point of a5, a7, a9 is b5, b7, b9.Then deformation is carried out to A1 part of the input parameter as radial basis function to hair A using the two stage cultivation point that a1, a3, a5 and b1, b3, b5 are constituted.Then with a5, a7, a9 and b5, b7, b9 structure At two stage cultivation point deformation is carried out to the part the A2 of hair A to the input parameter as radial basis function, as shown in Figure 5.For convenience, a1 is indicated with number 1 in Fig. 5, number 2 indicates a2, and number 3 indicates a3, and so on.
It is whole to include: to local deformation
It 3) is then at least two parts by the hair A after deformation points, to each part by 2) carrying out local deformation after by 1) carrying out whole deformation to hair A.
Radial basis function involved in the application is the function pre-defined, the preferable function of effect that can specifically obtain by a large number of experiments.Radial basis function used herein can be
It is performed both by for every hair and is deformed with the mode of texturing for hair A, then 3D hair template is updated, determines whether updated 3D hair template shelters from the non-scalp layer whether the root of hair region that the root of hair point in the scalp layer and the 3D hair template of the 3D head model is constituted shelters from the 3D head model completely.In the non-scalp layer for determining that the root of hair region that the root of hair point in the scalp layer or the 3D hair template that updated 3D hair template does not shelter from the 3D head model completely is constituted has partial occlusion residence to state 3D head model, repeat to execute every hair in the zone errors in 3D hair template it is above-mentioned 1) or 2) or 3) in operation, until the root of hair region that the root of hair point in the scalp layer and the 3D hair template that updated 3D hair template shelters from the 3D head model completely is constituted does not shelter from the non-scalp layer of the 3D head model.
The application can quickly be that the 3D head model in the relatively low terminal of storage capacity, computing capability constructs the 3D Hair model with intact fitting effect, the sense of reality of the 3D Hair model constructed can match in excellence or beauty in the Hair model generated using forming hair modeling method, but eliminate a large amount of man-machine interactively and operation time;Compared with existing Hair model reuse technology, without being limited to the testing result of 2D key point, being also not limited to 2D key point and facing the normal part of hair image and the matching precision of individual character part, the modeling without being directed to hair individual character part in the application, the Hair model that the reusability of 3D hair template can be effectively improved, and constructed can more precisely retain the appearance of prototype hair.
Referring to Fig. 6, for a kind of three-dimensional scalp electroacupuncture method flow diagram provided by the present application.
S601 determines between the 3D head model and preset reference head model of hair to be created One coordinate conversion relation, and the second coordinate conversion relation between the determining 3D head model and preset 3D hair template, and be registrated the 3D head model with the 3D hair template based on first coordinate conversion relation and the second coordinate conversion relation.Above-mentioned S601 is properly termed as Rigid Registration process.
Wherein, the preset 3D hair template and the preset reference head model match.
S602, the 3D hair template after detecting registration carry out deformation to the hair in the zone errors of the 3D hair template using radial basis function RBF, to correct the zone errors there are when zone errors.
Wherein, the region of the non-scalp layer of 3D head model is stated in the root of hair regional occlusion residence that the zone errors include the region for not sheltering from the scalp layer of the 3D head model in the 3D hair template completely or root of hair point in the 3D hair template is constituted.
Optionally, Rigid Registration process can be realized in the following way, as shown in Figure 7.
S701 determines the facial key point and scalp layer key point of the 3D head model of hair to be created, and determines the facial key point of preset reference head model.
S702 matches the facial key point of the 3D head model with the facial key point of the reference head model, obtains facial match point pair.
S703 determines the first coordinate conversion relation between the 3D head model and reference head model according to the facial match point pair.
S704 obtains three-dimensional coordinate of the 3D hair template in target-based coordinate system according to first coordinate conversion relation.
Wherein, the target-based coordinate system is the coordinate system where the 3D head model.
S705 matches the scalp layer key point of root of hair point and the 3D head model Jing Guo the transformed 3D hair template of the first coordinate conversion relation, obtains root of hair matching double points.
S706 determines the second coordinate conversion relation between the 3D head model and the 3D hair template according to the root of hair matching double points.
The 3D hair template is registrated by S707 according to second coordinate conversion relation with the 3D head model.
On the basis of the embodiment of Fig. 6, Fig. 7 description, during Rigid Registration, the first coordinate conversion relation may include rotation relationship, scaling relationship and translation relation.Wherein the first coordinate conversion relation s.R.t includes scaling relationship, rotation relationship and translation relation.Wherein, scaling relationship realizes that rotation relationship is realized by spin matrix R1 by zoom factor s1, and translation relation is realized by translation vector t1.The calculation method of zoom factor s1, spin matrix R1 and translation vector t1 may refer to above-mentioned corresponding description, and details are not described herein by the application.Referring to Fig. 8, for a kind of three-dimensional scalp electroacupuncture method schematic diagram provided by the present application.
It is primarily based on step S701, S702 and obtains the facial match point pair of 3D head model and reference head model.
In S703, according to the first coordinate conversion relation between the facial match point 3D head model described determination and reference head model, it can be accomplished in that
According to rotation relationship, scaling relationship and translation relation between the facial match point 3D head model described determination and reference head model.
Specifically, according to the facial match point to calculating s1, R1 and t1.
In S704, according to first coordinate conversion relation, three-dimensional coordinate of the three-dimensional coordinate point of 3D hair template in the coordinate system where the 3D head model is obtained, can be accomplished in that
It successively rotated, scaled and translation obtains three-dimensional coordinate of the 3D hair template in the coordinate system where the 3D head model using the rotation relationship, scaling relationship and translation relation by the three-dimensional coordinate point to the 3D hair template.The 3D hair template is transformed into the coordinate system of 3D head model.
Similarly, the second coordinate conversion relation may include rotation relationship, scaling relationship and translation relation;Wherein the first coordinate conversion relation s.R.t includes scaling relationship, rotation relationship and translation relation.Wherein, scaling relationship realizes that rotation relationship is realized by spin matrix R2 by zoom factor s2, and translation relation is realized by translation vector t2.
Then the root of hair matching double points of 3D head model and 3D hair template are obtained by S705.In S706, the second coordinate conversion relation between the 3D head model and the 3D hair template is determined according to the root of hair matching double points, can be accomplished in that
Rotation relationship, scaling relationship and translation relation between the 3D head model and the 3D hair template are determined according to the root of hair matching double points.
Specifically, calculating s2, R2 and t2 according to the root of hair matching double points.
In S707, according to second coordinate conversion relation, the 3D hair template is registrated with the 3D head model, can be accomplished in that
It successively rotated, scaled and translation using the rotation relationship, scaling relationship and translation relation by the three-dimensional coordinate point to the 3D hair template, the 3D hair template is registrated with the 3D head model.
Optionally, it is described that deformation is carried out to the hair in the zone errors of the 3D hair template using radial basis function RBF, radial basis function RBF specifically can be used and whole deformation is carried out to the hair in the zone errors of the 3D hair template or by the whole deformation to part or local deformation.
Carrying out whole deformation for each hair includes:
It is executed respectively for each hair in the zone errors of the 3D hair template as follows:
Select at least three three-dimensional coordinate point in each hair as the first key point, and determine that every one first key point constitutes hair matching double points in match point of the nearest neighbor point as every one first key point of the 3D head model scalp layer, and by the corresponding match point of every one first key point by nearest neighbor point algorithm;
Use hair matching double points to input parameter as radial basis function, deformation is carried out to each hair.
Optionally, the root of hair point in first key point including each hair and hair tip point.Other first key points can choose other three-dimensional coordinate points in each hair.It specifically can choose the three-dimensional coordinate point close to root of hair point and hair tip point midpoint.
Include: by the whole deformation to part for each hair progress
A1 is executed as follows respectively for each hair in the zone errors of the 3D hair template:
Select at least three three-dimensional coordinate point in each hair as the second key point, and every one second key point in second key point of at least three is determined in match point of the nearest neighbor point as every one second key point of the 3D head model scalp layer, and by described every 1 by nearest neighbor point algorithm The corresponding match point of two key points constitutes hair matching double points;Use hair matching double points to input parameter as radial basis function, deformation is carried out to each hair;
Each hair after deformation is divided at least two parts, executed respectively for each section hair as follows by A2:
Using at least three three-dimensional coordinate point in each section hair as third key point, and using the nearest neighbor point of each third key point in each section hair as the match point of each third key point in the three-dimensional coordinate point of the scalp layer in the 3D head model, and the corresponding match point of each third key point is constituted into segmentation hair matching double points;Deformation is carried out to each section hair using the segmentation hair matching double points as the input parameter of radial basis function.
Optionally, including the root of hair point and hair tip point in each hair in second key point;
The third key point includes two endpoints of each section hair.
Carrying out local deformation for each hair includes:
It is executed respectively for each hair in the zone errors of the 3D hair template as follows:
Each hair is divided at least two parts, and is executed respectively for each section hair as follows:
Using at least three three-dimensional coordinate point in each section hair as the 4th key point, and using the nearest neighbor point of every one the 4th key point in each section hair as the match point of every one the 4th key point in the three-dimensional coordinate point of the scalp layer in the 3D head model, and the corresponding match point of every one the 4th key point is constituted into segmentation hair matching double points;Deformation is carried out to each section hair using the segmentation hair matching double points as the input parameter of radial basis function.
Optionally, the third key point includes two endpoints of each section hair.
Present invention also provides a kind of three-dimensional scalp electroacupuncture devices, as shown in figure 9, the device includes:
First determination unit 901, the first coordinate conversion relation between 3D head model and preset reference head model for determining hair to be created;
Second determination unit 902, for determining the second coordinate conversion relation between the 3D head model and preset 3D hair template, wherein the preset 3D hair template and the preset reference head model match;
Registration unit 903, for determining that first coordinate transform is closed based on first determination unit 901 Second coordinate conversion relation that system and second determination unit 902 determine, the 3D head model is registrated with the 3D hair template;
Detection unit 904, for detecting the 3D hair template after being registrated with the presence or absence of zone errors;
Deformation unit 905, for when the detection unit 904 detects zone errors, detect that the hair in the zone errors of the 3D hair template carries out deformation to the detection unit 904 using radial basis function RBF, to correct the zone errors, wherein, the region of the non-scalp layer of 3D head model is stated in the root of hair regional occlusion residence that the zone errors include the region for not sheltering from the scalp layer of the 3D head model in the 3D hair template completely or root of hair point in the 3D hair template is constituted.
The application can quickly be that the 3D head model in the relatively low terminal of storage capacity, computing capability constructs the 3D Hair model with intact fitting effect, the sense of reality of the 3D Hair model constructed can match in excellence or beauty in the Hair model generated using forming hair modeling method, but eliminate a large amount of man-machine interactively and operation time;Compared with existing Hair model reuse technology, without being limited to the testing result of 2D key point, being also not limited to 2D key point and facing the normal part of hair image and the matching precision of individual character part, the modeling without being directed to hair individual character part in the application, the Hair model that the reusability of 3D hair template can be effectively improved, and constructed can more precisely retain the appearance of prototype hair.
Optionally, first determination unit 901, is specifically used for:
Determine the facial key point and scalp layer key point of the 3D head model of hair to be created;Determine the facial key point of preset reference head model;The facial key point of the 3D head model is matched with the facial key point of the reference head model, obtains facial match point pair;According to the facial match point pair, the first coordinate conversion relation between the 3D head model and the reference head model is determined;
The registration unit 903, for obtaining three-dimensional coordinate of the 3D hair template in target-based coordinate system according to first coordinate conversion relation, wherein the target-based coordinate system is the coordinate system where the 3D head model;
Second determination unit 902, is specifically used for: matching to the scalp layer key point of root of hair point and the 3D head model Jing Guo the transformed 3D hair template of the first coordinate conversion relation, obtains root of hair matching double points;According to the root of hair matching double points, the second coordinate conversion relation between the 3D head model and the 3D hair template is determined;
The registration unit 903, for according to second coordinate conversion relation, the 3D hair template to be registrated with the 3D head model.
In one possible implementation, the deformation unit 905, is specifically used for:
It is executed respectively for each hair in the zone errors of the 3D hair template as follows:
Select at least three three-dimensional coordinate point in each hair as the first key point, and determine that every one first key point constitutes hair matching double points in match point of the nearest neighbor point as every one first key point of the 3D head model scalp layer, and by the corresponding match point of every one first key point by nearest neighbor point algorithm;
Using hair matching double points as the input parameter of radial basis function, deformation is carried out to each hair.
It optionally, include the root of hair point and hair tip point of each hair in first key point.
In one possible implementation, the deformation unit 905, is specifically used for:
It is executed respectively for each hair in the zone errors of the 3D hair template as follows:
Select at least three three-dimensional coordinate point in each hair as the second key point, and determine that the corresponding match point of every one second key point in match point of the nearest neighbor point as every one second key point of the 3D head model scalp layer, and is constituted hair matching double points by every one second key point in second key point of at least three by nearest neighbor point algorithm;
Use hair matching double points to input parameter as radial basis function, deformation is carried out to each hair;Each hair after deformation is divided at least two parts, it is executed respectively for each section hair as follows: using at least three three-dimensional coordinate point in each section hair as third key point, and using the nearest neighbor point of each third key point in each section hair as the match point of each third key point in the three-dimensional coordinate point of the scalp layer in the 3D head model, and the corresponding match point of each third key point is constituted into segmentation hair matching double points;Deformation is carried out to each section hair using the segmentation hair matching double points as the input parameter of radial basis function.
It optionally, may include root of hair point in each hair and hair tip point in second key point;It include two endpoints of each section hair in the third key point.
In one possible implementation, the deformation unit 905, is specifically used for:
It is executed respectively for each hair in the zone errors of the 3D hair template as follows: each hair is divided at least two parts, and executed respectively for each section hair as follows:
Using at least three three-dimensional coordinate point in each section hair as the 4th key point, and using the nearest neighbor point of every one the 4th key point in each section hair as the match point of every one the 4th key point in the three-dimensional coordinate point of the scalp layer in the 3D head model, and the corresponding match point of every one the 4th key point is constituted into segmentation hair matching double points;Deformation is carried out to each section hair using the segmentation hair matching double points as the input parameter of radial basis function.
Optionally, the third key point may include two endpoints of each section hair.
It is schematical to the division of unit in the application, only a kind of logical function partition, there may be another division manner in actual implementation, in addition, each functional unit in each embodiment of the application can integrate in a processor, it is also possible to physically exist alone, can also be integrated in one unit with two or more units.Above-mentioned integrated unit both can take the form of hardware realization, can also be realized in the form of software function module.
Wherein, when integrated unit both can take the form of hardware realization, above-mentioned first determination unit 901, the second determination unit 902, registration unit 903, detection unit 904 and the correspondence of deformation unit 905 can be processor 1001 in the entity hardware of three-dimensional scalp electroacupuncture device, as shown in Figure 10.It can also include memory 1002, the program code executed for storage processor 1001 in three-dimensional scalp electroacupuncture device.
Memory 1002 can be volatile memory (English: volatile memory), such as random access memory (English: random-access memory, abbreviation: RAM);Memory is also possible to nonvolatile memory (English: non-volatile memory), such as read-only memory (English: read-only memory, abbreviation: ROM), flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state hard disk (English: solid-state drive, abbreviation: SSD), or memory can be used for carry or store have instruction or data structure form desired program code and can be by any other medium of computer access, but not limited to this.Memory can be the combination of above-mentioned memory.
It can also include communication interface 1003 in three-dimensional scalp electroacupuncture device, it is described preset for configuring the 3D head model, preset reference head model and preset 3D hair template of hair to be created Reference head model and preset 3D hair template match.Wherein it is stored in memory 1002 after the completion of configuration.
It can also include display 1004 in three-dimensional scalp electroacupuncture device, due to showing 3D head model, preset reference head model and the preset 3D hair template of hair to be created.
Wherein, processor 1001, memory 1002, communication interface 1003, display 1004 can be connected by bus 1005.Connection type between other components is only to be schematically illustrated, does not regard it as and be limited.The bus can be divided into address bus, data/address bus, control bus etc..Only to be indicated with a thick line in Figure 10, it is not intended that an only bus or a type of bus convenient for indicating.
The processor 1001, the program code stored for executing the memory 1002, specifically performs the following operations:
Determine the first coordinate conversion relation between the 3D head model and preset reference head model of hair to be created, and the second coordinate conversion relation between the determining 3D head model and preset 3D hair template, and be registrated the 3D head model with the 3D hair template based on first coordinate conversion relation and the second coordinate conversion relation.Above-mentioned S601 is properly termed as Rigid Registration process.
Wherein, the preset 3D hair template and the preset reference head model match.
The 3D hair template after detecting registration carries out deformation to the hair in the zone errors of the 3D hair template using radial basis function RBF, to correct the zone errors there are when zone errors.
Wherein, the region of the non-scalp layer of 3D head model is stated in the root of hair regional occlusion residence that the zone errors include the region for not sheltering from the scalp layer of the 3D head model in the 3D hair template completely or root of hair point in the 3D hair template is constituted.
Processor 1001 can be accomplished in that when executing the operation of Rigid Registration process
It determines the facial key point and scalp layer key point of the 3D head model of hair to be created, and determines the facial key point of preset reference head model;The facial key point of the 3D head model is matched with the facial key point of the reference head model, obtains facial match point pair;According to the facial match point pair, the first coordinate conversion relation between the 3D head model and reference head model is determined;According to first coordinate conversion relation, three-dimensional coordinate of the 3D hair template in target-based coordinate system is obtained;Wherein, the target-based coordinate system is the coordinate system where the 3D head model;Become to by the first coordinate The root of hair point of the 3D hair template after changing relation transformation and the scalp layer key point of the 3D head model are matched, and root of hair matching double points are obtained;According to the root of hair matching double points, the second coordinate conversion relation between the 3D head model and the 3D hair template is determined;According to second coordinate conversion relation, the 3D hair template is registrated with the 3D head model.
In the facial key point and scalp layer key point of the 3D head model of above-mentioned determination hair to be created, and when determining the facial key point of preset reference head model, it can be by selecting facial key point and scalp layer key point in the 3D head model that display 1004 is shown, pass through the facial key point and scalp layer key point of user input selection, then processor 1001 determines the facial key point and scalp layer key point of the 3D head model of hair to be created after receiving user's input.When determining the facial key point of preset reference head model, same mode can also be passed through.
Optionally, processor 1001 carries out deformation to the hair in the zone errors of the 3D hair template using radial basis function RBF, and radial basis function RBF specifically can be used and carry out whole deformation to the hair in the zone errors of the 3D hair template or by the whole deformation to part or local deformation.
Carrying out whole deformation for each hair includes:
It is executed respectively for each hair in the zone errors of the 3D hair template as follows:
Select at least three three-dimensional coordinate point in each hair as the first key point, and determine that every one first key point constitutes hair matching double points in match point of the nearest neighbor point as every one first key point of the 3D head model scalp layer, and by the corresponding match point of every one first key point by nearest neighbor point algorithm;
Use hair matching double points to input parameter as radial basis function, deformation is carried out to each hair.
Optionally, the root of hair point in first key point including each hair and hair tip point.Other first key points can choose other three-dimensional coordinate points in each hair.It specifically can choose the three-dimensional coordinate point close to root of hair point and hair tip point midpoint.
Include: by the whole deformation to part for each hair progress
It is executed respectively for each hair in the zone errors of the 3D hair template as follows: selecting at least three three-dimensional coordinate point in each hair as the second key point, and pass through nearest neighbor point algorithm Determine that the corresponding match point of every one second key point in match point of the nearest neighbor point as every one second key point of the 3D head model scalp layer, and is constituted hair matching double points by every one second key point in second key point of at least three;Use hair matching double points to input parameter as radial basis function, deformation is carried out to each hair;
Each hair after deformation is divided at least two parts, it is executed respectively for each section hair as follows: using at least three three-dimensional coordinate point in each section hair as third key point, and using the nearest neighbor point of each third key point in each section hair as the match point of each third key point in the three-dimensional coordinate point of the scalp layer in the 3D head model, and the corresponding match point of each third key point is constituted into segmentation hair matching double points;Deformation is carried out to each section hair using the segmentation hair matching double points as the input parameter of radial basis function.
Optionally, including the root of hair point and hair tip point in each hair in second key point;
The third key point includes two endpoints of each section hair.
Carrying out local deformation for each hair includes:
It is executed respectively for each hair in the zone errors of the 3D hair template as follows: each hair is divided at least two parts, and executed respectively for each section hair as follows: using at least three three-dimensional coordinate point in each section hair as the 4th key point, and using the nearest neighbor point of every one the 4th key point in each section hair as the match point of every one the 4th key point in the three-dimensional coordinate point of the scalp layer in the 3D head model, and the corresponding match point of every one the 4th key point is constituted into segmentation hair matching double points;Deformation is carried out to each section hair using the segmentation hair matching double points as the input parameter of radial basis function.
Optionally, the third key point includes two endpoints of each section hair.
As shown in figure 11, the 3D head model constructed in advance is completed in the application first to match with the rigidity of pre-stored 3D hair template.After completing rigid matching operation, 3D hair template is aligned with the scalp layer of 3D head model, and there may be the hiding relations of mistake for partial region, such as the region that annulus marks in Figure 11.Then 3D Hair model is instructed to carry out by the whole deformation to part using the key point of 3D head model scalp layer.Deformation can eliminate the hiding relation of mistake, obtain that the intact 3D hair template for being bonded effect is presented with 3D head model.
The application can quickly be that the 3D head model in the relatively low terminal of storage capacity, computing capability constructs the 3D Hair model with intact fitting effect, the sense of reality of the 3D Hair model constructed can match in excellence or beauty in the Hair model generated using forming hair modeling method, but eliminate a large amount of man-machine interactively and operation time;Compared with existing Hair model reuse technology, without being limited to the testing result of 2D key point, being also not limited to 2D key point and facing the normal part of hair image and the matching precision of individual character part, the modeling without being directed to hair individual character part in the application, the Hair model that the reusability of 3D hair template can be effectively improved, and constructed can more precisely retain the appearance of prototype hair.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program product.Therefore, the form of complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application.Moreover, the form for the computer program product implemented in the computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) that one or more wherein includes computer usable program code can be used in the application.
The application is that reference is described according to the flowchart and/or the block diagram of the present processes, equipment (system) and computer program product.It should be understood that the combination of process and/or box in each flow and/or block and flowchart and/or the block diagram that can be realized by computer program instructions in flowchart and/or the block diagram.These computer program instructions be can provide to the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to generate a machine, so that generating by the instruction that computer or the processor of other programmable data processing devices execute for realizing the device for the function of specifying in one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, to be able to guide in computer or other programmable data processing devices computer-readable memory operate in a specific manner, so that instruction stored in the computer readable memory generates the manufacture including command device, which realizes the function of specifying in one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that executing series of operation steps on a computer or other programmable device to generate computer implemented processing, so that instruction executed on a computer or other programmable device is provided for realizing in flow chart The step of function of being specified in one process or multiple processes and/or block diagrams one box or multiple boxes.
Although the preferred embodiment of the application has been described, once a person skilled in the art knows basic creative concepts, then additional changes and modifications can be made to these embodiments.So it includes preferred embodiment and all change and modification for falling into the application range that the following claims are intended to be interpreted as.
Obviously, those skilled in the art can carry out various modification and variations without departing from spirit and scope to the application.If then the application is also intended to include these modifications and variations in this way, these modifications and variations of the application belong within the scope of the claim of this application and its equivalent technologies.

Claims (17)

  1. A kind of three-dimensional scalp electroacupuncture method characterized by comprising
    Determine the first coordinate conversion relation between the 3D head model and preset reference head model of hair to be created, and the second coordinate conversion relation between the determining 3D head model and preset 3D hair template, and be registrated the 3D head model with the 3D hair template based on first coordinate conversion relation and the second coordinate conversion relation;Wherein, the preset 3D hair template and the preset reference head model match;
    There are when zone errors for the 3D hair template after detecting registration, deformation is carried out to the hair in the zone errors of the 3D hair template using radial basis function RBF, to correct the zone errors, wherein, the region of the non-scalp layer of 3D head model is stated in the root of hair regional occlusion residence that the zone errors include the region for not sheltering from the scalp layer of the 3D head model in the 3D hair template completely or root of hair point in the 3D hair template is constituted.
  2. The method as described in claim 1, it is characterized in that, determine the first coordinate transformation relation between the 3D head model and preset reference head model of hair to be created, and the second coordinate transformation relation between the determining 3D head model and preset 3D hair template, and the 3D head model is registrated with the 3D hair template based on first coordinate transformation relation and the second coordinate transformation relation, comprising:
    Determine the facial key point and scalp layer key point of the 3D head model of hair to be created;
    Determine the facial key point of preset reference head model;
    The facial key point of the 3D head model is matched with the facial key point of the reference head model, obtains facial match point pair;
    According to the facial match point pair, the first coordinate conversion relation between the 3D head model and the reference head model is determined;
    According to first coordinate conversion relation, three-dimensional coordinate of the 3D hair template in target-based coordinate system is obtained, wherein the target-based coordinate system is the coordinate system where the 3D head model;
    To the root of hair point and the 3D Jing Guo the transformed 3D hair template of the first coordinate conversion relation The scalp layer key point of head model is matched, and root of hair matching double points are obtained;
    According to the root of hair matching double points, the second coordinate conversion relation between the 3D head model and the 3D hair template is determined;
    According to second coordinate conversion relation, the 3D hair template is registrated with the 3D head model.
  3. It is method according to claim 1 or 2, which is characterized in that described that deformation is carried out to the hair in the zone errors of the 3D hair template using radial basis function RBF, comprising:
    It is executed respectively for each hair in the zone errors of the 3D hair template as follows:
    Select at least three three-dimensional coordinate point in each hair as the first key point, and determine that every one first key point constitutes hair matching double points in match point of the nearest neighbor point as every one first key point of the 3D head model scalp layer, and by the corresponding match point of every one first key point by nearest neighbor point algorithm;
    Using hair matching double points as the input parameter of radial basis function, deformation is carried out to each hair.
  4. Method as claimed in claim 3, which is characterized in that include the root of hair point and hair tip point of each hair in first key point.
  5. It is method according to claim 1 or 2, which is characterized in that described that deformation is carried out to the hair in the zone errors of the 3D hair template using radial basis function RBF, comprising:
    It is executed respectively for each hair in the zone errors of the 3D hair template as follows:
    Select at least three three-dimensional coordinate point in each hair as the second key point, and determine that the corresponding match point of every one second key point in match point of the nearest neighbor point as every one second key point of the 3D head model scalp layer, and is constituted hair matching double points by every one second key point in second key point of at least three by nearest neighbor point algorithm;
    Use hair matching double points to input parameter as radial basis function, deformation is carried out to each hair;
    Each hair after deformation is divided at least two parts, is executed respectively for each section hair as follows:
    Using at least three three-dimensional coordinate point in each section hair as third key point, and using the nearest neighbor point of each third key point in each section hair as the match point of each third key point in the three-dimensional coordinate point of the scalp layer in the 3D head model, and the corresponding match point of each third key point is constituted into segmentation hair matching double points;
    Deformation is carried out to each section hair using the segmentation hair matching double points as the input parameter of radial basis function.
  6. Method as claimed in claim 5, which is characterized in that include the root of hair point and hair tip point in each hair in second key point;
    It include two endpoints of each section hair in the third key point.
  7. It is method according to claim 1 or 2, which is characterized in that described that deformation is carried out to the hair in the zone errors of the 3D hair template using radial basis function RBF, comprising:
    It is executed respectively for each hair in the zone errors of the 3D hair template as follows:
    Each hair is divided at least two parts, and is executed respectively for each section hair as follows:
    Using at least three three-dimensional coordinate point in each section hair as the 4th key point, and using the nearest neighbor point of every one the 4th key point in each section hair as the match point of every one the 4th key point in the three-dimensional coordinate point of the scalp layer in the 3D head model, and the corresponding match point of every one the 4th key point is constituted into segmentation hair matching double points;
    Deformation is carried out to each section hair using the segmentation hair matching double points as the input parameter of radial basis function.
  8. The method of claim 7, which is characterized in that the third key point includes two endpoints of each section hair.
  9. A kind of three-dimensional scalp electroacupuncture device characterized by comprising
    First determination unit, the first coordinate conversion relation between 3D head model and preset reference head model for determining hair to be created;
    Second determination unit, for determining the second coordinate conversion relation between the 3D head model and preset 3D hair template, wherein the preset 3D hair template and the preset reference head model match;
    Registration unit, determines first coordinate conversion relation and second coordinate conversion relation for unit based on the determination, and the 3D head model is registrated with the 3D hair template;
    Detection unit, for detecting the 3D hair template after being registrated with the presence or absence of zone errors;
    Deformation unit, for using radial basis function RBF to detect the detection unit, the hair in the zone errors of the 3D hair template carries out deformation, to correct the zone errors, wherein, the region of the non-scalp layer of 3D head model is stated in the root of hair regional occlusion residence that the zone errors include the region for not sheltering from the scalp layer of the 3D head model in the 3D hair template completely or root of hair point in the 3D hair template is constituted.
  10. Device as claimed in claim 9, which is characterized in that first determination unit is specifically used for:
    Determine the facial key point and scalp layer key point of the 3D head model of hair to be created;Determine the facial key point of preset reference head model;The facial key point of the 3D head model is matched with the facial key point of the reference head model, obtains facial match point pair;According to the facial match point pair, the first coordinate conversion relation between the 3D head model and the reference head model is determined;
    The registration unit, for obtaining three-dimensional coordinate of the 3D hair template in target-based coordinate system according to first coordinate conversion relation, wherein the target-based coordinate system is the coordinate system where the 3D head model;
    Second determination unit, is specifically used for: matching to the scalp layer key point of root of hair point and the 3D head model Jing Guo the transformed 3D hair template of the first coordinate conversion relation, obtains root of hair matching double points;According to the root of hair matching double points, the second coordinate conversion relation between the 3D head model and the 3D hair template is determined;
    The registration unit, for according to second coordinate conversion relation, the 3D hair template to be registrated with the 3D head model.
  11. Device as described in claim 9 or 10, which is characterized in that the deformation unit is specifically used for:
    It is executed respectively for each hair in the zone errors of the 3D hair template as follows:
    It selects at least three three-dimensional coordinate point in each hair as the first key point, and passes through Nearest neighbor point algorithm determines that every one first key point constitutes hair matching double points in match point of the nearest neighbor point as every one first key point of the 3D head model scalp layer, and by the corresponding match point of every one first key point;
    Using hair matching double points as the input parameter of radial basis function, deformation is carried out to each hair.
  12. Device as claimed in claim 11, which is characterized in that include the root of hair point and hair tip point of each hair in first key point.
  13. Device as described in claim 9 or 10, which is characterized in that the deformation unit is specifically used for:
    It is executed respectively for each hair in the zone errors of the 3D hair template as follows:
    Select at least three three-dimensional coordinate point in each hair as the second key point, and determine that the corresponding match point of every one second key point in match point of the nearest neighbor point as every one second key point of the 3D head model scalp layer, and is constituted hair matching double points by every one second key point in second key point of at least three by nearest neighbor point algorithm;
    Use hair matching double points to input parameter as radial basis function, deformation is carried out to each hair;
    Each hair after deformation is divided at least two parts, is executed respectively for each section hair as follows:
    Using at least three three-dimensional coordinate point in each section hair as third key point, and using the nearest neighbor point of each third key point in each section hair as the match point of each third key point in the three-dimensional coordinate point of the scalp layer in the 3D head model, and the corresponding match point of each third key point is constituted into segmentation hair matching double points;
    Deformation is carried out to each section hair using the segmentation hair matching double points as the input parameter of radial basis function.
  14. Device as claimed in claim 13, which is characterized in that include the root of hair point and hair tip point in each hair in second key point;
    It include two endpoints of each section hair in the third key point.
  15. Device as described in claim 9 or 10, which is characterized in that the deformation unit is specifically used for:
    It is executed respectively for each hair in the zone errors of the 3D hair template as follows:
    Each hair is divided at least two parts, and is executed respectively for each section hair as follows:
    Using at least three three-dimensional coordinate point in each section hair as the 4th key point, and using the nearest neighbor point of every one the 4th key point in each section hair as the match point of every one the 4th key point in the three-dimensional coordinate point of the scalp layer in the 3D head model, and the corresponding match point of every one the 4th key point is constituted into segmentation hair matching double points;
    Deformation is carried out to each section hair using the segmentation hair matching double points as the input parameter of radial basis function.
  16. Device as claimed in claim 15, which is characterized in that the third key point includes two endpoints of each section hair.
  17. A kind of three-dimensional scalp electroacupuncture device characterized by comprising
    Communication interface, memory and processor;
    The communication interface, for configuring the 3D head model, preset reference head model and preset 3D hair template of hair to be created, the preset reference head model and preset 3D hair template match;
    The memory, the program code executed for storing the processor;
    The processor, for executing the program code of the memory storage, specific perform claim requires 1 to 8 described in any item methods.
CN201680025609.1A 2016-04-28 2016-04-28 Three-dimensional hair modeling method and device Active CN107615337B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/080511 WO2017185301A1 (en) 2016-04-28 2016-04-28 Three-dimensional hair modelling method and device

Publications (2)

Publication Number Publication Date
CN107615337A true CN107615337A (en) 2018-01-19
CN107615337B CN107615337B (en) 2020-08-25

Family

ID=60161663

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201680025609.1A Active CN107615337B (en) 2016-04-28 2016-04-28 Three-dimensional hair modeling method and device

Country Status (2)

Country Link
CN (1) CN107615337B (en)
WO (1) WO2017185301A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109002553A (en) * 2018-08-08 2018-12-14 北京旷视科技有限公司 Construction method, device, electronic equipment and the computer-readable medium of Hair model
CN109408653A (en) * 2018-09-30 2019-03-01 叠境数字科技(上海)有限公司 Human body hair style generation method based on multiple features retrieval and deformation

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112426716A (en) * 2020-11-26 2021-03-02 网易(杭州)网络有限公司 Three-dimensional hair model processing method, device, equipment and storage medium
CN112419487B (en) * 2020-12-02 2023-08-22 网易(杭州)网络有限公司 Three-dimensional hair reconstruction method, device, electronic equipment and storage medium
CN113713387A (en) * 2021-08-27 2021-11-30 网易(杭州)网络有限公司 Virtual curling model rendering method, device, equipment and storage medium
CN114202597B (en) * 2021-12-07 2023-02-03 北京百度网讯科技有限公司 Image processing method and apparatus, device, medium and product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101344373A (en) * 2008-08-14 2009-01-14 中国人民解放军总后勤部军需装备研究所 Standardization processing method based on three-dimensional head and face curved surface modeling
CN102236911A (en) * 2010-03-17 2011-11-09 卡西欧计算机株式会社 3d modeling apparatus and 3d modeling method
CN102419868A (en) * 2010-09-28 2012-04-18 三星电子株式会社 Device and method for modeling 3D (three-dimensional) hair based on 3D hair template
CN103035030A (en) * 2012-12-10 2013-04-10 西北大学 Hair model modeling method
CN103366400A (en) * 2013-07-24 2013-10-23 深圳市华创振新科技发展有限公司 Method for automatically generating three-dimensional head portrait
CN103606186A (en) * 2013-02-02 2014-02-26 浙江大学 Virtual hair style modeling method of images and videos

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9317970B2 (en) * 2010-01-18 2016-04-19 Disney Enterprises, Inc. Coupled reconstruction of hair and skin
CN102800129B (en) * 2012-06-20 2015-09-30 浙江大学 A kind of scalp electroacupuncture based on single image and portrait edit methods
CN103955962B (en) * 2014-04-21 2018-03-09 华为软件技术有限公司 A kind of device and method of virtual human hair's generation
CN105405163B (en) * 2015-12-28 2017-12-15 北京航空航天大学 A kind of static scalp electroacupuncture method true to nature based on multi-direction field

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101344373A (en) * 2008-08-14 2009-01-14 中国人民解放军总后勤部军需装备研究所 Standardization processing method based on three-dimensional head and face curved surface modeling
CN102236911A (en) * 2010-03-17 2011-11-09 卡西欧计算机株式会社 3d modeling apparatus and 3d modeling method
CN102419868A (en) * 2010-09-28 2012-04-18 三星电子株式会社 Device and method for modeling 3D (three-dimensional) hair based on 3D hair template
CN103035030A (en) * 2012-12-10 2013-04-10 西北大学 Hair model modeling method
CN103606186A (en) * 2013-02-02 2014-02-26 浙江大学 Virtual hair style modeling method of images and videos
CN103366400A (en) * 2013-07-24 2013-10-23 深圳市华创振新科技发展有限公司 Method for automatically generating three-dimensional head portrait

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李康 等: "一种快速可重用的三维头发模型重建方法", 《西北大学学报(自然科学版)》 *
李笑岚 等: "重建发型的真实感头部建模", 《计算机辅助设计与图形学学报》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109002553A (en) * 2018-08-08 2018-12-14 北京旷视科技有限公司 Construction method, device, electronic equipment and the computer-readable medium of Hair model
CN109408653A (en) * 2018-09-30 2019-03-01 叠境数字科技(上海)有限公司 Human body hair style generation method based on multiple features retrieval and deformation
US10891511B1 (en) 2018-09-30 2021-01-12 Plex-Vr Digital Technology (Shanghai) Co., Ltd. Human hairstyle generation method based on multi-feature retrieval and deformation
CN109408653B (en) * 2018-09-30 2022-01-28 叠境数字科技(上海)有限公司 Human body hairstyle generation method based on multi-feature retrieval and deformation

Also Published As

Publication number Publication date
WO2017185301A1 (en) 2017-11-02
CN107615337B (en) 2020-08-25

Similar Documents

Publication Publication Date Title
CN107615337A (en) A kind of three-dimensional scalp electroacupuncture method and device
US11055906B2 (en) Method, device and computing device of face image fusion
Zhang et al. Modeling hair from an rgb-d camera
CN108062791A (en) A kind of method and apparatus for rebuilding human face three-dimensional model
CN109285215A (en) A kind of human 3d model method for reconstructing, device and storage medium
CN108463823A (en) A kind of method for reconstructing, device and the terminal of user's Hair model
KR101430122B1 (en) System, method and computer readable recording medium for simulating hair style
CN109801380A (en) A kind of method, apparatus of virtual fitting, storage medium and computer equipment
US9202312B1 (en) Hair simulation method
CN110197462A (en) A kind of facial image beautifies in real time and texture synthesis method
JP2021528719A (en) Virtual avatar generation method and device, and storage medium
US20180144550A1 (en) System and method for rendering complex data in a virtual reality or augmented reality environment
JP2020177620A (en) Method of generating 3d facial model for avatar and related device
JP2019114253A (en) Improved age modeling method
CN103955962A (en) Device and method for virtualizing human hair growth
CN112221145A (en) Game face model generation method and device, storage medium and electronic equipment
Yeh et al. 2.5 D cartoon hair modeling and manipulation
CN109472786A (en) Cerebral hemorrhage image processing method, device, computer equipment and storage medium
Bernard et al. Linear shape deformation models with local support using graph-based structured matrix factorisation
US9607441B2 (en) Morphological attractor for creating custom ancestors in inheritance-based character generation
CN110084219A (en) Interface alternation method and device
CN114219001A (en) Model fusion method and related device
Fondevilla et al. Patterns from photograph: Reverse-engineering developable products
CN109242962A (en) The 3D display method, apparatus and electronic equipment of Lung neoplasm
CN109754467A (en) Three-dimensional face construction method, computer storage medium and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant