CN102609988B - Method for extracting fluid surface based on anisotropic screen-space smoothed particle hydrodynamics - Google Patents

Method for extracting fluid surface based on anisotropic screen-space smoothed particle hydrodynamics Download PDF

Info

Publication number
CN102609988B
CN102609988B CN201210015007.1A CN201210015007A CN102609988B CN 102609988 B CN102609988 B CN 102609988B CN 201210015007 A CN201210015007 A CN 201210015007A CN 102609988 B CN102609988 B CN 102609988B
Authority
CN
China
Prior art keywords
particle
rightarrow
sigma
matrix
epsiv
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.)
Expired - Fee Related
Application number
CN201210015007.1A
Other languages
Chinese (zh)
Other versions
CN102609988A (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.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
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 Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CN201210015007.1A priority Critical patent/CN102609988B/en
Publication of CN102609988A publication Critical patent/CN102609988A/en
Application granted granted Critical
Publication of CN102609988B publication Critical patent/CN102609988B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)

Abstract

The invention discloses a method for extracting a fluid surface based on anisotropic screen-space smoothed particle hydrodynamics. The method comprises the following steps of: 1) using an improved Laplace smoothing method to carry out smoothing process on a fluid particle coordinate; 2) using a weighted principal component analysis method to analyze particles and the field thereof, and obtaining an anisotropic transformation matrix G; 3) drawing an ellipsoid representing the particles, applying the transformation matrix G in the drawing process, recording the view space depth of pixels, and obtaining a depth image D; 4) using a bilateral Gaussian filtering method for the depth map D to obtain a smoothed depth image D'; 5) calculating the view space coordinate corresponding to each pixel of the D'; 6) and calculating the normal of each pixel. According to the method, the problem of surface extraction in fluid drawing of the screen-space smoothed particle hydrodynamics is solved. Compared with the method of the past screen-space fluid drawing field, the smoother fluid surface can be obtained through the method.

Description

