JPH022189B2 - - Google Patents

Info

Publication number
JPH022189B2
JPH022189B2 JP57214354A JP21435482A JPH022189B2 JP H022189 B2 JPH022189 B2 JP H022189B2 JP 57214354 A JP57214354 A JP 57214354A JP 21435482 A JP21435482 A JP 21435482A JP H022189 B2 JPH022189 B2 JP H022189B2
Authority
JP
Japan
Prior art keywords
line
run
stroke
strokes
list storage
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
Application number
JP57214354A
Other languages
Japanese (ja)
Other versions
JPS59103178A (en
Inventor
Yoshimasa Goto
Masahiro Sasaki
Etsuji Nishino
Takayuki Kageyama
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP57214354A priority Critical patent/JPS59103178A/en
Publication of JPS59103178A publication Critical patent/JPS59103178A/en
Publication of JPH022189B2 publication Critical patent/JPH022189B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/457Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by analysing connectivity, e.g. edge linking, connected component analysis or slices

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Character Discrimination (AREA)
  • Image Analysis (AREA)

Description

【発明の詳細な説明】 産業上の利用分野 本発明は図形、図面の認識や理解などを行なう
際、線図形中から、その形状特徴を示す線部分要
素としてのストロークを抽出するストローク抽出
装置に関するものである。
DETAILED DESCRIPTION OF THE INVENTION Field of Industrial Application The present invention relates to a stroke extraction device for extracting strokes as line segment elements representing the shape characteristics of a line figure from a line figure when recognizing or understanding figures or drawings. It is something.

従来例の構成とその問題点 従来、計算機へ線図形(論理回路図面や図表
等)情報を入力には、 線図形の座標情報をコーデイングし、カード
で入力する デイジタイザ、タブレツト等で線図形の座標
を指定して入力する グラフイツクデイスプレイ上にキイボードや
タブレツトからの入力により線図形を描きなが
ら入力する 線図形を画像データとして読み取り、パター
ン認識によつて情報を得る 等の方法がある。この中での入力方法は、計算
機による自動化が計れること、処理工数の短縮が
計れること、および人手介入によるミスを減少で
きることなど非常に大きな効果が期待できる。そ
のために関する方法にはこれまでいくつかの装
置が考案されている。
Conventional structure and problems Conventionally, to input information on line figures (logic circuit drawings, diagrams, etc.) to a computer, the coordinate information of the line figure was coded and input using a card.The line figure was input using a digitizer, tablet, etc. There are methods such as specifying and inputting coordinates, inputting by drawing a line figure on a graphic display using a keyboard or tablet, and reading the line figure as image data to obtain information through pattern recognition. This input method can be expected to have great effects, such as being able to be automated using a computer, reducing the number of processing steps, and reducing errors caused by manual intervention. Several devices have been devised for this purpose.

しかしながら従来の方法には、ストロークや線
図形の構成要素を抽出するために、原画像の全て
のデータ上での追跡方法を採つているため、原画
像の全てのデータを蓄積する大容量の記憶部が必
要である。また、追跡方法の前処理として細線化
処理が必要な場合もあり、この場合は処理時間が
長くかかる。さらに抽出を確実にまた効率良く行
なうためには、直線は定規を使用して書いたり、
図面構成要素の形はテンプレートを使用して書く
必要がある等、図面作成上に大きな制約を有する
という欠点がある。
However, in conventional methods, in order to extract the constituent elements of strokes and line figures, a tracking method is used on all the data of the original image, so a large capacity storage is required to store all the data of the original image. section is required. Furthermore, thinning processing may be necessary as preprocessing for the tracking method, and in this case, processing time is long. Furthermore, in order to perform extraction reliably and efficiently, it is necessary to draw straight lines using a ruler,
This method has the disadvantage that there are significant restrictions on drawing creation, such as the need to draw the shapes of drawing components using templates.

発明の目的 本発明は上記従来の問題点を解消するもので、
原画像データすべてを蓄積する記憶部をもたなく
とも、線図形を構成する水平ストローク、垂直ス
トローク、ななめストロークとその接続関係を抽
出でき、細線化処理等の前処理が不要であり、さ
らに対象とする図形にも大きな制約を加える必要
がない線図形のストローク抽出装置を提供するこ
とを目的とする。
Purpose of the invention The present invention solves the above-mentioned conventional problems.
Even without having a memory unit to store all the original image data, it is possible to extract the horizontal strokes, vertical strokes, diagonal strokes that make up a line figure, and their connection relationships, and there is no need for preprocessing such as line thinning processing, and the target It is an object of the present invention to provide a stroke extracting device for a line figure that does not require large restrictions on the figure.

発明の構成 本発明は2次元平面上に表現される2次元線図
形をラインスキヤナなどの線走査により観測しな
がら観測値を順次2値化処理する読取手段と、前
記2値化処理により生成された白画素、黒画素を
表現する2値化データを一走査線上で連続する黒
画素の集合毎に、上記2次元平面上における始点
と終点の座標値データに変換する処理および一走
査線上に存在する上記連続する黒画素の集合の数
を計数する処理とを行なうスキヤンリスト生成手
段と、前記スキヤンリスト生成手段により生成さ
れた座標値データと連続する黒画素の集合の数と
を、最新のものから2走査線分記憶するスキヤン
リスト記憶部と、前記スキヤンリスト記憶部に記
憶されているデータをもとに、隣接する2本の走
査線上にある一走査線上で連続する黒画素の集合
の長さと、前記連続する黒画素の隣接する2本の
走査線相互の接続関係とを調べ、あらかじめ設定
された接続パターン毎に処理を振り分けるパター
ン処理呼出手段と、前記パターン処理呼出手段に
より起動され、各接続パターンより、図形を構成
する線部分であるストロークとストローク相互間
の接続部分を表わすノードとを生成してパターン
処理を行なうパターン処理手段とを設け、前記2
走査線分の一走査線で連続する黒画素の集合の始
点と終点の座標値データと一走査線上に存在する
前記連続する黒画素の集合の数とを一走査線分更
新し、上記パターン毎に処理を振り分け、パター
ン処理を行なうことを反復することによつて、図
形を構成する線部分として、水平、垂直、ななめ
の3種のストロークとその接続関係を抽出するも
のである。
Structure of the Invention The present invention provides a reading means for sequentially binarizing observed values while observing a two-dimensional line figure expressed on a two-dimensional plane by line scanning using a line scanner, and A process of converting binary data representing white pixels and black pixels into coordinate value data of the starting point and end point on the two-dimensional plane for each set of consecutive black pixels on one scanning line, and scan list generation means that performs the process of counting the number of consecutive black pixel sets; and coordinate value data generated by the scan list generation means and the number of consecutive black pixel sets, starting from the latest one. Based on a scan list storage unit that stores two scan lines, and the data stored in the scan list storage unit, the length of a set of consecutive black pixels on one scan line on two adjacent scan lines is determined. , pattern processing calling means which examines the mutual connection relationship between two adjacent scanning lines of the continuous black pixels and distributes processing for each connection pattern set in advance; a pattern processing means for performing pattern processing by generating strokes, which are line portions constituting a figure, and nodes representing connection portions between the strokes, from the pattern;
The coordinate value data of the start point and end point of the set of consecutive black pixels on one scanning line and the number of the set of consecutive black pixels existing on one scanning line are updated for one scanning line, and the data is updated for each scanning line. By repeating the process of distributing the processing to the pattern processing and pattern processing, three types of strokes, horizontal, vertical, and diagonal, and their connection relationships are extracted as the line parts that make up the figure.

実施例の説明 以下、図面を参照しながら本発明の一実施例に
ついて説明する。
DESCRIPTION OF EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings.

第1図は本発明の一実施例における線図形のス
トローク抽出装置のブロツク図である。
FIG. 1 is a block diagram of a line figure stroke extraction device according to an embodiment of the present invention.

同図において、1はフアクシミリ等のラスタ走
査型の読取部で、2次元線図形に2値化処理を行
ない、白画素と黒画素とを表現する2値化データ
を出力する。2はスキヤンリスト生成部で、読取
部1の出力情報に基いて黒ラン毎の始点、終点の
座標値データへの変換と一走査線上の黒ラン数の
計数と水平、垂直及びななめストロークのいずれ
を構成する黒ランかの識別を行なう。3はスキヤ
ンリスト生成部で、スキヤンリスト生成部2から
送出される黒ランの始点、終点の座標値データ、
黒ランの種類及び一走査線上の黒ランの数を常に
新しいものから2走査線分だけ記憶する。4はパ
ターン処理呼出部で、上下2走査線上の黒ランの
接続関係を調べ、あらかじめ設定されたパターン
のうちどのパターンに属するかを類別し、対応す
るパターン処理部5を呼び出す。6はリスト処理
部で、パターン処理部5の呼び出しに応じてスト
ロークの基本的抽出処理を行なう。7a,7b及
び7cはそれぞれストロークリスト記憶部、ノー
ドリスト記憶部及びランリスト記憶部で、リスト
処理部6の処理結果に応じて最新のデータに遂次
更新され、最終的にストロークとストロークの接
続関係を記憶する。8は出力部で、線図形のスト
ローク抽出結果を出力する。
In the figure, reference numeral 1 denotes a raster scanning type reading unit such as a facsimile, which performs binarization processing on a two-dimensional line figure and outputs binarized data representing white pixels and black pixels. 2 is a scan list generation unit, which converts the start point and end point of each black run into coordinate value data based on the output information of the reading unit 1, counts the number of black runs on one scan line, and selects horizontal, vertical, and diagonal strokes. The black runs that make up the area are identified. 3 is a scan list generation unit, which receives coordinate value data of the start point and end point of the black run sent from the scan list generation unit 2;
The type of black run and the number of black runs on one scanning line are always stored for two scanning lines starting from the newest one. Reference numeral 4 denotes a pattern processing calling section which examines the connection relationship of the black runs on the upper and lower two scanning lines, classifies which pattern it belongs to among preset patterns, and calls the corresponding pattern processing section 5. A list processing section 6 performs basic stroke extraction processing in response to a call from the pattern processing section 5. 7a, 7b, and 7c are a stroke list storage section, a node list storage section, and a run list storage section, respectively, which are successively updated to the latest data according to the processing results of the list processing section 6, and finally connect strokes to each other. Remember relationships. Reference numeral 8 denotes an output unit that outputs the stroke extraction result of a line figure.

上記のように構成された装置について、以下そ
の動作を説明する。
The operation of the apparatus configured as described above will be explained below.

まず対象となる2次元線図形は、フアクシミリ
等のラスタ走査型の読取部1で観測され、2値化
処理により、白画素と黒画素を表現する2値化デ
ータとなる。この2値化データは、順次、スキヤ
ンリスト生成部12に入力され、黒ラン毎に、2
次元平面上での始点、終点の座標値データに変換
され、出力される。
First, a target two-dimensional line figure is observed by a raster scanning type reading unit 1 such as a facsimile, and subjected to a binarization process to become binarized data representing white pixels and black pixels. This binarized data is sequentially input to the scan list generation unit 12, and for each black run, 2
It is converted into coordinate value data of the start point and end point on the dimensional plane and output.

またスキヤンリスト生成部2では、黒ランの長
さによつて、それが水平ストロークを構成する黒
ラン(以下水平ランと言う)か、垂直ストローク
あるいはななめストロークを構成する黒ラン(以
下、非水平ランと言う)かを識別する。すなわち
第2図に示すように2次元線図形の代表線巾を
W、ストローク21の水平方向からの傾きをθと
すると、ラン長Lは、 L=(1/sinθ)W となる。したがつて水平ストロークとみなす最大
のθをθHとすると、ラン長Lが、 L≧(1/sinθH)W となる黒ランを水平ランとする。θHとしては例え
ば15゜程度を選ぶことにより、通常の手書き図形
に対し、良好な結果を得ることができる。
In addition, the scan list generation unit 2 determines whether a black run constitutes a horizontal stroke (hereinafter referred to as a horizontal run), or a black run constitutes a vertical stroke or a diagonal stroke (hereinafter referred to as a non-horizontal run), depending on the length of the black run. orchid). That is, as shown in FIG. 2, if the representative line width of the two-dimensional line figure is W and the inclination of the stroke 21 from the horizontal direction is θ, then the run length L is as follows: L=(1/sinθ)W. Therefore, if the maximum θ that is regarded as a horizontal stroke is θ H , then a black run where the run length L is L≧(1/sin θ H )W is defined as a horizontal run. By selecting θ H to be about 15°, for example, good results can be obtained for ordinary handwritten figures.

