A kind of spectrum posture moving method based on deformation pattern
Technical field
The present invention relates to the technical fields of 3D model spectra posture migration, refer in particular to a kind of spectrum posture based on deformation pattern and move
Shifting method.
Background technique
Three-dimensional grid model 3D printing, virtual reality, in terms of be widely used.It is built using traditional-handwork
Mould, scanning device or modeling software are difficult rapidly and accurately to model complicated geometry.And to existing grid mould
Type is edited and is reused, can be to avoid modeling again.It is moved as the mesh modeling technology deformation migration based on sample with posture
It moves and obtains the target gridding with similar posture using the existing posture of the grid of reference but how accurately to describe source grid mould
Type posture, automatic guiding target grid model deformation is also a challenging project.
Characteristics of low-frequency function (the i.e. smaller characteristic value that L é vy passes through Laplce (Laplacian) matrix of exchange grid
Corresponding characteristic function) corresponding coefficient carries out ordinary posture migration between the grid with identical connection relationship.But
Due to the difference of source grid and Laplce's feature base of the grid of reference, its expression of results is caused notable difference occur.Posture is moved
The target gridding model obtained after shifting will appear serious distortion and metaboly, and posture study is not enough.Kovnatsky
Deng the Laplacian Matrix feature base of the different grid model of two connection relationships of optimization, obtain based on Functional Mapping have it is simultaneous
The coupling quasi- reconciliation base of capacitive, then it is different to be attached relationship for the quasi- low frequency coefficient for reconciling base of the coupling of two grids of exchange
, the migration of posture between the grid model that posture is different.Although this method solve due to the different caused shape of feature basis
Twisted phenomena, but posture study is still not enough.Yin etc. proposes the spectrum posture migration algorithm of details holding and multilayer is moved
Move frame.This method is on the basis of reconciliation base posture migration quasi- based on coupling, in conjunction with the subspace based on broad sense centre coordinate
Technology, being acted on behalf of with Cage as geometry reduces solution scale, reduces the freedom degree of deformation, guarantees the stability solved.To understand
Certainly posture learns insufficient problem, and the propositions such as Yin are layered posture migration strategy, and the region insufficient to migration posture is divided
It cuts, will not be that the posture of large scale is converted into the large scale posture of regional area, then carries out spectrum posture migration originally.To obtain
Preferable posture migration effect.But since this method indicates source grid using Cage and HCCI combustion, and HCCI combustion is discontented
The internal locality of foot, therefore posture migration results are affected by Cage.
The present invention provides a kind of spectrum posture moving method based on deformation pattern, is replaced using embedding distortion figure edit methods wide
The sub-space technique of adopted centre coordinate, using deformation pattern as geometry, agency, geodesic distance indicate source grid as weight.Embedding distortion
The geometric detail of grid can be preferably kept, this reduces influence of the geometry agency to migration results to a certain extent, to mention
The quality of high migration results.
Summary of the invention
The purpose of the present invention is to overcome the shortcomings of the existing technology and deficiency, proposes a kind of spectrum posture based on deformation pattern
Moving method simplifies source grid using optimization second order error measure and obtains deformation pattern, recycles embedding distortion figure editing side
Method replaces the sub-space technique of broad sense centre coordinate, and using deformation pattern as geometry, agency, geodesic distance indicate source grid as weight.
Embedding distortion can preferably keep the geometric detail of grid, this reduces geometry agency to the shadow of migration results to a certain extent
It rings, to improve the quality of migration results.
To achieve the above object, a kind of technical solution provided by the present invention are as follows: spectrum posture migration side based on deformation pattern
Method, comprising the following steps:
1) simplify source grid using Mesh simplification algorithm and generate source distortion of the mesh figure;
2) source grid migrated based on the quasi- spectrum posture for reconciling base of coupling using the grid of reference;
3) it is desired to make money or profit according to posture migration results and source distortion of the mesh and is deformed after generating posture migration with optimized energy function
Figure;
4) deformation pattern generated after being migrated according to posture generates target using embedding distortion figure edit methods deformation sources grid
Grid;
5) divided ownership grid posture migrates insufficient region, carries out layering posture migration according to step 2) to step 4),
Until posture migration is abundant.
In step 1), optimization second order error metric algorithm, the i.e. letter of QEM (quadric error metric) algorithm are utilized
Change source grid generates deformation pattern, optimizes total collapse cost of grid each edge in second order error metric algorithm is defined as:
Cost (a, b)=α QQEM(a,b)+βQF(a,b)+γQReg(a,b)+μQAre(a,b)
In formula, a, b are two endpoints on side to be folded respectively, and α, β, γ, μ are respectively scalar weight, QQEMFor the side QEM folding
Iterate valence, QFIt is the offset on adjacent smallest offset degree side after edge contraction to be folded, QRegWhen for folded edge (a, b) → v just
Then property cost, QReg=| Reg (NF(v))-max{Reg(NF(a)),Reg(NF(b)) } |, NF(a)、NF(b)、NFBe (v) vertex a,
B, the adjoining triangle sets of v, Reg (tri)=3-2R (tri), R (tri)=cos (∠ α)+cos (∠ β)+cos (∠ γ),
For the regularity of Δ tri,Wherein S (tri) is the area of triangle tri.
In step 2), source grid migrated based on the quasi- spectrum posture for reconciling base of coupling using the grid of reference, including
Following steps:
2.1) input grid of reference M, the Laplacian Matrix of source grid M ' and its corresponding spectrum and characteristic function, meter are calculated
Calculate the Laplacian Matrix of deformation pattern G;
2.2) grid of reference and the direct feature corresponding points of source grid are chosen, the base between the grid of reference and source grid is calculated
In area approximation s neighborhood point of corresponding points indicator function as the respective function between grid;
2.3) the Laplce's feature base for optimizing grid of reference M and source grid M ' obtains coupling the quasi- base { φ that reconcilesi M}、
{φi M', utilize formulaFind out the posture migration results based on the quasi- reconciliation base of coupling
In formula, αi MAnd αi M'The respectively spectral coefficient of M and M ', k are exchange αi M'Number, | V'| be M ' number of vertices.
In step 3), after carrying out posture migration using the quasi- reconciliation base of coupling, posture migration results is utilized and optimize energy
Flow functionFind out the deformation pattern after posture migrates, point constraint item in formulaProtect Laplce's coordinate itemScale bound termQ is geodesic distance weight matrix,For the deformation pattern solved,For deformation pattern to be solved
Vertex set,ForNumber of vertices,For based on coupling it is quasi- reconcile base carry out posture migration as a result,For rotation
Turn transformation matrix, δi GFor Laplce's coordinate of deformation pattern G,By solution deformation pattern Laplce's coordinate,ForScaled matrix, λ1、λ2For scalar weight.
In step 4), obtained deformation pattern will be solved and generate target using embedding distortion figure edit methods deformation sources grid
Grid, comprising the following steps:
4.1) minimum energy function is utilizedOptimize posture
Migration results obtain the rotational translation matrix of source distortion of the mesh, whereinForNumber of vertices, rotate itemSingle vertex rotates item Rot (Rj)=(c1·c2)2+(c1·c3)2+(c2·c3)2+(c1·c2)2+
(c1·c1-1)2+(c2·c2-1)2+(c3·c3-1)2,c1、c2And c3It is deformation pattern apex spin matrix RjColumn vector, rule
Then change itemN (j) is vertex vjNeighborhood, t be translation
Transformation,For deformation pattern vertex, αjn=1.0, point constraint item For the target gridding of generation
On vertex,For deformation patternVertex, wrot、wreg、wconFor scalar weight;
4.2) formula is utilized after obtaining rotational translation matrix
Calculate target griddingVertex setWherein wj(vl') it is geodesic distance weight,For spin matrix,It is flat
Move matrix, vl' be source grid vertex, gj(vi') be and source grid vertex vi' on m nearest deformation pattern G of geodesic distance
Vertex set,For the vertex on required final goal grid.
In step 5), the segmentation grid of reference, the target gridding of generation and its deformation pattern posture migrate insufficient region, root
Layering posture migration is carried out according to step 2) to step 4), until posture migration is abundant, is included the following steps:
5.1) choose posture learn insufficient Local grid, by corresponding grid of reference M, generation target gridding M ',
Deformation patternIt is split, obtains corresponding local subnet lattice S, S ' and Gs;
5.2) local deformation figure G is found out using step 2) to step 3)sDeformation pattern after posture migration
5.3) G is calculatedsMean deviation amount of the partitioning boundary vertex position before and after posture migration, is added toPhase
Answer vertex;
5.4) it utilizesVertex information update deformation pattern
5.5) final carriage migration results are obtained using step 4).
Compared with prior art, the present invention have the following advantages that with the utility model has the advantages that
1, the present invention simplifies source grid using optimization second order error measurement (quadric error metric, QEM) algorithm
It generates vertex to be evenly distributed deformation pattern, better effect can be generated in driving source distortion of the mesh.
2, the present invention using embedding distortion edit methods replace broad sense centre coordinate sub-space technique, using deformation pattern as
Geometry agency, geodesic distance weight indicate source grid, effectively improve posture migration and generate target gridding quality.
3, when being layered posture migration, directly translation regional area grid (sub-grid) carries out and integral grid the present invention
Splicing, it is not necessary to carry out towards adjustment.
Detailed description of the invention
Fig. 1 is that posture of the present invention migrates flow chart.
Fig. 2 is that posture of the present invention migrates flow diagram.
Fig. 3 is that the present invention carries out carrying out posture migration results schematic diagram based on the quasi- base that reconciles of coupling.
Fig. 4 is that posture of the present invention migrates deformation result diagram intention.
Specific embodiment
The present invention is further explained in the light of specific embodiments.
As depicted in figs. 1 and 2, the spectrum posture moving method based on deformation pattern provided by the present embodiment, input grid and
Source grid comprising following steps:
1) simplify source grid using optimization second order error measurement (quadric error metric, QEM) algorithm and generate top
The deformation pattern that point is evenly distributed optimizes total collapse cost of grid each edge in second order error metric algorithm is defined as:
Cost (a, b)=α QQEM(a,b)+βQF(a,b)+γQReg(a,b)+μQAre(a,b)
In formula, a, b are two endpoints on side to be folded respectively, and α, β, γ, μ are respectively scalar weight, QQEMFor the side QEM folding
Iterate valence, QFIt is the offset on adjacent smallest offset degree side after edge contraction to be folded, QRegWhen for folded edge (a, b) → v just
Then property cost, QReg=| Reg (NF(v))-max{Reg(NF(a)),Reg(NF(b)) } |, NF(a)、NF(b)、NFBe (v) vertex a,
B, the adjoining triangle sets of v, Reg (tri)=3-2R (tri), R (tri)=cos (∠ α)+cos (∠ β)+cos (∠ γ),
For the regularity of Δ tri,Wherein S (tri) is the area of triangle tri.
2) source grid migrated based on the quasi- spectrum posture for reconciling base of coupling using the grid of reference, comprising the following steps:
2.1) input grid of reference M, the Laplacian Matrix of source grid M ' and its corresponding spectrum and characteristic function, meter are calculated
Calculate the Laplacian Matrix of deformation pattern G;
2.2) grid of reference and the direct feature corresponding points of source grid are chosen, the base between the grid of reference and source grid is calculated
In area approximation s neighborhood point of corresponding points indicator function as the respective function between grid;
2.3) the Laplce's feature base for optimizing grid of reference M and source grid M ' obtains coupling the quasi- base { φ that reconcilesi M}、
{φi M', utilize formulaFind out the posture migration results based on the quasi- reconciliation base of coupling
In formula, αi MAnd αi M'The respectively spectral coefficient of M and M ', k are exchange αi M'Number, | V'| be M ' number of vertices.The base of generation
It is as shown in Figure 3 in the spectrum posture migration results of the quasi- reconciliation base of coupling.
3) after carrying out posture migration using the quasi- reconciliation base of coupling, posture migration results are utilized into optimized energy functionDeformation pattern after finding out posture migration, as shown in figure 4, point constraint item in formulaProtect Laplce's coordinate itemScale bound termQ is geodesic distance weight matrix,For the deformation pattern solved,For deformation pattern to be solved
Vertex set,ForNumber of vertices,For based on coupling it is quasi- reconcile base carry out posture migration as a result,For rotation
Turn transformation matrix, δi GFor Laplce's coordinate of deformation pattern G,By solution deformation pattern Laplce's coordinate,ForScaled matrix, λ1、λ2For scalar weight.
4) obtained deformation pattern will be solved and generates target gridding using embedding distortion figure edit methods deformation sources grid, including
Following steps:
4.1) minimum energy function is utilizedOptimize posture
Migration results obtain the rotational translation matrix of source distortion of the mesh, whereinForNumber of vertices, rotate itemSingle vertex rotates item Rot (Rj)=(c1·c2)2+(c1·c3)2+(c2·c3)2+(c1·c2)2+
(c1·c1-1)2+(c2·c2-1)2+(c3·c3-1)2,c1、c2And c3It is deformation pattern apex spin matrix RjColumn vector, rule
Then change itemN (j) is vertex vjNeighborhood, t be translation
Transformation,For deformation pattern vertex, αjn=1.0, point constraint item For the target gridding of generation
On vertex,For deformation patternVertex, wrot、wreg、wconFor scalar weight;
4.2) formula is utilized after obtaining rotational translation matrix
Calculate target griddingVertex setWherein wj(vl') it is geodesic distance weight,For spin matrix,It is flat
Move matrix, vl' be source grid vertex, gj(vi') be and source grid vertex vi' on m nearest deformation pattern G of geodesic distance
Vertex set,For the vertex on required final goal grid.
The spectrum posture migration low frequency posture migration results based on deformation pattern generated are as shown in the step 2-4 in Fig. 2.
5) divide the grid of reference, the target gridding of generation and its deformation pattern posture and migrate insufficient region, according to step 2)
Layering posture migration is carried out to step 4), until posture migration is abundant, is included the following steps:
5.1) choose posture learn insufficient Local grid, by corresponding grid of reference M, generation target gridding M ',
Deformation patternIt is split, obtains corresponding local subnet lattice S, S ' and Gs;
5.2) local deformation figure G is found out using step 2) to step 3)sDeformation pattern after posture migration
5.3) G is calculatedsMean deviation amount of the partitioning boundary vertex position before and after posture migration, is added toPhase
Answer vertex;
5.4) it utilizesVertex information update deformation pattern
5.5) final carriage migration results are obtained using step 4).
Posture transition process and final result are layered as shown in the step 5 in Fig. 2.
In conclusion the present invention provides new method for three-dimensional model attitude migration after using above scheme, utilize
Embedding distortion figure edit methods indicate there is preferable locality when the grid of source, reduce geometry agent quality to a certain extent
Influence to result;Simple offset splicing is used to sub-grid, it is not necessary to carry out towards adjustment.It effectively improves posture migration and generates mesh
The quality of grid is marked, there is actual promotional value, be worthy to be popularized.
Embodiment described above is only the preferred embodiments of the invention, and but not intended to limit the scope of the present invention, therefore
All shapes according to the present invention change made by principle, should all be included within the scope of protection of the present invention.