Based on the level and smooth particle flux body dynamics of anisotropic screen space flow surface extracting method
Technical field
The present invention relates to level and smooth particle hydrodynamic flow field of drawing, relate in particular to a kind of based on the level and smooth particle flux body dynamics of anisotropic screen space flow surface extracting method.
Background technology
It is to use Marching Cube in conjunction with ray tracing method that classical level and smooth particle hydrodynamic flow is drawn, can obtain level and smooth and realistic flow surface, but being only suitable for off-line, its too low operational efficiency draws, and be not suitable for real-time rendering field, as virtual reality, game making, real-time animation etc.Screen space fluid rendering technique is the rendering technique rising in recent years, it represents the spheroid of particle by direct drafting, or the depth information of spheroid, then level and smooth mode is obtained flow surface in addition, avoid the excessive surface extraction step of expense in previous methods, there is very high operational efficiency, therefore can be applied to real-time streams volume drawing.But the surface irregularity that the method is extracted, the smoothing method that forefathers propose is all difficult to obtain level and smooth drawing result, and its reason is that the degree of depth itself of isotropic spherome surface or spheroid is exactly rough.
First introduce the level and smooth particle hydrodynamic flow of existing screen space method for drafting below:
1) build the method for flow surface grid model at screen space
First the method replaces fluid particles with spheroid, and the pixel depth of spherome surface is recorded in depth map D, then depth map D is carried out to binomial filtering, the depth map D ' after acquisition is level and smooth, then from D ', build grid model.The method has abandoned too much information as liquid thickness in the time building grid model, is difficult to reach good drawing result, and binomial filtering easily causes fluid boundary diffusion.
2) based on the minimized screen space method for drafting of curvature
First the method replaces fluid particles with spheroid, and the pixel depth of spherome surface is recorded in depth map D, and use the step of iteration, the curvature of depth map D being minimized in iteration each time, depth map D ' after finally obtaining smoothly, then from D ', extract pixel coordinate and normal, draw for fluid.The method can only make transition between adjacent spheroid become smoothly, and can not solve the concave-convex surface problem that spheroid brings of drawing completely.
Above method all can not obtain preferably level and smooth flow surface, and its reason is that the degree of depth itself of isotropic spherome surface or spheroid is exactly rough, and namely raw data problem causes being difficult to simulate correct result.
Invention Inner holds
The object of the invention is to solve the problem that the level and smooth particle hydrodynamic flow of existing screen space method for drafting is difficult to obtain level and smooth flow surface, provide one one kinds based on the level and smooth particle flux body dynamics of anisotropic screen space flow surface extracting method.
Comprise the following steps based on the level and smooth particle flux body dynamics of anisotropic screen space flow surface extracting method:
1) use improved Laplce's smoothing method convection cell Particle World volume coordinate to do smoothing processing;
2) to the each particle i after level and smooth, use the contribution of weighted principal component analyzing methods analyst neighborhood particle to current particle i, obtain the anisotropy transform matrix G of particle i i;
3), to each particle i, draw and represent the ellipsoid of this particle, and in drawing process, apply anisotropy transform matrix G i, record the view space z axial coordinate value of each pixel, obtain depth map D;
4) depth map D is used to bilateral gaussian filtering method, obtain the depth map D ' after level and smooth;
5) the depth map D ' after level and smooth is calculated to view space coordinate corresponding to each pixel;
6) ask the tangent vector of each pixel in x, y direction according to view space coordinate, and ask this pixel normal direction by multiplication cross tangent vector.
Described step 1) be:
(1) to each particle i, obtain its radius r iall spectra particle coordinate in scope;
(2) according to field particle, current particle i is used to Laplace method smoothing method, obtain the new coordinate of particle
Figure BDA0000131931790000021
x i ‾ = ( 1 - λ ) x i + λ Σ j w ij x j / Σ j w ij
W in formula ijbe an isotropy weighting function about particle i and particle j, it is defined as:
w ij = 1 - ( | | x i - x j | | / r i ) 3 if | | x i - x j | | < r i 0 otherwise ;
(3) improvement to Laplace method, makes λ be subject to neighborhood particle number affects, is defined as:
&lambda; = d * &Sigma; j 0 w ij d * &Sigma; j n = 0 w ij < 1 1 d * &Sigma; j w ij &GreaterEqual; 1
This like-particles reposition weight λ change according to neighborhood particle number is different.
Described step 2) be:
(4) to each particle i, obtain its radius r iall spectra particle coordinate in scope;
(5) principal component analysis (PCA) is analyzed neighborhood particle, obtains anisotropy transform matrix G, the steps include:
A) weighted mean of calculating neighborhood particle location point:
x i w = &Sigma; j w ij x j / &Sigma; j w ij
B) the zero-sum covariance matrix C of a weighting of structure:
C i = &Sigma; j w ij ( x j - x i w ) ( x j - x i w ) T / &Sigma; j w ij
Wherein function w ijbe isotropic weighting function, it depends on particle x i, x jwith radius of neighbourhood r i:
w ij = 1 - ( | | x i - x j | | / r i ) 3 if | | x i - x j | | < r i 0 otherwise
C) covariance matrix C use characteristic value is decomposed, obtains following form:
C=R∑R T
∑=diag(σ 1,σ 2,σ 3)
R is the rotation matrix of three characteristic series vector v 1, v2, v3 composition, ∑ is the diagonal matrix that contains eigenwert σ 1 > σ 2 > σ 3, we use σ 1, σ 2, σ 3 to affect respectively the length of the major axis of ellipsoid, inferior major axis and minor axis, distinguish corresponding v1, v2, tri-major axes orientations of v3;
D), for to avoid occurring flat ellipsoid, define each eigenwert:
&sigma; ~ k = max ( &sigma; ~ k , &sigma; 1 / k r )
E) obtain the scaling to spheroid:
&omega; k = C r &sigma; ~ k
F) suddenly change around threshold value for fear of spheroid, will
Figure BDA0000131931790000036
the linear interpolation of the matrix ∑ of the unit's of being set to diagonal matrix and generation:
&Sigma; ~ = diag ( &omega; 1 , &omega; 2 , &omega; 3 ) ifN > N t &lambda;I + ( 1 - &lambda; ) diag ( &omega; 1 , &omega; 2 , &omega; 3 ) if N 0 < N < N t I ifN < N 0
G) obtained like this anisotropy transform matrix G:
G = R &Sigma; ~ R T .
Described step 3) be:
(6) render target is set as to depth texture;
(7) in the time that representing the ellipsoid of this particle, drafting applies anisotropy transform matrix G i, operation below need to carrying out in the vertex coloring program of drawing spheroid:
Vertex position position application matrix conversion to spheroid:
pos=mul(position,G i);
(8) the view space coordinate figure of recording pixel, in the vertex coloring program of drawing spheroid, carry out following steps:
A) the vertex position pos using viewpoint matrixing to spheroid:
view_pos=mul(pos,view_matrix);
Wherein view_matrix is viewpoint change matrix.
B) the z axial coordinate value of output view_pos:
Output=view_pos.z;
Described step 4) be:
(9) depth map is used to bilateral gaussian filtering, its filter function:
I ( x ) = k d - 1 ( x ) &Integral; - &infin; &infin; &Integral; - &infin; &infin; f ( &epsiv; ) c ( &epsiv; , x ) s ( f ( &epsiv; ) , f ( x ) ) d&epsiv;
In formula
k ( x ) = &Integral; - &infin; &infin; &Integral; - &infin; &infin; c ( &epsiv; , x ) s ( f ( &epsiv; ) , f ( x ) ) d&epsiv;
Wherein image space adjacency function c (ε, x) and pixel value similarity function s (f (ε), f (x)) are taken as Gaussian function, are defined as:
c ( &epsiv; , x ) = e - 0.5 ( d ( &epsiv; , x ) &sigma; d ) 2
s ( f ( &epsiv; ) , f ( x ) ) = e - 0.5 ( &delta; ( f ( &epsiv; ) , f ( x ) ) &sigma; &gamma; ) 2
Wherein
d(ε,x)=d(ε-x)=||ε-x||
δ(f(ε),f(x))=δ(f(ε)-f(x))=||f(ε)-f(x)||。
Described step 5) be:
(10) try to achieve in advance in depth map D ' (0,0) coordinate points N at the view space coordinate of the subpoint N ' of hither plane:
N′.x=-d*tan(θ/2)*A
N′.y=d?*tan(θ/2)
N′.z=d
Wherein d be hither plane apart from view distance, θ be view frustums at Y-direction subtended angle, A is screen width high ratio;
(11) ask the view space coordinate of target pixel points P at the subpoint P ' of hither plane:
P′=(N′.x+x s*w,N′.y+y s*h,N′.z)
(12) ask the view space coordinate that target pixel points P is corresponding:
P = P &prime; P , z P &prime; , z .
Described step 6) be:
(13) consider boundary problem, ask each pixel to divide in the left and right sides of x direction deviation according to view space coordinate
Figure BDA0000131931790000054
respectively ask a deviation to divide in the both sides up and down of y direction
Figure BDA0000131931790000055
with
Figure BDA0000131931790000056
ddx &RightArrow; = v ( x + &Delta;x , y ) - v ( x , y )
ddx &prime; &RightArrow; = v ( x , y ) - v ( x - &Delta;x , y )
ddy &RightArrow; = v ( x , y + &Delta;y ) - v ( x , y )
ddy &prime; &RightArrow; = v ( x , y ) - v ( x , y - &Delta;y )
(14) multiplication cross tangent vector is asked this pixel normal direction
Figure BDA0000131931790000064
n &RightArrow; = T ( x ) &RightArrow; &times; T ( y ) &RightArrow; | | T ( x ) &RightArrow; &times; T ( y ) &RightArrow; | |
Wherein
T ( x ) = ddx &RightArrow; if | | ( ddx &prime; &RightArrow; ) . z | | > | | ( ddx &RightArrow; ) . z | | ddx &prime; &RightArrow; if | | ( ddx &prime; &RightArrow; ) . z | | < | | ( ddx &RightArrow; ) . z | |
T ( y ) = ddy &RightArrow; if | | ( ddy &prime; &RightArrow; ) . z | | > | | ( ddy &RightArrow; ) . z | | ddy &prime; &RightArrow; if | | ( ddy &prime; &RightArrow; ) . z | | < | | ( ddy &RightArrow; ) . z | | .
The invention has the advantages that:
The level and smooth particle hydrodynamic flow of traditional screen space method for drafting, its surface extraction is the degree of depth obtaining based on isotropic spheroid, this depth information itself is exactly rough, and therefore other smoothing methods are all difficult to therefrom obtain level and smooth flow surface.
Method of the present invention has proposed to draw based on the degree of depth of anisotropy spheroid, each particle is calculated to anisotropy transform matrix according to the distribution of its neighborhood space particle, to represented that the spheroid of particle applied this conversion in the past, obtain meeting the spheroid that neighborhood particle distributes.The depth map of drawing with this spheroid, fundamentally has and meets the smoothness properties that neighborhood particle distributes.We have fundamentally solved the uneven problem that causes being difficult to extract smooth surface of depth map like this.
The present invention uses weighted principal component analyzing method to obtain anisotropy transform matrix, and provide the method for use characteristic value matching spheroid zoom factor, by a series of regulations to zoom factor, avoid occurring undesirable spheroid again, avoid spheroid around threshold value, to occur sudden change simultaneously.
The present invention proposes a kind of improved Laplce's smoothing method for particle position is carried out to smoothing processing, and the particle position after level and smooth contributes to obtain better anisotropy transform matrix and more level and smooth depth map.
The present invention uses bilateral filtering to do smoothing processing to depth map, and has provided and in the depth map from level and smooth, obtain view space coordinate that pixel is corresponding and the method for normal.
In a word, the present invention has provided the surface extraction method of the level and smooth particle hydrodynamic flow of a kind of screen space, and the method contrast, at present in the surface extraction method of screen space fluid field of drawing, can obtain more level and smooth flow surface.Method of the present invention can parallel processing, is easy to realize in GPU, can obtain real-time operational efficiency.
Accompanying drawing explanation
Fig. 1 is the flow surface PRELIMINARY RESULTS before using Laplce level and smooth;
Fig. 2 is the PRELIMINARY RESULTS after having used Laplce level and smooth;
Fig. 3 is the schematic diagram that anisotropy transform matrix G is applied to spheroid;
Fig. 4 is respectively the contrast of the depth map based on isotropy spheroid (left side) and anisotropy spheroid (right side);
Fig. 5 is the depth map D using before bilateral filtering;
Fig. 6 is the depth map D ' after corresponding use bilateral filtering.
Embodiment
Comprise the following steps based on the level and smooth particle flux body dynamics of anisotropic screen space flow surface extracting method:
1) use improved Laplce's smoothing method convection cell Particle World volume coordinate to do smoothing processing;
2) to the each particle i after level and smooth, use the contribution of weighted principal component analyzing methods analyst neighborhood particle to current particle i, obtain the anisotropy transform matrix G of particle i i;
3), to each particle i, draw and represent the ellipsoid of this particle, and in drawing process, apply anisotropy transform matrix G i, record the view space z axial coordinate value of each pixel, obtain depth map D;
4) depth map D is used to bilateral gaussian filtering method, obtain the depth map D ' after level and smooth;
5) the depth map D ' after level and smooth is calculated to view space coordinate corresponding to each pixel;
6) ask the tangent vector of each pixel in x, y direction according to view space coordinate, and ask this pixel normal direction by multiplication cross tangent vector.
Described step 1) be:
(1) to each particle i, obtain its radius r iall spectra particle coordinate in scope;
(2) according to field particle, current particle i is used to Laplace method smoothing method, obtain the new coordinate of particle
Figure BDA0000131931790000071
x i &OverBar; = ( 1 - &lambda; ) x i + &lambda; &Sigma; j w ij x j / &Sigma; j w ij
W in formula ijbe an isotropy weighting function about particle i and particle j, it is defined as:
w ij = 1 - ( | | x i - x j | | / r i ) 3 if | | x i - x j | | < r i 0 otherwise ;
(3) improvement to Laplace method, makes λ be subject to neighborhood particle number affects, is defined as:
&lambda; = d * &Sigma; j 0 w ij d * &Sigma; j n = 0 w ij < 1 1 d * &Sigma; j w ij &GreaterEqual; 1
This like-particles reposition
Figure BDA0000131931790000084
weight λ change according to neighborhood particle number is different.
Fig. 1 is the flow surface PRELIMINARY RESULTS before using Laplce level and smooth, Fig. 2 is the PRELIMINARY RESULTS after having used Laplce level and smooth, can find out the level and smooth effectively level and smooth particle position of improved Laplce, the concave-convex surface that therefore can avoid particle position problem to cause.It should be noted that, Fig. 1 and Fig. 2 directly draw particle spheroid, and do not draw and smooth operation through anisotropy depth map, in addition in order significantly to demonstrate the level and smooth effect of Laplce, in Fig. 2, used larger d value, and we get d=0.014 to avoid λ value excessive in real work.
Described step 2) be:
(4) to each particle i, obtain its radius r iall spectra particle coordinate in scope;
(5) principal component analysis (PCA) is analyzed neighborhood particle, obtains anisotropy transform matrix G, the steps include:
A) weighted mean of calculating neighborhood particle location point:
x i w = &Sigma; j w ij x j / &Sigma; j w ij
B) the zero-sum covariance matrix C of a weighting of structure:
C i = &Sigma; j w ij ( x j - x i w ) ( x j - x i w ) T / &Sigma; j w ij
Wherein function w ijbe isotropic weighting function, it depends on particle x i, x jwith radius of neighbourhood r i:
w ij = 1 - ( | | x i - x j | | / r i ) 3 if | | x i - x j | | < r i 0 otherwise
C) covariance matrix C use characteristic value is decomposed, obtains following form:
C=R∑R T
∑=diag(σ 1,σ 2,σ 3)
R is the rotation matrix of three characteristic series vector v 1, v2, v3 composition, ∑ is the diagonal matrix that contains eigenwert σ 1 > σ 2 > σ 3, we use σ 1, σ 2, σ 3 to affect respectively the length of the major axis of ellipsoid, inferior major axis and minor axis, distinguish corresponding v1, v2, tri-major axes orientations of v3;
D), for to avoid occurring flat ellipsoid, define each eigenwert:
&sigma; ~ k = max ( &sigma; ~ k , &sigma; 1 / k r )
E) obtain the scaling to spheroid:
&omega; k = C r &sigma; ~ k
F) suddenly change around threshold value for fear of spheroid, will the linear interpolation of the matrix ∑ of the unit's of being set to diagonal matrix and generation:
&Sigma; ~ = diag ( &omega; 1 , &omega; 2 , &omega; 3 ) ifN > N t &lambda;I + ( 1 - &lambda; ) diag ( &omega; 1 , &omega; 2 , &omega; 3 ) if N 0 < N < N t I ifN < N 0
G) obtained like this anisotropy transform matrix G:
G = R &Sigma; ~ R T .
Described step 3) be:
(6) render target is set as to depth texture;
(7) in the time that representing the ellipsoid of this particle, drafting applies anisotropy transform matrix G i, operation below need to carrying out in the vertex coloring program of drawing spheroid:
Vertex position position application matrix conversion to spheroid:
pos=mul(position,G i);
Fig. 3 has provided the schematic diagram that anisotropy transform matrix G is applied to spheroid, this figure is in the time of overall zoom factor c=0.5, directly draw the result that spheroid obtains, notice that this figure is the effect for transformation matrix G is described and the schematic diagram that provides does not represent drawing process or result.As can be seen from Figure 3 each spheroid is different with field particle according to its present position, has different directions and zoom factor.Adjacent spheroid often has similar direction and zoom factor, and therefore our method makes the border of adjacent spheroid be very easy to merge.
(8) the view space coordinate figure of recording pixel, in the vertex coloring program of drawing spheroid, carry out following steps:
A) the vertex position pos using viewpoint matrixing to spheroid:
view_pos=mul(pos,view_matrix);
Wherein view_matrix is viewpoint change matrix.
B) the z axial coordinate value of output view_pos:
Output=view_pos.z;
Fig. 4 has provided the depth map contrast based on isotropy spheroid (left side) and anisotropy spheroid (right side), has provided respectively the flow surface depth map in two kinds of situations.The depth map of drawing based on anisotropic fluid particle has more level and smooth performance in degree of depth continuity, and between adjacent particles, surperficial degrees of fusion is higher.
Described step 4) be:
(9) depth map is used to bilateral gaussian filtering, its filter function:
I ( x ) = k d - 1 ( x ) &Integral; - &infin; &infin; &Integral; - &infin; &infin; f ( &epsiv; ) c ( &epsiv; , x ) s ( f ( &epsiv; ) , f ( x ) ) d&epsiv;
In formula
k ( x ) = &Integral; - &infin; &infin; &Integral; - &infin; &infin; c ( &epsiv; , x ) s ( f ( &epsiv; ) , f ( x ) ) d&epsiv;
Wherein image space adjacency function c (ε, x) and pixel value similarity function s (f (ε), f (x)) are taken as Gaussian function, are defined as:
c ( &epsiv; , x ) = e - 0.5 ( d ( &epsiv; , x ) &sigma; d ) 2
s ( f ( &epsiv; ) , f ( x ) ) = e - 0.5 ( &delta; ( f ( &epsiv; ) , f ( x ) ) &sigma; &gamma; ) 2
Wherein
d(ε,x)=d(ε-x)=||ε-x||
δ(f(ε),f(x))=δ(f(ε)-f(x))=||f(ε)-f(x)||。
Fig. 5 is the depth map D using before bilateral filtering, and Fig. 6 is the depth map D ' after corresponding use bilateral filtering.By depth map being used to bilateral gaussian filtering, successfully in level and smooth flow surface depth map, keep boundary information.
Described step 5) be:
(10) try to achieve in advance in depth map D ' (0,0) coordinate points N at the view space coordinate of the subpoint N ' of hither plane:
N′.x=-d*tan(θ/2)*A
N′.y=d*tan(θ/2)
N′.z=d
Wherein d be hither plane apart from view distance, θ be view frustums at Y-direction subtended angle, A is screen width high ratio;
(11) ask the view space coordinate of target pixel points P at the subpoint P ' of hither plane:
P′=(N′.x+x s*w,N′.y+y s*h,N′.z)
(12) ask the view space coordinate that target pixel points P is corresponding:
P = P &prime; P , z P &prime; , z .
Described step 6) be:
(13) consider boundary problem, ask each pixel to divide in the left and right sides of x direction deviation according to view space coordinate
Figure BDA0000131931790000112
respectively ask a deviation to divide in the both sides up and down of y direction
Figure BDA0000131931790000113
with
Figure BDA0000131931790000114
ddx &RightArrow; = v ( x + &Delta;x , y ) - v ( x , y )
ddx &prime; &RightArrow; = v ( x , y ) - v ( x - &Delta;x , y )
ddy &RightArrow; = v ( x , y + &Delta;y ) - v ( x , y )
ddy &prime; &RightArrow; = v ( x , y ) - v ( x , y - &Delta;y )
(14) multiplication cross tangent vector is asked this pixel normal direction
Figure BDA0000131931790000122
n &RightArrow; = T ( x ) &RightArrow; &times; T ( y ) &RightArrow; | | T ( x ) &RightArrow; &times; T ( y ) &RightArrow; | |
Wherein
T ( x ) = ddx &RightArrow; if | | ( ddx &prime; &RightArrow; ) . z | | > | | ( ddx &RightArrow; ) . z | | ddx &prime; &RightArrow; if | | ( ddx &prime; &RightArrow; ) . z | | < | | ( ddx &RightArrow; ) . z | |
T ( y ) = ddy &RightArrow; if | | ( ddy &prime; &RightArrow; ) . z | | > | | ( ddy &RightArrow; ) . z | | ddy &prime; &RightArrow; if | | ( ddy &prime; &RightArrow; ) . z | | < | | ( ddy &RightArrow; ) . z | | .
By above step, method of the present invention has finally obtained level and smooth flow surface data, its form of expression is a coordinate diagram and a normal map, and each pixel of coordinate diagram records the view space coordinate of this point, and each pixel of normal map records the view space normal direction of this point.Two Zhang Tu have represented the visible flow surface of viewpoint, the coordinate of its each pixel and normal information.Any method for drafting all can be combined with this information and draw out level and smooth flow surface afterwards.
What more than enumerate is only specific embodiments of the invention.Obviously, the invention is not restricted to above embodiment, can also have many distortion.All distortion that those of ordinary skill in the art can directly derive or associate from content disclosed by the invention, all should think protection scope of the present invention.

