Presentation is loading. Please wait.

Presentation is loading. Please wait.

Course 8 Contours. Def: edge list ---- ordered set of edge point or fragments. Def: contour ---- an edge list or expression that is used to represent.

Similar presentations


Presentation on theme: "Course 8 Contours. Def: edge list ---- ordered set of edge point or fragments. Def: contour ---- an edge list or expression that is used to represent."— Presentation transcript:

1 Course 8 Contours

2 Def: edge list ---- ordered set of edge point or fragments. Def: contour ---- an edge list or expression that is used to represent the curve. A contour can be open or closed.

3 1.Digital Curve. (1) Curve length: (2) K-slope: the (angle) direction vector between points with k edge points apart.

4 (3) K-curvature: the difference between left k-slope and right k-slope at a digital curve point:

5 2. Curve Representations 1) Chain code Chain code quantities a space to 8 directions and encodes a contour at each edge point with the directions in an ordered sequence. ------- Chain code has compact description. ------- Chain code cannot express branched curves.

6 2) plot: For a digital curve, compute curve length and slope from a beginning edge point. Then plot the obtained curve length and slop in space. ------ Line segment in curve; horizontal line in plot. ------ Circular arc in curve; line segment of some direction in space. ------ Using plot can easily segment a curve at discontinuous point of plot.

7

8 3)Graph representation: Establish topology relations among edge list points. Each edge point is a graph node. Struct Node { int node_number; int curve_number; int x, y; // position char type; int link[8]; //link relation int link_direction[8]; //heading or ending char flag; //process flag } node;

9 ------ Digital description of curve. ------ Can handle branched curves. ------ Easy in operation. ------ Use more memories, but it can be simplified. e.g. to remove nodes that have type=2. Struct link { int curve_number; int link_length; int node_list[]; char flag; //process flag } link;

10 3. Polyline representation Represent an edge list by a set of joined line segments. The edge data not being the joint point will be neglected.

11 1). Recursive splitting method: Consider a curve with endpoint A and B (a) connect end-points A and B (b) along the curve, compute normalized distance to chord. find the edge point say c with maximum. (c) if, the preset threshold, insert a vertex at edge point c. The curve is then subdivided into two curves. (d) For each curve, repeat the process a)—c) until no vertex can be inserted.

12 2). Sequential method: (a) Starting with an endpoint of a curve tracing the curve, calculate the distance between the curve and the chord from the starting point to moving point. (b) If the distance is greater than a preset threshold, put a vertex there. (c) Take the vertex as a new starting point. Repeat the operation a) and (d) until it complete the curve.

13 3). Area based sequential method: The same as the above method. But the criteria to insert a vertex is where is the area between the curve and chord. is the length of chord.

14 4). Break-point detection: Sequential polyline methods have advantage of easy and fast operations. But they are error-based operations, Corner positions usually cannot accurately located. One way to solve the problem is to detect break point first. Then polylinelize the curve piecewise. To detect break point: a) Calculate K-curvature along a curve. b) Plot the curve’s curvatures in plane. Where ---curvature, s ---curve length.

15 c)Do Gaussian smooth to the plot to remove noise of the plot. d)Corners of original curve will correspond to peaks in plot, arcs to plateaus, threshold the value in plot will get break points.

16 5). Hop-Along algorithm: Hop-along method approximate a contour by a sequence of line segments, doing split and merge in short subsets of edge points. a) Start with the first K edge points from edge list. b) Fit line segment (say, using least- square method) between the first and the last edge points of the sub list. c) If normalized maximum error is too large, shorten the sub list at the point of maximum error. Return step b).

17 d) If the line fit succeeds, compare the orientation of the current line segment with that the previous line segments. If two line segments have similar orientation, replace the two line segments with a single line segment. e) Make the current line segment the previous line segment and advance the window of edges so that there are K edge points in the sub list. Return to step b).

18 3. Curve fitting Curve fitting is trying to find a smooth curve expression of mathematic form from curve’s polyline expression. 1)Conic sections: To determine a conic section is to determine parameters a, b, c, d, e, f from 3 edge points, although there are classic method. We will introduce a “guided form” method.

19 a)Select knot position from each polyline segment. where

20 b) Form lines of guided frame: K i V i+1 : V i+1 K i+1 : K i K i+1 : Then: the conic intersection is: where is control parameter.

21 2) Cubic Spline: Cubic spline represents a curve piecewise by 3 rd - order polynomials joined smoothly at knots of the curve. Between two knots: where There are 8 parameters and need 8 constraints to determine the 8 parameters.

22 Positions of first and last edge points give 4 constraints. The continuity of the curve with its neighboring curves gives another 2 constraints. Orientation of edge at knot provides one constraint. or where, tangent direction at knot introduces two equations and one additional unknown. All the parameters and can be solved.

23 4. Regression 1) Least Squares Regretion Using all edge point in an edge list to compute the model of curve, minimizing the distances between data points to the curve. For a straight edge: Then: call least square to solve for and.

24 Note: If outlier points in edge list, it can pull the solution away from the true one.

25 2) Least-Median-Square Regression: It claim that the algorithm can handle out 50% of outlines in edge list: Algorithm: a) Choose p points randomly from the set of n data points. b) Compute the fit model to the p points. c) Compute the median of the residual squares. d) The fitting procedure is repeated until a fit is found with sufficiently small median of residual squares, or processes reached preset steps.

26 5. Hough Transform --- Voting based method: a point on a curve votes several combinations of curve parameters. --- Edge point not necessary in an ordered list. Consider a straight Line in x-y space: are variables and are parameters. If given only a point, it can draw infinite number lines passing through point with different slope and intercept. The relation between and appears to be a line in space. ( are fixed)

27 This indicates that a point in x-y space corresponds to a line in m-c space. If all data points come from a straight line in x-y space, their corresponding lines in m-c space will intersect at a point. The corresponding values of m and c of the intersection gives the parameters of the line in x-y space. c m

28 In practice, we use polar form of a line to avoid the problem of vertical lines. Given a set of points Find the parameters and. Algorithm: (a) Quantize the parameters space (b) Each cell in parameter space is an accumulator. Initialize all cells to zero.

29 (c ) For each data point in image space, increment by 1 each of the accumulator that satisfy the equation. (d) Maximize in the accumulator array correspond to the parameters of the model (line). ---- When several curves in images, there will be several peaks in parameter space. It may be difficult to determine which peaks are significant. ---- When the number of parameter increases, the size of parameters space will increase quickly. It will reduce computation speed.


Download ppt "Course 8 Contours. Def: edge list ---- ordered set of edge point or fragments. Def: contour ---- an edge list or expression that is used to represent."

Similar presentations


Ads by Google