そしてスキヤンリスト生成部2は、対象と考え
ている黒ランが水平ランか非水平ランかの識別結
果と、一走査線上に存在する黒ランの個数を出力
する。
Then, the scan list generation unit 2 outputs the result of identifying whether the black run considered as a target is a horizontal run or a non-horizontal run, and the number of black runs existing on one scan line.

次にスキヤンリスト生成部2から出力される黒
ランの始点、終点の座標値データ、黒ランの種類
及び一走査線上の黒ランの数は、常に新しいもの
から2走査線分がスキヤンリスト記憶部3に登録
される。(以下、スキヤンリスト記憶部3の内容
を単にスキヤンリストと言い、最新走査線のスキ
ヤンリストを第2走査線のスキヤンリスト、その
1本前のスキヤンリストを第1走査線のスキヤン
リストと言う。) そしてパターン処理呼出部14では、上記スキ
ヤンリストをもとに、第2走査線上の黒ランと、
第1走査線上の黒ランを順に対応させ、上下2走
査線上の黒ランの接続関係を調べ、その接続関係
と、それらの黒ランの種類(水平ランか非水平ラ
ンか)に応じて、あらかじめ設定されたパターン
のうちどのパターンに属するか類別し、対応する
パターン処理部5を呼び出す。
Next, the coordinate value data of the start point and end point of the black run output from the scan list generation unit 2, the type of black run, and the number of black runs on one scanning line are always stored in the scan list storage for two scanning lines from the newest one. Registered in 3. (Hereinafter, the contents of the scan list storage unit 3 will be simply referred to as a scan list, the scan list for the latest scan line will be referred to as the scan list for the second scan line, and the scan list for the previous scan line will be referred to as the scan list for the first scan line. ) Then, in the pattern processing calling unit 14, based on the scan list, the black run on the second scanning line,
The black runs on the first scanning line are made to correspond in order, and the connection relationship between the black runs on the upper and lower two scan lines is checked. It classifies which pattern it belongs to among the set patterns, and calls the corresponding pattern processing section 5.

