Summary of the invention
The purpose of the present invention is to provide a kind of human body dot cloud hole method for repairing and mending based on template, people provided by the invention
The dot cloud hole that body dot cloud hole method for repairing and mending encounters when can carry out three-dimensional modeling to human body is repaired and guarantees that hole is repaired
It mends result and meets body shape priori knowledge, have the advantages that repair perforated transitions smooth and operation efficiency is high.
The technical solution adopted by the present invention are as follows:
A kind of human body dot cloud hole method for repairing and mending based on template, comprising:
(1) human body grid model template is split according to the perforated in original human body point cloud, and to segmentation after
Human body grid model template be marked with the crucial character pair point in original human body point cloud;
(2) the original human body point cloud from original human body data reduction with confidence level expands boundary point set;
(3) by the human body grid model template and original human body point cloud local progress Rigid Registration after segmentation;
(4) the human body grid model template deformation after the Rigid Registration for obtaining step (3) is allowed to and original human body point cloud
Part matches;
(5) vertex in extraction step (4) in deformed human body grid model template constitutes template point cloud, and according to arriving
The method of boundary point set distance threshold removes part Chong Die with original human body point cloud in template point cloud, obtains overlapping template point
Cloud;
(6) go overlapping template point cloud resampling to original human body point cloud density for what step (5) obtained, and smooth blend arrives
Complete cloud of hole has been filled up in original human body dot cloud hole part.
In step (2), the method that the original human body point cloud with confidence level expands boundary point set is extracted are as follows:
(2-1) carries out boundary point differentiation using original point set of the combination distinguishing criterion to human body point cloud: using maximum angle
Amount criterion, semi-disc measurement criterion and shape measurements criterion calculate separately boundary point probability, and weighted sum obtains probability-weighted value,
Probability-weighted value is compared with given threshold value, then thinks that the point is boundary point greater than threshold value, obtains boundary point set
(2-2) is to boundary point setIt is expanded according to distance threshold, and calculates each pixel confidence cp, obtain with confidence
The original human body point cloud of degree expands boundary point set.
In step (2-1), the probability-weighted value are as follows:
P (p)=w1P1(p)+w2P2(p)+w3P3(p)
P1(p)、P2(p) and P3It (p) is quasi- using maximum angular measurement criterion, semi-disc measurement criterion and shape measurements respectively
The boundary point probability then calculated, w1、w2And w3For the corresponding weight of each criterion.
In step (2-1), the basic thought of maximum angular measurement criterion is: if the adjoint point collection N (p) of data point p is in office
Biggish notch is formd between subpoint in portion's tangent plane, then it is assumed that data point p is boundary point;Conversely, if N (p) was at p weeks
It encloses and is uniformly distributed, then it is assumed that p is interior point.
First according to data point p and its adjoint point NpConstruct local tangential plane of the point set curved surface at p;Then by adjoint point collection Np
It projects in tangent plane, obtains subpoint p 'i.Next each subpoint p ' is calculatediThe angle that line between p point is formed
Gather { αi, it is ranked up, maximum angle β=max (α is found outi), boundary point probability value is finally obtained according to the following formula:
In step (2-1), semi-disc measurement criterion is that hole boundary point is judged by the local space structure of point set
's.On two-dimensional manifold, a point p on curved surface is taken, if the point is interior point, neighborhood homeomorphism is in disk, then point p and its neighborhood
Average point μpDeviation should very little;, whereas if the point is boundary point, neighborhood homeomorphism is in semi-disc, then μpIt should be able to be with p
Position have relatively large deviation.
The adjoint point N of data point ppProjection in local tangential plane may be considered on two-dimensional manifold, by number to be determined
The neighboring mean value μ of strong point ppIt is compared with the centroid position of the ideal semi-disc in tangent plane, and with distance between the two
To measure the probability that p point belongs to boundary point.Wherein, using gaussian kernel function
To calculate neighborhood NpWeighted average μp, wherein σ depend on data point p to its adjoint point average distance rp, usually
It takesThus it can calculate
And to μpCalculate its and plane on projectionIt is then available that boundary is belonged to according to semi-disc criterion measurement p
The probability value of point:
In step (2-1), shape measurements criterion is the adjoint point N using data point ppConstruct corresponding covariance matrix Cp,
And boundary point is detected according to three of them characteristic value.For hole boundary point and internal point, association that neighborhood is constituted
Three feature Distribution values of variance matrix are different, so as to differentiate accordingly to boundary point.Its basic step is as follows:
First according to data point p and its adjoint point NpConstruct corresponding covariance matrix
Obtain three of them eigenvalue λ0≥λ1≥λ2>=0, composition decision vector is normalized to characteristic valueWherein α=λ0+λ1+λ2.The then corresponding four kinds of different decision vector distribution characteristics of the type of point p, point
The type of p is boundary point, interior point, angle point/noise spot, the point on straight line, and corresponding decision vector is respectively Λ4=(1,0,0).
Four kinds of distribution characteristics points of Λ can just form the triangle T comprising all probable values of ΛΛ, can pass through
Calculating space kernel function belongs to certain type of probability to data point and estimates near characteristic point.Use Gaussian kernel gσ,
Variance isBy normalization, it can be deduced that data point belongs to the general of boundary point
Rate value:
In step (2-2), expands and calculate each pixel confidence cpMethod are as follows:
A distance threshold τ is provided in advanced, and confidence interval [cL,cU], in the distance d≤τ for arriving holedRange
Interior, closer to hole boundary point, confidence level is lower, and boundary pixel confidence is set as cL;Further away from the point of hole, confidence level
It is higher;Distance is more than τdPoint, confidence level is set as maximum cU;Define point set any pointDistance to hole is should
Point arrives boundary point setThe minimum value of the distance of middle all the points, i.e.,
Then expand boundary point setAre as follows:
And on point set any point p confidence level cpMeet about dpFunctional relation,
cp=C (dp)=min (f (dp)(cU-cL)+cL,cU)
The valuation functions f (d) of distance to confidence level is that codomain is [0,1] monotonically increasing function,
By seeking original point setAll the points confidence level, available boundary point set?On with τdFor maximum
The expansion point set of distanceAnd have
In step (4), the mode of calculation template deformation is that iteration carries out corresponding points lookup and minimizes with minor function:
Iteration is restrained until T, i.e., iterates to calculate out twice | | T(k+1)-T(k)| | < ε, ε are the error threshold pre-set
Value.
Wherein, α, β, γ are pre-set parameter, V=[v1,…,vn]TThe square constituted for apex coordinates all in template
Battle array, U=[u1,…,un]TFor the matrix that the corresponding points coordinate that vertex in V is searched in cloud is constituted, W=diag
(w1,…,wn) be template to point cloud each group of corresponding points weighted value, Metzler matrix indicates the adjacent pass in template between vertex
System, for connection vertex to (vi,vj) side r, M r row nonzero term be Mri=-1, Mrj=1,For Kronecker product, I4
For 4 × 4 unit matrixs, VLWith ULRespectively the row of correspondence markings point in V is taken out, and the row of the corresponding points in U is taken out,
The matrix of composition.
Deform the principle of fitting are as follows: for each vertex v in templateiThere is corresponding 3 × 4 affine transformation square respectively
Battle array Ti, each affine transformation matrix includes 12 freedom degrees.Target is to find one group of affine transformation, can be by body templates song
FaceIn all the points be moved to deformed curved surfaceOn, so thatThe reference surface defined with human body point cloudSufficiently connect
Closely.
Enable T=[T1,…,Tn]TFor the affine transformation matrix T of vertex correspondence each in templateiThe matrix of the 4n connected into × 3,
The mode for calculating T is that iterative search deforms rear pattern plate vertex TiviCorresponding points u on to cloudi, and minimize above-mentioned energy letter
Number.
When minimizing energy function, it is noted that A is sequency spectrum, and Hessian matrix is nonsingular, therefore this is
One well-posed problem.By making the derivative of E (T) equal to 0, available system of linear equations, and E (T) is solved in T=(ATA)- 1ATB obtains minimum value.
In step (4), when being iterated optimization, to weighted value wiFollowing strategy is taken to be adjusted:
(4-1) is if uiFor the boundary point on original point cloud, then it is assumed that viLack part on corresponding original point cloud, will be right
Answer matched weighted value wiIt is set to 0 (thinking that there is no corresponding points in original point cloud);
(4-2) is if TiviWith uiNormal vector angle it is excessive (be greater than specified threshold), then it is assumed that matching is unreliable, will be right
Answer matched weighted value wiIt is set to 0;
(4-3) for other matchings, use obtained in step (2) on point cloud every pixel confidence after normalization as
Weighted value, i.e.,
Because searching a point T on the deforming template being calculated using closest approach when being iterated optimizationiviTo a cloud
On corresponding points uiMatching result be not necessarily reliably, therefore take strategy it is adjusted.
Deformation fitting is carried out for each perforated by using the local template of segmentation respectively, we can reduce list
The scale of secondary Solve problems.And this method can be eliminated when the template far from perforated is fitted input point cloud pair
The contribution of energy function, so that the convergence rate of local fit is faster, error is smaller.
It further include accelerating convergence by multiresolution method and in optimization process in iterative process in step (4)
Different phase uses different weight parameters to energy term.
Because above-mentioned energy function E (T) has higher locality, convergence rate is slower, is easily trapped into local minimum, right
This can accelerate to restrain by multiresolution method;Simultaneously in the different phase of optimization process, the weight used energy term
Parameter is also different.
Described accelerates convergent method by multiresolution method are as follows: by carrying out differentiate to template mesh model more
Rate auto-adaptive parameter obtains the corresponding relationship in the version and these versions of different resolution between vertex;First at low point
Above-mentioned optimization process is carried out on the down-sampling of resolution template and original point cloud point cloud;Then affine transformation matrix is upsampled to
In high-resolution template, optimized as initial transformation, then to high-resolution template.
The method that the different phase in optimization process uses different weight parameters to energy term are as follows: rigid in iteration
When beginning, α is gradually increased as iteration carries out using lesser α and biggish β, γ, is missed by minimizing closest approach matching
Poor item allow template and human body original point cloud as far as possible close to.
In step (5), deformation is removed using according to the method for the expansion boundary point set distance threshold obtained to step (2)
The part Chong Die with human body point cloud on human body network model template afterwards.
The method of the removing template point cloud part Chong Die with original human body point cloud are as follows: for the point v on template point cloudi, make
It is searched to obtain its corresponding points u on original human body point cloud with closest approachiIf dist (vi,ui) < τmAndThen will
It is rejected;Wherein τmIt is a specified distance threshold,τdIt is
Specified expansion radius.
Using boundary expansion algorithm identical with step (2),For original point cloudBoundary point composition set, use
Radius τdBoundary is expanded, the expansion boundary point set with certain " thickness " is obtainedWherein τdIt is specified expansion radius.
The distance threshold τmSelection be sufficiently large, enable and correspond to the part of non-perforated well in template
It is removed, and because without rejecting against expansion boundary point setPart, point cloud by rejecting and original point cloud exist
Hole boundary has a degree of coincidence.
In step (6), the method for the complete cloud for having been filled up hole are as follows:
The expansion boundary point set that (6-1) obtains step (2)Chong Die template point cloud is gone to make with what step (5) obtained
For input, is handled using MLS smoothing algorithm, obtain merging point cloud;
(6-2) and by merging point cloud resampling, keeps the averag density of merging point cloud consistent with original point cloud, obtain a cloud
(6-3) will put cloud againBoundary point set is expanded with eliminatingOriginal point cloudMerge, has been filled up hole
Complete cloud:
In the present invention, original human body point cloud is also known as original point cloud or human body point cloud.
Compared with prior art, the beneficial effects of the present invention are embodied in following aspect:
(1) present invention is by combining expansion weighting boundary point set and being filled out using the method for template deformation to perforated
It fills, using the prior information of template, can handle the hole of complicated shape, and smooth in hole border transition, it can be preferably
Real human body is described in the shape in the region.
(2) by being split to manikin, by perforated piecemeal handle, and use multiresolution method with
Interim parameter, accelerates the convergence rate of deformation algorithm, and reduces the matched error of deformation.
Specific embodiment
Method provided by the invention is further illustrated with reference to the accompanying drawings and embodiments.
As shown in Figure 1, the implementation steps of the human body dot cloud hole method for repairing and mending provided in this embodiment based on template are as follows:
Step (1): human body grid model template is split according to the perforated in cloud, and to template and human body
Some crucial character pair points in point cloud are marked.
In the present embodiment, the typical hole in the human body point cloud human body three-dimensional reconstructing system based on passive vision obtained
Hole region is divided, such as: under the crown, oxter, hand, hip, sole.And 7-12 group is marked in each cut zone
Character pair point.
Step (2): the human body point cloud with confidence level is extracted from original human body point cloud and expands boundary point set.
(2-1) carries out boundary point differentiation using original point set of the combination distinguishing criterion to human body point cloud: using maximum angle
Amount criterion, semi-disc measurement criterion and shape measurements criterion calculate separately boundary point probability, and weighted sum obtains probability-weighted value,
Probability-weighted value is compared with given threshold value, then thinks that the point is boundary point greater than threshold value, obtains boundary point set
For the every bit in human body point cloud, using calculating maximum angular measurement criterion, semi-disc measurement criterion and shape degree
Amount criterion calculates separately the probability P that the point is boundary point1(p)、P2(p)、P3(p), weighted sum:
P (p)=w1P1(p)+w2P2(p)+w3P3(p)
And be compared probability-weighted value with given threshold value, then think that the point is boundary point greater than threshold value.It chooses herein
Weight is w1=w2=w3=1/3, threshold value 0.9.
(2-2) is to boundary point setIt is expanded according to distance threshold, and calculates each pixel confidence cp, obtain with confidence
The human body point cloud of degree expands boundary point set.
When calculating the expansion boundary point set for having confidence level, according to the equalization point spacing selected distance threshold value of cloud, this reality
Apply τ in exampled=12, confidence interval is set as [0,1];Define point set any pointDistance to hole is the point to boundary
Point setThe minimum value of the distance of middle all the points, i.e.,
Then expand boundary point setAre as follows:
And on point set any point p confidence level cpMeet about dpFunctional relation,
Step (3): by the human body grid model template and original human body point cloud local progress Rigid Registration after segmentation.
The template after segmentation first specially is calculated to human body point cloud local using the corresponding points marked in step (1)
Thick rigid transformation matrix reuses ICP algorithm and is iterated optimization, obtain more accurate Rigid Registration as initial value.
Step (4): the human body grid model template deformation after the Rigid Registration that step (3) is obtained is allowed to and primitive man
Body point cloud local matches.
The mode of calculation template deformation is that iterative search deforms rear pattern plate vertex TiviCorresponding points u on to cloudi, and most
Smallization is with minor function:
Wherein, T=[T1,…,Tn]TFor the affine transformation matrix T of vertex correspondence each in templateiThe square of the 4n connected into × 3
Battle array, α, β, γ are pre-set parameter, V=[v1,…,vn]TFor the matrix that apex coordinates all in template are constituted, U=
[u1,…,un]TFor the matrix that the corresponding points coordinate that vertex in V is searched in cloud is constituted, W=diag (w1,…,wn) be
Template is to the weighted value for each group of corresponding points for putting cloud, and Metzler matrix indicates the syntople in template between vertex, for connection top
Point is to (vi,vj) side r, M r row nonzero term be Mri=-1, Mrj=1,For Kronecker product, I4For 4 × 4 unit squares
Battle array, VLWith ULRespectively the row of correspondence markings point in V is taken out, and the row of the corresponding points in U is taken out, the matrix of composition.
Closest approach lookup is accelerated using kd-tree, and the minimum of energy function passes through iterative calculation T=(ATA)- 1ATB is carried out, and until T convergence, i.e., is iterated to calculate out twice | | T(k+1)-T(k)| | iteration ends when < ε choose ε=10 herein-6。
When being iterated optimization, take following strategy to weighted value wiIt is adjusted:
1. if uiFor the boundary point on original point cloud, by the weighted value w of Corresponding matchingiIt is set to 0;
2. if TiviWith uiNormal vector angle be greater than threshold value, by the weighted value w of Corresponding matchingiIt is set to 0, the present embodiment
In the threshold value position 90 °;
3. for other matchings, use obtained in step (2) on point cloud every pixel confidence as weighted value, i.e. wi=ci。
To accelerate convergence, using multiresolution method: by carrying out multi-resolution adaptive parameter to template mesh model
Change, obtains the corresponding relationship in the version and these versions of different resolution between vertex.First in low resolution template and
Above-mentioned optimization process is carried out on the down-sampling point cloud of original point cloud, affine transformation matrix is then upsampled to high-resolution template
On, it is optimized as initial transformation, then to high-resolution template.In the present embodiment, using the template of Resolutions: face
The primary template of low resolution template and full resolution that the piece number halves.
To accelerate convergence, in the different phase of optimization process, different weight parameters is used to energy term.In the present embodiment
In, the parameter for having used 8 groups of unique steps to change, wherein α is from 0.4 to 1, and β is from 1 to 0.2, and γ is from 1 to 0.
Step (5): the vertex in extraction step (4) in deformed human body grid model template constitutes template point cloud, and
Part Chong Die with original human body point cloud in template point cloud is removed according to the method to boundary point set distance threshold, obtains being overlapped
Template point cloud.
Template point cloud is made of all vertex in deformed template.For the point v on template point cloudi, using being based on
The closest approach of kd-tree is searched to obtain its corresponding points u on original point cloudi.If dist (vi,ui) < τmAnd
Then rejected.Wherein τmIt is preset distance threshold, τ in the present embodimentm=1.5,For the boundary according to step (2)
The expansion boundary point set that Extension algorithm obtains.
Step (6): go overlapping template point cloud resampling to original human body point cloud density for what step (5) obtained, and smooth
It is fused to original human body dot cloud hole part, has been filled up complete cloud of hole.
The expansion boundary point set that step (2) is obtainedThe template point cloud obtained with step (5) is used as input
MLS smoothing algorithm is handled, and obtains merging point cloud, and by its resampling, is kept its equalization point spacing consistent with original point cloud, is obtained
To a cloudFinally, by its with eliminate expansion boundary point setOriginal point cloudMerge, has been filled up the complete of hole
Integral point cloud:
The foregoing is merely the preferred embodiment of the present invention, protection scope of the present invention is not limited in above-mentioned embodiment party
Formula, all technical solutions for belonging to the principle of the invention all belong to the scope of protection of the present invention.For those skilled in the art and
Speech, several improvements and modifications carried out without departing from the principles of the present invention, these improvements and modifications also should be regarded as this
The protection scope of invention.