JPS61153785A - Vertex detecting method - Google Patents

Vertex detecting method

Info

Publication number
JPS61153785A
JPS61153785A JP27814784A JP27814784A JPS61153785A JP S61153785 A JPS61153785 A JP S61153785A JP 27814784 A JP27814784 A JP 27814784A JP 27814784 A JP27814784 A JP 27814784A JP S61153785 A JPS61153785 A JP S61153785A
Authority
JP
Japan
Prior art keywords
point
vector
vertex
angle difference
predetermined value
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.)
Pending
Application number
JP27814784A
Other languages
Japanese (ja)
Inventor
Koichi Ejiri
公一 江尻
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP27814784A priority Critical patent/JPS61153785A/en
Publication of JPS61153785A publication Critical patent/JPS61153785A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To detect a correct vertex by obtaining an angle difference between mean vectors before and after a noticing point on a curved line and detecting this noticing point as the vertex of the curved line when the angle difference exceeds a predetermined value. CONSTITUTION:A vector adder 110 change a direction code held by stages 105, 106, 107 into a vector expression and adds to obtain a mean vector Sc. A differential device 113 calculates an angle difference between the mean vector Sc and a vector Cn of a noticing point. In a comparator 115, the angle difference thetais compared with a predetermined value Th1 and if theta>Th1, a switch 116 is operated, and an output (Sc) of a vector adder 110 and the output of the other vector adder 111 are outputted to a difference device 113. In the difference device 113, the angle difference ¦ScEc¦ is obtained and compared with a predetermined value Th7 by the compara tor 115. When the angle difference is larger than Th7, the noticing point is detected as a vertex.

Description

【発明の詳細な説明】 〔技術分野〕 本発明は1曲線を直線近似する場合などに好適な頂点検
出方法に関する。
DETAILED DESCRIPTION OF THE INVENTION [Technical Field] The present invention relates to a vertex detection method suitable for linear approximation of a curve.

〔従来技術〕[Prior art]

第4図(a)はチェーンコード表現された曲線であり、
各数字は方向コードで第3図に示すベクトルである。こ
の曲線を直線近似するために頂点を見出すことには、従
来は1次のような方法によっている。
Figure 4(a) is a curve expressed as a chain code,
Each number is a direction code and is a vector shown in FIG. Conventionally, a first-order method is used to find the vertex for linear approximation of this curve.

始点Sから曲線上のある点(現在点)まで直線を引き、
その直線と途中の点X+の距離りが所定の許容値以下で
あるか調べる。許容値以下ならば。
Draw a straight line from the starting point S to a certain point on the curve (current point),
It is checked whether the distance between the straight line and point X+ on the way is less than or equal to a predetermined tolerance. If it is below the allowable value.

現在点を進め、同様の判定を行う。ある現在点で距離り
が許容量を越えると、その直前の点を頂点とし、そこか
ら始点Sまでの点を両点を結ぶ直線で表現する。そして
、その現在点を改めて始点として同様の操作を続ける。
Advance the current point and make the same determination. When the distance exceeds the allowable amount at a certain current point, the point immediately before that point is set as the apex, and the points from there to the starting point S are expressed by a straight line connecting both points. Then, the same operation is continued using the current point as the starting point.

このような方法により第4図の曲線の頂点Pl。By this method, the apex Pl of the curve in FIG.

P2が検出され、この曲線は、第5図に示すように、5
−PI−P2−Eの3つの線分で表現される。しかし、
第4図を観察すれば、この曲線は3木の線分より2本の
線分で表現する方が現実に近いことは明らかである。し
かも、幾何図形を一デジタル表現すると、一般に第4図
のように頂点部分が丸まるから、上記のような問題が起
りやすい。
P2 is detected and this curve is 5 as shown in FIG.
-PI-P2-E is expressed by three line segments. but,
Observing FIG. 4, it is clear that this curve is more realistic if it is represented by two line segments than by three tree line segments. Moreover, when a geometric figure is digitally represented, the apex portions are generally rounded as shown in FIG. 4, so the above-mentioned problems are likely to occur.

さらに、上記従来方法は演算量が極めて多い。Furthermore, the conventional method described above requires an extremely large amount of calculation.

〔目 的〕〔the purpose〕

本発明の目的は、上記のような問題点を解決できる頂点
検出法を提供することにある。
An object of the present invention is to provide a vertex detection method that can solve the above problems.

〔構 成〕〔composition〕

本発明の頂点検出法は、方向コード列で表現された曲線
上の注目点の前と後の平均ベクトルを求め、該平均ベク
トル間の角度差を求め、該角度差を所定値と比較し、該
角度差が該所゛定埴を越えた場合に、該注目点を該曲線
の甲8点として検出することを特徴とするものである8
  − 以下1図面を参照して本発明の一実施例を説明する。
