System for generating approximate curves and system for memorizing curves

Abstract: A system for generating approximate curves which takes out three adjacent points from input points to generate quadratic rational Bezier curve approximating the curve fitting these three points, extends the curve to the maximum within the user-specified tolerance, and repeats said processes. A system for memorizing quadratic rational Bezier curves which memorizes a tangent at a control point which is one side end of the first curve, a control point which is another side end of the last curve, control points which are one side ends of each curve and a camber vector.

Description: This invention relates to a system for generating approximate curves and for memorizing the curves. Furthermore, it relates to a system to get a minimum number of curves which approximate given sequence of points and to memorize the resulting curves efficiently. As a conventional system to get curves from given sequence of sampled points, a system in which the points are connected by straight lines and the curves are represented by polygonal line is well known. Another system in which a sequence of points is divided into some groups and points of the each group are represented by circles, ellipses or parabolas is also well known. Furthermore, instead of using circles, ellipses or parabolas, a system using cubic polynomial, B spline curves or Bezier curves is well known. These polygonal line or curves are memorized in the form of parametric formes, or in the form of many points data after interpolating the points on the curves. The conventional systems using polygonal line, circles, ellipses or parabolas have problems of lacking smoothness and are only used for low level application. On the contrary, the conventional systems using cubic polynomial, B spline curves or Bezier curves have smoothness and are used for high level application. However, as cubic polynomial, B spline curves or Bezier curves cannot correctly represent conics, there are problems that they cannot represent exactly arc such as character fonts designed basically by using a compass. Also, as the cubic polynomial cannot solve analytically, in general, there are problems that calculation is quite complex. On the other hand, when the approximate curves are memorized in control points scheme, as range of control point differs from that of given points, there are problems that handling on memory is very complicated. When the approximate curves are memorized in the form of the many points data, as the amount of data becomes huge, there are problems that large capacity of memories is required. The article by L. Piegl in IEEE Computer Graphics and Applications (1987) APRIL, VOL. 7, N°4, pg. 45-58 : "Interactive data interpolation by rational Bezier curves" P45 gives algorithms for interpolation using conic rational Bezier curves. GB 2203613A discloses an algorithm for approximating a curve by using Cubic Bezier curves and for storing it. The object of the invention is to provide a system for generating approximate curves and a system for memorizing the curves so as to solve the above mentioned problems. Accordingly, in a first aspect, the invention provides an apparatus for generating an image comprising: an input device for inputting a sequence of points of an image; a processor for generating approximate curves fitting that sequence of points, comprising, (a) an initial segment generating means which selects adjacent three points and finds a rational Bezier curve of degree two having as control points the two end points among the adjacent three points and the node of tangents at these two points and which transits the middle one point of the three adjacent points; characterized in that (i) the processor further comprises (a) an approximate segment generating means which extends the rational Bezier curver of degree two, finds the outermost point to which distance from the curve is within a predetermined allowance value, finds a provisional rational Bezier curve of degree two which gives minimal total distance between each point until the outermost point and the curve, repeats said process to extend the rational Bezier curve of degree two and to find a new provisional rational Bezier curve of degree two, and then, finds a final rational Bezier curve of degree two which approximates the points until the outermost point to which distance from the curve is within the predetermined allowance value, and (b) a repeat control means which repeats said initial segment generating step and said approximate segment generating step regarding to the remaining points and stops repeating when there is no remaining point; and (ii) the apparatus further comprises a memory for memorizing curves by which rational Bezier curves of degree two from the first to the X-th being tangent-continuous thereof are memorized, said memory being arranged to (a) memorize a tangent at a control point P10 which is one side end of the first rational Bezier curve of degree two, (b) memorize a control point PX2 which is another side end of the X-th rational Bezier curve of degree two, (c) memorize a control point Pi0 which is one side end of the i-th (1≤i≤X) rational Bezier curve of degree two, and (d) memorize the following camber vector b i, b i = ( P i1 - ( P i0 + P i2) /2) Wi / (1 + Wi) whereby, P i1 is a control point of a node of tangents at P i0 and P i2, Wi is the weight of i'-th rational Bezier curve of degree two; and an output device for outputting the image. In a second aspect, the invention provides a method of generating an image comprising: inputting a sequence of points of an image; generating approximate curves fitting that sequence of points, by (a) selecting adjacent three points and finding a rational Bezier curve of degree two having as control points the two end points among the adjacent three points and the node of tangents at these two points and which transits the middle one point of the three adjacent points; characterized in that (i) said step of generating approximate curves includes (a) extending the rational Bezier curver of degree two, finding the outermost point to which distance from the curve is within a predetermined allowance value, finding a provisional rational Bezier curve of degree two which gives minimal total distance between each point until the outermost point and the curve, and repeating said process to extend the rational Bezier curve of degree two and to find a new provisional rational Bezier curve of degree two, and then, finding a final rational Bezier curve of degree two which approximates the points until the outermost point to which distance from the curve is within the predetermined allowance value, and (b) repeating said initial segment generating step and said approximate segment generating step regarding to the remaining points and stopping repeating when there is no remaining point; and (ii) the method further includes memorizing curves by which rational Bezier curves of degree two from the first to the X-th being tangent-continuous thereof are memorized by (a) memorizing a tangent at a control point P10 which is one side end of the first rational Bezier curve of degree two, (b) memorizing a control point PX2 which is another side end of the X-th rational Bezier curve of degree two, (c) memorizing a control point Pi0 which is one side end of the i-th (1≤i≤X) rational Bezier curve of degree two, and (d) memorizing following camber vector b i, b i = ( P i1 - ( P i0 + P i2) /2) Wi / (1 + Wi) whereby, P i1 is a control point of a node of tangents at P i0 and P i2, Wi is the weight of i-th rational Bezier curve of degree two; and outputting the image. Preferred features of the invention will now be described. A quadratic rational Bezier curve is generally expressed as follows, r T = 1- T w o P o + 2 T 1- T w 1 P 1 + T 2 w 2 P 2 1- T w o +2 T 1- T w 1 + T 2 w 2 here, T (0≦T≦1) is a parameter, P o , P 1 , P 2 are position vectors at control points, and W o , W 1 , W 2 are weights given to each control point. When W o ·W 2 > 0, set ω = (W o /W 2 ) 0.5 to give parameter transformation of T = ωt / ((ω-1)t+1), above quotation (1) can be expressed as follows. r t . W = 1- t P o +2 t 1- t W P 1 + t 2 P 2 1- t +2 t 1- t W + t 2 here W is weight and W = w 1 / w o ·w 2 ) 0.5 By the processes, not only the approximate curves can be easily generated, but also the member of curves is minimized. The system of the invention doesn't memorize each control point P o , P 1 , P 2 and weight W of plural of quadratic rational Bezier curves being tangent-continuous thereof, but memorize tangent at one end control point of the first quadratic rational Bezier curve, the other end's control point of the last quadratic rational Bezier curve, the one end control point of each quadratic rational Bezier curve and said camber vector. Instead of the control point P 1 whose value is likely to largely differ from that of other points P o , P 2 , said camber vector which isn't likely to differ as the above mentioned is memorized to ease the process in memories. It, also can reduce the data amount. In the drawings : Fig. 1A and Fig. 1B are flowcharts according to an embodiment of this invention. Fig. 2 is a diagram of input sequence of points. Fig. 3 is a diagram showing the principles of generating the quadratic rational Bezier curve from three points. Fig. 4 is a diagram showing the extension of quadratic rational Bezier curve. Fig. 5 is a diagram of approximated character font generated by the system for generating curves of this invention. Fig. 6 is a diagram showing the principles of the systen for memorizing curves of this invention. Fig. 7 is a block diagram of a computer system by which the system for generating curves and the system for memorizing curves of this invention are embodied. This invention will be described in more detail in accordance with the preferred embodiments illustrated. It is to be noted that this invention is not limited by these embodiments. The system for generating curves and the system for memorizing curves of this invention are embodied by a computer system 10 shown in the Fig. 7. When data of a sequence of points are input by an input device 11, a processor 12 computes a quadratic rational Bezier curves approximating to the curve fitting the sequence of points. The quadratic rational Bezier curves are memorized by a memory 13 and are output by an output device 14. The flowcharts of Fig. 1A and Fig. 1B show the operation of the processor 12 computing the quadratic rational Bezier curves. In step 101, when an input sequence of points are Q 0 , Q 1 , Q 2 , ... , the point Q 0 is set as a control point P 0 and the point Q 2 is set as a control point P 2 as shown in Fig. 2. In step 102, a tangent α on the control point P 0 and a tangent β on the control point P 2 are obtained. Then, a cross point of the tangent α and the tangent β is obtained and is set as a control point P 1 as shown in Fig. 3. Conventional process for finding tangent may be used as the process to find the tangent α and the tangent β. In step 103, the control point P 0 , P 1 and P 2 are substituted into the aforesaid expression (2) to find the weight W which make the curve transit the point Q 1 . Thus, a quadratic rational Bezier curve fitting the point Q 0 , Q 1 , Q 2 is found. The abovementioned process is an inital segment generating step. In step 104, the quadratic rational Bezier curve r 0 is extended as shown in Fig. 4. That is to say, as there is a property that a quadratic rational Bezier curve r (t, -W) represents an extended portion of the quadratic rational Bezier curve r (t, W) with reverse sign of the weight W, this step finds the extended portion r oe of the quadratic rational Bezier curve r 0 by using said property. In step 105, a distance d between the point Q 3 and the extended portion r oe is calculated. In step 106, the distance d and the user-specified tolerance δ are compared. If the distance d is not larger than the user-specified tolerance δ, then back to the aforesaid step 105 and calculate the distance d between the next point Q 4 and the extended portion r oe . This process is repeated until the distance d becomes larger than the user-specified tolerance δ. When the distance d becomes larger than the user-specified tolerance δ at the point Q k+1 , jump to step 107. In step 107, the point Q k is set as a control point P 2 and in next step 108, a control point p 1 is obtained by the same process as aforesaid step 102. In step 109, re-calculate the weight W which minimize a mean distance between the curve and each point by changing the weight W in the expression (2) to calculate the mean value of each distance between the curve and the points Q 1 - Q k . Thus, new quadratic rational Bezier curve r 0 approximating the curve fitting points Q 0 - Q k is got. Then, back to the step 104, extend the aforesaid quadratic rational Bezier curve r 0 and repeat the steps 105 - 109. When new quadratic rational Bezier curve r o fitting the points Q 0 - Q L is got and a distance d between an extended portion of the curve and the point Q L+1 becomes larger than the user-specified tolerance δ, the quadratic rational Bezier curve at that time is set as the final approximate curve fitting the points Qo - QL. The abovementioned process is an approximate segment generating step. After that, the points Q L , Q L+1 , Q L+2 are taken out and the aforesaid steps 101 - 109 are repeated. When any point to be taken out is no longer existing, the process is terminated. This is a repeat control step. If only one point to be taken out exists as the last point, the point just before the said last point is set as a control point P 0 and the last point is set as a control point P 2 (step 110), and the control point P 1 is found by the same process as the step 102 (step 111), and then, the last curve is got by using these control points P0, P2, P1 and the weight W = 1 (step 112). Thus, the quadratic rational Bezier curves r 0 , r 1 , r 2 , r 3 , ... which approximate the curve fitting the input sequence of points Q 0 , Q 1 , Q 2 ... are got. Fig. 5 shows an example of approximate curves which are got by abovementiond process and represent a sequence of points for character font. To memorize the quadratic rational Bezier curves r 0 , r 1 , r 2 , r 3 ... approximating the curve fitting the sequence of points Q 0 , Q 1 , Q 2 , ... can be done by memorizing the control points P 0 , P 1 , P 2 and the weight W for each quadratic rational Bezier curve r 0 , r 1 , r 2 , r 3 ... . However, as the control point P 1 is the cross point of the tangent α and the tangent β, it may position far from the control point P 0 or P 2 . In this case, the value of the point P 1 is largely different from that of the control point P 0 or P 2 . For this reason, the data structure in the memory 13 becomes complicated and the accuracy becomes low. Then, under the relation shown in Fig. 6, the processor 12 computes the camber vector b i of each quadratic rational Bezier curves r i by using following equation: b i = ( P 1 - ( P 0 + P 2 )/2) W/(1+W) Each quadratic rational Bezier curve r 0 , r 1 , r 2 , r 3 , ... r x is memorized in the memory 13 by memorizing tangent α at the control point P 0 of the first quadratic rational Bezier curve r 0 , the control point P 2 of the last quadratic rational Bezier curve r x , the control point P 0 of each quadratic rational Bezier curve r 0 , r 1 , r 2 , r 3 , ..., r x and the camber vector b 0 , b 1 , b 2 , b 3 , ..., b x . When the quadratic rational Bezier curve r i is reconstructed from the memorized data, the control point P 2 of the quadratic rational Bezier curve r i is required. But, the control point P 0 of the quadratic rational Bezier curve r i+1 can be used as the control point P 2 of the quadratic rational Bezier curve r i . Therefore, only the control point P 2 of the last quadratic rational Bezier curve should be memorized. As understood from the above description, the system for generating approximate curves and the system for memorizing curves of this invention gives following effects. 1. Since the quadratic rational Bezier curves are used, conics can be expressed exactly. So, the diagram like a character font which is basically designed by using compass can be expressed exactly. 2. Since the quadratic rational Bezier curves can be analytically found, the computation becomes easy. 3. The range of the sequence of points which can be approximated by one curve segment can be found easily and accurately. In other words, the maximum range which can be approximated by one conic section is approximated by one curve segment. 4. Since the data to be memorized are similar values, the data structure becomes easy and a lowering of accuracy can be avoided. 5. Since an amount of the data to be memorized can be reduced. a small-capacity memory can be used and a time for data transmission can be shortened.