なお上記黒ランの接続関係は、スキヤンリスト
をもとに、次のように調べる。
The connection relationship of the above black runs is checked as follows based on the scan list.

すなわち、第3図に示すように第2走査線上の
黒ランの始点、終点のx座標をxS,2,xE,2、また、
第1走査線上の黒ランの始点、終点x座標をxS,1
xE,1とすると、これらの間に次の,,のう
ち、どれか1つの関係がある時、上下2走査線上
の黒ランは接続していると判定する。
That is, as shown in FIG. 3, the x coordinates of the starting point and ending point of the black run on the second scanning line are x S,2 , x E,2 , and
The x coordinates of the starting point and ending point of the black run on the first scanning line are x S,1 ,
Assuming x E,1 , if there is any one of the following relationships between them, it is determined that the black runs on the upper and lower two scanning lines are connected.

xS,2≦xS,1≦xE,2+1 xS,2−1≦xE,1≦xE,2 xS,1<xS,2≦xE,2<xE,1 なおここで座標を次のようにとる。ラインスキ
ヤナの主走査方向をx座標とし、副走査方向(主
走査方向に垂直方向)をy座標とする。x方向は
画素毎に、y方向は1走査線毎に座標値が1だけ
増加するものとする。
x S,2 ≦x S,1 ≦x E,2 +1 x S,2 −1≦x E,1 ≦x E ,2 x S,1 <x S,2 ≦x E,2 <x E,1 Here, the coordinates are taken as follows. Let the main scanning direction of the line scanner be the x coordinate, and let the sub-scanning direction (perpendicular to the main scanning direction) be the y coordinate. It is assumed that the coordinate value increases by 1 for each pixel in the x direction and for each scanning line in the y direction.