The apex detection method of the present invention calculates average vectors before and after a point of interest on a curve expressed by a direction code string, calculates an angular difference between the average vectors, and compares the angular difference with a predetermined value. It is characterized in that when the angle difference exceeds a fixed value at the location, the point of interest is detected as the 8th point on the curve.
- An embodiment of the present invention will be described below with reference to one drawing.

第1図は頂点検出のフローチャートであるにこで、Cn
はチェーンコード表現された曲線のn番目の点の方向コ
ードである。各方向コードは第3図(b)に示すような
ベクトルであり、ベクトル表現すれば1次式の通りであ
る。
Figure 1 is a flowchart of vertex detection.
is the direction code of the nth point of the chain code represented curve. Each direction code is a vector as shown in FIG. 3(b), and expressed as a vector as a linear equation.

1= (1,0) 2= (L  L) 3= (0,1) 4= (−1,1) 5=(−L、0) 6= (−り、−1) 7=  (0,−1) 8=(1−、−1)                
 ・・・(1)このフローチャートの処理内容は、方向
コード列として表現された曲線上の注目点の前と後の平
均ベクトルの角度差が大きいとき、その点を頂点(co
rner)として検出するものである。
1= (1,0) 2= (L L) 3= (0,1) 4= (-1,1) 5=(-L,0) 6= (-ri,-1) 7= (0, -1) 8=(1-,-1)
(1) The processing content of this flowchart is that when the angular difference between the average vectors before and after a point of interest on a curve expressed as a direction code string is large, that point is
rner).

まず、チェーン要素の番号nを1に初期設定し。First, initialize the chain element number n to 1.

処理を開始する(ステップ51)。nを1だけインクリ
メントしくステップ52)、その方向コー□ ドCnが
0であるか調べる(ステップ53)。C−nが0ならば
、つまり曲線上の点ではなければ、処理は終了する。
Processing is started (step 51). Increment n by 1 (step 52), and check whether the direction code Cn is 0 (step 53). If C-n is 0, that is, if the point is not on the curve, the process ends.

Cn≠Oならば、その点(注目点)から1個前の点まで
の平均ベクトルScを求める(ステップ54)、そして
、注目点のベクトル(方向コード)Cnと、その前の平
均ベクトルScとの角度差1cnAsc1.具体的には
次式の角度Oを設定値Th、と比較する(ステップ55
)。
If Cn≠O, calculate the average vector Sc from that point (point of interest) to the previous point (step 54), and calculate the vector (direction code) Cn of the point of interest and the previous average vector Sc. Angle difference 1cnAsc1. Specifically, the angle O in the following equation is compared with the set value Th (step 55).
).

ICn1・l5nl 角度差が所定値以下ならば、注目点は頂点ではないので
、ステップ52に戻り1次の点を注目点として処理を続
行する。
If the ICn1·l5nl angular difference is less than the predetermined value, the point of interest is not a vertex, and the process returns to step 52 and continues the process with the primary point as the point of interest.

角度差が所定値より大きければ、注目点から後のr個の
点までの平均ベクトルEcを求める(ステップ56)。
If the angular difference is larger than the predetermined value, the average vector Ec from the point of interest to the subsequent r points is determined (step 56).

このベクトルEcと注目点の前の平均ベクトルScとの
角度差1sc’Eclを所定値Th、と比較する(ステ
ップ57)。角度差が所定値以下ならば、注目点は頂点
でないのでステップ52へ戻り次の注目点の処理に進む
The angular difference 1sc'Ecl between this vector Ec and the average vector Sc before the point of interest is compared with a predetermined value Th (step 57). If the angular difference is less than or equal to the predetermined value, the point of interest is not a vertex, so the process returns to step 52 and proceeds to process the next point of interest.

角度差が所定値より大きければ、その注目点を頂点とし
て検出しくステップ58)、nをrだけインクリメント
しくステップ59)、ステップ53へ戻る。
If the angular difference is larger than the predetermined value, the point of interest is detected as a vertex (step 58), n is incremented by r (step 59), and the process returns to step 53.

以上の処理はソフトウェアでもハードウェアでも実行不
可能であるが、そのハードウェアの具体例について第2
図により説明する。
The above process cannot be executed by software or hardware, but we will discuss a specific example of that hardware in the second section.
This will be explained using figures.

この図において、100は7段のステージ101〜10
7からなるシフトレジスタであり1図の左側の端より方
向コードのチェーンが入力される6そのステージ104
の内容が注目点の方向コードである。ベクトル加算器1
10は、ステージ105.106,107に保持されて
いる方向コード(ベクトル)を、(1)式のベクトル表
現に変えて加算し、平均ベクトル9cを求める。差分器
112は、平均ベクトルScと、注目点のベクトルCn
との角度差θを(2)式によって計算する。
In this figure, 100 represents seven stages 101 to 10.
It is a shift register consisting of 7 and 6 stages 104 into which a direction code chain is input from the left end of the figure.
The content is the direction code of the point of interest. vector adder 1
10 converts the direction codes (vectors) held in the stages 105, 106, and 107 into the vector expression of equation (1) and adds them to obtain an average vector 9c. The differentiator 112 calculates the average vector Sc and the vector Cn of the point of interest.
The angular difference θ is calculated using equation (2).