Claims: An apparatus for generating an image comprising: an input device (11) for inputting a sequence of points of an image; a processor (12) for generating approximate curves fitting that sequence of points, comprising, (a) an initial segment generating means which selects adjacent three points and finds a rational Bezier curve of degree two having as control points the two end points (Q 0 ,Q 2 ) among the adjacent three points and the node of tangents at these two points and which transits the middle one point (Q 1 ) of the three adjacent points; characterised in that; (i) the processor further comprises (a) an approximate segment generating means which extends the rational Bezier curve of degree two, finds the outermost point to which distance from the curve is within a predetermined allowance value (δ), finds a provisional rational Bezier curve of degree two which gives minimal total distance between each point until the outermost point and the curve, repeats said process to extend the rational Bezier curve of degree two and to find a new provisional rational Bezier curve of degree two, and then, finds a final rational Bezier curve of degree two which approximates the points until the outermost point to which distance from the curve is within the predetermined allowance value (5), and (b) a repeat control means which repeats said initial segment generating step and said approximate segment generating step regarding to the remaining points and stops repeating when there is no remaining point; and (ii) the apparatus further comprises a memory (13) for memorizing curves by which rational Bezier curves of degree two from the first to the X-th being tangent-continuous thereof are memorized, said memory being arranged to (a) memorize a tangent at a control point P10 which is one side end of the first rational Bezier curve of degree two, (b) memorize a control point PX2 which is another side end of the X-th rational Bezier curve of degree two, (c) memorize a control point Pi0 which is one side end of the i-th (1≤i≤X) rational Bezier curve of degree two, and (d) memorize the following camber vector b i, b i = ( P i1 - ( P i0 + P i2) /2) Wi / (1 + Wi) whereby, P i1 is a control point of a node of tangents at P i0 and P i2, Wi is the weight of i-th rational Bezier curve of degree two; and an output device (14) for outputting the image. A method of generating an image comprising: inputting a sequence of points of an image; generating approximate curves fitting that sequence of points, by (a) selecting (101, 102) adjacent three points and finding (103) a rational Bezier curve of degree two having as control points the two end points (Q 0 ,Q 2 ) among the adjacent three points and the node of tangents at these two points and which transits the middle one point of the three adjacent points (Q 1 ); characterised in that; (i) said step of generating approximate curves includes (a) extending (104) the rational Bezier curve of degree two, finding the outermost point to which distance from the curve is within a predetermined allowance value, finding a provisional rational Bezier curve of degree two which gives minimal total distance between each point until the outermost point and the curve, and repeating said process to extend the rational Bezier curve of degree two and to find a new provisional rational Bezier curve of degree two, and then, finding a final rational Bezier curve of degree two which approximates the points until the outermost point to which distance from the curve is within the predetermined allowance value, and (b) repeating said initial segment generating step and said approximate segment generating step regarding to the remaining points and stopping repeating when there is no remaining point; and (ii) the method further includes memorizing curves by which rational Bezier curves of degree two from the first to the X-th being tangent-continuous thereof are memorized by (a) memorizing a tangent at a control point P10 which is one side end of the first rational Bezier curve of degree two, (b) memorizing a control point PX2 which is another side end of the X-th rational Bezier curve of degree two, (c) memorizing a control point Pi0 which is one side end of the i-th (1≤i≤X) rational Bezier curve of degree two, and (d) memorizing following camber vector bi , b i = ( P i1 - ( P i0 + P i2) /2) Wi / (1 + Wi) whereby, P i1 is a control point of a node of tangents at P i0 and P i2, Wi is the weight of i-th rational Bezier curve of degree two; and outputting the image.

Inventors: HOSAKA MAMORU, KUSHIMOTO TAKUYA, SAITOH TSUYOSHI, HOSAKA, MAMORU, KUSHIMOTO, TAKUYA, SAITOH, TSUYOSHI
Applicants: STANLEY ELECTRIC CO LTD, STANLEY ELECTRIC CO., LTD.
Application year: 1990
Main classification: G06F17
IPC codes: G06F17, G06T11