上記のあらかじめ設定された接続パターンは多
種類あるが、その中で基本的なものは次の7種類
である。
There are many types of connection patterns that are set in advance, but the following seven types are the basic ones.

A…第4図aに示すように、第2走査線に第1走
査線の黒ランと接続しない水平ランが存在する
場合。
A: As shown in FIG. 4a, the second scanning line has a horizontal run that is not connected to the black run of the first scanning line.

B…第4図bに示すように、第2走査線に第1走
査線の黒ランと接続しない非水平ランが存在す
る場合。
B: As shown in FIG. 4b, the second scanning line has a non-horizontal run that is not connected to the black run of the first scanning line.

C…第4図cに示すように、第2査線の水平ラン
と第1走査線の水平ランが接続している場合。
C: As shown in FIG. 4c, the horizontal run of the second scanning line and the horizontal run of the first scanning line are connected.

D…第4図dに示すように第2走査線の非水平ラ
ンと、第1走査線の非水平ランが接続している
場合。
D: A case where the non-horizontal run of the second scanning line and the non-horizontal run of the first scanning line are connected as shown in FIG. 4d.

E…第4図eに示すように、第2走査線の水平ラ
ンと、第1走査線の非水平ランとが接続してい
る場合。
E: As shown in FIG. 4e, the horizontal run of the second scanning line and the non-horizontal run of the first scanning line are connected.

F…第4図fに示すように、第2走査線の非水平
ランと、第1走査線の水平ランとが接続してい
る場合。
F: As shown in FIG. 4f, the non-horizontal run of the second scanning line and the horizontal run of the first scanning line are connected.

G…第4図gに示すように、第1走査線に非水平
ランがあり、第2走査線にこれと接続されるべ
き黒ランが存在しない場合。
G: As shown in FIG. 4g, there is a non-horizontal run in the first scanning line and there is no black run to be connected to it in the second scanning line.

以上のように、スキヤンリストをもとに黒ラン
の接続関係が分類できる。
As described above, the connection relationships of black runs can be classified based on the scan list.

さてパターン処理呼出部4で呼出されたパター
ン処理部5では、パターンに応じた処理手順に従
い、後述するリスト処理部6を複数個呼び出し、
後述するストロークリスト記憶部7a、ノードリ
スト記憶部7b、ランリスト記憶部7cをリスト
処理部6の処理結果に応じて最新のデータに遂次
更新して、最終的にストロークとストロークの接
続関係をこれらの記憶部7a〜7cに蓄積する。
Now, the pattern processing section 5 called by the pattern processing calling section 4 calls a plurality of list processing sections 6, which will be described later, according to the processing procedure according to the pattern.
The stroke list storage section 7a, node list storage section 7b, and run list storage section 7c, which will be described later, are successively updated to the latest data according to the processing results of the list processing section 6, and finally the connection relationship between strokes is determined. The data is stored in these storage units 7a to 7c.

ここでパターン処理部5と、パターン処理部5
から呼び出されるリスト処理部6で行われるスト
ロークの基本的な抽出過程について、上記記憶部
と関連させながら説明をする。
Here, the pattern processing section 5 and the pattern processing section 5
The basic process of extracting strokes performed by the list processing section 6 called from the list processing section 6 will be explained in relation to the above-mentioned storage section.

(イ) 第5図aに示すように水平ランが接続してい
る場合、 順次走査をして行くと第2走査線分のスキヤ
ンリストの最新のスキヤンリストである第2走
査線のスキヤンリストにまず第iランが現われ
る。この場合、この黒ランから水平ストローク
が始まると判断し、ストロークリスト記憶部7
aにストロークの種類と第iランのy座標、始
点および終点のx座標を登録する。
(b) When horizontal runs are connected as shown in Figure 5a, when scanning is performed sequentially, the scan list for the second scan line, which is the latest scan list of the scan list for the second scan line, is displayed. First, the i-th run appears. In this case, it is determined that the horizontal stroke starts from this black run, and the stroke list storage unit 7
The type of stroke, the y-coordinate of the i-th run, and the x-coordinates of the start point and end point are registered in a.

次にスキヤンリストを1ライン分更新すると
第1走査線のスキヤンリストに第iランが第2
走査線のスキヤンリストに第(i+1)ランが
現われる。ここで、ストロークリスト記憶部7
aの始点および終点のx座標と第(i+1)ラ
ンの始点および終点のx座標を第(i+1)ラ
ンの始点および終点のx座標を比較し、ストロ
ークリスト記憶部7aを更新する。即ち、 xS=MiN(xS,xS,I+1)を始点x座標 xE=MAX(xE,xE,I+1)を終点x座標とする。
Next, when the scan list is updated by one line, the i-th run is added to the scan list for the first scan line.
The (i+1)th run appears in the scan list of scan lines. Here, the stroke list storage unit 7
The x-coordinates of the starting point and ending point of a, the x-coordinates of the starting point and ending point of the (i+1)th run, and the x-coordinates of the starting point and ending point of the (i+1)th run are compared, and the stroke list storage unit 7a is updated. That is, x S =MiN (x S , x S , I +1 ) is the starting point x coordinate, and x E =MAX (x E , x E , I +1 ) is the ending point x coordinate.

