【発明の詳細な説明】[Detailed description of the invention]
(A) 発明の技術分野
本発明は線図形の近似方式に係り、特に手画き入力線図
形の1うに、時間情報をもつ2次うC座標点列形式で入
力された文字・図形の形状を曲線や円弧で近イ11表示
するようにした線図形の直線・円弧近似方式に1゛1す
る。
(13)従来技術と問題点
例えばタブレットより手411人力[また文字あるいは
図形を表示するとき、この手書入カバターンを一定時間
毎にサンプリングしてそのときの平面座標情報を&/e
取ってこれを記憶処理する8委がある。
しかしながらこの場合、サンプリング点のデータをその
まま全部保持するのはメモリ答)+4が大きくなり好ま
しくない。したがってサンプリング点のデータを仮想的
にir:# 腺や円弧で近似的(てイJ示(7でこれを
ベクトル情報と(A) Technical Field of the Invention The present invention relates to a method of approximating line figures, and in particular, to approximating the shape of characters and figures input in the form of a quadratic C-coordinate point series with time information, such as hand-drawn input line figures. The method of approximating line figures using curves and circular arcs is used to approximate straight lines and circular arcs. (13) Prior art and problems For example, when displaying characters or figures, this handwritten cover pattern is sampled at regular intervals and the plane coordinate information at that time is
There are 8 committees that will take this and process it into amnestics. However, in this case, it is not preferable to retain all the data at the sampling points as it is because the memory (result) +4 becomes large. Therefore, the data at the sampling point can be virtually approximated using glands or arcs (see 7).
【2て記憶すること、つまり線図形近似
方式による記憶が行われている。
従来の線図形近似方式としてti、■仮想的pc ia
腺と円弧の式を立ててそのいずれかに合致するのかを求
める方式や、■連続する3点a、b、cのうち両端のa
−c点を結ぶ直線と中間のb点との距r、t+を求め′
C曲率を表わして直線と円弧でA百トζする方式等があ
る。しかし前者は嵌状がA411かすぎるので11°f
報量が多くなり、また後者では各サンプリング点毎VC
その両端のサンプリング虚聞を結ぶ的綜との距離を求め
るために距t’1li(引算に時間がかかるという欠点
がある。
に)発明の目的
本発明の目的は、このよう々欠点を改善するために、少
ないl+’i報Bで、しかも高速にかつ原図形に近い近
似lfl線や近似円弧を演算できる線図形の直線・円弧
近似方式X!!i−提供することである。
0))発明の構成
この目的を遂行するため本発明の線図形の直線・円弧近
似方式では、時間情報をもつ2久元座標点列のデータに
より検出される文字・図形等を直線と円弧により近世す
る方式において、入力された点列をaeの方向コードに
近似する方向コード近似手段と、該方向コードの出現順
序を判定する判定手段とを設け、入力された点列を方向
コード近似により分割し、分割された部分を方向コード
の11iI’i現11ヒ1序1・て応じてiM 1)t
iiあるいは円弧に近似することを特徴とする〇
任コ 発明の実施例
以下、本発明にかかる線図形のIfAA&・円弧近似方
式の実施例を図面を用いて詳、flllに説明する。
まず第1図乃至第4図を用いて、本発明の詳細な説明す
る。
第1図は手曹き入力される図形の一例を7表わす図であ
る。
同図Ca>のような図形を舗1くと同図(b)のよりな
PII・11点列が検出される。第1図(a)(+3)
の矢印及び添字は夫々込1かれた順序、検出された順序
を示す。
第2図は、方向コードを8個と【、た場合の方向コード
を表わす図である。
第3図は第4図(l))に示す座標点列を第2図に示す
方向コードにより近似した例を示す[ン1で、%、る。
第3図に示すよう!F:t1.て方向コードの列を求め
たイ、訃、以下に述べる方法で座標点列の分割及び分割
された部分の形状を直線あるいr、t p]弧VC44
1定する。
(1)同じコードが2個以上連続するときは、イ゛の点
で分割し、そのAまでの部夕)の形状’y: iKX;
’iと判定する。
(2)2種類の番号のコードが交互に((])の条r1
:を満たさない限り連続してもよい)表わねた後、この
2種類の?Ir号のコードと尼なる番号のコードが表わ
れた場合、この異なる番号のコードが表われた点で分割
し、この部分の始点と終点を結ぶ石線をlとして、その
部分に含まれる点のうち、直rh /の一方の側にある
点の個数mと直り一の他方の側にある点の個数nを求め
る1、直線!上に、*、る点は個数として計数17がい
。
このとき、m = 0 、またはn=00場0、その部
分の形状を円弧として判定する。
また、m\0.かつn\0の場合、その部分に含まれる
点のうち「f純lと最も離れた小の直線lからの距肉)
i r苓−求める。
このときr〈βの場合は、その形状を直線と判定する。
着た、r≧βの場合it 、その部分と直It!i!
1の交点を求め、夜点に4rって、さら(・ζその部分
を分割し、伜のおのの形状を円弧と判定するOこのとき
、値βは、値線あるいは円弧に近似するたぬの任意の値
である。
以」二説明したように、直線と判定された場f:tけ、
始)さと終点の)4−4:’ンでその形状を表現[7、
円1jlkと制御宛された3、j、+、 fi、 t−
1,始点と終点及びその¥?IS分σ)中Iらの点から
、その3点を含む円の中心のル什と半径を求める。ここ
で、3つの点が値線上にJ))乙ときは直線とする。
α=5.β=0.4としだ場合の鎮3図に示す図形を分
割したものを第4図に示し、第5図にその処理結果を示
す。
次に前述の如き、直線と円弧の判定の処理を行なうため
の一実施例舌・第6図に示【1、同図を用いて詳細に説
明する。
′第6図において、1は入力装置、2け8方向コード討
ち回路、3は座標虞列格納部、4は同一コード連続判定
回路、5は異コード入力判定回路、6はiff線1青報
出力回路、7はIjij形性刊穿回貼、8はlI]弧情
層情報1回路、9は最大距Ill計p回路、10は部分
DI<標点列分割回路、1工し1図形情報格納部である
。
入力装置1は、例えばタブレットの如き入力デバイスで
あって、阻1図(b)に示す1・J11点シIf I’
+〜1ノ24の如く一定時間毎Vこデータ線aを−j
1′シてサンプリングされた座標を出力するものである
。
8方向コ一ド計1マ回路2はデータ線aを介して入力さ
れた座標とその前に入力された座標から8方向コードを
求めデータa、a C*介して、求めた8方向コードを
同一コード連続判定回路4、異コード入力判定回路5v
r、出力すると共に、データ線))を介して座4q点列
格納部3に求めた8方向コードを格納する。
座標点列格納部311、同一コード連続判定回路4、界
コード人力判定回路5によって入力座は点列が分割され
るときに処理される部分子−1’+4パ8点列を格納す
る。
同一コード連続判定回路4け同じコードがある回数連続
して入力された場合、データ線dを介して11紳情報出
力回路6を起111Ji”ると共に、異コード入力判定
回路5をリセットする。
異コード入力判定回路5FJ、入力された8方向コード
の卵類が3梯11゛1になった」具合、データ線eを介
(−て向形性判定回路7を起動−rると共に同一コード
連続判定回路4をリセ、ツトする。
石綿情報出力回路6rよデータ線dあるいは1全介して
起yIhされ、座、隙点列格納部3に格納され−〔いる
始点、終点の座標をデータに9fを介して受は取り、デ
ータ線l(を介して図形情報1納部11に出力する。
4’ltl形性判5i!回路7I/′i、座標点列(へ
納部3に格納されている部分座標点列をデータ線f舌二
介【2−c受tJ取り、始点と終点を通る直線を計19
11、その間の点と直線の関係を求め、そのVi腺の片
側だけに分布する場合1rT、データ1腺gから始点表
終点が・四点1]であるかを円弧悄+45′i¥出回路
8に入力する。・また片側に分布しなければデータ紳1
1f介して最大用m計算回路を起動する。
円弧情報算出回路8は、データ線gあるいはlを介して
座′41“1°!虚列格納部3に格納さJlているBi
t分座標点列の何点目から何点1迄が円弧であるかを判
断し、データ線fを介して座4〃点列惰納iXB 3か
らその座標点列金受は取り、円l111(情報を3r出
し、データ線1]】を介し−C図形情報格納部11に出
力する。
最大踏hIL計算回路9け始点と終点を結ぶILf線と
その間にあるその直線と最も離れた点の距離を求めその
比重がある照灯以内ならば、データ線iを介して直線情
報出力回路6を起動し、ある距離以上ならば、データ&
l jを介して部分座標点列分割器10を起動する。
部分座標点列分割器10はjにより起動され、その点列
の始点と終点が何点目であるかをデータ線l!を介して
円弧情報を邊゛出回路8に出力する。
11は図形情報18納部である。
以上説明した構よとすることで、入力された線図形を直
線あるいは円弧に近イ1″Iすることができる。
間 発明の効果
以−ト説明したように、本発明によれば、タブレットの
如き2次元入力面上から入力された°文字、パターンの
ような図形情報を複数の方向コードに近似し、方向コー
ドの出現11Fj序によシ簡単に直線あるいは円弧に近
似することができるので、非常に効率よく短時間で圧縮
することができる。[2] In other words, storage is performed using a line figure approximation method. As the conventional line figure approximation method, ti, virtual pc ia
There are methods to set up equations for glands and arcs and find out which one of them matches,
Find the distances r and t+ between the straight line connecting point -c and point b in the middle'
There are methods such as expressing C curvature and expressing A hundred ζ by a straight line and a circular arc. However, the former has a fitting shape of A411 which is too high, so it is 11°f.
In the latter case, the amount of VC increases at each sampling point.
In order to find the distance to the target helix that connects the sampling falsehoods at both ends, the distance t'1li (which has the disadvantage that it takes time to subtract) In order to do this, a straight line/circular arc approximation method for line figures that can calculate approximate lfl lines and approximate circular arcs close to the original figure at high speed and with less l+'i information B is introduced. ! i- To provide. 0)) Structure of the Invention In order to achieve this purpose, the linear/circular approximation method for line figures of the present invention uses straight lines and circular arcs to detect characters, figures, etc. detected using data of a two-dimensional coordinate point sequence with time information. In modern methods, a direction code approximation means for approximating an input point sequence to the direction code of ae and a determination means for determining the appearance order of the direction code are provided, and the input point sequence is divided by direction code approximation. Then, change the divided part to the direction code of 11iI'i according to the direction code.
ii or 〇Renko characterized by approximation to a circular arc Embodiments of the invention Hereinafter, embodiments of the IfAA & arc approximation method for line figures according to the present invention will be described in detail with reference to the drawings. First, the present invention will be explained in detail using FIGS. 1 to 4. FIG. 1 is a diagram showing seven examples of figures that are manually input. When a figure such as Ca> in the figure is drawn, a sequence of 11 PII points as shown in FIG. 2B is detected. Figure 1 (a) (+3)
The arrows and subscripts indicate the order of inclusion and the order of detection, respectively. FIG. 2 is a diagram showing direction codes when there are eight direction codes. FIG. 3 shows an example in which the coordinate point sequence shown in FIG. 4(l)) is approximated by the direction code shown in FIG. As shown in Figure 3! F:t1. The sequence of direction codes is calculated by dividing the sequence of coordinate points and the shape of the divided part by the method described below.
1 set. (1) When two or more of the same codes are consecutive, divide them at the point A, and form the part up to A)'y: iKX;
'i' is determined. (2) Article r1 in which two types of number codes are alternately ((])
: Can be consecutive as long as it does not satisfy) After these two types of ? When a code with the number Ir and a code with the number Ama appear, divide it at the point where the code with the different number appears, and let the stone line connecting the start and end points of this part be l, and calculate the points included in that part. Find the number m of points on one side of straight rh / and the number n of points on the other side of straight line 1. Straight line! The number of * and dots above is 17. At this time, if m = 0 or n = 00, the shape of that part is determined to be an arc. Also, m\0. And in the case of n\0, among the points included in that part, "f pure l and the distance from the smallest straight line l that is the most distant"
i r 蓓 - seek. At this time, if r<β, the shape is determined to be a straight line. If r≧β then it is directly connected to that part! i!
Find the intersection point of As explained above, if it is determined to be a straight line, then f:t is an arbitrary value.
Start) and end point) 4-4:'n express the shape [7,
Circle 1jlk and control addressed 3,j,+,fi,t-
1. Starting point and ending point and their ¥? IS σ) From the points I and others, find the radius and radius of the center of the circle that includes those three points. Here, when the three points are on the value line, it is assumed to be a straight line. α=5. FIG. 4 shows a divided figure of the figure shown in FIG. 3 in the case of β=0.4, and FIG. 5 shows the processing results. Next, one embodiment of the process for determining straight lines and circular arcs as described above will be described in detail with reference to FIG. 6. 'In Fig. 6, 1 is an input device, 2-digit 8-way code decoding circuit, 3 is a coordinate column storage section, 4 is a same code continuity judgment circuit, 5 is a different code input judgment circuit, and 6 is an IF line 1 blue report. Output circuit, 7 is Ijij shape publication perforation paste, 8 is lI] arc layer information 1 circuit, 9 is maximum distance Ill meter p circuit, 10 is partial DI < gage sequence division circuit, 1 work and 1 figure information It is a storage part. The input device 1 is, for example, an input device such as a tablet, and the input device 1 is an input device such as a tablet.
+ to 1 no 24, every certain time V this data line a -j
1' and outputs the sampled coordinates. 8-direction code total 1 circuit 2 calculates an 8-direction code from the coordinates input via data line a and the previously input coordinates, and outputs the obtained 8-direction code via data a, a, and C*. Same code continuous determination circuit 4, different code input determination circuit 5v
r, and at the same time, the obtained 8-direction code is stored in the 4q point sequence storage section 3 via the data line)). The coordinate point sequence storage unit 311, the same code continuity determination circuit 4, and the field code manual determination circuit 5 store the input locus as a partial molecule -1'+4P8 point sequence that is processed when the point sequence is divided. Same code consecutive judgment circuit When the same code is inputted a certain number of times in succession, the same code output circuit 6 is activated via the data line d, and the different code input judgment circuit 5 is reset. The code input judgment circuit 5FJ starts the morphotropy judgment circuit 7 via the data line e (-r), and the same code continues. Reset and turn off the determination circuit 4. The asbestos information output circuit 6r is generated via the data line d or 1, and the coordinates of the starting point and ending point stored in the seat and gap row storage section 3 are stored as data 9f. The receiver is received via the data line l (and output to the graphic information 1 storage unit 11. Take the partial coordinate point sequence of
11. Find the relationship between the points and the straight line between them, and if it is distributed only on one side of the Vi gland, 1rT, from the data 1 gland g, find out whether the starting point table ending point is 4 points 1] arc + 45'i\ output circuit Enter 8.・If the distribution is not on one side, the data is 1
Activate the maximum m calculation circuit via 1f. The arc information calculation circuit 8 calculates Bi stored in the imaginary column storage section 3 via the data line g or l.
Determine from what point to what point 1 in the coordinate point sequence for t minutes is a circular arc, and take the coordinate point sequence from the seat 4 through the data line f to the circle l111. (outputs information 3r and outputs it to the -C figure information storage unit 11 via the data line 1]) Maximum stroke hIL calculation circuit9 If the distance is determined and the specific gravity is within the light, the linear information output circuit 6 is activated via the data line i, and if the distance is over a certain distance, the data &
Activate the partial coordinate point sequence divider 10 via lj. The partial coordinate point sequence divider 10 is activated by j, and determines which points are the starting and ending points of the point sequence using the data line l! The circular arc information is output to the exit circuit 8 via. 11 is a graphic information 18 storage section. By implementing the above-described structure, it is possible to approximate the input line figure to a straight line or a circular arc. Graphical information such as letters and patterns input from a two-dimensional input screen such as It can be compressed very efficiently and in a short time.
【図面の簡単な説明】[Brief explanation of the drawing]
第1図は手゛#1.き入力される図形の一例を表わす図
、第2図は8方向コードを♀ミわす図、詑3図は#!1
図(b)に示す座標点列を8方向コードにより近似した
例を示す図、第4図、第5図は本発明の詳細な説明する
だめの図1、M6図は本発明の一実施例を説明するため
の図である。
図において、lは入方装h″、2は8方向コ一ド計算回
路、3は座標点列格納部、4は同一コード連続判定回路
、5は異コード入力判定回路、6は直線情報出力回路、
7は線形性判定回路、8は円弧情報算出回路、9は最大
距離計算回路、10は部分座標点列分割器、11は図形
情報格納部である。
■1 、 1
6
第2図
第3圀
第4
第5[Figure 1 shows step #1. Figure 2 is a diagram showing an example of a figure input by inputting ``♀'', Figure 2 is a diagram showing an 8-way code, and Figure 3 is #! 1
A diagram showing an example of approximating the coordinate point sequence shown in FIG. FIG. In the figure, l is the input method h'', 2 is the 8-direction code calculation circuit, 3 is the coordinate point sequence storage unit, 4 is the same code continuity judgment circuit, 5 is the different code input judgment circuit, and 6 is the straight line information output circuit,
7 is a linearity determination circuit, 8 is an arc information calculation circuit, 9 is a maximum distance calculation circuit, 10 is a partial coordinate point sequence divider, and 11 is a graphic information storage section. ■1, 1 6 Figure 2, Section 3, Section 4, Section 5 [