JPS6255191B2 - - Google Patents
Info
- Publication number
- JPS6255191B2 JPS6255191B2 JP56159467A JP15946781A JPS6255191B2 JP S6255191 B2 JPS6255191 B2 JP S6255191B2 JP 56159467 A JP56159467 A JP 56159467A JP 15946781 A JP15946781 A JP 15946781A JP S6255191 B2 JPS6255191 B2 JP S6255191B2
- Authority
- JP
- Japan
- Prior art keywords
- line segment
- angle
- extracted
- angles
- contour
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/46—Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Description
【発明の詳細な説明】
本発明は、三角形、四角形、五角形、六角形、
円、長円および楕円等の図形形状や、物体形状を
識別分類する装置に関するものである。DETAILED DESCRIPTION OF THE INVENTION The present invention provides triangular, quadrilateral, pentagonal, hexagonal,
The present invention relates to a device for identifying and classifying graphic shapes such as circles, ellipses, and ellipses, and object shapes.
例えば、電子計算機にプログラムを入力するた
めには、一般に、フローチヤートを作成した後コ
ーデイングを行ない、カードやテープなどにパン
チしてから入力機器により入力するという手順を
踏んでいる。このため、多くの手数を必要として
いる。そこで、フローチヤートを認識しうる入力
機器があれば、フローチヤートから直接電子計算
機にプログラムを入力することが可能であり、そ
の省力効果は絶大である。 For example, in order to input a program into a computer, the steps are generally to create a flowchart, code it, punch it onto a card or tape, and then input it using an input device. Therefore, a lot of work is required. Therefore, if there is an input device that can recognize the flowchart, it is possible to input the program directly from the flowchart into a computer, and the labor-saving effect is enormous.
ところで、フローチヤートを認識するために
は、まずフローチヤートに使用される記号、すな
わち処理(長方形)、判断(菱形、六角形)、端子
(長円)、結合子(五角形、円、三角形)などを識
別分類することが重要である。 By the way, in order to recognize a flowchart, you must first understand the symbols used in the flowchart: processing (rectangle), judgment (diamond, hexagon), terminal (ellipse), connector (pentagon, circle, triangle), etc. It is important to identify and classify the
本発明は、上述した図形形状の識別分類を極め
て簡単な処理で実施できるようにすることを目的
とし、図形の輪郭線を直線近似しつつ追跡し、隣
接する二直線の交角から図形の角を検出すると同
時に、抽出線分情報と抽出角情報とから図形を円
類と角類とに分類する認識論理を備え、認識精度
を向上したことを特徴とするものであり、以下詳
細に説明する。 The purpose of the present invention is to enable the above-mentioned identification and classification of figure shapes to be carried out with extremely simple processing.The present invention tracks the outline of a figure while linearly approximating it, and calculates the corners of the figure from the intersection angles of two adjacent straight lines. It is characterized by having recognition logic that simultaneously detects and classifies figures into circles and angles based on extracted line segment information and extracted angle information, improving recognition accuracy, and will be described in detail below.
第1図は本発明第1の実施例のブロツク図であ
り、読取部1は平面図形を光学的に読み取り、図
形を構成する線分の各点の座標に対応する電気信
号を提供する。読取部1の出力は、例えばデイジ
タル形式とする。読取部1により読み取つた図形
パターンの外形である輪郭点を、輪郭追跡部2に
て追跡する。その後、線分・角抽出部3により線
分情報、角情報を抽出した後、円/角分類部4に
おいて円類と角類との分類を行なう。こうして得
られた各種情報にもとづいて、形状判定部5にお
いて読取り図形の識別分類を行なう。なお輪郭点
追跡部2は、4連結―境界線追跡アルゴリズム
〔電子通信学会論文誌56―D巻11号667〜668頁
(1973年11月)〕等公知の技術を用いて差し支えな
く、4連結―境界線追跡アルゴリズムにて得られ
た輪郭線の一例を第2図に示した。 FIG. 1 is a block diagram of a first embodiment of the present invention, in which a reading section 1 optically reads a planar figure and provides electrical signals corresponding to the coordinates of each point on a line segment forming the figure. The output of the reading section 1 is, for example, in digital format. A contour tracking section 2 tracks contour points that are the outer shape of the graphic pattern read by the reading section 1 . Thereafter, line segment information and angle information are extracted by the line segment/angle extraction section 3, and then the circle/angle classification section 4 performs classification into circles and angles. Based on the various information thus obtained, the shape determining section 5 performs identification and classification of the read figures. Note that the contour point tracking unit 2 may use a known technique such as the 4-connection boundary line tracking algorithm [Transactions of the Institute of Electronics and Communication Engineers, Vol. 56-D, No. 11, pp. 667-668 (November 1973)]. - An example of a contour line obtained using the boundary line tracing algorithm is shown in Figure 2.
第2図Aは長円の輪郭線例であり、第2図Bは
菱形の輪郭線例である。 FIG. 2A shows an example of an oval outline, and FIG. 2B shows an example of a rhombus outline.
線分および角の抽出方法について、第3図のフ
ローチヤートを用いて説明する。記憶装置に格納
されている輪郭点座標を所定の間隔dにて取り出
す。例えば一番最初は、輪郭の第1番目の点(P1
と略称する)と第(1+d)番目の点(P1+dと
略称する)が取り出される。この2点を各々始
点、終点とする線分を暫定線分Lとする。中間の
輪郭点、すなわち第2番目の点P2と暫定線分Lと
の距離D2が所定の閾値Δl以内であれば、第3
番目の点P3との距離D3…、第d番目の点Pdとの
距離Ddという具合に順次所定の閾値Δl以内で
あるか否かを判別し、もし距離がΔlをこえる点
があつたらその点を終点とし、D1を始点とする
線分を抽出線分S1とし、距離がすべてΔl以内で
あるときは、Lを抽出線分S1とする。抽出線分S1
の終点を始点とし、dだけ隔たつた点を終点とす
る線分を暫定線分Lとして、中間の輪郭点とLと
の距離から上記と同様の操作を行なつて抽出線分
Sを決定する。抽出線分Sと、一回前に抽出され
た抽出線分(この場合はS1)との交角θ1を算出
し、θ1が直線化判定角θsよりも大きい場合は
抽出線分Sを抽出線分S2とし、θ1が直線化判定
角θ2よりも小さい場合は抽出線分Sと抽出線分
S1とを一本化する。すなわち、S1の始点を始点と
し、Sの終点を終点とする線分を改めて抽出線分
S1とする。また、交角θ1が直線化判定角θsよ
りも大きい場合には、更に交角θ1が角判定角θ
Lよりも大きいか否かを調べ、大きい場合には検
出角数に1を加える。 A method for extracting line segments and angles will be explained using the flowchart shown in FIG. Outline point coordinates stored in the storage device are retrieved at predetermined intervals d. For example, at the very beginning, the first point of the contour (P 1
) and the (1+d)th point (abbreviated as P 1+d ) are extracted. A line segment having these two points as a starting point and an ending point, respectively, is defined as a provisional line segment L. If the distance D2 between the intermediate contour point, that is, the second point P2 , and the provisional line segment L is within the predetermined threshold Δl, the third
Distance D 3 to the th point P 3 ..., distance D d to the d th point P d , and so on, are sequentially determined whether the distance is within a predetermined threshold Δl, and if the distance exceeds Δl, If so, set that point as the end point and set the line segment with D 1 as the starting point as the extracted line segment S 1. If all distances are within Δl, set L as the extracted line segment S 1 . Extracted line segment S 1
The line segment with the end point as the starting point and the end point as the point separated by d is set as the provisional line segment L, and the same operation as above is performed from the distance between the intermediate contour point and L to determine the extracted line segment S. do. Calculate the intersection angle θ 1 between the extracted line segment S and the previously extracted extracted line segment (S 1 in this case), and if θ 1 is larger than the straightening judgment angle θ s , the extracted line segment S is the extracted line segment S 2 , and if θ 1 is smaller than the linearization judgment angle θ 2 , the extracted line segment S and the extracted line segment
Integrate with S 1 . In other words, the line segment whose starting point is the starting point of S 1 and whose ending point is the ending point of S is re-extracted.
Let it be S 1 . In addition, if the intersection angle θ 1 is larger than the linearization judgment angle θ s , the intersection angle θ 1 is also larger than the angle judgment angle θ
Check whether it is larger than L , and if larger, add 1 to the number of detected angles.
以上を整理すると、現在の抽出線分Sと一回前
に抽出された抽出線分S1との交角θ1を算出し、
θ1≦θSのとき
S1とSとを一直線とみなした線分をS1とす
る。 To summarize the above, the intersection angle θ 1 between the current extracted line segment S and the previously extracted extracted line segment S 1 is calculated, and when θ 1 ≦ θ S , S 1 and S are considered to be a straight line. Let the line segment be S 1 .
θS<θ1≦θLのとき
Sを抽出線分S2とし、S1とS2とが弧をなして
いると判断する。 When θ S <θ 1 ≦θ L , S is set as the extracted line segment S 2 and it is determined that S 1 and S 2 form an arc.
θL<θ1のとき
Sを抽出線分S2とし、S1とS2との交点が図形
の角であると判断する。 When θ L <θ 1 , S is set as the extracted line segment S 2 and the intersection of S 1 and S 2 is determined to be a corner of the figure.
ということになる。It turns out that.
上記操作を輪郭線に沿つて、輪郭線の1周分を
なぞり終るまで順次繰り返す。 The above operations are sequentially repeated along the contour until one complete rotation of the contour is completed.
理解が容易なるよう、第4図の具体例を用いて
説明を補うことにする。図中の黒点は輪郭点であ
り、破線は輪郭線の一部分である。所定の間隔d
=8、所定の閾値Δl=2の場合を仮定して説明
を進める。まずP1を始点、P9を終点とする線分を
暫定線分Lとすると、中間の輪郭点P2〜P8とLと
の距離D2〜D8はすべてΔl以内であるから、L
を抽出線分S1とする。次にP9を始点、P17を終点
とする線分9・17を暫定線分Lとして、中間の
輪郭点との距離を調べるとD14>Δlとなるか
ら、暫定線分Lを線分9・14に変更し、抽出線
分Sは線分9・14となる〔第4図A〕。そこでS1
とSとの交角θ1を調べると、直線化判定角θS
よりも小さいから、SをS1と一本化して、抽出線
分S1を線分1・14に変更する。次いで線分14・
P22を暫定線分Lとして、中間の輪郭点との距離
を調べると、すべてΔl以内であるからLを抽出
線分Sとする。そこでS1とSとの交角θ1を調べ
ると、直線化判定角θSよりも大きいからSを抽
出線分S2として登録する。すなわち、抽出線分S2
=線分14・22である。 In order to facilitate understanding, the explanation will be supplemented using the specific example shown in FIG. The black dots in the figure are contour points, and the broken lines are part of the contour line. predetermined interval d
The explanation will proceed assuming that the predetermined threshold value Δl=8 and the predetermined threshold value Δl=2. First, if the line segment with P 1 as the starting point and P 9 as the end point is a provisional line segment L, then the distances D 2 to D 8 between intermediate contour points P 2 to P 8 and L are all within Δl, so L
Let be the extracted line segment S 1 . Next, we use line segments 9 and 17 with P 9 as the starting point and P 17 as the end point as provisional line segment L, and check the distance to the intermediate contour point. Since D 14 > Δl, we define provisional line segment L as a line segment. 9.14 , and the extracted line segment S becomes line segment 9.14 [ Figure 4 A]. So S 1
By examining the intersection angle θ 1 between and S, we find that the linearization judgment angle θ S
Since it is smaller than , S is unified with S 1 and extracted line segment S 1 is changed to line segment 1.14 . Then line segment 14・
When P 22 is set as the provisional line segment L, and the distances to the intermediate contour points are examined, they are all within Δl, so L is set as the extracted line segment S. Therefore, when the intersecting angle θ 1 between S 1 and S is examined, it is larger than the linearization determination angle θ S , so S is registered as the extracted line segment S 2 . In other words, the extracted line segment S 2
= line segment 14・22 .
ところで、交角θ1は角判定角θLよりも大き
いから、検出角数に1を加え(最初は検出角数=
0であるから、検出角数=1となる)ると同時
に、抽出角K1としてθ1を登録する〔第4図
B〕。 By the way, since the intersection angle θ 1 is larger than the angle determination angle θ L , add 1 to the number of detected angles (initially, the number of detected angles =
0, the number of detected angles = 1), and at the same time, θ 1 is registered as the extraction angle K 1 [Fig. 4B].
次に線分22・30を暫定線分Lとして、中間の
輪郭点との距離を調べると、すべてΔl以内であ
るからLを抽出線分Sとする。そこでS2とSとの
交角θ2を調べると、直線化判定角θsよりも大
きいからSを抽出部分S3として登録する。すなわ
ち、抽出線分S3=線分22・30である。ところで
交角θ2は角判定角θLよりも小さいから、検出
角数は不変であり、抽出角Kの登録は行なわれ
ず、交角θ2が格納されるだけである〔第4図
C〕。 Next, line segments 22 and 30 are set as provisional line segments L, and when the distances to the intermediate contour points are checked, they are all within Δl, so L is set as the extracted line segment S. Then, when the intersecting angle θ 2 between S 2 and S is examined, it is larger than the linearization determination angle θ s , so S is registered as the extracted portion S 3 . That is, the extracted line segment S 3 = line segment 22 · 30 . By the way, since the intersection angle θ 2 is smaller than the angle determination angle θ L , the number of detected angles remains unchanged, and the extraction angle K is not registered, but only the intersection angle θ 2 is stored [FIG. 4C].
このような操作を、輪郭線の1周分をなぞり終
るまで順次繰り返すわけである。 These operations are repeated one after another until one complete rotation of the contour line has been traced.
1周分をなぞり終つた時点には、抽出線分情報
と抽出角情報とが得られている。しかしながら、
きつちり1周をなぞつただけでは、最後の抽出線
分Soと最初の抽出線分S1との接続関係がわから
ないから、SoとS1との交角θoを求めて、上記と
同様の操作、すなわちθo>θL>θSのときSoを
正式な抽出線分として登録すると共に検出角数に
1を加え、抽出角Knとしてθoを登録する。また
θL≧θo>θSのとき、抽出線分Soと交角θoを
正式に登録する。またθL>θS≧θoのとき、So
とS1とを一体化した線分を抽出線分S1として登録
しなおすことが必要である。こうして、線分情報
と角情報との抽出が完了する。 At the time when tracing one round has been completed, extracted line segment information and extracted angle information have been obtained. however,
Just by tracing one round of the tight circle, the connection relationship between the last extracted line segment S o and the first extracted line segment S 1 cannot be determined, so find the intersection angle θ o between S o and S 1 and do the same as above. In other words, when θ o >θ L >θ S , S o is registered as a formal extraction line segment, 1 is added to the number of detected angles, and θ o is registered as the extraction angle K n . Further, when θ L ≧ θ o > θ S , the extracted line segment S o and the intersection angle θ o are formally registered. Also, when θ L > θ S ≧θ o , S o
It is necessary to re-register the line segment that integrates and S1 as the extracted line segment S1 . In this way, the extraction of line segment information and corner information is completed.
第2図に示した輪郭線例の線分・角抽出結果例
を第5図に示す。なお、各パラメータの設定値を
所定の間隔d=8、所定の閾値Δl=2、直線化
判定角θS=15゜、角判定角θL=30゜とした場合
の抽出結果である。 FIG. 5 shows an example of line segment/corner extraction results for the contour example shown in FIG. 2. Note that the extraction results are obtained when the set values of each parameter are a predetermined interval d=8, a predetermined threshold value Δl=2, a linearization judgment angle θ S =15°, and an angle judgment angle θ L =30°.
さて、こうして得られた線分情報と角情報とか
ら図形の形状を識別分類するわけであるが、検出
角数がmだからといつて、いきなりm角形である
と決めることはできない。何故なら、線分・角抽
出結果例第5図Aからも明らかな通り、長円、楕
円、円などの円類においても角が検出されてしま
うからである。勿論、角判定角θLを大きく設定
しておけば、円類から角を検出しないようにする
ことはできるが、θLを無制限に大きく設定する
ことはできない。というのは、六角形や菱形にお
いては交角θがかなり小さくなるため、θLを大
きくすと、交角の小さな角を弧と誤判断してしま
う恐れがあるからである。この矛盾を解決するた
めには、円類/角数分類論理を併用することが非
常に有効である。すなわち、正三角形、正方形、
長方形、菱形、六角形など角類の角検出が正確に
行なわれるように角検出角θLなどのパラメータ
値を設定しておき、角類の形状識別には検出角数
を最大限利用し、円類の形状識別においては検出
角数をあまり重視しないという考え方である。 Now, the shape of a figure is identified and classified from the line segment information and angle information obtained in this way, but just because the number of detected angles is m, it cannot be suddenly determined that it is an m-gon. This is because, as is clear from the line segment/angle extraction result example in FIG. 5A, corners are detected even in circles such as ellipses, ellipses, and circles. Of course, by setting the angle determination angle θ L large, it is possible to prevent angles from being detected from circles, but it is not possible to set θ L large indefinitely. This is because in a hexagon or a rhombus, the intersecting angle θ is quite small, so if θ L is increased, there is a risk that an angle with a small intersecting angle will be mistakenly judged as an arc. In order to resolve this contradiction, it is very effective to use circle/angle classification logic in combination. i.e. equilateral triangle, square,
Parameter values such as angle detection angle θ L are set to accurately detect angles of angles such as rectangles, rhombuses, and hexagons, and the number of detected angles is utilized to the maximum for shape identification of angles. The idea is not to place much emphasis on the number of detected angles when identifying shapes of circles.
第6図のフローチヤートを用いて、円類/角類
分類論理を説明する。 The circle/corner classification logic will be explained using the flowchart of FIG.
認識対象多角形の角数の上限値をn(例えば三
角形から六角形までを識別分類すればよい場合に
は、n=6である)とすると、検出角数が2以下
のときと検出角数が(n+1)以上のときは円類
であるが、n≧検出角数≧3のときは円類である
可能性もあり、角類である可能性もある。 Assuming that the upper limit of the number of angles of the polygon to be recognized is n (for example, if it is sufficient to distinguish and classify from triangles to hexagons, n = 6), then when the number of detected angles is 2 or less and the number of detected angles is When is (n+1) or more, it is a circle class, but when n≧number of detected angles≧3, it may be a circle class, and there is also a possibility that it is a horn class.
そこで、検出角数の検出線数に対する比(検出
角数/検出線数)を角数比と名付けると、もし角
数の抽出が角類に対して正確に行なわれるように
しておけば、角類では検出角数=検出線数である
から角数比は1のはずであり、円数では多くの弧
が抽出されるが、検出角数は0のはずであるから
角数比は0となる。しかしながら、線分・角抽出
に多少の誤差を生じた場合には、角類の角数比は
1よりやや減少し、円類の角数比は0よりやや増
加する。第5図に示した実測例の場合も、円類で
ある長円が角数比=3/11=0.27、角類である菱
形が角数比=4/6=0.67となつている。 Therefore, the ratio of the number of detected angles to the number of detected lines (number of detected angles/number of detected lines) is called the angle number ratio.If the number of angles is extracted accurately for angles, In the class, the number of detected angles = the number of detected lines, so the angle ratio should be 1. In the circle number, many arcs are extracted, but the number of detected angles should be 0, so the angle ratio should be 0. Become. However, if some error occurs in line segment/corner extraction, the angle ratio of angles will decrease slightly from 1, and the angle ratio of circles will increase slightly from 0. In the actual measurement example shown in FIG. 5, the angular ratio of the ellipse, which is a circle, is 3/11 = 0.27, and the angular ratio of the rhombus, which is a square, is 4/6 = 0.67.
それゆえ、円類識別閾値k0を0よりやや大きい
適当な値に設定し、角数比がk0以下のものを円類
と識別する。また、角数識別閾値k1を1よりやや
小さな適当な値に設定し、角数比がk1以上のもの
を角類と識別する。かくして、ほとんどの図形は
円類と角類とに識別分類することができるが、確
実性を重視して、角類識別閾値k1をかなり1に近
く設定し、円類識別閾値k0をかなり0に近く設定
すると、k1>角数比>k0となつてしまう図形もあ
る。その場合には、更に交角偏差を利用すると確
実性が高くなる。交角偏差とは、抽出した交角θ
1〜θoの最大値から最小値を引いた値であり、
円類の場合は交角偏差値が小さく、角類の場合は
交角偏差値が大きいから、適当な閾値Δθとの大
小に応じて各々角類、円類に識別分類することが
できる。その理由は、円類の場合、本来はすべて
の交角θ1〜θoは直線化判定角θSと角判定角θ
Lとの間の値になるはずであるが、その時は検出
角数=0であるから、交角偏差の判断に来る前に
すでに円類と識別分類されており、この判断部に
到達したということは、少なくとも1ケの検出角
があつたということである。すなわち、大半の交
角θはθL≧θ>θSであるか、たまたまθ>θL
なる交角θもあつたということである。しかしな
がら、θ>θLなる交角もそう極端にθLをこえて
いるはずはないから、交角偏差=θnax―θnio
は、たかだかθL―θSよりもやや大きな値をとる
にすぎない。また角類の場合、本来は弧は存在し
ないのだから、すべての交角θ1〜θoは角判定
θLよりも大きい値になるばずであるが、その時
は検出角数=検出線数であるから角数比が1とな
り、交角偏差の判断に来る前にすでに角類と分類
されており、この判断部に到達したということ
は、検出角数<検出線数すなわちθL≧θ>θSを
満足する交角θが少なくとも1ケは存在するとい
うことである。それゆえ交角偏差=θnax―θnio
は、小さくともθnax―θLである。であるから、
交角偏差の閾値Δθとして、
θnax―θL>Δθ≫θL―θS ……
を満足する値を選択すれば、円類と角類との選択
分類をすることができる。 Therefore, the circle identification threshold k 0 is set to an appropriate value slightly larger than 0, and those whose angle ratio is less than or equal to k 0 are identified as circles. In addition, the angle number identification threshold k 1 is set to an appropriate value slightly smaller than 1, and those whose angle number ratio is k 1 or more are identified as angles. In this way, most figures can be distinguished and classified into circles and angles, but with emphasis on certainty, the angle discrimination threshold k 1 is set fairly close to 1, and the circle discrimination threshold k 0 is set fairly close to 1. If it is set close to 0, there are some shapes where k 1 > angular ratio > k 0 . In that case, reliability can be increased by further utilizing the intersection angle deviation. The intersection angle deviation is the extracted intersection angle θ
It is the value obtained by subtracting the minimum value from the maximum value of 1 ~ θ o ,
In the case of circles, the intersection angle deviation value is small, and in the case of angles, the intersection angle deviation value is large, so that they can be distinguished and classified into angles and circles, respectively, depending on the magnitude of the appropriate threshold Δθ. The reason is that in the case of circles, all intersecting angles θ 1 to θ o are the linearization judgment angle θ S and the angle judgment angle θ
It should be a value between L and L, but since the number of detected angles is 0 at that time, it has already been classified as circular before coming to the judgment of the intersection angle deviation, and it has reached this judgment part. means that at least one detection angle was detected. That is, most intersection angles θ are θ L ≧ θ > θ S or happen to be θ > θ L
This means that there is also an intersection angle θ. However, since the intersection angle θ>θ L cannot exceed θ L by that extreme, the intersection angle deviation = θ nax −θ nio
is at most a slightly larger value than θ L −θ S. In addition, in the case of angles, since there are no arcs, all intersecting angles θ 1 to θ o should be larger than the angle judgment θ L , but in that case, the number of detected angles = the number of detected lines. Therefore, the angle ratio becomes 1, and it is already classified as angle before coming to the judgment of the intersection angle deviation.The fact that it has reached this judgment section means that the number of detected angles<the number of detected lines, that is, θL ≧θ>θ This means that there is at least one intersection angle θ that satisfies S. Therefore, intersection angle deviation = θ nax −θ nio
is at least θ nax −θ L. Because it is,
If a value satisfying θ nax −θ L >Δθ≫θ L −θ S is selected as the threshold value Δθ of the intersection angle deviation, it is possible to perform selective classification into circles and angles.
具体例をあげると、角類が正三角形〜正六角形
までしかない場合、交角の最小値は正六角形の場
合の60゜であり、θL=30゜,θS=15゜とした場
合、Δθが満たすべき条件は式より30゜>Δθ
≫15゜であるから、25゜程度に設定すればよい。 To give a specific example, if the angles are only from a regular triangle to a regular hexagon, the minimum value of the intersecting angle is 60° for a regular hexagon, and if θ L = 30° and θ S = 15°, Δθ The condition that should be satisfied is 30゜>Δθ from the formula
≫15°, so it should be set to about 25°.
なお実験によれば、各パラメータの設定値を所
定の間隔d=8、所定の閾値Δl=2、直線化判
定角θS=15゜、角判定角θL=30゜として線分・
角の抽出を行ない、角類識別閾値k1=0.85、円類
識別閾値k0=1.15、交角偏差の閾値Δθ=30゜に
て40種の図形のパターンの円/角分類を行なつた
ところ、分類正答率は100%であつた。ここで40
種の図形パターンの内訳は、正三角形、正方形、
長方形、菱形(内角は60゜と120゜)、正六角形、
円、長円、楕円の8種につき、寸法を5段階に可
変したものである。 According to experiments, line segments and
Corners were extracted and 40 types of figure patterns were classified as circles/corners using the angle identification threshold k 1 = 0.85, the circle identification threshold k 0 = 1.15, and the intersection angle deviation threshold Δθ = 30°. , the classification accuracy rate was 100%. here 40
The breakdown of the shape patterns of the species is equilateral triangle, square,
Rectangle, rhombus (interior angles are 60° and 120°), regular hexagon,
Dimensions are varied in 5 steps for 8 types: circle, ellipse, and ellipse.
こうして得られた線分情報、角情報および円
類/角類情報とから、容易に図形の形状を識別分
類することができる。 From the line segment information, corner information, and circle/corner information obtained in this way, the shape of the figure can be easily identified and classified.
第7図は、角類の形状判定のフローチヤートで
あり、説明の便宜上、角類の図形種類が正三角
形、正方形、長方形、菱形(内角は60゜と120
゜)、正五角形、正六角形に限定されている場合
の例を説明する。検出角数が3,5および6の場
合は、該当する図形種類が各々1種類しかないか
ら、検出角数=3のときは正三角形、検出角数=
5のときは正五角形、検出角数=6のときは正六
角形と判断して差し支えない。 Figure 7 is a flowchart for determining the shape of angles.
゜), a regular pentagon, and a regular hexagon will be explained below. When the number of detected angles is 3, 5, and 6, there is only one corresponding figure type each, so when the number of detected angles = 3, it is an equilateral triangle, and the number of detected angles =
When the number of detected angles is 5, it can be determined that it is a regular pentagon, and when the number of detected angles is 6, it can be determined that it is a regular hexagon.
検出角数が4の場合は、該当する図形が正方
形、長方形および菱形の3種類であるから、その
識別分類のためまず4個の検出角度K1〜K4が
各々ほぼ直角であるか否かを調べ、ほぼ直角であ
る場合は正方形か長方形であり、そうでないとき
菱形である。なお、ほぼ直角であるか否かの判断
は、例えば80゜<K1〜K4<100゜であるか否かに
て行なえばよい。 When the number of detected angles is 4, there are three types of corresponding figures: square, rectangle, and rhombus, so in order to identify and classify them, first check whether each of the four detected angles K 1 to K 4 is approximately a right angle. If it is almost a right angle, it is a square or rectangle, and if it is not, it is a rhombus. Note that whether or not the angle is approximately right angle may be determined by determining, for example, whether 80°<K 1 to K 4 <100°.
4個の検出角度K1〜K4が各々ほぼ直角であ場
合は、抽出線分の長さと長い順にl1,l2,l3,l4と
し、(l3+l4)/(l1+l2)が辺長比閾値Hよりも大
きいときは正方形であると判断し、辺長比閾値H
以下のときは長方形であると判断する。辺長比閾
値Hは、識別したい長方形の辺長比に対応して、
それよりやや大きめの値に設定すればよい。 If each of the four detection angles K 1 to K 4 is approximately a right angle, the lengths of the extracted line segments are set as l 1 , l 2 , l 3 , l 4 in order of length, and (l 3 + l 4 )/(l 1 +l 2 ) is larger than the side length ratio threshold H, it is determined that it is a square, and the side length ratio threshold H
It is determined that it is a rectangle in the following cases. The side length ratio threshold H corresponds to the side length ratio of the rectangle to be identified.
You can set it to a value slightly larger than that.
第8図は、円類の形状判定のフローチヤートで
あり、説明の便宜上、円類の図形種類が円、楕
円、長円に限定されている場合の例を説明する。
円および楕円は、抽出線分がすべて円弧部である
から、抽出線分の長さは短かく、かつかなり均等
であるはずである。それに対して、長は直線部分
を2本有するから、抽出線分の長さは2本だけが
長く、他は短かくかつかなり均等であるはずであ
る。よつて抽出線分の長さを長い順にl1,l2,
l3,l4とし、(l1+l2)/(l3+l4)が辺長比閾値Zよ
りも大きいときは長円であると判断し、辺長比閾
値Z以下のときは円か楕円である。辺長比閾値Z
は、識別したい長円の直線部分長の最小値を前述
した所定の間隔dにて除した値近傍に設定すると
よい。 FIG. 8 is a flowchart for determining the shape of circles, and for convenience of explanation, an example will be described in which the types of circles are limited to circles, ellipses, and ellipses.
For circles and ellipses, all extracted line segments are circular arcs, so the lengths of the extracted line segments should be short and fairly uniform. On the other hand, since the length has two straight line segments, only two of the extracted line segments should be long, and the others should be short and fairly even. Therefore, the lengths of the extracted line segments are set as l 1 , l 2 ,
l 3 , l 4 , and when (l 1 + l 2 )/(l 3 + l 4 ) is larger than the side length ratio threshold Z, it is determined that it is an ellipse, and when it is less than the side length ratio threshold Z, it is determined that it is a circle. It is an ellipse. Side length ratio threshold Z
is preferably set near a value obtained by dividing the minimum length of the straight line portion of the ellipse to be identified by the predetermined interval d described above.
円と楕円との識別分類は、図形パターンのX
軸、Y軸への射影をとると、円の場合は理論的に
は、XV=XH,YV=YHとなるはずであるから、
XHI=XV/XH=1,YHI=YV/YH=1となる
はずである。そこで、多少の誤差に対する余裕を
みてXHI≒1かつYHI≒1である場合を円と判断
し、それ以外の場合を楕円と判断する。 The identification classification between a circle and an ellipse is the X of the figure pattern.
If we take the projection onto the axis and the Y axis, in the case of a circle, theoretically, X V = X H and Y V = Y H , so
It should be that XHI=X V /X H =1, YHI=Y V /Y H =1. Therefore, considering the margin for some errors, the case where XHI≒1 and YHI≒1 is determined to be a circle, and the other cases are determined to be an ellipse.
なお、円と楕円との識別分類に交角偏差、すな
わち抽出した交角θ1〜θoの最大値から最小値
を引いた値を利用することもできる。何故なら、
円の場合は曲率半径が円周の1周にわたつて常に
一定であるから、交角θ1〜θoはすべてほとん
ど均等であり交角偏差がかなり0に近づくのに対
し、楕円の場合は曲率半径が一定でないから、交
角偏差がある程度以上の値を示す性質を利用する
ことができるからである。 Note that the intersection angle deviation, that is, the value obtained by subtracting the minimum value from the maximum value of the extracted intersection angles θ 1 to θ o , can also be used for classification between circles and ellipses. Because,
In the case of a circle, the radius of curvature is always constant over one circumference, so the intersection angles θ 1 to θ o are all almost equal and the intersection angle deviation approaches 0, whereas in the case of an ellipse, the radius of curvature This is because since the angle of intersection is not constant, it is possible to utilize the property that the intersection angle deviation has a value above a certain level.
かくして、正三角形、正方形、長方形、菱形、
正五角形、正六角形、円、楕円、長円を確実に識
別分類することができる。 Thus, equilateral triangles, squares, rectangles, rhombuses,
It is possible to reliably identify and classify regular pentagons, regular hexagons, circles, ellipses, and ellipses.
以上説明したように、第1の実施例では、図形
の輪郭線を直線近似しつつ追跡し、隣接する二直
線の交角から図形の角や円弧を検出し、図形形状
を識別分類する方法において、抽出線分情報と抽
出角情報とから図形を円類と角類とにまず分類す
る円/角分類部を備えているため、例えば円類図
形の曲率半径が小さくて、円弧相互のなす交角を
図形の角と誤半定してしまつた場合でも図形の分
類識別結果には誤りを生じないという利点があ
る。 As explained above, in the first embodiment, in the method of tracking the outline of a figure while linearly approximating it, detecting the corners and arcs of the figure from the intersection angles of two adjacent straight lines, and identifying and classifying the shape of the figure, It is equipped with a circle/angle classification section that first classifies shapes into circles and angles based on extracted line segment information and extracted angle information. There is an advantage that even if a corner of a figure is incorrectly determined, an error will not occur in the result of classification and identification of the figure.
また、円/角分類部を備えていない場合には、
円弧相互のなす交角を図形の角と誤判定しないた
めには角判定角θLを大きくせざるを得ず、の結
果逆に本物の角を検出もれしてしまう可能性を生
ずるなど、θLの設定値に余裕が少ない場合があ
る。ところが円/角分類部を備えることにより、
角判定角θLは図形の角をもれなく検出すること
を第1義に考えて設定すればよいため、θLの設
定値の余裕が前者の場合よりも大きくなるという
利点もある。 In addition, if it is not equipped with a circle/angle classification section,
In order to avoid misjudging the intersection angle between two circular arcs as an angle of a figure, the angle judgment angle θ L must be made large, and as a result, there is a possibility that a real angle may be missed. There are cases where there is little margin for the setting value of L. However, by providing a circle/angle classification section,
Since the angle determination angle θ L can be set with the primary consideration being to detect all the corners of the figure, there is also the advantage that the margin for the set value of θ L is larger than in the former case.
第1の実施例では、形状判定部において、抽出
線分の勾配を利用しない方法について説明した
が、各線分の始点座標、終点座標がわかつている
のであるから、各線分の勾配情報も得られている
わけであり、勾配情報をも利用することによつ
て、線分相互の平行関係なども検出容易であり、
より正確な識別分類が可能となる。また、識別対
象図形種類を増加することも可能である。 In the first embodiment, a method was explained in which the slope of the extracted line segment is not used in the shape determination section, but since the starting point coordinates and end point coordinates of each line segment are known, slope information of each line segment can also be obtained. By using gradient information, it is easy to detect parallel relationships between line segments.
More accurate identification and classification becomes possible. It is also possible to increase the types of figures to be identified.
また第1の実施例では、図形の形状を識別分類
する方法のみについて説明したが、抽出線分の勾
配などを併用することにより、図形の傾斜角度を
も判定することが可能であることは言うまでもな
い。 Furthermore, in the first embodiment, only the method of identifying and classifying the shapes of figures was explained, but it goes without saying that by using the gradient of extracted line segments, etc., it is also possible to determine the inclination angle of figures. stomach.
また第1の実施例では、図形の形状を識別分類
する方法のみについて説明したが、抽出線分の長
さ情報や角検出点の座標情報などから、図形寸法
を求めることが可能であることも言うまでもな
い。 Furthermore, in the first embodiment, only the method of identifying and classifying the shape of the figure was explained, but it is also possible to obtain the figure dimensions from the length information of the extracted line segment, the coordinate information of the corner detection point, etc. Needless to say.
本発明は、基本的な図形形状を正確に識別分類
することができるのであるから、フローチヤート
の認識・入力機器に利用することができるのは勿
論のこと、部品等の物体識別分類にも利用するこ
とができる。また、印影の認識・照合における外
枠の識別分類にも利用することができる。 Since the present invention can accurately identify and classify basic graphic shapes, it can of course be used for flowchart recognition and input equipment, and can also be used for object identification and classification such as parts. can do. It can also be used to identify and classify outer frames in recognition and verification of seal impressions.
第1図は本発明第1の実施例のブロツク図、第
2図AおよびBは輪郭線の一例、第3図は本発明
実施例の線分・角抽出部のフロー、第4図A,B
およびCは線分・角抽出方法の説明図、第5図A
およびBは本発明実施例の線分・角抽出結果の一
例、第6図は本発明実施例の円/角分類部のフロ
ー、第7図は本発明実施例の角類図形の形状判定
部のフロー、第8図は本発明実施例の円類図形の
形状判定部のフローである。
1…読取部、2…輪郭追跡部、3…線分・角抽
出部、4…円/角分類部、5…形状判定部、θS
…直線化判定角、θL…角判定角、S1〜So…抽出
線分、θ1〜θo…交角、K1〜Kn…抽出角、k0
…円類識別閾値、k1…角類識別閾値、Δθ…交角
偏差の閾値、H…辺長比閾値。
Fig. 1 is a block diagram of the first embodiment of the present invention, Fig. 2 A and B are examples of contour lines, Fig. 3 is the flow of the line segment/corner extraction section of the embodiment of the present invention, Fig. 4 A, B
and C are explanatory diagrams of the line segment/corner extraction method, Figure 5A
and B are examples of line segment/corner extraction results according to the embodiment of the present invention, FIG. 6 is the flow of the circle/angle classification section according to the embodiment of the present invention, and FIG. 7 is the shape determination section for angle figures according to the embodiment of the present invention. FIG. 8 is a flowchart of the circular figure shape determination section according to the embodiment of the present invention. 1...Reading section, 2...Contour tracking section, 3...Line segment/corner extraction section, 4...Circle/corner classification section, 5...Shape determination section, θ S
... Straight line judgment angle, θ L ... Angle judgment angle, S 1 - S o ... Extraction line segment, θ 1 - θ o ... Intersection angle, K 1 - K n ... Extraction angle, k 0
... Circle identification threshold, k 1 ... Horn identification threshold, Δθ... Threshold for intersection angle deviation, H... Side length ratio threshold.
Claims (1)
光学的に読取り該線分を構成する各点の座標に対
応する電気信号を提供する読取部と、 読取部にて読み取つた図形パターンの輪郭点を
追跡する輪郭追跡部と、二輪郭点相互を接続した
暫定線分と、該二輪郭点にはさまれた輪郭点との
距離が常に所定閾値以下であり、かつ該条件に適
合する限りは該二輪郭点間の間隔を初期設定値に
保つべく分割するような、連続する暫定線分群に
て輪郭線を順次直線近似する手段と、 前記暫定線分の相隣る二直線相互のなす交角
と、大・小2種の閾値との大小関係により、交角
が小なる閾値以下の場合は該二直線を一本の直線
に統合し、交角が小なる閾値より大きい場合に
は、該二直線を一本化せずに抽出線分として登録
し、なおかつ交角が大なる閾値より大きい場合に
は、該交角と検出角として登録するという操作を
繰り返して線分情報と角情報とを抽出する手段と
で構成される線分・角抽出部と、 抽出された線分情報と角情報とから図形を識別分
類する形状判定部とを備え、 検出した角の数を抽出した線分の数で除した値
と、2つの閾値との大小関係および抽出した交角
の最大値から最小値をひいた値と閾値との大小関
係とにより図形パターンを円類と角類とに分類す
る円/角分類部を備えたことを特徴とする図形形
状の識別分類装置。[Scope of Claims] 1. A reading unit that optically reads line segments that make up a figure drawn on a sheet of paper and provides electrical signals corresponding to the coordinates of each point that makes up the line segment; A contour tracking section that tracks the contour points of the figure pattern read by the contour tracking section, a provisional line segment connecting two contour points, and a contour point sandwiched between the two contour points, and a distance between the two contour points are always less than or equal to a predetermined threshold. , and means for sequentially linearly approximating the contour line by a group of continuous provisional line segments such that the interval between the two contour points is maintained at an initial setting value as long as the condition is met; Based on the magnitude relationship between the intersection angle between two adjacent straight lines and the two types of large and small thresholds, if the intersection angle is less than the small threshold, the two straight lines are integrated into one straight line, and the intersection angle is set to the small threshold. If the line segment is larger, the two straight lines are registered as an extracted line segment without unifying them, and if the intersection angle is larger than the larger threshold, the line segment is created by repeating the operation of registering the intersection angle and the detected angle. A line segment/corner extraction unit configured with a means for extracting information and corner information, and a shape determination unit that identifies and classifies figures from the extracted line segment information and corner information, and calculates the number of detected corners. The figure pattern is divided into circles and angles by the value obtained by dividing the value by the number of extracted line segments, the magnitude relationship between the two threshold values, and the magnitude relationship between the value obtained by subtracting the minimum value from the maximum value of the extracted intersection angles and the threshold value. An apparatus for identifying and classifying graphic shapes, characterized by comprising a circle/corner classification section for classifying shapes.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP56159467A JPS5862767A (en) | 1981-10-08 | 1981-10-08 | Discriminating classification device for shape |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP56159467A JPS5862767A (en) | 1981-10-08 | 1981-10-08 | Discriminating classification device for shape |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS5862767A JPS5862767A (en) | 1983-04-14 |
| JPS6255191B2 true JPS6255191B2 (en) | 1987-11-18 |
Family
ID=15694400
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP56159467A Granted JPS5862767A (en) | 1981-10-08 | 1981-10-08 | Discriminating classification device for shape |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS5862767A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10328437B2 (en) | 2014-01-29 | 2019-06-25 | Mitsubishi Hitachi Power Systems Environmental Solutions, Ltd. | Electrostatic precipitator, charge control program for electrostatic precipitator, and charge control method for electrostatic precipitator |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS59161182A (en) * | 1983-03-04 | 1984-09-11 | Toshiba Corp | Linear graphic processing device |
| JPH08161493A (en) * | 1994-12-08 | 1996-06-21 | Mazda Motor Corp | Line shape detection method and apparatus |
-
1981
- 1981-10-08 JP JP56159467A patent/JPS5862767A/en active Granted
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10328437B2 (en) | 2014-01-29 | 2019-06-25 | Mitsubishi Hitachi Power Systems Environmental Solutions, Ltd. | Electrostatic precipitator, charge control program for electrostatic precipitator, and charge control method for electrostatic precipitator |
Also Published As
| Publication number | Publication date |
|---|---|
| JPS5862767A (en) | 1983-04-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4542526A (en) | Character recognition apparatus | |
| US4481665A (en) | Character segmentation method | |
| CN108182383B (en) | Vehicle window detection method and device | |
| CN115082942B (en) | A document image flowchart recognition method, device, and medium based on YOLO v5 | |
| CN105809151A (en) | Image recognition method for state of pressure gauge of fire extinguisher | |
| JPH0728937A (en) | Image extractor | |
| CN116403223A (en) | A method and system for recognizing pointer meter readings based on machine learning | |
| JPS6255191B2 (en) | ||
| CN113449644B (en) | Method for extracting outlines of common urban buildings from airborne laser point clouds | |
| JPS6255192B2 (en) | ||
| JP2944650B1 (en) | Fingerprint matching device and method | |
| JPS6270988A (en) | Ellipse detection device | |
| CN115019290A (en) | Instrument reading identification method and device and storage medium | |
| CN117237657A (en) | RSCD arc detection method based on hough transformation | |
| JPH0738223B2 (en) | Image recognition device for mobile robots | |
| JPH01271884A (en) | Detecting system for center of fingerprint | |
| JP2551021B2 (en) | How to determine the center position of the fingerprint image | |
| JP3067822B2 (en) | Pattern identification method | |
| JPS5953054B2 (en) | Electrocardiogram waveform automatic analysis method | |
| JPS6223350B2 (en) | ||
| JP2630261B2 (en) | Character recognition device | |
| US20260038281A1 (en) | Identification method and system for parking space information fusion | |
| JPS5835674A (en) | Extracting method for feature of online hand-written character | |
| JPH07118016B2 (en) | Figure recognition device | |
| JPS6334682A (en) | Character recognition system |