Claims (5)

1. based on the level and smooth particle flux body dynamics of an anisotropic screen space flow surface extracting method, it is characterized in that comprising the following steps:
1) use improved Laplce's smoothing method convection cell Particle World volume coordinate to do smoothing processing;
2) to the each particle i after level and smooth, use the contribution of weighted principal component analyzing methods analyst neighborhood particle to current particle i, obtain the anisotropy transform matrix G of particle i i;
3), to each particle i, draw and represent the ellipsoid of this particle, and in drawing process, apply anisotropy transform matrix G i, record the view space z axial coordinate value of each pixel, obtain depth map D;
4) depth map D is used to bilateral gaussian filtering method, obtain the depth map D ' after level and smooth;
5) the depth map D ' after level and smooth is calculated to view space coordinate corresponding to each pixel;
6) ask the tangent vector of each pixel in x, y direction according to view space coordinate, and ask this pixel normal direction by multiplication cross tangent vector;
Described step 1) is:
(1) to each particle i, obtain its radius r iall neighborhood particle coordinates in scope;
(2) according to neighborhood particle, current particle i is used to Laplace method smoothing method, obtain the new coordinate of particle
Figure FDA0000491298090000011
x &OverBar; i = ( 1 - &lambda; ) x i + &lambda; &Sigma; j w ij x j / &Sigma; j w ij
W in formula ijbe an isotropy weighting function about particle i and particle j, it is defined as:
w ij = 1 - ( | | x i - x j | / | r i ) 3 if | | x i - x j | | < r i 0 otherwise ;
(3) improvement to Laplace method, makes λ be subject to neighborhood particle number affects, is defined as:
&lambda; = d * &Sigma; j 0 w ij d * &Sigma; j n = 0 w ij < 1 1 d * &Sigma; j j w ij &GreaterEqual; 1
The new coordinate of this like-particles
Figure FDA0000491298090000015
weight λ change according to neighborhood particle number is different;
Described step 2) be:
(4) to each particle i, obtain its radius r iall neighborhood particle coordinates in scope;
(5) principal component analysis (PCA) is analyzed neighborhood particle, obtains anisotropy transform matrix G, the steps include:
A) weighted mean of calculating neighborhood particle location point:
x i w = &Sigma; j w ij x j / &Sigma; j w ij
B) the zero-sum covariance matrix C of a weighting of structure i:
C i = &Sigma; j w ij ( x j - x i w ) ( x j - x i w ) T / &Sigma; j w ij
Wherein function w ijbe isotropic weighting function, it depends on particle x i, x jwith radius of neighbourhood r i:
w ij = 1 - ( | | x i - x j | | / r i ) 3 if | | x i - x j | | < r i 0 otherwise
C) covariance matrix C use characteristic value is decomposed, obtains following form:
C=RΣR T
Σ=diag(σ 1,σ 2,σ 3)
R is the rotation matrix of three characteristic series vector v 1, v2, v3 composition, Σ is the diagonal matrix that contains eigenwert σ 1> σ 2> σ 3, we use σ 1, σ 2, σ 3 to affect respectively the length of the major axis of ellipsoid, inferior major axis and minor axis, distinguish corresponding v1, v2, tri-major axes orientations of v3;
D), for to avoid occurring flat ellipsoid, define each eigenwert:
&sigma; ~ k = max ( &sigma; ~ k , &sigma; 1 / k r )
E) obtain the scaling to spheroid:
&omega; k = C r i &sigma; ~ k
F) suddenly change around threshold value for fear of spheroid, will
Figure FDA0000491298090000031
the linear interpolation of the matrix Σ of the unit's of being set to diagonal matrix and generation:
&Sigma; ~ = diag ( &omega; 1 , &omega; 2 , &omega; 3 ) ifN > N t &lambda;I + ( 1 - &lambda; ) diag ( &omega; 1 , &omega; 2 , &omega; 3 ) if N 0 < N < N t I ifN < N 0
G) obtained like this anisotropy transform matrix G:
Figure FDA0000491298090000033
2. one according to claim 1, based on the level and smooth particle flux body dynamics of anisotropic screen space flow surface extracting method, is characterized in that described step 3) is:
(6) render target is set as to depth texture;
(7) in the time that representing the spheroid of this particle, drafting applies anisotropy transform matrix G i, operation below need to carrying out in the vertex coloring program of drawing spheroid:
Vertex position position application matrix conversion to spheroid:
position=mul(position,G i);
(8) the view space coordinate figure of recording pixel, in the vertex coloring program of drawing spheroid, carry out following steps:
A) the vertex position position using viewpoint matrixing to spheroid:
view_pos=mul(position,view_matrix);
Wherein view_matrix is viewpoint change matrix,
B) the z axial coordinate value of output view_pos:
Output=view_pos.z。
3. one according to claim 1, based on the level and smooth particle flux body dynamics of anisotropic screen space flow surface extracting method, is characterized in that described step 4) is:
(9) depth map is used to bilateral gaussian filtering, its filter function:
I ( x ) = k d - 1 ( x ) &Integral; - &infin; &infin; &Integral; - &infin; &infin; f ( &epsiv; ) c ( &epsiv; , x ) s ( f ( &epsiv; ) , f ( x ) ) d&epsiv;
In formula
k d ( x ) = &Integral; - &infin; &infin; &Integral; - &infin; &infin; c ( &epsiv; , x ) s ( f ( &epsiv; ) , f ( x ) ) d&epsiv;
Wherein image space adjacency function c (ε, x) and pixel value similarity function s (f (ε), f (x)) are taken as Gaussian function, are defined as:
c ( &epsiv; , x ) = e - 0.5 ( d ( &epsiv; , x ) &sigma; d ) 2
s ( f ( &epsiv; ) , f ( x ) ) = e - 0.5 ( &delta; ( f ( &epsiv; ) , f ( x ) ) &sigma; &gamma; ) 2
Wherein
d(ε,x)=d(ε-x)=||ε-x||
δ(f(ε),f(x))=δ(f(ε)-f(x))=||f(ε)-f(x)||。
4. one according to claim 1, based on the level and smooth particle flux body dynamics of anisotropic screen space flow surface extracting method, is characterized in that described step 5) is:
(10) try to achieve in advance in depth map D ' (0,0) coordinate points N at the view space coordinate of the subpoint N ' of hither plane:
N′.x=-d*tan(θ/2)*A
N′.y=d*tan(θ/2)
N′.z=d
Wherein d be hither plane apart from view distance, θ be view frustums at Y-direction subtended angle, A is screen width high ratio;
(11) ask the view space coordinate of target pixel points P at the subpoint P ' of hither plane:
P′=(N′.x+x s*w,N′.y+y s*h,N′.z)
(12) ask the view space coordinate that target pixel points P is corresponding:
P = P &prime; P . z P &prime; . z .
5. one according to claim 1, based on the level and smooth particle flux body dynamics of anisotropic screen space flow surface extracting method, is characterized in that described step 6) is:
(13) consider boundary problem, ask each pixel to divide in the left and right sides of x direction deviation according to view space coordinate
Figure FDA0000491298090000051
respectively ask a deviation to divide to the both sides up and down of y direction
Figure FDA0000491298090000052
with
ddx &RightArrow; = v ( x + &Delta;x , y ) - v ( x , y )
dd x &prime; &RightArrow; = v ( x , y ) - v ( x - &Delta;x , y )
ddy &RightArrow; = v ( x , y + &Delta;y ) - v ( x , y )
dd y &prime; &RightArrow; = = v ( x , y ) - v ( x , y - &Delta;y )
(14) multiplication cross tangent vector is asked this pixel normal direction
Figure FDA0000491298090000058
n &RightArrow; = T ( x ) &RightArrow; &times; T ( y ) &RightArrow; | | T ( x ) &RightArrow; &times; T ( y ) &RightArrow; | |
Wherein
T ( x ) = dd &RightArrow; x if | | ( dd x &prime; &RightArrow; ) . z | | > | | ( ddx &RightArrow; ) . z | | dd x &prime; &RightArrow; if | | ( dd x &prime; &RightArrow; ) . z | | < | | ( ddx &RightArrow; ) . z | |
T ( y ) = dd &RightArrow; y if | | ( dd y &prime; &RightArrow; ) . z | | > | | ( ddy &RightArrow; ) . z | | dd y &prime; &RightArrow; if | | ( dd y &prime; &RightArrow; ) . z | | < | | ( ddy &RightArrow; ) . z | | .
CN201210015007.1A 2012-01-18 2012-01-18 Method for extracting fluid surface based on anisotropic screen-space smoothed particle hydrodynamics Expired - Fee Related CN102609988B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210015007.1A CN102609988B (en) 2012-01-18 2012-01-18 Method for extracting fluid surface based on anisotropic screen-space smoothed particle hydrodynamics

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210015007.1A CN102609988B (en) 2012-01-18 2012-01-18 Method for extracting fluid surface based on anisotropic screen-space smoothed particle hydrodynamics

