Centerline: CEDAR DEFINITIONS = BEGIN Handle: TYPE = REF Rec; Rec: TYPE = RECORD [ width: REAL, --expected line width t: REAL, --threshold at which we are definitely outside of the line maxV: INT, --maximum pixel value startX, startY, endX, endY: INT, --window on image get: PROC[client: REF, x,y: INT] RETURNS[INT], --called to get pixels newPoint: PROC[client: REF, x,y: REAL] RETURNS[abort: BOOLEAN _ FALSE],--return points on curve to client client: REF, --returned to client in procs above data: REF --private data for the outline procedures ]; CurveTrace: PUBLIC PROC[h: Handle, x1,y1,x2,y2: REAL]; InvalidID: SIGNAL; GetOutline: PROC [data: REF, newPoint: PROC[x,y: REAL], id: INT]; END. šCenterline.mesa Copyright c 1984, 1985 by Xerox Corporation. All rights reserved. Maureen Stone October 17, 1984 4:31:08 pm PDT Doug Wyatt, September 5, 1985 2:42:31 pm PDT This provides an alternative method for getting a sampled curve from an image, appropriate if the image consists of a line drawing. The basic idea is to first blur the image so that the backround just reaches the center of lines of the desired width, and then to trace out the 'valley' thus defined. Traces a curve. The expected line width is h.w. The trace will start at (x1,y1), and will end somewhere. One possible end condition is that the trace comes close to (x2,y2) or (x1,y1), another is that the sampled value exceeds the threshold h.t. The trace starts out in the approximate direction of (x2,y2) data should be handle.data. The id is the outline number [0..nOutlines]. Call this procedure in a loop to get all the outlines. Κj˜codešœ™Kšœ Οmœ7™BKšœ-™-K™,—K˜KšΠbl œΟkœ˜KšŸ˜Kšœ¬™¬KšœŸœŸœ˜šœŸœŸœ˜KšœŸœΟc˜"KšœŸœ :˜DKšœŸœ ˜!KšœŸœ ˜4Kš œŸœ ŸœŸœŸœŸœ ˜Ešœ Ÿœ ŸœŸœ˜&KšŸœŸœŸœ "˜B—KšœŸœ #˜0KšœŸœ )˜4K˜—KšΟn œŸœŸœŸœ˜6Kšœ΅™΅Kšœ Ÿ˜š ‘ œŸœŸœ ŸœŸœŸœ˜AK™—KšŸœ˜K˜—…—ΐΔ