course 13 curves and surfaces. course 13 curves and surface ----- surface representation...
TRANSCRIPT
Course 13 Curves and Surface
----- Surface Representation
• Representation
• Interpolation
• Approximation
----- Surface Segmentation
• Segmentation
• Registration
1.Basic Geometry
1) Curve:
Parameter form:
e.g., a line segment between and :
Implicit form:
Explicit form:
10))(),(),((),,()( ttttztytxzyxtp
1p 2p
10)1()( 12 tptpttp
0),,(
0),,(
2
1
zyxf
zyxf
),(
),(
2
1
yxfz
yxfz
2) Surface:
Parameter form:
Implicit form:
Explicit form:
(graph surface)
1010 ;)),,(),,(),,((),,( vvvuuuvuzvuyvuxzyxs
0),,( zyxf
),( yxfz
3) Planes:
Assume are 3 non-collinear points in space. A plane is uniquely determined by the points.
Let
The equation of the plane is
210 ,, ppp
011 ppe 022 ppe 12 een
0)( 0 npp
where is the normal of the plane. In parametric form of the plane, we can redefine
Then the plane equation is:
where are parameters,
n
12 ene
021 peveup
vu, Dvu ),(
4) Surface Curvatures:
Assume a surface in form of
The normal of the surface of point is
where are partial derivatives of the
surface.
)),(),,(),,((),( vuzvuyvuxvup Dvu ),(
p
vu
vu
pp
pppn
)(
vu pp
,
(1) Normal curvature:
The intersection of a surface and a plane that passes through the normal at a point P of the surface is a 2D curve. The curvature of the 2D curve at point P is called normal curvature of the surface at point P.
n
p
---- At a surface point. The surface has infinite many normal curvatures.
---- The minimum and maximum normal curvatures, K1 and K2 are called principal curvatures.
(3) Types of a surface region
K(x,y)
+ 0 –
+ peak ridge saddle ridge
0
flat minimal surface
– pit valley saddle Valley
),( yxH
(4) Curvature Calculation
For a surface ),( yxfz
222
2
)1( yx
xyyyxx
ff
fffK
322
22
)1(2
2)1()1(
yx
xyyxyyxxxy
ff
fffffffH
2. Representation of curve and surface1) Curve representations:
----- Piecewise curve segments
-----Joint condition: smooth at least in the first order derivatives,i.e. continuous in curve slope.
----- Lowerest order of polynomials.
This leads to cubic spline curve:
x(t) = axt3 + bxt
2 + cxt + dx
y(t) = ayt3 + byt
2 + cyt + dy
z(t) = azt3 + bzt
2 + czt + dz
10 t
When one uses:
then a curve can be written as:
),,(
),,(
),,(
zyx
zyx
zyx
cccc
bbbb
aaaa
10,)( 23 tdtctbtatp
For a curve, it is in piecewise form:
112
13
11 )( dtctbtatp
222
23
22 )( dtctbtatp
nnnnn dtctbtatp 23)(
)0()1(
)0()1('
1'
1
ii
ii
pp
pp
With connection conditions:
2) Polygonal mesh surfaces:
----- Each mesh is a planar polygon (facet)
----- How to structure data if n data points are given.
----- Easily search from facet, edge or vertex.
Data structure of polygonal mesh surface has 3 records: edge record, vertex record and facet record. Each record links the other two by proper pointers.
Edge Record{ int: edge number, other attributes; pointer: North-vertex, south_vertex; pointer: left_facet, right_facet pointer: NE_winged_edge, NW_winged_edge, SE_winged_edge, SW_winged_edge ; }Vertex Record{ int: vertex_number; int: position(x,y); pointer: edge1, edge2, edge3;}Facet Record{ int: facet_number; pointer: edge1,edge2, …, edgen; int: other attributes; }
N
S
NENW
SW SE
W E
3) Surface Patches
Surface patch is a portion of surface. It can be modeled by polynomial or tensors-product if it is a graph surface. (1) Polynomial surface patch
Planar patch: z = a0 + a1x + a2y
Bilinear patch: z = a0 + a1x + a2y + a3xy
Biquadratic patch:
z = a0 + a1x + a2y + a3xy + a4x2 + a5y2
Other high-order patches. The coefficients of polynomials are determined from data points using surface fitting methods, such as least-square regression.
(2) Tensor –product surfaces
Tensor-product surface representation is formed by combination of two curve representations, one for each parametric coordinate.
Let curve1 and curve2 be cubic polynomial curves:
1
,,,)(2
3
43211u
u
u
aaaaup
1
,,,)(2
3
11112v
v
v
bbbbvp
The tensor-product surface is defined as:
Denote
The surface is expressed as
where the parametric matrix ca be determined from data points using regression.
1
,,,1,,,)()(),(2
3
4321
4
3
2
1
2321
v
v
v
bbbb
a
a
a
a
uuuvpupvup
T
T
T
T
T
4321
4
3
2
1
,,, bbbb
a
a
a
a
M
T
T
T
T
1
2
3
u
u
u
U
1
2
3
v
v
v
V
MVUvup T),(
3. Surface Interpolation
Create data of surface from existing data points,
e.g.
----- rectify the coordinate grids.
----- smooth representation of a surface by planar meshes.
1) Triangular mesh interpolation:From 3 data points, a planar patch can be determined:
then at position , the depth of the surface is calculated as
----- It is good for coordinate rectification.----- It cannot improve the smoothness of the surface even more data points are created.
yaxaaz 210
),( ii yx
iii yaxaaz 210
2) Bilinear Interpolation
From 4 data points, a bilinear surface patch can be determined as z = f(x,y) = a1 + a2x + a3y + a4xy then the new surface point can be calculated from given position (xi, yi)
zi = f(x,y) = a1 + a2xi + a3yi + a4xiyi
4.Surface Approximation
----- Estimate mathematic form of surface from enough measurement data.
----- Smoothness constraint should be enforced to obtain a unique solution.
1) Variational method:Let the surface be in the form , at data points we should have
By variation calculus, we get a differential equation.
This differential equation can be solved for with
Proper boundary conditions.
min]2[),((1
2
2
2
222
n
iiii dxdy
y
f
y
f
x
f
x
fyxfz
),( yxfz
n
ikkk yxfzyxf
1
24 )],([),(
),( yxf
2) B-spline RegressionSmoothness constraint is automatically applied when we approach surface regression by combining a set of smooth functions which are nonzero over a certain intervals. B-spline is the one commonly used.
In one-Dimensional case, any function f(x) has:
----- is nonzero over interval .
i.e. spans over 4 intervals, and
has one interval shift in the combination.
----- is continuous up to second order derivatives
in its domain.
)(xBi)(xBi
)(xBi
)(xBi)4,[ ii
)(1 xBi
m
iii xBaxf
0
)()(
The definition of 1-D B-spline function is
10,6
331)(
6
364)(
6
3331)(
6)(
32
3
32
2
32
1
3
0
xxxx
xB
xxxB
xxxxB
xxB
Since each B-spline function covers 4 intervals, f(x) is approximated by only 4 spline functions in each interval. In interval [i, i+1]
)()()()()( 112233 xBaxBaxBaxBaxf iiiiiiii
At curve’s data point ,
above approximation becomes :
With m+1 data point on the curve, the coefficients a0,
a1,…, am can be solved (note: scaling and shift xi to
interval [0, 1]). Although SVD method can be used in
solving the linear equations, spare matrix technique is
preferred as there are a lot of zero elements in
coefficient matrix of the equations.
iii
iiii
iii
iiii za
xa
xxxa
xxa
xxx
66
331
6
364
6
331 3
1
32
2
32
3
32
]1,[ iixi
In 2D case, a surface is expressed as a tensor-product form i.e.,
where and are 1-D B-spline functions.
A surface is approximated by 2D B-spline functions.
At a data point of the surface on a surface patch, the above approximation becomes
)()(),( yBxByxB ijij
n
i
m
jijij yBxBayxf
0 0
)()(),(
)(xB j )( yBi
With (n+1)(m+1) data points on the surface, the coefficients aij can be solved linearly. Again, spare matrix technique ca
n yield fast computation.
i
i
ih
j
jkikihhk zyBxBa
3 3
)()(
3) Weighted Spline Approximation:
So far, we have discussed surface approximations only for smooth surfaces. What shall we do with surface boundaries?
Solution one : If we can know boundary positions, we can approach the surfaces piecewise, and the unions of the surface pieces are the object surface.
),(),(1
yxfyxf l
n
l
Solution two : weighted regression:
w(x,y): Large in surface far from boundary Small in surface near to boundary
e.g.,
Where is gradient of surface
is weight control parameter
n
iiii dxdy
y
f
y
f
x
f
x
fyxwyxfz
12
2
2
22 ]2)[,(),((
2
2
),(1),(
yxgyxw
α
),( yxg
α
5. Surface Segmentation
1) Concept:
----- a complex surface is segmented into several sub-surfaces.
For each sub-surface, approximation is made to approach an analytic form.
),,,(),(),(1
lyxyxfyxfzn
ll
otherwiselyx
Ryxiflyx l
,0),,(
),(,1),,(
lRyxmji
jiijl yxayxf
),(
),(
----- Use curvature properties of surface initially to partition the surface into core regions, then shrink the surface region to small surface patches,so-called “seeds”.
----- Extend surface seeds to cover neighboring data to form subsurfaces.
Surface approximation and data extending are iteratively performed in this process.
2) AlgorithmGiven a set of surface data zi = f(xi, yi) to segment the surfac
e into subsurfaces.
a) Compute the first and second partial derivatives of the surface data.
b) Compute Gaussian and mean curvatures at each image location.
c) Label each surface data with the formula
T[i,j] = 1 + 3(1 + sgn(H[i,j])) + (1 + sgn(K[i,j]))
The formula numerates surface types:
T[i,j]=1: saddle ridge; T[i,j]=2: ridg
T[i,j]=3: peak; T[i,j]=4: minimal surface
T[i,j]=5: Flat; T[i,j]=6: No definition
T[i,j]=7: Saddle valley; T[i,j]=8: Valley
T[i,j]=9: Pitd) Identify core regions by finding connected components (clustering)e) Shrink the core region to eliminate false labels near region boundaries.f) Remove the core regions that are too small.
g) Fit a bi-variable patch to each core region.
h) Find a set of neighboring pixels of the regions with
the similar data values to the neighboring pixels in
the region. Include the candidate pixels in the region.
i) Refit the surface with the surface data of the
union of original region pixels and candidate pixels. If
the fit is acceptable (residue is small enough), add
the candidate data to the region. Otherwise, discard
the candidates.
j) Repeat step h) and step i) until no region is
changed.
6. Surface Registration
Registration problem is to align two shapes without
knowing feature correspondences (e,g., point
correspondences or line correspondences), such as
align a set of surface data (e.g. range data) with a
model of surface. This is to determine a
transformation (rotation, translation and scaling) to
surface data so that they can well align with the
surface model.
Basic concept of surface registration:
Given: a set of surface data (e.g. range data), and
the model of the surface.
Find: Rotation, translation and scaling applied to
surface data to align the data with the surface
model.