Publications (2)

Publication Number Publication Date
CN102609988A CN102609988A (en) 2012-07-25
CN102609988B true CN102609988B (en) 2014-07-02

Family

ID=46527329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210015007.1A Expired - Fee Related CN102609988B (en) 2012-01-18 2012-01-18 Method for extracting fluid surface based on anisotropic screen-space smoothed particle hydrodynamics

Country Status (1)

Country Link
CN (1) CN102609988B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102880797A (en) * 2012-09-19 2013-01-16 北京师范大学 Mesoscopic method for processing dryness and wetness boundary problem
CN106201995B (en) * 2016-06-24 2019-10-22 张麟 A kind of image boundary member processing method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101930622A (en) * 2009-09-29 2010-12-29 北京航空航天大学 Realistic modeling and drawing of shallow water wave
CN102262689A (en) * 2010-05-26 2011-11-30 利弗莫尔软件技术公司 Hybrid element enabling finite element/smoothed particle hydrodynamics coupling

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI220234B (en) * 2003-10-21 2004-08-11 Ind Tech Res Inst A method to simulate animated images for an object

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101930622A (en) * 2009-09-29 2010-12-29 北京航空航天大学 Realistic modeling and drawing of shallow water wave
CN102262689A (en) * 2010-05-26 2011-11-30 利弗莫尔软件技术公司 Hybrid element enabling finite element/smoothed particle hydrodynamics coupling

