Computer Vision Pattern Recognition Lab Computer Graphics Chapter
Computer Vision & Pattern Recognition Lab. Computer Graphics Chapter 14 Spline Representations Computer Vision & Pattern Recognition Lab.
14. Spline Representation n Problem: How to represent this object smoothly? 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 2
14. Spline Representation Spline: smooth curve n Spline representation n Smooth curve can be represented by piecewise polynomials n Segment: A part of curve generated by a few control points n Curve shape is determined by adding/deleting/moving control points n 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 3
14. Spline Representation n Parametric representation: n "Cubic curves" => x, y, z: cubic polynomials in u 4 x 3 unknown coefficient n Needs 4 x 3 known conditions n (ex: 4 points on the curve) Hermite, Bezier, Splines, . . . n Why cubic? n Why not use 4 points on the curve? n 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 4
14. Spline Representation n Continuity for 2 curve segments tangent vector: G 0 (Geometric) continuity: two segments join together G 1 (Geometric) continuity: direction of tangent vectors are equal C 0 (Parametric) continuity: same as G 0 continuity C 1 (Parametric) continuity: direction & mag. of 2 tangent vectors are equal ( are equal. ) Cn (Parametric) continuity: are equal. : are equal. 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 5
14. Spline Representation n Conditions (Constraints) Hermite: 2 endpoints, 2 endpoints' tangent vectors n Bezier: 2 endpoints, 2 other points n Splines: 4 control points n 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 6
Parametric polynomial Scalar form Vector form Matrix form Curve modeling
14. 7. Hermite Interpolation n Hermite curves: Constraints on 2 endpoints P(0), P(1) and 2021 -02 -23 2 tangent vectors P’(0), P’(1) Computer Vision & Pattern Recognition Lab. 8
14. 7. Hermite Interpolation n In terms of boundary conditions, 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 9
14. 7. Hermite Interpolation n In terms of boundary conditions, n In terms of cubic polynomial of u, n 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 10
14. 7. Hermite Interpolation n Blending function 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 11
14. 7. Hermite Interpolation n Verify 4 constraints 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 12
14. 7. Hermite Interpolation n Effects of increasing magnitude of tangent vector n Effects of varying tangent vector at start point 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 13
14. 7. Hermite Interpolation Note: -. Conditions for G 0 continuity : -. Conditions for G 1 continuity : -. Conditions for C 1 continuity : n Example: n 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 14
14. 8. Bezier Spline Curves n Bezier curves (Designer at Renault) Given 4 points p 0, p 1, p 2, p 3 such that Dpk = P'(0) = 3(p 1 -p 0) Dpk+1 = P'(1) = 3(p 3 -p 2) => endpoint tangents n 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 15
14. 8. Bezier Spline Curves n By using linear blending, 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 16
14. 8. Bezier Spline Curves 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 17
14. 8. Bezier Spline Curves 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 18
14. 8. Bezier Spline Curves 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 19
14. 8. Bezier Spline Curves 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 20
14. 8. Bezier Spline Curves n In terms of boundary conditions, n In terms of cubic polynomial of u, n 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 21
14. 8. Bezier Spline Curves n Blending function 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 22
14. 8. Bezier Spline Curves n Bezier curves n Hermite curves 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 23
14. 8. Bezier Spline Curves n Note n Conditions for G 0 continuity : p 4 = p 3 n Conditions for G 1 continuity : p 5 - p 4 = k (p 3 - p 2) n Conditions for C 1 continuity : p 5 - p 4 = p 3 - p 2 n Sum of blending polynomials = 1 Each polynomial ≥ 0 n Each curve segment is completely contained in convex hull of 4 points => Useful for clipping n 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 24
14. 8. Bezier Spline Curves n Verify that P(0) = p 0, P(1) = p 3, P'(0) = 3(p 1 -p 0), P'(1) = 3(p 3 -p 2) 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 25
14. 9. Bezier Surfaces n Bezier Curve : n Bezier Surface : 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 26
14. 10. B-Spline Curves n Natural cubic spline: C 0, C 1, C 2 continuous (C 2 continuous: very smooth) n n n Pass through n+1 control points n+1 points => n cubic functions => 4 n variables 2 points per cubic => 2 n eq. slope/curvature at x 1, . . . , xn-1 => 2(n-1) eq. S 0 = Sn = 0 => 2 eq. (S 0, Sn : 2 nd derivatives) Problems of Natural cubic spline Need to compute (n+1) x (n+1) matrix inverse o Moving one control point affects entire curve o Solution: => B-spline (basis-spline) 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 27
14. 10. B-Spline Curves n (Uniform nonrational) B-spline n C 0, C 1, C 2 continuous n Easy to compute coefficients n Local effect (4 segments are affected) n Does not pass through control points p 0, p 1, . . . pm : (m+1) control points n P 3, P 4, . . . Pm : (m-2) cubic polynomials n 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 28
14. 10. B-Spline Curves 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 29
14. 10. B-Spline Curves n In terms of boundary conditions, n In terms of cubic polynomial of u, n n n 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 30
14. 10. B-Spline Curves n Blending function 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 31
14. 10. B-Spline Curves n Verify that 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 32
14. 10. B-Spline Curves n Note: C 0, C 1, C 2 continuous => very smooth n Local effect (Only 4 segments are affected) n Less control of where curve goes. (P 3 begins somewhere near p 1 and ends somewhere near p 2) n To force curve to pass thru specific point, replicate points. n To make a closed curve: p 0, p 1, . . . pm , p 0, p 1, p 2 n Convex hull property (sum of poly = 1, each poly ≥ 0 ) n 2021 -02 -23 Computer Vision & Pattern Recognition Lab. 33
14. 10. B-Spline Curves n Interpolating curve n n The curve passes through the control points: Hermite, Bezier Approximating curve The curve may not pass through control points for smoothness: B-spline n Control points attracts the curve to change the curve shape n 34
14. 10. B-Spline Curves n Other splines: Nonuniform B-spline n Beta-Spline n Rational Splines n x(u) = X(u)/W(u), y(u) = Y(u)/W(u), z(u) = Z(u)/W(u) n Comparison of curve functions In terms of ease of interactive manipulation degree of continuity generality speed (computation time) Computer Vision & Pattern Recognition Lab. 2021 -02 -23 35
- Slides: 35