但し、xS,xE:ストロークリスト記憶部17a
に登録されている水平ストロークの始点および
終点のx座標。
However, x S , x E : Stroke list storage section 17a
The x-coordinates of the start and end points of the horizontal stroke registered in .

xS,I+1,xE,I+1:第(i+1)ランの始点
および終点のx座標。
x S , I +1 , x E , I +1 : x coordinates of the start and end points of the (i+1)th run.

以下、順次スキヤンリストを更新しながら同
様の処理を繰り返し、第1走査線上のスキヤン
リストに第(i+k)ランが現われた時に、第
2走査線には続く黒ランが無いため水平ストロ
ークの抽出が完了する。すなわち、第5図bに
示すように、最小の始点座標xSと最大の終点座
標xEとを結ぶストローク51が検出される。
Thereafter, the same process is repeated while sequentially updating the scan list, and when the (i+k)th run appears in the scan list on the first scan line, the horizontal stroke cannot be extracted because there is no subsequent black run on the second scan line. Complete. That is, as shown in FIG. 5b, a stroke 51 connecting the minimum starting point coordinate x S and the maximum ending point coordinate x E is detected.

(ロ) 第6図aに示すように非水平ランが連続して
いる場合、 順次走査を行なうとまず第2走査線のスキヤ
ンリストに第iランが現われる。この時この黒
ランより垂直ストロークあるいはななめストロ
ークが始まつたと判断し、ランリスト記憶部7
cに第iランのy座標、始点および終点のx座
標を登録する。その後スキヤンリストを順次更
新してゆくと第2走査線のスキヤンリストに
は、第(i+1)ラン、第(i+2)ラン……
と現われるが、その都度ランリスト記憶部17
cにそのランの情報(例えば始点と終点の座
標)を登録してゆく。そして、第1走査線のス
キヤンリストに第(i+k)ランが現われた
時、第2走査線上に続く黒ランが存在しないた
めに垂直ストロークあるいは、ななめストロー
クが終結したと判断し、遂次記憶したランリス
トの情報より、それが垂直ストロークか、なな
めストロークか、あるいは雑音であるか判別
し、ストロークリスト記憶部7aにそのストロ
ークの種類と始点および終点の座標を登録す
る。その結果、ストロークは第6図b61に示
すように抽出される。
(b) When non-horizontal runs are continuous as shown in FIG. 6a, when sequential scanning is performed, the i-th run first appears in the scan list of the second scanning line. At this time, it is determined that a vertical stroke or diagonal stroke has started from this black run, and the run list storage unit 7
The y-coordinate of the i-th run and the x-coordinates of the starting point and ending point are registered in c. After that, when the scan list is updated sequentially, the scan list for the second scan line includes the (i+1)th run, the (i+2)th run, etc.
appears, but each time the run list storage unit 17
The run information (for example, the coordinates of the start point and end point) is registered in c. When the (i+k)th run appears in the scan list of the first scanning line, it is determined that the vertical stroke or diagonal stroke has ended because there is no continuing black run on the second scanning line, and the memory is sequentially stored. Based on the information in the run list, it is determined whether the stroke is a vertical stroke, diagonal stroke, or noise, and the type of stroke and the coordinates of the starting point and ending point are registered in the stroke list storage section 7a. As a result, strokes are extracted as shown in FIG. 6b61.

ここで、垂直ストロークとななめストローク
との判別は、1例としてストロークを構成する
第6図a第iランおよび第(i+k)ランの位
置関係より、求めることができ。即ち、始ラン
(最初の黒ラン)の中点を(xS,YS)終ラン
(最後の黒ラン)の中点を(xE,yE)とすれば、
ある値θVを設定し、 yS−yE/xS−xE≧tanθV ならば、垂直ストローク、それ以外はななめ
ストロークとする。ここでtanθVの設定は任意
にできるが、通常の線図形の場合は、例えば、 θV=80゜ 程度とすることにより、良好な結果が得られ
る。
Here, the discrimination between a vertical stroke and a diagonal stroke can be determined, for example, from the positional relationship between the i-th run and the (i+k)-th run in FIG. 6A, which constitute the stroke. That is, if the midpoint of the starting run (first black run) is (x S , Y S ) and the midpoint of the ending run (last black run) is (x E , y E ), then
Set a certain value θ V , and if y S −y E /x S −x E ≧tanθ V , it is a vertical stroke, otherwise it is a diagonal stroke. Here, tan θ V can be set arbitrarily, but in the case of a normal line figure, good results can be obtained by setting θ V = about 80°, for example.

(ハ) 第7a図に示すように、水平ランと非水平ラ
ンが接続している場合、 順次走査をくり返し、スキヤンリストを更新
し第2走査線のスキヤンリストに第iランが、
第1走査線のスキヤンリストに第(i−1)ラ
ンが現れた場合、まず第(i−1)ランで水平
ストロークが終了したと判断し、そのストロー
クリスト記憶部7aのそのストロークの更新を
終了する。そして、第iランより新たに垂直ス
トロークあるいはななめストロークが現われた
と判断し、第iランのy座標および始点および
終点のx座標をランリスト記憶部7cに登録す
る。
(C) As shown in Figure 7a, when a horizontal run and a non-horizontal run are connected, the scan list is updated by repeating sequential scanning, and the i-th run is added to the scan list of the second scan line.
When the (i-1)th run appears in the scan list of the first scanning line, it is first determined that the horizontal stroke has ended in the (i-1)th run, and the stroke is updated in the stroke list storage section 7a. finish. Then, it is determined that a new vertical stroke or diagonal stroke has appeared from the i-th run, and the y-coordinate and x-coordinates of the start point and end point of the i-th run are registered in the run list storage section 7c.