比較器115において、角度差Oを所定値Th。The comparator 115 sets the angular difference O to a predetermined value Th.

と比較し、θ>Th、ならば、スイッチ116を作動さ
せ、ベクトル加算器110の出力(Sc)と、他方のベ
クトル加算器111の出力を差分器113へ入力させる
。θ≦Th、ならば、スイッチ116は作動さす、その
後、パルスジェネレータ113からパルスが1つ送出さ
れ、シフトレジスタ100の内容は右へ1ステージだけ
シフトされる(注目点が1つ進む)。
If θ>Th, the switch 116 is activated to input the output (Sc) of the vector adder 110 and the output of the other vector adder 111 to the difference unit 113. If θ≦Th, the switch 116 is activated, and then one pulse is sent from the pulse generator 113, and the contents of the shift register 100 are shifted to the right by one stage (the point of interest advances by one).

ベクトル加算器111は、ステージ101,102.1
03に保持されている方向コードを(1)式の形に変え
て加算し、平均ベクトルEcを求めるものである。スイ
ッチ116が作動し、平均べクトルSc、Ecが差分器
113へ入力すると、角度差lsc’Eclが求められ
、比較器115で所定値Th、と比較される。角度差が
Th、より大きければ、比較器115から頂点検出信号
が送出され、注目点が頂点として検出されることになる
。この頂点検出信号が発生すると、カウンタ118が作
動してパルスジェネレータ117からシフトパルスが3
個送出され、シフトレジスタ100の内容が3ステ一ジ
分だけ右シフトされる6すなわち、注目点は3つ進む。
Vector adder 111 includes stages 101, 102.1
The direction code held in 03 is changed to the form of equation (1) and added to obtain the average vector Ec. When the switch 116 is activated and the average vectors Sc and Ec are input to the differentiator 113, an angular difference lsc'Ecl is obtained and compared with a predetermined value Th by the comparator 115. If the angular difference is greater than Th, a vertex detection signal is sent from the comparator 115, and the point of interest is detected as a vertex. When this apex detection signal is generated, the counter 118 operates and the pulse generator 117 outputs three shift pulses.
6, and the contents of the shift register 100 are shifted to the right by three stages 6, that is, the point of interest advances three steps.

以上のようにして検出された頂点を直線で順次結ぶこと
により、曲線を折れ線近似することができる。例えば、
第4図の曲線は、頂点が2つ検出され、2つの直線で近
似される。
By sequentially connecting the vertices detected as described above with straight lines, a curve can be approximated by a polygonal line. for example,
The curve in FIG. 4 has two detected vertices and is approximated by two straight lines.

さて1以上のような近似を行うことにより、2つの曲線
の類似度を調べる方法を次に説明する。
Next, a method for examining the similarity between two curves by performing approximations of 1 or more will be described.

