JP2735974B2 - Curve linear approximation method - Google Patents

Curve linear approximation method

Info

Publication number
JP2735974B2
JP2735974B2 JP4064256A JP6425692A JP2735974B2 JP 2735974 B2 JP2735974 B2 JP 2735974B2 JP 4064256 A JP4064256 A JP 4064256A JP 6425692 A JP6425692 A JP 6425692A JP 2735974 B2 JP2735974 B2 JP 2735974B2
Authority
JP
Japan
Prior art keywords
curve
coordinate value
value
coordinate
integer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP4064256A
Other languages
Japanese (ja)
Other versions
JPH05266184A (en
Inventor
敏也 山内
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP4064256A priority Critical patent/JP2735974B2/en
Publication of JPH05266184A publication Critical patent/JPH05266184A/en
Application granted granted Critical
Publication of JP2735974B2 publication Critical patent/JP2735974B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Controls And Circuits For Display Device (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、曲線の実数座標値から
整数座標値を求めて直線近似する直線近似方式に関する
ものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a linear approximation method for obtaining an integer coordinate value from a real number coordinate value of a curve and performing linear approximation.

【0002】ディスプレイやプリンタなどの出力装置
は、品質の高い出力が要求されている。特に、文字の出
力方法に関しては、曲線アウトラインフォントといった
輪郭を曲線式で表現する方法を使用し、品質の高い文字
を出力している。
[0002] Output devices such as displays and printers are required to have high quality output. In particular, with regard to a method of outputting characters, a method of expressing contours such as a curved outline font by a curved expression is used to output high-quality characters.

【0003】しかし、曲線アウトラインフォントは、曲
線式の表現方法が複雑であって、処理速度が遅いなどの
欠点もあり、輪郭を直線で表現した直線アウトラインフ
ォントの需要も高い。このため、文字の輪郭をより曲線
に近い直線で表現するための直線近似方式が望まれてい
る。
However, the curved outline font has a drawback that the method of expressing the curved line is complicated and the processing speed is slow, and there is a high demand for a linear outline font whose outline is represented by a straight line. Therefore, a straight-line approximation method for expressing the outline of a character with a straight line closer to a curve is desired.

【0004】[0004]

【従来の技術】従来の曲線を直線で近似する直線近似方
式の構成を図6に示す。この図6の構成によれば、曲線
の実数座標値を四捨五入などして整数座標値に変換し、
この変換後の整数座標値から等間隔で抽出して近似直線
の整数座標値を求めるようにしていた。以下図6の構成
および動作を簡単に説明する。
2. Description of the Related Art FIG. 6 shows a configuration of a conventional linear approximation method for approximating a curve with a straight line. According to the configuration of FIG. 6, the real coordinate values of the curve are converted to integer coordinate values by rounding or the like,
The integer coordinate values of the approximate straight line are obtained by extracting the integer coordinate values at regular intervals from the converted integer coordinate values. Hereinafter, the configuration and operation of FIG. 6 will be briefly described.

【0005】図6は、従来技術の説明図を示す。図6に
おいて、曲線座標算出部21は、文字などの輪郭の曲線
の実数座標値を算出し、曲線の実数座標メモリ24に格
納するものである。
FIG. 6 shows an explanatory diagram of the prior art. In FIG. 6, a curve coordinate calculator 21 calculates real coordinate values of a curve of a contour of a character or the like, and stores the calculated values in a real coordinate memory 24 of the curve.

【0006】整数座標算出部22は、曲線の実数座標メ
モリ24から取り出した実数座標値を、整数座標値に変
換(例えば四捨五入)し、変換した整数座標値を曲線の
整数座標メモリ25に格納するものである。
The integer coordinate calculation unit 22 converts (eg, rounds) the real coordinate values extracted from the real coordinate memory 24 of the curve into integer coordinate values, and stores the converted integer coordinate values in the integer coordinate memory 25 of the curve. Things.

【0007】等間隔抽出部23は、曲線の整数座標メモ
リ25から取り出した整数座標値から、等間隔のものを
取り出し、直線座標メモリ26に格納するものである。
次に、動作説明する。
[0007] The equal interval extracting section 23 extracts equidistant values from the integer coordinate values extracted from the integer coordinate memory 25 of the curve and stores them in the linear coordinate memory 26.
Next, the operation will be described.

【0008】(1) 曲線座標算出部21が、文字など
の輪郭線の曲線の実数座標値を算出し、曲線の実数座標
メモリ24に格納する(例えば図7の(a)の曲線座標
のベクトルの実数座標値を算出し、曲線の実数座標メモ
リ24に格納する)。
(1) The curve coordinate calculation unit 21 calculates the real coordinate values of a curve of a contour line such as a character and stores it in the real coordinate memory 24 of the curve (for example, the vector of the curve coordinates in FIG. Is calculated and stored in the curve's real number coordinate memory 24).

【0009】(2) 整数座標算出部22が、曲線の実
数座標メモリ24から取り出した実数座標値について、
整数座標値に変換(例えば四捨五入)し、曲線の整数座
標メモリ25に格納する。
(2) The integer coordinate calculator 22 calculates the real coordinate values extracted from the real coordinate memory 24 of the curve as follows.
It is converted into an integer coordinate value (for example, rounded off) and stored in an integer coordinate memory 25 for the curve.

【0010】(3) 等間隔抽出部23が、曲線の整数
座標メモリ25から取り出した整数座標値について、等
間隔に抽出して直線座標メモリ26に格納する。この格
納した等間隔に抽出した整数座標値を直線で結び、模式
的に表示すると、図7の(b)の線分を接続した直線と
なる。
(3) The equal-interval extracting unit 23 extracts the integer coordinate values extracted from the integer coordinate memory 25 of the curve at equal intervals and stores them in the linear coordinate memory 26. When the stored integer coordinate values extracted at regular intervals are connected by a straight line and are schematically displayed, a straight line connecting the line segments of FIG. 7B is obtained.

【0011】[0011]

【発明が解決しようとする課題】上述した図6の構成に
よって、図7の(a)の曲線座標のベクトルを整数座標
値に変換し、等間隔で抽出して線分で結ぶと図7の
(b)のようになり、本来の曲線の形と異なり、不要な
ギザギザが発生するという問題があった。この不要なギ
ザギザは、曲線の実数座標値を整数座標値に変換したと
きにその誤差によって発生したものであり、更に、等間
隔に抽出していたため、曲線と、得られた線分との誤差
が必ずしも小さい整数座標値を抽出するとは限られず、
ギザギザとなったものである。このために、これらのギ
ザギザをなくし、元の曲線に近い滑らかな直線の整数座
標値を求めることが要望されている。
When the vector of the curve coordinates in FIG. 7A is converted into an integer coordinate value by the configuration of FIG. 6 described above, extracted at equal intervals and connected by a line segment, the vector shown in FIG. As shown in FIG. 2B, there is a problem that, unlike the original curve shape, unnecessary jaggedness occurs. This unnecessary jaggedness is caused by an error when the real coordinate value of the curve is converted into an integer coordinate value, and is extracted at equal intervals, so that the error between the curve and the obtained line segment is obtained. Does not always extract small integer coordinate values,
It was jagged. For this reason, it is demanded to eliminate the jaggedness and obtain an integer coordinate value of a smooth straight line close to the original curve.

【0012】本発明は、これらの問題を解決するため、
曲線の実数座標値から整数座標値に変換した後、元の曲
線の実数座標値とこの整数座標値との誤差を求め、誤差
が小さい整数座標値のみを取り出してこれらを結んで近
似直線を求め、拡大時の品質低下を防止した曲線に近い
高品質な近似直線を生成することを目的としている。
The present invention has been developed to solve these problems.
After converting the real coordinate values of the curve into integer coordinate values, find the error between the real coordinate value of the original curve and this integer coordinate value, take out only the integer coordinate values with small errors, and connect them to obtain an approximate straight line It is an object of the present invention to generate a high-quality approximate straight line close to a curve that prevents quality deterioration during enlargement.

【0013】[0013]

【課題を解決するための手段】図1を参照して課題を解
決するための手段を説明する。図1において、整数座標
算出部2は、曲線の実数座標値から整数座標値を算出す
るものである。
Means for solving the problem will be described with reference to FIG. In FIG. 1, an integer coordinate calculator 2 calculates an integer coordinate value from a real number coordinate value of a curve.

【0014】座標選択部3は、元の曲線の実数座標値と
この算出した整数座標値との誤差を求め、所定閾値以下
の整数座標値を選択するものである。
The coordinate selector 3 calculates an error between the real coordinate value of the original curve and the calculated integer coordinate value, and selects an integer coordinate value equal to or less than a predetermined threshold value.

【0015】[0015]

【作用】本発明は、図1に示すように、整数座標算出部
2が曲線の実数座標値から整数座標値を算出し、座標選
択部3が元の曲線の実数座標値とこの算出した整数座標
値との誤差を求め、所定閾値以下の整数座標値を選択
し、これら選択した整数座標値を直線で結んで直線近似
するようにしている。
According to the present invention, as shown in FIG. 1, an integer coordinate calculator 2 calculates integer coordinate values from the real coordinate values of a curve, and a coordinate selector 3 calculates the real coordinate values of the original curve and the calculated integers. An error from the coordinate value is obtained, integer coordinate values equal to or less than a predetermined threshold value are selected, and the selected integer coordinate values are connected by a straight line to approximate a straight line.

【0016】また、整数座標算出部2が曲線の実数座標
値から整数座標値を算出し、座標選択部3が曲線の実数
座標値とこの算出した整数座標値との誤差を求め、所定
閾値以下の整数座標値を選択し、これら選択した整数座
標値を直線で結び、この直線と曲線の実数座標値との誤
差を算出し、誤差の最大値が所定閾値以下のときに当該
直線を求める近似直線とし、一方、誤差の最大値が所定
閾値以上のときに曲線の実数座標値の間隔を細かくし、
最初から処理を繰り返すようにしている。
The integer coordinate calculation unit 2 calculates an integer coordinate value from the real coordinate value of the curve, and the coordinate selection unit 3 calculates an error between the real coordinate value of the curve and the calculated integer coordinate value. Of the integer coordinate values, and connects the selected integer coordinate values with a straight line, calculates an error between the straight line and the real coordinate value of the curve, and obtains the straight line when the maximum value of the error is equal to or less than a predetermined threshold. A straight line, while narrowing the interval between the real coordinate values of the curve when the maximum value of the error is equal to or greater than a predetermined threshold,
The process is repeated from the beginning.

【0017】また、整数座標算出部2が曲線の実数座標
値から整数座標値を算出し、座標選択部3が曲線の実数
座標値とこの算出した整数座標値との誤差を求め、所定
閾値以下の整数座標値を選択し、これら選択した整数座
標値を直線で結び、この直線と曲線の実数座標値との誤
差の最大値を算出し、誤差の最大値が所定閾値以下のと
きに当該直線を求める近似直線とし、一方、誤差が所定
閾値以上のときに前後の曲線の実数座標値の間隔を細か
くし、この細かくした部分について最初から処理を繰り
返すようにしている。
Further, the integer coordinate calculator 2 calculates an integer coordinate value from the real coordinate value of the curve, and the coordinate selector 3 calculates an error between the real coordinate value of the curve and the calculated integer coordinate value. Is selected, and the selected integer coordinate values are connected by a straight line, and the maximum value of the error between the straight line and the real coordinate value of the curve is calculated. When the maximum value of the error is equal to or less than a predetermined threshold, the straight line is calculated. , And when the error is equal to or greater than a predetermined threshold, the interval between the real coordinate values of the preceding and following curves is made smaller, and the process is repeated from the beginning on this smaller portion.

【0018】従って、曲線の実数座標値から整数座標値
に変換した後、元の曲線の実数座標値とこの整数座標と
の誤差を求め、誤差が小さい整数座標値のみを取り出し
てこれらを結んで近似直線を求めたり、更に整数座標値
を結ぶ直線と曲線の実数座標値との誤差の最大値を求め
て所定閾値以上のときに実数座標値の全体あるいはその
前後を細かくし、処理を繰り返すことにより、品質低下
を防止した曲線に近い高品質な近似直線を生成すること
が可能となる。
Therefore, after converting the real coordinate value of the curve into an integer coordinate value, an error between the real coordinate value of the original curve and the integer coordinate is obtained, and only the integer coordinate value with a small error is extracted and connected. Calculate the approximate straight line or further calculate the maximum value of the error between the straight line connecting the integer coordinate values and the real coordinate value of the curve. Accordingly, it is possible to generate a high-quality approximate straight line close to a curve in which quality deterioration is prevented.

【0019】[0019]

【実施例】次に、図1から図3を用いて本発明の実施例
の構成および動作を順次詳細に説明する。
Next, the structure and operation of an embodiment of the present invention will be sequentially described in detail with reference to FIGS.

【0020】図1は、本発明の1実施例構成図を示す。
図1において、曲線座標算出部1は、文字などの輪郭を
曲線ベクトルで表現した表現式から当該曲線の実数座標
値を算出するものである。例えば図3の(a)に示すよ
うに、X座標の実数座標値1.00、2.00・・・に
対応づけてY座標の実数座標値3.00、3.03・・
・というように算出するものである。この算出した実数
座標値は、曲線の実数座標値メモリ4に格納する。
FIG. 1 is a block diagram showing one embodiment of the present invention.
In FIG. 1, a curve coordinate calculation unit 1 calculates a real coordinate value of a curve from an expression formula expressing a contour of a character or the like by a curve vector. For example, as shown in FIG. 3A, real coordinate values of the Y coordinate are 3.00, 3.03,.
・ It is calculated as follows. The calculated real number coordinate values are stored in the real number coordinate value memory 4 for the curve.

【0021】整数座標算出部2は、曲線の実数座標メモ
リ4より読み出した曲線の実数座標値から整数座標値を
算出するものである。この整数座標値の算出は、曲線の
実数座標値を例えば四捨五入して算出する。算出した整
数座標値は、曲線の整数座標メモリ5に格納する。
The integer coordinate calculator 2 calculates integer coordinate values from the real coordinate values of the curve read from the real coordinate memory 4 for the curve. The calculation of the integer coordinate value is performed by, for example, rounding off the real number coordinate value of the curve. The calculated integer coordinate value is stored in the curve integer coordinate memory 5.

【0022】座標選択部3は、曲線の実数座標メモリ4
から読み出した実数座標値と、曲線の整数座標メモリ5
から読み出した整数座標値との間の誤差を求め、この誤
差が所定閾値以下の整数座標値のみを選択するものであ
る。この選択した誤差が所定閾値以下の整数座標値は、
直線座標メモリ6に格納する。また、誤差が所定閾値以
下の整数座標値を直線で結び、この直線と曲線の実数座
標値との誤差の最大値が所定閾値以上のときに、曲線座
標算出部1による曲線の実数座標値を算出する全ての間
隔を細かくしたり(図4を用いて後述する)、あるいは
曲線座標算出部1による曲線の実数座標値について、誤
差が最大値の実数座標値の近傍の間隔を細かくしたり
し、誤差の最大値が所定閾値を越えないようにする。
The coordinate selecting section 3 has a real coordinate memory 4 for curves.
And the integer coordinate memory 5 of the curve read from the
An error between the coordinate value and the integer coordinate value read from is calculated, and only the integer coordinate value whose error is equal to or less than a predetermined threshold value is selected. An integer coordinate value of which the selected error is equal to or less than a predetermined threshold is
It is stored in the linear coordinate memory 6. In addition, an integer whose error is equal to or less than a predetermined threshold value is connected by a straight line, and when the maximum value of the error between the straight line and the real coordinate value of the curve is equal to or more than the predetermined threshold, the real coordinate value of the curve by the curve coordinate calculation unit 1 is calculated. All the intervals to be calculated are made finer (to be described later with reference to FIG. 4), or the intervals near the real number coordinate values having the maximum error in the real number coordinate values of the curve by the curve coordinate calculation unit 1 are made finer. , The maximum value of the error does not exceed a predetermined threshold.

【0023】曲線の実数座標メモリ4は、曲線の実数座
標値を格納するメモリであって、例えば図3の(a)に
示すように、X座標が1.00の間隔毎のY座標の実数
座標値の列を格納するメモリである。
The real coordinate memory 4 of the curve is a memory for storing the real coordinate values of the curve. For example, as shown in FIG. This is a memory for storing a column of coordinate values.

【0024】曲線の整数座標メモリ5は、曲線の実数座
標メモリ4から読み出して整数にした整数座標値を格納
するメモリである(図3の(b)参照)。直線座標メモ
リ6は、曲線の整数座標メモリ5から読み出した整数座
標値のうち、曲線の実数座標メモリ4から読み出した実
数座標値との誤差(誤差の絶対値)が所定閾値以下のも
のを格納するメモリである(図3の(d)参照)。
The curve integer coordinate memory 5 is a memory for storing integer coordinate values read from the curve real number coordinate memory 4 and converted into integers (see FIG. 3B). The linear coordinate memory 6 stores, among the integer coordinate values read from the integer coordinate memory 5 of the curve, those whose error (absolute value) from the real coordinate value read from the real coordinate memory 4 of the curve is equal to or smaller than a predetermined threshold value. (See FIG. 3D).

【0025】次に、図2のフローチャートに示す順序に
従い、図1の構成の動作を詳細に説明する。図2におい
て、S1は、曲線の実数座標値を算出する。これは、例
えば図3の(e)の曲線座標のベクトルについて、所定
の間隔、ここではX=1.00の間隔でY座標の実数座
標値を図3の(a)に示すように算出する。
Next, the operation of the configuration of FIG. 1 will be described in detail according to the order shown in the flowchart of FIG. In FIG. 2, S1 calculates a real coordinate value of a curve. For example, for the vector of the curve coordinates in FIG. 3E, the real coordinate value of the Y coordinate is calculated at a predetermined interval, here, X = 1.00, as shown in FIG. 3A. .

【0026】S2は、曲線の整数座標値を算出する。こ
れは、例えば図3の(a)の曲線の実数座標値を、四捨
五入して整数にした図3の(b)の整数座標値を算出す
る。S3は、実数座標値と整数座標値の差の絶対値(=
誤差)を算出する。これは、例えば図3の(a)の曲線
の実数座標値と、図3の(b)の整数座標値との差の絶
対値を誤差として算出する。
In step S2, an integer coordinate value of the curve is calculated. In this case, for example, the integer coordinate values in FIG. 3B are calculated by rounding off the real number coordinate values of the curve in FIG. S3 is the absolute value of the difference between the real coordinate value and the integer coordinate value (=
Error). For example, the absolute value of the difference between the real coordinate value of the curve shown in FIG. 3A and the integer coordinate value shown in FIG. 3B is calculated as an error.

【0027】S4は、誤差が閾値以下か判別する。YE
Sの場合には、S5で整数座標値を出力(整数座標値を
直線座標メモリ6に格納)し、S6に進む。NOの場合
には、S6に進む。例えば図3の(c)の誤差(ここで
は、Y座標の誤差)が所定閾値(ここでは0.15以
下)か判別し、YESのものを図3の(d)に示すよう
に出力する。
In step S4, it is determined whether the error is equal to or smaller than a threshold. YE
In the case of S, the integer coordinate value is output in S5 (the integer coordinate value is stored in the linear coordinate memory 6), and the process proceeds to S6. In the case of NO, the process proceeds to S6. For example, it is determined whether the error of FIG. 3C (here, the error of the Y coordinate) is a predetermined threshold value (here, 0.15 or less), and the result of YES is output as shown in FIG. 3D.

【0028】S6は、座標データが終了か判別する。こ
れは、S1で算出した曲線の実数座標値について、S2
からS5の処理を全て終了したか判別する。YESの場
合には、終了する(END)。NOの場合には、次の座
標データ(曲線の実数座標値)について、S2からS5
を繰り返し実行する。
A step S6 decides whether or not the coordinate data is completed. This is because the real coordinate value of the curve calculated in S1 is
It is determined whether all of the processes from S5 to S5 have been completed. If YES, the process ends (END). In the case of NO, the next coordinate data (the actual coordinate value of the curve) is changed from S2 to S5.
Is repeatedly executed.

【0029】以上によって、例えば図3の(e)の曲線
座標のベクトルについて、所定間隔毎に曲線の実数座標
値を算出(S1、図3の(a)参照)し、この曲線の実
数座標値を例えば四捨五入して整数座標値を算出(S
2、図3の(b)参照)した後、曲線の実数座標値と整
数座標値との差の絶対値である誤差を求め(S3、図3
の(c)参照)、この誤差が所定閾値以下のものを選択
して出力する(S4のYES、S5、図3の(d)参
照)。これにより、曲線の実数座標値から誤差が所定閾
値以下の整数座標値のみを選択して出力でき、図3の
(f)に示すように、曲線に沿った滑らかな近似直線を
求めることが可能となる。
As described above, for example, with respect to the vector of the curve coordinates in FIG. 3E, the real coordinate values of the curve are calculated at predetermined intervals (S1, see FIG. 3A), and the real coordinate values of the curve are calculated. Is rounded to calculate an integer coordinate value (S
2, (b) of FIG. 3), an error which is an absolute value of a difference between a real coordinate value and an integer coordinate value of the curve is obtained (S3, FIG. 3).
(C)), those whose errors are equal to or smaller than a predetermined threshold are selected and output (YES in S4, S5, see (d) in FIG. 3). Thereby, it is possible to select and output only integer coordinate values whose error is equal to or less than a predetermined threshold value from the real coordinate values of the curve, and to obtain a smooth approximate straight line along the curve as shown in FIG. Becomes

【0030】図3は、本発明の具体例を示す。図3の
(a)は、曲線の実数座標値の例を示す。これは、図3
の(e)の曲線座標のベクトルについて、X座標の1.
00の間隔毎にそのときのY座標の実数座標値を図示の
ように算出したものである。
FIG. 3 shows a specific example of the present invention. FIG. 3A shows an example of the real coordinate values of the curve. This is shown in FIG.
(E) of the curve coordinate vector, the X coordinate of 1..
The real coordinate value of the Y coordinate at that time is calculated as shown in FIG.

【0031】図3の(b)は、曲線の整数座標値の例を
示す。これは、図3の(a)の曲線の実数座標値のY座
標値について四捨五入して整数座標値を算出したもので
ある。
FIG. 3B shows an example of the integer coordinate values of the curve. This is obtained by calculating the integer coordinate value by rounding off the Y coordinate value of the real number coordinate value of the curve in FIG.

【0032】図3の(c)は、図3の(a)と(b)の
誤差の例を示す。誤差は、下式(1)によって算出す
る。 誤差=|曲線の実数座標値−整数座標値|・・・・・・・・・・・・・(1) ここで、曲線の実数座標値は例えば図3の(a)のY座
標の3.03であり、整数座標値は図3の(b)のY座
標の3.00であるから、これら両者を式(1)に代入
し、 誤差=|3.03−3.00|=0.03 と算出する。
FIG. 3C shows an example of the error between FIGS. 3A and 3B. The error is calculated by the following equation (1). Error = | real number coordinate value of curve−integer coordinate value | ... (1) Here, the real number coordinate value of the curve is, for example, 3 of the Y coordinate in FIG. .03, and the integer coordinate value is 3.00 of the Y coordinate in FIG. 3 (b). Therefore, these two values are substituted into the equation (1), and the error = | 3.03−3.00 | = 0 .03.

【0033】図3の(d)は、図3の(c)の誤差が
0.15以下の整数座標値を選択したものである。ここ
では、点線の矢印を用いて選択した整数座標値を示す。
図3の(e)は、曲線座標のベクトルの例を示す。これ
は、文字の曲線部の輪郭線の曲線座標のベクトルの例で
ある。この曲線座標のベクトルから、X座標について
1.00の間隔毎にY座標の実数座標値を算出し、図3
の(a)を求める。
FIG. 3D shows the case where the integer coordinate values whose error in FIG. 3C is 0.15 or less are selected. Here, an integer coordinate value selected by using a dotted arrow is shown.
FIG. 3E shows an example of a curve coordinate vector. This is an example of a curve coordinate vector of the contour line of the curved portion of the character. From the vector of the curve coordinates, the real coordinate value of the Y coordinate is calculated at intervals of 1.00 with respect to the X coordinate.
(A) is obtained.

【0034】図3の(f)は、図3の(d)の整数座標
値を直線で結んだ近似直線を示す。この近似直線から判
明するように、本発明は、曲線の実数座標値と誤差が閾
値以下(ここでは0.15以下)の整数座標値のみを選
択し、これらを結んで近似直線とすることにより、曲線
の実数座標値から整数座標値に四捨五入したときの誤差
の小さい整数座標値のみとなり、従来の図7の(b)の
近似直線に発生するギザギザを無くし、曲線に沿った滑
らかな近似直線を算出することが可能となる。
FIG. 3 (f) shows an approximate straight line connecting the integer coordinate values of FIG. 3 (d) with a straight line. As can be seen from this approximate straight line, the present invention selects only integer coordinate values whose error is equal to or less than a threshold value (here, 0.15 or less) of the real number coordinate value of the curve and connects them to form an approximate straight line. 7, only the integer coordinate value having a small error when the actual coordinate value of the curve is rounded off to the integer coordinate value is eliminated, and the jaggedness that occurs in the conventional approximate line of FIG. 7B is eliminated, and the smooth approximate line along the curve is eliminated. Can be calculated.

【0035】次に、図4は、本発明の他の動作説明フロ
ーチャート(その1)を示す。これは、図2のフローチ
ャートに従い、S5で出力した整数座標値について、更
に当該整数座標値を結んだ直線と、曲線の実数座標値と
の誤差の最大値が所定閾値を越えたときに、曲線の実数
座標値の算出する間隔を細かくし、当該誤差の最大値が
所定閾値以下となるようにしたものである。以下説明す
る。
FIG. 4 is a flowchart (part 1) for explaining another operation of the present invention. According to the flowchart of FIG. 2, when the maximum value of the error between the integer coordinate value output in S5 and the straight line connecting the integer coordinate value and the real coordinate value of the curve exceeds a predetermined threshold, the curve The interval at which the real coordinate values are calculated is made smaller so that the maximum value of the error is equal to or less than a predetermined threshold value. This will be described below.

【0036】図4において、S1からS6は、図2のS
1からS6と同じであるので、説明を省略する。S7
は、整数座標値を直線で結ぶ。
In FIG. 4, S1 to S6 correspond to S1 in FIG.
1 to S6, the description is omitted. S7
Connects integer coordinate values with a straight line.

【0037】S8は、実数座標値と直線の差の絶対値
(=誤差)を算出する。S9は、最大誤差が閾値以下か
判別する。YESの場合には、求めた整数座標値を結ん
だ直線と曲線の実数座標値との誤差が閾値以下であると
判明したので、一連の処理を終了する。一方、NOの場
合には、求めた整数座標値を結んだ直線と曲線の実数座
標値との誤差の最大値が閾値以上であると判明したの
で、S10で座標算出の間隔を細かくし、S1以降を実
行する。これにより、曲線の実数座標値を求める間隔を
細かくし、曲線を直線近似する際の間隔を短かくし、曲
線に沿った近似直線を求めるようにする。
In step S8, the absolute value (= error) of the difference between the real coordinate value and the straight line is calculated. In step S9, it is determined whether or not the maximum error is equal to or smaller than a threshold. In the case of YES, it is determined that the error between the straight line connecting the obtained integer coordinate values and the real coordinate value of the curve is equal to or smaller than the threshold value, and thus a series of processing ends. On the other hand, in the case of NO, since the maximum value of the error between the straight line connecting the obtained integer coordinate values and the real coordinate value of the curve is found to be equal to or larger than the threshold value, the coordinate calculation interval is reduced in S10, and S1 is set. Execute the following. As a result, the interval for obtaining the real coordinate values of the curve is made smaller, the interval for linearly approximating the curve is made shorter, and an approximate straight line along the curve is obtained.

【0038】以上により、図2のフローチャートによっ
て算出した整数座標値を結んだ直線と曲線の実数座標値
との誤差の最大値が閾値以上のときに、曲線の実数座標
値を求める間隔を動的に細かくし、曲線に沿った品質の
高い近似直線を自動的に求めることが可能となる。
As described above, when the maximum error between the straight line connecting the integer coordinate values calculated according to the flowchart of FIG. 2 and the real coordinate value of the curve is equal to or greater than the threshold value, the interval for obtaining the real coordinate value of the curve is dynamically adjusted. It is possible to automatically obtain a high-quality approximate straight line along the curve.

【0039】次に、図5は、本発明の他の動作説明フロ
ーチャート(その2)を示す。これは、図2のフローチ
ャートに従い、S5で出力した整数座標値について、更
に当該整数座標値を結んだ直線と、曲線の実数座標値と
の誤差の最大値が所定閾値を越えたときに、この所定閾
値を越えた前後の曲線の実数座標値の算出する間隔を細
かくし、当該誤差の最大値が所定閾値以下となるように
したものである。以下説明する。
FIG. 5 is a flowchart (part 2) for explaining another operation of the present invention. According to the flowchart of FIG. 2, when the maximum value of the error between the integer coordinate value output in S5 and the straight line connecting the integer coordinate value and the real coordinate value of the curve exceeds a predetermined threshold value, The interval for calculating the real coordinate values of the curves before and after exceeding the predetermined threshold value is made finer, and the maximum value of the error is set to be equal to or less than the predetermined threshold value. This will be described below.

【0040】図5において、S1からS6は、図2のS
1からS6と同じであるので、説明を省略する。S17
は、整数座標値を直線で結ぶ。
In FIG. 5, S1 to S6 correspond to the S in FIG.
1 to S6, the description is omitted. S17
Connects integer coordinate values with a straight line.

【0041】S18は、実数座標値と直線の差の絶対値
(=誤差)を算出する。S19は、最大誤差が閾値以下
か判別する。YESの場合には、求めた整数座標値を結
んだ直線と曲線の実数座標値との誤差の最大値が閾値以
下であると判明したので、一連の処理を終了する。一
方、NOの場合には、求めた整数座標値を結んだ直線と
曲線の実数座標値との誤差の最大値が閾値以上であると
判明したので、S20で最大誤差の前後の整数座標値の
間で座標間隔を細かくし、曲線座標を算出しなおし、S
2以降を実行する。これにより、直線と曲線の実数座標
値の誤差が最大の部分について、曲線の実数座標値を求
める間隔を細かくし、曲線を直線近似する際の間隔を短
かくし、曲線に沿った近似直線を求めるようにする。
In step S18, the absolute value (= error) of the difference between the real coordinate value and the straight line is calculated. A step S19 decides whether or not the maximum error is equal to or smaller than a threshold. In the case of YES, it is determined that the maximum value of the error between the straight line connecting the obtained integer coordinate values and the real coordinate value of the curve is equal to or smaller than the threshold value, and thus a series of processing is ended. On the other hand, in the case of NO, the maximum value of the error between the straight line connecting the obtained integer coordinate values and the real coordinate value of the curve is found to be equal to or larger than the threshold value. Between the coordinate intervals, and recalculate the curve coordinates.
Execute the second and subsequent steps. Thereby, for the part where the error between the real coordinate value of the straight line and the curve is the largest, the interval for obtaining the real coordinate value of the curve is made finer, the interval when the curve is approximated by a straight line is shortened, and an approximate straight line along the curve is obtained To do.

【0042】以上により、図2のフローチャートによっ
て算出した整数座標値を結んだ直線と曲線の実数座標値
との誤差の最大値が閾値以上のときに、誤差が大きい部
分の曲線の実数座標値を求める間隔を動的に細かくし、
曲線に沿った品質の高い近似直線を自動的に求めること
が可能となる。
As described above, when the maximum value of the error between the straight line connecting the integer coordinate values calculated according to the flowchart of FIG. 2 and the real coordinate value of the curve is equal to or greater than the threshold value, the real coordinate value of the curve having a large error is calculated. Dynamically refine the required interval,
It is possible to automatically obtain a high-quality approximate straight line along the curve.

【0043】[0043]

【発明の効果】以上説明したように、本発明によれば、
曲線の実数座標値から整数座標値に変換した後、元の曲
線の実数座標値とこの整数座標との誤差を求め、誤差が
小さい整数座標値のみを取り出してこれらを結んで近似
直線を求たり、更に整数座標値を結ぶ直線と曲線の実数
座標値との誤差の最大値を求めて所定閾値以上のときに
実数座標値の全体あるいはその前後を細かくし、処理を
繰り返す構成を採用しているため、曲線に近い高品質な
近似直線を生成することができる。これにより、本来の
曲線の実数座標値から誤差の少ない整数座標値を選択
し、この選択した整数座標値を近似直線の座標とし、従
来の直線近似で見られた拡大時の品質低下を防ぎ、拡大
しても曲線に近い高品質の近似直線の整数座標値を求め
ることができる。
As described above, according to the present invention,
After converting the real coordinate values of the curve into integer coordinate values, find the error between the real coordinate value of the original curve and this integer coordinate, take out only the integer coordinate values with small errors, and connect them to obtain an approximate straight line. Furthermore, the maximum value of the error between the straight line connecting the integer coordinate values and the real coordinate value of the curve is obtained, and when the difference is equal to or larger than a predetermined threshold value, the whole of the real coordinate value or before and after the fine value is refined, and the processing is repeated. Therefore, it is possible to generate a high-quality approximate straight line close to a curve. Thereby, an integer coordinate value with a small error is selected from the real number coordinate value of the original curve, and the selected integer coordinate value is used as an approximate straight line coordinate, to prevent the quality degradation at the time of enlargement seen in the conventional linear approximation, It is possible to obtain an integer coordinate value of a high-quality approximate straight line that is close to a curve even when enlarged.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の1実施例構成図である。FIG. 1 is a configuration diagram of one embodiment of the present invention.

【図2】本発明の動作説明フローチャートである。FIG. 2 is a flowchart illustrating the operation of the present invention.

【図3】本発明の具体例である。FIG. 3 is a specific example of the present invention.

【図4】本発明の他の動作説明フローチャート(その
1)である。
FIG. 4 is a flowchart (part 1) for explaining another operation of the present invention.

【図5】本発明の他の動作説明フローチャート(その
2)である。
FIG. 5 is a flowchart (part 2) for explaining another operation of the present invention.

【図6】従来技術の説明図である。FIG. 6 is an explanatory diagram of a conventional technique.

【図7】従来技術の具体例である。FIG. 7 is a specific example of the related art.

【符号の説明】[Explanation of symbols]

1:曲線座標算出部 2:整数座標算出部 3:座標選択部 4:曲線の実数座標メモリ 5:曲線の整数座標メモリ 6:直線座標メモリ 1: Curve coordinate calculation unit 2: Integer coordinate calculation unit 3: Coordinate selection unit 4: Real number coordinate memory of curve 5: Integer coordinate memory of curve 6: Linear coordinate memory

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】曲線の実数座標値から整数座標値を求めて
直線近似する直線近似方式において、 曲線の実数座標値から整数座標値を算出する整数座標算
出部(2)と、 元の曲線の実数座標値とこの算出した整数座標値との誤
差を求め、この誤差が所定閾値以下の整数座標値を選択
する座標選択部(3)とを備え、 選択した整数座標値を直線で結んで直線近似するように
構成したことを特徴とする曲線の直線近似方式。
A linear approximation method for obtaining an integer coordinate value from a real coordinate value of a curve and linearly approximating the same, comprising: an integer coordinate calculator (2) for calculating an integer coordinate value from the real coordinate value of the curve; An error between the real number coordinate value and the calculated integer coordinate value is obtained, and a coordinate selection unit (3) for selecting an integer coordinate value whose error is equal to or less than a predetermined threshold value is provided. A straight-line approximation method of a curve characterized by being configured to approximate.
【請求項2】曲線の実数座標値から整数座標値を求めて
直線近似する直線近似方式において、 曲線の実数座標値から整数座標値を算出する整数座標算
出部(2)と、 元の曲線の実数座標値とこの算出した整数座標値との誤
差を求め、この誤差が所定閾値以下の整数座標値を選択
する座標選択部(3)とを備え、 選択した整数座標値を直線で結び、この直線と曲線の実
数座標値との誤差を算出し、誤差の最大値が所定閾値以
下のときに当該直線を求める近似直線とし、一方、誤差
の最大値が所定閾値以上のときに曲線の実数座標値の間
隔を細かくし、最初から処理を繰り返すように構成した
ことを特徴とする曲線の直線近似方式。
2. A linear approximation method for obtaining an integer coordinate value from a real coordinate value of a curve and performing linear approximation, wherein: an integer coordinate calculation unit (2) for calculating an integer coordinate value from the real coordinate value of the curve; An error between the real coordinate value and the calculated integer coordinate value is obtained, and a coordinate selector (3) is provided for selecting the integer coordinate value whose error is equal to or less than a predetermined threshold value. An error between the straight line and the real coordinate value of the curve is calculated, and when the maximum value of the error is equal to or less than a predetermined threshold, the approximate straight line is determined. A straight-line approximation method for a curve, characterized in that processing is repeated from the beginning by narrowing value intervals.
【請求項3】曲線の実数座標値から整数座標値を求めて
直線近似する直線近似方式において、 曲線の実数座標値から整数座標値を算出する整数座標算
出部(2)と、 元の曲線の実数座標値とこの算出した整数座標値との誤
差を求め、この誤差が所定閾値以下の整数座標値を選択
する座標選択部(3)とを備え、 選択した整数座標値を直線で結び、この直線と曲線の実
数座標値との誤差を算出し、誤差の最大値が所定閾値以
下のときに当該直線を求める近似直線とし、一方、誤差
の最大値が所定閾値以上のときに当該誤差の最大値の前
後の曲線の実数座標値の間隔を細かくし、この細かくし
た部分について最初から処理を繰り返すように構成した
ことを特徴とする曲線の直線近似方式。
3. A linear approximation method for obtaining an integer coordinate value from a real coordinate value of a curve and performing linear approximation, wherein: an integer coordinate calculation unit (2) for calculating an integer coordinate value from the real coordinate value of the curve; An error between the real coordinate value and the calculated integer coordinate value is obtained, and a coordinate selector (3) is provided for selecting the integer coordinate value whose error is equal to or less than a predetermined threshold value. An error between the straight line and the real coordinate value of the curve is calculated, and when the maximum value of the error is equal to or less than a predetermined threshold value, the approximate line is determined as an approximate straight line. A straight line approximation method for a curve, characterized in that the interval between the real number coordinate values of the curve before and after the value is made fine, and the processing is repeated from the beginning for this fine part.
JP4064256A 1992-03-19 1992-03-19 Curve linear approximation method Expired - Lifetime JP2735974B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4064256A JP2735974B2 (en) 1992-03-19 1992-03-19 Curve linear approximation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4064256A JP2735974B2 (en) 1992-03-19 1992-03-19 Curve linear approximation method

Publications (2)

Publication Number Publication Date
JPH05266184A JPH05266184A (en) 1993-10-15
JP2735974B2 true JP2735974B2 (en) 1998-04-02

Family

ID=13252921

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4064256A Expired - Lifetime JP2735974B2 (en) 1992-03-19 1992-03-19 Curve linear approximation method

Country Status (1)

Country Link
JP (1) JP2735974B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6155092B2 (en) * 2013-05-17 2017-06-28 株式会社フィックスターズ Graphic information creating apparatus, area dividing apparatus, graphic information creating method, area dividing method, and program

Also Published As

Publication number Publication date
JPH05266184A (en) 1993-10-15

Similar Documents

Publication Publication Date Title
JP3238580B2 (en) Thicker text generator
JP2909273B2 (en) Outline font line width adjusting method and apparatus
US5189730A (en) Apparatus for generating character pattern signals and method for generating same
JP2735974B2 (en) Curve linear approximation method
US5519412A (en) Pattern processing method
JPH0744152A (en) Data converting device
US6504543B1 (en) Polygon drawing method and polygon drawing apparatus
JPH0125072B2 (en)
JPH11109943A (en) Font processor and recording medium recorded with font processing program
JP3280160B2 (en) Document processing apparatus and document processing method
JPH06100906B2 (en) Character processing method
JP2730399B2 (en) Image data reduction device
JP3215179B2 (en) Hinting outline fonts
US5995674A (en) Image processing apparatus with shape-correction of a contour-specified figure
JPH0580741A (en) System and device for character font generation
JP3057959B2 (en) Data converter
JP2971765B2 (en) Polygon drawing method and polygon drawing device
JP2776347B2 (en) Drawing device for printer
JPH03290691A (en) Reduction method for vector font
JPH05266183A (en) Linear approximation system
JP2736803B2 (en) How to convert image magnification
JPH0264598A (en) Graphic character developing method
JPH09212667A (en) Method for transforming line segment data and device therefor
JPH0736434A (en) Character output device
JPS62211691A (en) Character synthesization system

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19971216