さらに、この2種のストロークの接続関係を
表現するため「ノード」という概念を用い、ノ
ードリスト記憶部7bにそのノードの座標と、
そのノードで接続するストロークとを登録す
る。抽出されたストロークとノードは第7図b
に示すようになる。ここで、ノードの座標とし
て上記第iランに現われた黒ランのほぼ中心相
当位置を用いている。
Furthermore, in order to express the connection relationship between these two types of strokes, the concept of "node" is used, and the coordinates of the node are stored in the node list storage section 7b.
The strokes connected at that node are registered. The extracted strokes and nodes are shown in Figure 7b.
It becomes as shown in . Here, a position approximately corresponding to the center of the black run appearing in the i-th run is used as the coordinates of the node.

(ニ) 第8図aに示すように非水平ランと水平ラン
が接続している場合、 順次走査をくり返し、スキヤンリストを更新
し第2走査線のスキヤンリストに第iランが、
第1走査線のスキヤンリストに第(i−1)ラ
ンが現われた場合、まず第(i−1)ランの情
報をランリスト記憶部7cに登録し、第(i−
1)ランで垂直あるいはななめストロークが終
結したと判断し、このストロークを構成するラ
ンリスト記憶部の情報より、それが垂直ストロ
ークがななめストロークか雑音かを判別し、ス
トロークリスト記憶部7aにそのストロークの
種類と始点および終点座標を登録する。さら
に、第2走査線のスキヤンリストにある第iラ
ンから水平ストロークが始まると判断し、スト
ロークリストに第iランのストロークの種類、
y座標、始点および終点のy座標を登録する。
同時にこの2種のストロークの接続関係を表わ
すため、ノードリスト記憶部7bにそのノード
の座標すなわち第(i−1)ランの中心相当位
置座標とそのノードに接続するストロークとを
登録する。これにより第8図bのようにストロ
ークとノードが抽出される。
(D) When a non-horizontal run and a horizontal run are connected as shown in Figure 8a, the scan list is updated by repeating sequential scanning, and the i-th run is added to the scan list of the second scan line.
When the (i-1)th run appears in the scan list of the first scanning line, information about the (i-1)th run is first registered in the run list storage section 7c, and
1) It is determined that a vertical or diagonal stroke has ended with a run, and based on the information in the run list storage unit that constitutes this stroke, it is determined whether the vertical stroke is a diagonal stroke or noise, and the stroke is stored in the stroke list storage unit 7a. Register the type and start point and end point coordinates. Furthermore, it is determined that the horizontal stroke starts from the i-th run in the scan list of the second scanning line, and the stroke type of the i-th run is added to the stroke list.
Register the y-coordinate, the y-coordinates of the starting point, and the ending point.
At the same time, in order to represent the connection relationship between these two types of strokes, the coordinates of the node, that is, the coordinates of the center equivalent position of the (i-1)th run, and the strokes connected to the node are registered in the node list storage section 7b. As a result, strokes and nodes are extracted as shown in FIG. 8b.

なお上記(イ)〜(ニ)の処理における、ストロークリ
スト記憶部7a、ノード記憶部7b、ランリスト
記憶部7cとの入出力処理は、リスト処理部が行
なう。
Note that in the processes (a) to (d) above, input/output processing with the stroke list storage section 7a, node storage section 7b, and run list storage section 7c is performed by the list processing section.

以上本実施例によれば例えば、A4版の原図形
を副走査8本/mmで走査する場合、原図形の全画
像データを蓄積する方法に較べて本方式は約1/
1200の画像データ蓄積容量で済むことになり、低
コストの装置を実現することができる。
According to this embodiment, for example, when scanning an A4 size original figure at a sub-scan of 8 lines/mm, this method is approximately 1/2 times faster than the method of accumulating all image data of the original figure.
The image data storage capacity is only 1,200, making it possible to realize a low-cost device.

なお本実施例においては基本的部分を説明した
が、実際の場合には第9図に示すように水平ラン
の最初および最後に短かい黒ランが検出されるこ
とが多い。そのような黒ランは一旦は非水平ラン
としてランリストに登録されるが、一定走査線数
以上続いて出現しない場合はノイズと見倣してそ
の情報を捨てる。例えば2本以内の黒ランの連続
はノイズとして捨てても、本方式によるストロー
ク抽出に何等悪影響を与えないばかりでなく、ノ
イズ成分が少なくなり良好な結果が得られる。
Although the basic parts have been explained in this embodiment, in actual cases, short black runs are often detected at the beginning and end of a horizontal run, as shown in FIG. Such black runs are once registered in the run list as non-horizontal runs, but if they do not appear continuously for a certain number of scanning lines or more, they are treated as noise and the information is discarded. For example, even if two or less consecutive black runs are discarded as noise, not only will this method not have any negative effect on stroke extraction using this method, but the noise component will be reduced and good results will be obtained.

また、本実施例では1走査線上に単一の黒ラン
が存在する場合を述べたが、1走査線上に複数の
黒ランが存在する場合にも全く同様にストローク
を抽出することができる。
Further, in this embodiment, a case where a single black run exists on one scanning line has been described, but strokes can be extracted in exactly the same way even when a plurality of black runs exist on one scanning line.