角度差θと、頂点間の長さQを使って、一方の曲線(Q
、 θ1.Q1 θ71”’Qmθm)と表現できる。
Using the angle difference θ and the length Q between the vertices, one curve (Q
, θ1. It can be expressed as Q1 θ71”'Qmθm).

同様の表現された別の曲線(Q、’  θ、′Q? ’
  0? ’ ! ”・Qm′ θ、′)との距離りを
次の式で計算することにより1両曲線の類似度を定義で
きる7 ・・・(3) pからqに変化させたときの最小値を意味する。
Another similarly expressed curve (Q,'θ,'Q?'
0? '! ”・Qm′ θ,′) The degree of similarity between both curves can be defined by calculating the distance with the following formula7...(3) Means the minimum value when changing from p to q do.

〔効 果〕〔effect〕

以上説明した本発明の方法によれば、従来よりも正確な
頂点検出が可能であり、また前記実施例から明らかなよ
うに、頂点検出のための演算量も従来よりかなり少なく
なるなどの効果が得られる。
According to the method of the present invention described above, it is possible to detect vertices more accurately than before, and as is clear from the above embodiments, the amount of calculation for detecting vertices is considerably smaller than before. can get.

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

第1図は本発明の一実施例における頂点検出処理のフロ
ーチャート、第2図は同処理を実行するハードウェアの
一例を示すブロック図、第3図は方向コードの説明図、
第4図は方向コードのチェーンで表現された曲線を示す
図、第5図は第4図の曲線に対する従来方法による直線
近似の結果を示す図である6 100・・・シフトレジスタ、   tto、ilt・
・・ベクトル加算器、   112.113・・・差分
器。 114.115・・・比較器、  116・・・スイッ
チ。 117・・・パルスジェネレータ、  118・・・カ
ウンタ。 第  2  図 第3図 第  4  図 第5図
FIG. 1 is a flowchart of vertex detection processing in an embodiment of the present invention, FIG. 2 is a block diagram showing an example of hardware that executes the same processing, and FIG. 3 is an explanatory diagram of direction codes.
FIG. 4 is a diagram showing a curve expressed by a chain of direction codes, and FIG. 5 is a diagram showing the result of linear approximation by a conventional method to the curve in FIG. 4. 6 100...shift register, tto, ilt・
...Vector adder, 112.113...Differentiator. 114.115...Comparator, 116...Switch. 117...Pulse generator, 118...Counter. Figure 2 Figure 3 Figure 4 Figure 5

Claims (1)

【特許請求の範囲】[Claims] (1)方向コード列で表現された曲線上の注目点の前と
後の平均ベクトルを求め、該平均ベクトル間の角度差を
求め、該角度差を所定値と比較し、該角度差が該所定値
を越えた場合に、該注目点を該曲線の頂点として検出す
ることを特徴とする頂点検出法。
(1) Find the average vectors before and after the point of interest on the curve expressed by the direction code string, find the angular difference between the average vectors, compare the angular difference with a predetermined value, and determine whether the angular difference is A vertex detection method characterized in that when a predetermined value is exceeded, the point of interest is detected as the vertex of the curve.
JP27814784A 1984-12-26 1984-12-26 Vertex detecting method Pending JPS61153785A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP27814784A JPS61153785A (en) 1984-12-26 1984-12-26 Vertex detecting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP27814784A JPS61153785A (en) 1984-12-26 1984-12-26 Vertex detecting method

Publications (1)

Publication Number Publication Date
JPS61153785A true JPS61153785A (en) 1986-07-12

Family

ID=17593242

Family Applications (1)

Application Number Title Priority Date Filing Date
JP27814784A Pending JPS61153785A (en) 1984-12-26 1984-12-26 Vertex detecting method

Country Status (1)

Country Link
JP (1) JPS61153785A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63147275A (en) * 1986-12-11 1988-06-20 Furuno Electric Co Ltd Method for extracting graphic data
JPS6468889A (en) * 1987-09-09 1989-03-14 Easel Kk Method for converting graphic form to vector
JPH01106183A (en) * 1987-10-19 1989-04-24 Iizeru:Kk Picture processing system
JPH01123371A (en) * 1987-11-06 1989-05-16 Iizeru:Kk Method for vectorizing graphic
JPH07146944A (en) * 1993-11-22 1995-06-06 Nec Corp Graphic recognition device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63147275A (en) * 1986-12-11 1988-06-20 Furuno Electric Co Ltd Method for extracting graphic data
JPS6468889A (en) * 1987-09-09 1989-03-14 Easel Kk Method for converting graphic form to vector
JPH01106183A (en) * 1987-10-19 1989-04-24 Iizeru:Kk Picture processing system
JPH01123371A (en) * 1987-11-06 1989-05-16 Iizeru:Kk Method for vectorizing graphic
JPH07146944A (en) * 1993-11-22 1995-06-06 Nec Corp Graphic recognition device

Similar Documents

Publication Publication Date Title
US5633818A (en) Method and apparatus for performing floating point arithmetic operation and rounding the result thereof
US5309521A (en) Method and apparatus for generating a character curve by dividing and developing a bezier curve
JPS61153785A (en) Vertex detecting method
JP3012357B2 (en) Shift amount detection circuit
JP3080102B2 (en) Data processing method and device
JP2901463B2 (en) Addition device
JPH087670B2 (en) Adder circuit
KR0132823B1 (en) Fuzzy vector
US5801978A (en) Overflow detection for integer-multiply instruction
JPS60167030A (en) System and circuit for shift flag generation
JP3121609B2 (en) Digital signal processor
JPS60144878A (en) Detector for constant of circle
JPS6229816B2 (en)
JP2591250B2 (en) Data processing device
SU734709A1 (en) Device for interpolation and piece-linear approximation
JPS62126483A (en) Differential circuit device
JPH07210681A (en) Device for detecting rotational position
JPH05180855A (en) Speed detector
JPH10275240A (en) Circular arc interpolation processing method
JPH047744A (en) Fuzzy inference device
JPS60237582A (en) Graphic analyzer
JPH10161799A (en) Coordinate input device and processing method for writing track
JPH04167170A (en) Multiplication/addition arithmetic circuit
JPH0667894A (en) Power function processing system
JPH0553759A (en) Fixed decimal point arithmetic unit