Also Published As

Publication number Publication date
CN102609988A (en) 2012-07-25

Similar Documents

Publication Publication Date Title
CN104392486B (en) One kind point cloud scene reconstruction method
Wang et al. Surface feature based mesh segmentation
CN104376594A (en) Three-dimensional face modeling method and device
CN111368673A (en) Method for quickly extracting human body key points based on neural network
CN104899877A (en) Method for extracting image foreground based on super pixel and fast trimap image
CN104954780A (en) DIBR (depth image-based rendering) virtual image restoration method applicable to high-definition 2D/3D (two-dimensional/three-dimensional) conversion
CN103914863A (en) Method for abstractly drawing color image
US10169908B2 (en) Method, apparatus, storage medium and device for controlled synthesis of inhomogeneous textures
CN102930576A (en) Feature flow-based method for generating abstract line drawing
CN104299263A (en) Method for modeling cloud scene based on single image
CN113689445B (en) High-resolution remote sensing building extraction method combining semantic segmentation and edge detection
CN106709964A (en) Gradient correction and multi-direction texture extraction-based sketch generation method and device
CN116682120A (en) Multilingual mosaic image text recognition method based on deep learning
CN102855631A (en) Method for extracting visual energy information for image quality evaluation
CN105095857A (en) Face data enhancement method based on key point disturbance technology
CN102354402A (en) Drawing rendering method based on style learning
CN102609988B (en) Method for extracting fluid surface based on anisotropic screen-space smoothed particle hydrodynamics
CN110335275B (en) Fluid surface space-time vectorization method based on three-variable double harmonic and B spline
CN103093211A (en) Human motion tracking method based on deep nuclear information image feature
CN104123719B (en) Method for carrying out infrared image segmentation by virtue of active outline
Li et al. Image stylization with enhanced structure on GPU
CN111047684A (en) Model simplification method based on three-dimensional model characteristics
CN104517299A (en) Method for restoring and resimulating physical video fluid driving model
CN107358616B (en) SAR image edge detection method based on anisotropic morphological direction ratio
Masaoka et al. Edge-enhanced GAN with vanishing points for image inpainting

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140702

Termination date: 20200118