発明の効果 以上に述べたように本発明は、原図形の読取と
同時に一走査線の走査毎にその走査線内の黒ラン
の情報を座標値データに変換し、黒ランの始点お
よび終点の座標値から成るスキヤンリストを蓄積
するスキヤンリスト記憶部を主たる記憶部として
設けるだけで、線図形を構成する水平ストロー
ク、垂直ストローク、ななめストロークとそれら
の接続関係を抽出することができ、従来の装置に
比べ蓄積容量が少なくて済み、データ量も少な
く、高効率で高速の処理ができるという効果があ
る。
Effects of the Invention As described above, the present invention converts the information of the black run in each scanning line into coordinate value data at the same time as reading the original figure, and converts the information of the black run in the scanning line into coordinate value data. By simply providing a scan list storage unit that stores scan lists consisting of coordinate values as the main storage unit, it is possible to extract the horizontal strokes, vertical strokes, and diagonal strokes that make up a line figure, as well as their connection relationships. It has the advantage of requiring less storage capacity, less amount of data, and being able to process with high efficiency and high speed.

また、一連の処理のうち最も図形入力部分に近
い部分において、画像データを、ストロークとそ
の接続関係という符号化され圧縮された情報に変
換するので、従来の細線化を行なう手法などと比
較して全体の処理速度を大幅に短縮することが可
能である。
In addition, in the part of the series of processing that is closest to the figure input part, image data is converted into encoded and compressed information of strokes and their connection relationships, so compared to conventional line thinning methods, etc. It is possible to significantly reduce the overall processing speed.

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

第1図は本発明の一実施例における線図形のス
トローク抽出装置のブロツク結線図、第2図は水
平ランと非水平ランの区別を示す図、第3図は黒
ラン相互の接続関係を示す図、第4図は黒ランの
接続関係の基本を示す図、第5図は水平ラン相互
の接続関係から水平ストロークの抽出を示す図、
第6図は非水平ラン相互の接続関係から非水平
(垂直またはななめ)ストロークの抽出を示す図、
第7図は水平ランに非水平ランが続きノードを形
成する場合の抽出方法を示す図、第8図は非水平
ランに水平ランが続きノードを形成する場合の抽
出を示す図、第9図は水平ランにノイズ的な非水
平ランが続く場合を示す図である。 1……読取部、2……スキヤンリスト生成部、
3……スキヤンリスト記憶部、4……パターン処
理呼出部、5……パターン処理部、6……リスト
処理部、7a……ストロークリスト記憶部、7b
……ノードリスト記憶部、7c……ランリスト記
憶部。
Fig. 1 is a block wiring diagram of a line figure stroke extraction device according to an embodiment of the present invention, Fig. 2 is a diagram showing the distinction between horizontal runs and non-horizontal runs, and Fig. 3 is a diagram showing the connection relationship between black runs. Figure 4 is a diagram showing the basics of the connection relationship between black runs, Figure 5 is a diagram showing the extraction of horizontal strokes from the connection relationship between horizontal runs,
FIG. 6 is a diagram showing the extraction of non-horizontal (vertical or diagonal) strokes from the connection relationship between non-horizontal runs;
Figure 7 shows the extraction method when a horizontal run is followed by a non-horizontal run to form a node, Figure 8 is a diagram showing the extraction method when a non-horizontal run is followed by a horizontal run to form a node, and Figure 9. is a diagram showing a case where a horizontal run is followed by a noisy non-horizontal run. 1...Reading section, 2...Scan list generation section,
3... Scan list storage section, 4... Pattern processing calling section, 5... Pattern processing section, 6... List processing section, 7a... Stroke list storage section, 7b
... Node list storage section, 7c... Run list storage section.

Claims (1)

