MCPcopy Create free account
hub / github.com/creatale/node-dv / FindDirectionChanges

Function FindDirectionChanges

deps/tesseract/classify/mfoutline.cpp:121–143  ·  view source on GitHub ↗

---------------------------------------------------------------------------*/ * This routine searches through the specified outline, computes * a slope for each vector in the outline, and marks each * vector as having one of the following directions: * N, S, E, W, NE, NW, SE, SW * This information is then stored in the outline and the * outline is returned. * @param Outline micro-feature

Source from the content-addressed store, hash-verified

119 * @note History: 7/21/89, DSJ, Created.
120 */
121void FindDirectionChanges(MFOUTLINE Outline,
122 FLOAT32 MinSlope,
123 FLOAT32 MaxSlope) {
124 MFEDGEPT *Current;
125 MFEDGEPT *Last;
126 MFOUTLINE EdgePoint;
127
128 if (DegenerateOutline (Outline))
129 return;
130
131 Last = PointAt (Outline);
132 Outline = NextPointAfter (Outline);
133 EdgePoint = Outline;
134 do {
135 Current = PointAt (EdgePoint);
136 ComputeDirection(Last, Current, MinSlope, MaxSlope);
137
138 Last = Current;
139 EdgePoint = NextPointAfter (EdgePoint);
140 }
141 while (EdgePoint != Outline);
142
143} /* FindDirectionChanges */
144
145
146/*---------------------------------------------------------------------------*/

Callers 1

iterateFunction · 0.85

Calls 1

ComputeDirectionFunction · 0.85

Tested by

no test coverage detected