【特許請求の範囲】 1 2次元平面上に表現される2次元線図形をラ
インスヤナなどの線走査により観測しながら観測
値を順次2値化処理する読取手段と、前記2値化
処理により生成された白画素、黒画素を表現する
2値化データを一走査線上で連続する黒画素の集
合毎に、上記2次元平面上における始点と終点の
座標値データに変換する処理、および一走査線上
に存在する上記連続する黒画素の集合の数を計数
する処理とを行なうスキヤンリスト生成手段と、
前記スキヤンリスト生成手段により生成された座
標値データと連続する黒画素の集合の数とを、最
新のものから2走査線分記憶するスキヤンリスト
記憶部と、前記スキヤンリスト記憶部に記憶され
ているデータをもとに、隣接する2本の走査線上
にある、一走査線上で連続する黒画素の集合の長
さと、前記連続する黒画素の隣接する2本の走査
相互の接続関係とを調べ、あらかじめ設定された
接続パターン毎に処理を振り分けるパターン処理
呼出手段と、前記パターン処理呼出手段により起
動され、各接続パターンより、図形を構成する線
部分であるストロークとストローク相互間の接続
部分を表わすノードとを生成してパターン処理を
行なうパターン処理手段とを具備し、前記2走査
線分の一走査線で連続する黒画素の集合の始点と
終点の座標値データと一走査線上に存在する前記
連続する黒画素の集合の数とを一走査線分更新
し、上記パターン毎に処理を振り分け、パターン
処理を行なうことを反復することによつて、図形
を構成する線部分として、水平、垂直、ななめの
3種のストロークとその接続関係を抽出すること
を特徴とする線図形のストローク抽出装置。 2 パターン処理手段は図形を構成する線部分で
あるところのストロークの始点および終点の座標
とストロークの種類とを登録するストロークリス
ト記憶部と、ストローク相互間の接続部分を表わ
すノードの座標、およびそのノードで接続するス
トロークを登録するノードリスト記憶部と、垂直
あるいは、ななめのストロークを構成すると考え
られている一連の黒画素の集合の始点、および終
点の座標を登録するランリスト記憶部と、各パタ
ーン毎に前記ストロークリスト記憶部、前記ノー
ドリスト記憶部、および前記ランリスト記憶部の
データを操作するリスト処理手段とを具備する特
許請求の範囲第1項記載の線図形のストローク抽
出装置。
[Scope of Claims] 1. A reading means for sequentially binarizing observed values while observing a two-dimensional line figure expressed on a two-dimensional plane by line scanning such as a line scanner; A process of converting binary data representing white pixels and black pixels into coordinate value data of the start point and end point on the two-dimensional plane for each set of consecutive black pixels on one scanning line, and scan list generation means for performing a process of counting the number of sets of continuous black pixels that exist;
a scan list storage unit that stores the coordinate value data generated by the scan list generation means and the number of consecutive black pixel sets for two scanning lines starting from the latest one; and the scan list storage unit stores the coordinate value data and the number of consecutive black pixel sets. Based on the data, examine the length of a set of consecutive black pixels on one scanning line on two adjacent scanning lines and the connection relationship between the two adjacent scanning lines of the continuous black pixels, A pattern processing calling means that distributes processing for each connection pattern set in advance, and a node that is activated by the pattern processing calling means and represents strokes that are line portions forming a figure and connecting portions between the strokes. and pattern processing means for performing pattern processing by generating the coordinate value data of the start point and end point of a set of consecutive black pixels on one scanning line of the two scanning lines and the continuous black pixels existing on one scanning line. By updating the number of black pixel sets for one scanning line, distributing processing for each pattern, and repeating pattern processing, horizontal, vertical, diagonal A stroke extraction device for line figures, characterized in that it extracts three types of strokes and their connection relationships. 2. The pattern processing means includes a stroke list storage unit that registers the coordinates of the start and end points of strokes, which are line parts constituting a figure, and the type of stroke, and the coordinates of nodes representing connecting parts between strokes, as well as their coordinates. A node list storage unit that registers strokes connected by nodes, a run list storage unit that registers the coordinates of the start and end points of a set of black pixels that are considered to constitute a vertical or diagonal stroke, and each 2. The line graphic stroke extraction device according to claim 1, further comprising list processing means for manipulating data in the stroke list storage section, the node list storage section, and the run list storage section for each pattern.
JP57214354A 1982-12-06 1982-12-06 Stroke extracting device of linear pattern Granted JPS59103178A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP57214354A JPS59103178A (en) 1982-12-06 1982-12-06 Stroke extracting device of linear pattern

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP57214354A JPS59103178A (en) 1982-12-06 1982-12-06 Stroke extracting device of linear pattern

Publications (2)

Publication Number Publication Date
JPS59103178A JPS59103178A (en) 1984-06-14
JPH022189B2 true JPH022189B2 (en) 1990-01-17

Family

ID=16654381

Family Applications (1)

Application Number Title Priority Date Filing Date
JP57214354A Granted JPS59103178A (en) 1982-12-06 1982-12-06 Stroke extracting device of linear pattern

Country Status (1)

Country Link
JP (1) JPS59103178A (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6345687A (en) * 1986-08-13 1988-02-26 Yokogawa Electric Corp Line segment extracting method for digital image
JP4262471B2 (en) 2002-11-12 2009-05-13 富士通株式会社 Biometric feature data acquisition device
JP4692109B2 (en) * 2005-07-04 2011-06-01 セイコーエプソン株式会社 Image inclination detection method, image inclination detection apparatus, and image inclination detection program

Also Published As

Publication number Publication date
JPS59103178A (en) 1984-06-14

Similar Documents

Publication Publication Date Title
JP2940936B2 (en) Tablespace identification method
JPH0772861B2 (en) Program creation device
JPH05342408A (en) Document image filing device
JPH022189B2 (en)
JPH0656618B2 (en) Image information character / graphic separation method
JP2789622B2 (en) Character / graphic area determination device
Ablameyko et al. Automatic/interactive interpretation of color map images
JP2507949B2 (en) Character / graphic area determination device
JP3104355B2 (en) Feature extraction device
JP2890507B2 (en) Separation device for character area and graphic area
JP3045810B2 (en) Binary image processing method and apparatus
JPH11120291A (en) Pattern recognition system
JP2674286B2 (en) Feature extraction method
KR100332753B1 (en) Image processing method of image processing system
JPH0540848A (en) Area extraction method for document image
JPS63157287A (en) Character pattern extracting method
Ablameyko et al. Hierarchical vector representation of document images
JPS60146380A (en) Character recognition device
CN113239929A (en) Method for identifying numbers in computer display screen
JPH03268181A (en) Document reader
JP2575402B2 (en) Character recognition method
JPH0495180A (en) Segment/curve recognizing system
JPH0343879A (en) Character area separating system for character recognizing device
JPH02166583A (en) Character recognizing device
JP2002032713A (en) Character recognition processing method