JP3177138B2 - Extraction method of drawing closed area - Google Patents

Extraction method of drawing closed area

Info

Publication number
JP3177138B2
JP3177138B2 JP30236795A JP30236795A JP3177138B2 JP 3177138 B2 JP3177138 B2 JP 3177138B2 JP 30236795 A JP30236795 A JP 30236795A JP 30236795 A JP30236795 A JP 30236795A JP 3177138 B2 JP3177138 B2 JP 3177138B2
Authority
JP
Japan
Prior art keywords
grid
grid intersection
pattern
line segment
digit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP30236795A
Other languages
Japanese (ja)
Other versions
JPH09147105A (en
Inventor
康浩 青木
昭夫 塩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP30236795A priority Critical patent/JP3177138B2/en
Publication of JPH09147105A publication Critical patent/JPH09147105A/en
Application granted granted Critical
Publication of JP3177138B2 publication Critical patent/JP3177138B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は,イメージスキャナ
等を介して入力される手書きまたは印刷された図面情報
から自動的に閉領域を抽出する方法に関し,特に,対象
とする図面は結合部の角度が数種類に限定されている線
分を基本構成として持つものとし,その線分からなる閉
領域を,線のかすれや切れまたは雑音があっても抽出で
きるようにした図面閉領域の抽出方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for automatically extracting a closed area from handwritten or printed drawing information input via an image scanner or the like. The present invention relates to a method for extracting a closed region of a drawing, which has a line segment limited to several types as a basic configuration, and is capable of extracting a closed region formed by the line segment even if there is faint or broken lines or noise.

【0002】[0002]

【従来の技術】手書きまたは印刷された図面を自動認識
する場合,図面を構成する線分や閉領域の抽出処理が必
要になる。閉領域の抽出方法としては,領域の内部や外
部の境界点追跡を行う手法が使われてきた。しかし,従
来の境界点追跡の技術では,線のかすれや切れの存在に
よって,隣接する別々の領域が結合して1つの領域とし
て抽出されたり,閉領域として抽出できないといった問
題があった。
2. Description of the Related Art When automatically recognizing a handwritten or printed drawing, it is necessary to perform a process of extracting a line segment or a closed region constituting the drawing. As a method of extracting a closed region, a method of tracking a boundary point inside or outside the region has been used. However, in the conventional boundary point tracking technology, there is a problem that, due to the presence of blurred or broken lines, adjacent separate regions are combined and extracted as one region, or cannot be extracted as a closed region.

【0003】[0003]

【発明が解決しようとする課題】本発明は,従来の図面
閉領域の抽出方法における上記の問題を解決し,正確に
印刷された図面だけでなく,線のかすれや切れの多い手
書き図面にも対応できる新しい閉領域抽出方法を提供す
ることを目的とする。
SUMMARY OF THE INVENTION The present invention solves the above-mentioned problems in the conventional method of extracting a closed region of a drawing, and is applicable not only to a correctly printed drawing but also to a handwritten drawing having many faint lines and cuts. It is an object of the present invention to provide a new closed region extraction method that can be used.

【0004】[0004]

【課題を解決するための手段】本発明の図面閉領域の抽
出方法では,上記課題を解決するために,(1)イメー
ジスキャナ等を介して得られたラスタデータを,線分の
始終点パターンを使って格納する手法と,(2)始終点
パターンを使って輪郭追跡を行い,閉領域を抽出する手
法とを用いる。
According to the method for extracting a closed region of a drawing of the present invention, in order to solve the above-mentioned problems, (1) raster data obtained through an image scanner or the like is converted into a line segment start / end pattern; And (2) a method of performing contour tracing using a start / end point pattern and extracting a closed region.

【0005】図1は,本発明の処理の流れを示す図であ
る。図1において,10はパターンマップ作成処理,2
0は閉領域抽象処理の過程を表す。パターンマップ作成
処理10は,2値データの図面情報が入力されると,グ
リッド状の補助線が印刷された用紙上のグリッド交点か
ら複数の方向に延びるグリッド線上の各々の方向に線分
の探索領域を設定し,この探索領域を線分の方向と垂直
な方向に1列ずつ走査し,黒画素が1個以上存在する列
の数が所定のしきい値を越えているか否かにより前記各
方向に対して線分が存在するか否かを判定し(S1
1),線分の有無に応じて符号を割り当て,存在する各
方向の線分の組み合わせによりグリッド交点の状態パタ
ーンを決定し,全グリッド交点について状態パターンを
決定してパターンマップを作成する(S12)過程であ
る。
FIG. 1 is a diagram showing a processing flow of the present invention. In FIG. 1, reference numeral 10 denotes a pattern map creation process;
0 indicates the process of the closed area abstraction process. When the drawing information of the binary data is input, the pattern map creation processing 10 searches for line segments in each direction on a grid line extending in a plurality of directions from a grid intersection on a sheet on which a grid-like auxiliary line is printed. Set an area and set this search area perpendicular to the direction of the line segment
Scans one row at a time in any direction, and has one or more black pixels
Is determined by whether or not the number exceeds a predetermined threshold.
It is determined whether a line segment exists in the direction (S1).
1) A code is assigned according to the presence or absence of a line segment, a state pattern of grid intersections is determined by a combination of existing line segments in each direction, and a state pattern is determined for all grid intersections to create a pattern map (S12). ) Process.

【0006】閉領域抽出処理20は,パターンマップか
ら閉領域探索の開始点を見つけ(S21),開始点のグ
リッド交点パターンから次方向の優先順位に基づき次の
点を決定して次経路を決定し(S22),決定した経路
を閉領域の輪郭として(S23),閉領域を抽出する過
程である。
The closed area extraction processing 20 finds the start point of the closed area search from the pattern map (S21), determines the next point from the grid intersection pattern of the start point based on the priority in the next direction, and determines the next route. (S22), the determined route is taken as the contour of the closed area (S23), and the closed area is extracted.

【0007】各グリッド交点の状態パターンは,例えば
グリッド交点から延びるグリッド線の線分の数に応じた
桁(ビットまたはビット群)を含む符号であって,その
各線分に対応する符号中の各桁の位置が所定の方向から
左回りまたは右回りに現れる線分の方向の順番になるよ
うに定められた符号で表される。経路探索における探索
方向の優先順位は,この状態パターンを表す符号におけ
る既知の経路方向の桁の次の桁位置から順番に桁の並び
に従って定められる。
The state pattern of each grid intersection is, for example, a code including digits (bits or bit groups) corresponding to the number of line segments of the grid line extending from the grid intersection, and each code in the code corresponding to each line segment. The position of the digit is represented by a code determined so as to be in the order of the direction of a line segment appearing counterclockwise or clockwise from a predetermined direction. The priority order of the search directions in the route search is determined according to the order of the digits in order from the digit position next to the digit of the known route direction in the code representing the state pattern.

【0008】本発明のパターンマップ作成処理10で
は,線分の始終点パターンを用いて各グリッド交点ごと
の状態パターンのパターンマップを作成するため,手書
きによる線の蛇行を修正し,切れやかすれを減少させる
ことができる。
In the pattern map creation processing 10 of the present invention, a pattern map of a state pattern for each grid intersection is created using the start and end point patterns of the line segment. Can be reduced.

【0009】また,閉領域抽出処理20では,前記パタ
ーンマップを用いてグリッド交点間の線分の接続を判定
するようにしているため,線分の切れやかすれに影響さ
れにくくなるとともに,雑音による影響をも除外するこ
とができる。また,輪郭の経路探索方向の優先順位を,
状態パターンに割り当てた符号の桁(ビットまたはビッ
ト群)の並びに従って決定できるようにすることによ
り,簡単な論理による効率のよい探索を実現することが
できる。
In the closed region extraction processing 20, the connection of the line segment between the grid intersections is determined using the pattern map. Effects can also be ruled out. In addition, the priority of the contour route search direction is
By making it possible to determine according to the arrangement of the digits (bits or bit groups) of the codes assigned to the state patterns, it is possible to realize an efficient search using simple logic.

【0010】[0010]

【発明の実施の形態】本発明の図面閉領域の抽出方法
は,グリッド状の補助線が記された用紙を用いて作成さ
れた回路配線を示す論理回路図面,間取りの空間配置を
示す間取り図面などの様々な図面における閉領域の自動
抽出処理に利用することができる。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A method for extracting a drawing closed area according to the present invention is a logical circuit drawing showing circuit wiring created using a sheet on which grid-like auxiliary lines are drawn, and a floor plan showing a spatial layout of a floor plan. It can be used for automatic extraction processing of a closed region in various drawings such as.

【0011】図2は,それら図面を書き込むための用紙
にドロップアウト・カラーなどで記されたグリッド状の
補助線の例を示す図である。この補助線は,等間隔に交
点ができるように,いくつかの方向に,平行な線を等間
隔で引いたものである。図2(A)は,縦と横方向の2
種類の補助線であり,図2(B)は,これに左右の斜め
45度の補助線を加えたものである。
FIG. 2 is a diagram showing an example of grid-like auxiliary lines written in dropout color or the like on a sheet for writing those drawings. These auxiliary lines are parallel lines drawn at equal intervals in several directions so that intersections are made at equal intervals. FIG. 2A shows two vertical and horizontal directions.
FIG. 2B shows auxiliary lines of a 45-degree diagonal left and right direction.

【0012】以下,本発明の実施の一形態として,間取
り図面中の閉領域抽出に本発明を適用した場合について
説明する。間取り図面専用の用紙には,通常,基準線と
して図2(A)に示すような縦横の線が等間隔に引かれ
ている。この図面上の基準線をグリッド線,基準線の交
点をグリッド交点と呼ぶこととする。
Hereinafter, as one embodiment of the present invention, a case where the present invention is applied to extraction of a closed region in a floor plan will be described. Usually, vertical and horizontal lines as shown in FIG. 2A are drawn at regular intervals as reference lines on a sheet dedicated to the floor plan. The reference line on this drawing is called a grid line, and the intersection of the reference lines is called a grid intersection.

【0013】間取り図面を構成する多くの要素(壁,建
具,畳,階段等)のサイズが,グリッド線の間隔の整数
倍で表現される。このため,この専用用紙に間取り図面
を書く場合,大部分の線分がグリッド線上に書かれ,さ
らにその線分の始終点はグリッド交点上に書かれる。本
発明の閉領域の抽出方法は,この特徴を利用するもので
あり,図面要素を構成する線分をグリッド線上に書くこ
とを筆記条件として,グリッド線上に書かれた図面要素
を構成する線分が作る閉領域を抽出対象とする。
The size of many elements (walls, fittings, tatami mats, stairs, etc.) constituting the floor plan is expressed by an integral multiple of the interval between grid lines. For this reason, when drawing a floor plan on this special paper, most line segments are written on grid lines, and the start and end points of the line segments are written on grid intersections. The method for extracting a closed region according to the present invention utilizes this feature, and the condition that a line segment forming a drawing element is written on a grid line is a writing condition, and a line segment forming a drawing element written on the grid line is used. Let the closed region created by be an extraction target.

【0014】図1に示す本発明の処理手順を詳細に説明
する。パターンマップ作成処理10で,入力された2値
のラスタデータを本発明のパターンマップへ変換し,次
に,閉領域抽出処理20で閉領域の輪郭部分の探索を行
う。
The processing procedure of the present invention shown in FIG. 1 will be described in detail. The input binary raster data is converted into the pattern map of the present invention in the pattern map creation processing 10, and then the outline of the closed area is searched for in the closed area extraction processing 20.

【0015】まず,パターンマップ作成処理10につい
て説明する。パターンマップとは,図面上のグリッド交
点部分を通過する線分の状態を,予め用意していた線分
の状態パターンとマッチングさせ,適合した状態パター
ンのパターンコードを記録したデータのことである。手
書きで書かれた間取り図面を,イメージスキャナを介し
て得られるラスタデータに変換し,そこからパターンマ
ップを生成する。
First, the pattern map creation processing 10 will be described. The pattern map is data in which a state of a line passing through a grid intersection on a drawing is matched with a state pattern of a previously prepared line, and a pattern code of an appropriate state pattern is recorded. The floor plan drawn by hand is converted into raster data obtained via an image scanner, and a pattern map is generated therefrom.

【0016】このとき用いるパターンコードは,2進数
に変換した場合に,その各桁とグリッド交点から延びる
各方向とが対応したものとする。つまり,線分が存在し
ている方向に対応しているパターンコードの桁は1と
し,存在していない方向に対応している桁は0とする。
The pattern code used at this time, when converted into a binary number, corresponds to each digit and each direction extending from the grid intersection. That is, the digit of the pattern code corresponding to the direction in which the line segment exists is set to 1, and the digit corresponding to the direction in which the line segment does not exist is set to 0.

【0017】例えば,図3に示すように,グリッド交点
から4方向に延びるパターンでは,パターンコードは2
進数表現で4桁であり,N方向(上方向)は第1桁に,
E方向(右方向)は第2桁に,S方向(下方向)は第3
桁に,W方向(左方向)は第4桁に対応する。これらす
べての方向に,記入された線分が存在している場合に
は,その対応する各桁がすべて1(1,1,1,1)と
なる。
For example, as shown in FIG. 3, in a pattern extending from the grid intersection in four directions, the pattern code is 2
4 digits in hexadecimal notation, N direction (upward) is the first digit,
The E direction (right direction) is the second digit, and the S direction (downward) is the third digit.
The W direction (left direction) corresponds to the fourth digit. If there are line segments written in all of these directions, all the corresponding digits are 1 (1,1,1,1).

【0018】本実施例で使われる図面において,印刷さ
れたグリッド線の線分が水平方向と垂直方向の2種類で
あるとした場合,グリッド交点のパターンは,図4に示
すような16パターンである。状態パターンの決定で
は,図面中のグリッド交点を中心に上下左右の4方向に
関して,書かれた線分の有無を判定し,存在した線分の
組み合わせでパターンを決定する。
In the drawing used in the present embodiment, if the printed grid lines are of two types, that is, the horizontal direction and the vertical direction, the grid intersection pattern has 16 patterns as shown in FIG. is there. In the determination of the state pattern, the presence or absence of a written line segment is determined in four directions, up, down, left, and right, with the grid intersection in the drawing as the center, and the pattern is determined by a combination of existing line segments.

【0019】図5は,グリッド交点付近における線分の
有無の判定方法の例を説明する図である。図5(A)
は,線分の有無の判定対象となるグリッド交点を示す。
図5(B)に示すように,グリッド交点の近辺において
グリッド交点を中心に4方向に線分の探索領域を設定す
る。この領域を線分の方向と垂直な方向に1列ずつ走査
し,黒画素が存在する列を1,存在しない列を0とす
る。こうしてすべての列を走査した結果,1となった列
が,あるしきい値を越えている場合に,線分が存在して
いると判定する。
FIG. 5 is a diagram for explaining an example of a method for determining the presence or absence of a line segment near a grid intersection. FIG. 5 (A)
Indicates a grid intersection for which the presence or absence of a line segment is to be determined.
As shown in FIG. 5B, a search area for line segments is set in four directions around the grid intersection near the grid intersection. This area is scanned one column at a time in the direction perpendicular to the direction of the line segment, and the column where the black pixel exists is set to 1 and the column not existing is set to 0. As a result of scanning all the columns in this manner, when the column which becomes 1 exceeds a certain threshold value, it is determined that a line segment exists.

【0020】図5(C)に各方向の黒画素の存在の割合
を示す。ここで,しきい値を4/7とすると,上,右,
下の3方向に線分が存在し,左方向のみ存在していない
と判定される。この結果,図5(A)に示すグリッド交
点は,図4に示すグリッド交点の16パターンのうち,
パターン7と判定され,パターンコード〔0111〕が
付与される。こうして,すべてのグリッド交点につい
て,パターンを判定し,パターンコードを付与すること
により,パターンマップを作成する。
FIG. 5C shows the proportion of black pixels in each direction. Here, assuming that the threshold is 4/7, the upper, right,
It is determined that the line segment exists in the lower three directions and does not exist only in the left direction. As a result, the grid intersection shown in FIG. 5A is one of the 16 grid intersections shown in FIG.
It is determined to be pattern 7, and a pattern code [0111] is assigned. Thus, a pattern map is created by determining a pattern and assigning a pattern code for all grid intersections.

【0021】図6は,手書きの図面データをパターンマ
ップに変換した例を示す。図6(A)に示す図面データ
のすべてのグリッド交点について,状態パターンを決定
する。グリッド交点P1は,図4に示すグリッド交点パ
ターンのうち,パターン6と合致すると判定し,パター
ンマップのグリッド交点P1の位置に「6」を格納す
る。同様にグリッド交点P2は,図4に示すグリッド交
点パターンのうち,パターンAと合致すると判定し,パ
ターンマップのグリッド交点P2の位置に「A」を格納
する。この処理をすべてのグリッド交点について行うこ
とにより,図6(B)に示すようなパターンマップが得
られる。
FIG. 6 shows an example in which handwritten drawing data is converted into a pattern map. A state pattern is determined for all grid intersections in the drawing data shown in FIG. It is determined that the grid intersection P1 matches the pattern 6 among the grid intersection patterns shown in FIG. 4, and “6” is stored at the position of the grid intersection P1 in the pattern map. Similarly, it is determined that the grid intersection P2 matches the pattern A among the grid intersection patterns shown in FIG. 4, and “A” is stored at the position of the grid intersection P2 in the pattern map. By performing this processing for all grid intersections, a pattern map as shown in FIG. 6B is obtained.

【0022】図7は,パターンマップ作成処理の処理フ
ローチャートである。図7において,ステップS31で
は,グリッド交点からグリッド線上に所定の大きさの線
分探索領域を設定する。
FIG. 7 is a processing flowchart of the pattern map creation processing. In FIG. 7, in step S31, a line segment search area of a predetermined size is set on a grid line from a grid intersection.

【0023】ステップS32では,各方向の探索領域内
の線分の有無を,図5で説明した方法により判定する。
ステップS33では,線分の有無の判定結果により,線
分の存在する方向の組み合わせから状態パターンを決定
する。
In step S32, the presence or absence of a line segment in the search area in each direction is determined by the method described with reference to FIG.
In step S33, a state pattern is determined from a combination of directions in which the line segment exists, based on the determination result of the presence or absence of the line segment.

【0024】ステップS34では,パターンマップ上の
該当するグリッド交点の位置に決定した状態パターンを
示す値(パターンコード)を格納する。ステップS35
によりすべてのグリッド交点についての処理が終了した
かどうかを判定し,終了していなければ,ステップS3
1へ戻って同様に処理を繰り返す。すべてのグリッド交
点について終了したならば,パターンマップ作成処理を
終了する。
In step S34, a value (pattern code) indicating the determined state pattern is stored at the position of the corresponding grid intersection on the pattern map. Step S35
It is determined whether or not the processing for all grid intersections has been completed, and if not, step S3
Returning to step 1, the same process is repeated. When the processing has been completed for all grid intersections, the pattern map creation processing ends.

【0025】このパターンマップ作成処理10の特徴
は,図6に示すように図面上のすべてのグリッド交点に
ついてパターンコード化したデータを作成すること,各
パターンコードは,図5に示すように,多少の線の途切
れやかすれに影響されないように,一定範囲の広さで画
素をチェックして求めること,パターンコードを2進数
表現した場合の各桁が,図3に示すように,グリッド交
点の各方向の線分状態と対応していることである。
The feature of this pattern map creation process 10 is that pattern-coded data is created for all grid intersections on the drawing as shown in FIG. 6, and that each pattern code is slightly different as shown in FIG. In order not to be affected by the interruption or blurring of the line, it is necessary to check and find the pixels in a certain range, and each digit when the pattern code is expressed in a binary number, as shown in FIG. This corresponds to the state of the line segment in the direction.

【0026】次に,閉領域抽出処理20について説明す
る。閉領域抽出処理20は,先に,パターンマップ作成
処理10で生成したパターンマップを利用し,図面閉領
域の境界点を探索する処理である。
Next, the closed region extraction processing 20 will be described. The closed region extraction process 20 is a process of searching for a boundary point of a drawing closed region using the pattern map generated in the pattern map creation process 10 earlier.

【0027】その手順は,まずパターンマップから開始
点の候補を見つける。次に,その開始点のグリッド交点
の状態パターンをもとに,次点への経路探索方向の優先
順位に基づいて,閉領域の輪郭上の次のグリッド交点を
決定する。このとき,線分が進んできた方向に対し,次
のグリッド交点の状態パターンがその方向(前の交点の
方向)に線分が存在するものでなければ,線分が連続し
ているとは言えないので,その確認処理を行う。さら
に,同様に次々と次経路を決定していく。経路が開始点
に戻った時点で,一つの閉領域の輪郭を表す経路が抽出
されたことになる。図面上に他の開始点候補があれば,
そのグリッド交点を第2の開始点として,同様に上記処
理を繰り返す。
In the procedure, first, a starting point candidate is found from the pattern map. Next, based on the state pattern of the grid intersection at the start point, the next grid intersection on the contour of the closed area is determined based on the priority of the route search direction to the next point. At this time, if the state pattern of the next grid intersection does not include a line segment in the direction (direction of the previous intersection) with respect to the direction in which the line segment has advanced, the line segment is considered to be continuous. Since it cannot be said, the confirmation processing is performed. Further, the next route is similarly determined one after another. When the path returns to the start point, a path representing the outline of one closed region is extracted. If there are other starting point candidates on the drawing,
The above processing is repeated in the same manner with the grid intersection as the second starting point.

【0028】本実施例では,探索開始点とするグリッド
交点の状態パターンを,図4に示す状態パターンのうち
パターン6,7,E,Fの4パターンとして,パターン
マップ上にそのいずれかのパターンコードがあった場合
に,そのグリッド交点を探索開始点とする。開始点から
の探索方向は右方向とする。この後の経路探索に関して
は,図8に示すように,経路の進行方向に対して左回り
の優先順位(右方向,直進方向,左方向,後進方向)と
する。
In this embodiment, the state pattern of the grid intersection as the search start point is set to four patterns 6, 7, E, and F among the state patterns shown in FIG. If there is a code, the grid intersection is set as the search start point. The search direction from the start point is rightward. As for the subsequent route search, as shown in FIG. 8, a leftward priority is given to the traveling direction of the route (right direction, straight traveling direction, left direction, backward direction).

【0029】このとき,前述したように2進数変換した
パターンコードの各桁が,どの方向に線分が延びている
かを表しているので,以下のような処理で経路探索を行
うことができる。なお,各桁と各方向の対応は図3で示
したとおりである。
At this time, since each digit of the binary-converted pattern code indicates the direction in which the line segment extends, the route search can be performed by the following processing. The correspondence between each digit and each direction is as shown in FIG.

【0030】図6に示す図面データをもとに具体的に説
明する。図面データの左上からラスタスキャンを行って
いくと,グリッド交点P1(パターン6)が最初の開始
点としてピックアップされる。開始点からの経路探索の
進行方向は右方向としているため,第2点の候補はグリ
ッド交点P2となる。
A specific description will be given based on the drawing data shown in FIG. As the raster scan is performed from the upper left of the drawing data, the grid intersection P1 (pattern 6) is picked up as the first start point. Since the traveling direction of the route search from the start point is the right direction, the candidate for the second point is the grid intersection P2.

【0031】ここで,グリッド交点P1とP2の接続状
態をチェックする。接続しているかどうかは,グリッド
交点P1を始点,グリッド交点P2を終点としたとき,
終点側のパターンが始点方向に線の延びているものであ
るかどうかで判断する。すなわち,終点のP2にとって
始点のP1は図3のW方向(左)の位置にあるので,グ
リッド交点P2の状態パターンにおいて,このW方向の
位置に線分が存在すれば,グリッド交点P1とグリッド
交点P2は接続していると判断する。図3に示すよう
に,W方向(左)の位置はビット列で4桁目にあたるた
め,パターンコードの第4桁目が1であれば,線分が存
在することになる。
Here, the connection state between the grid intersections P1 and P2 is checked. Whether the connection is made is determined by setting the grid intersection P1 as the start point and the grid intersection P2 as the end point.
Judgment is made based on whether or not the pattern on the end point has a line extending in the direction of the start point. That is, since the start point P1 is located at the position in the W direction (left) in FIG. 3 with respect to the end point P2, if a line segment exists at this position in the W direction in the state pattern of the grid intersection P2, the grid intersection P1 and the grid intersection P1 It is determined that the intersection P2 is connected. As shown in FIG. 3, since the position in the W direction (left) corresponds to the fourth digit in the bit string, if the fourth digit of the pattern code is 1, a line segment exists.

【0032】ここで,グリッド交点P2のパターンコー
ドはA(=1010)であるため,グリッド交点P1と
グリッド交点P2は接続していると判断する。これによ
ってグリッド交点P2が第2点となる。第3点以降は,
図8に示すように後進方向の次(進行方向に対して右方
向)から左回りの優先順位の方向でその候補点を決めて
いく。
Here, since the pattern code of the grid intersection P2 is A (= 1010), it is determined that the grid intersection P1 and the grid intersection P2 are connected. As a result, the grid intersection P2 becomes the second point. After the third point,
As shown in FIG. 8, the candidate points are determined in the direction of the priority in the counterclockwise direction from the next in the backward direction (to the right with respect to the traveling direction).

【0033】この経路探索の左回りの優先順位をパター
ンコードのビット列の表現で言えば,4桁目→3桁目→
2桁目→1桁目→4桁目→・・・の順(ただし,最優先
の桁は進行方向に対して右方向の桁)となる。つまり,
優先順位は進行方向を表す桁に対して,右側へシフトし
た桁が最も高くなる。第2点のグリッド交点P2(パタ
ーンA=1010)では,開始点であるグリッド交点P
1(パターン6=0110)からの進行方向が4桁目で
あったので,次方向で最も優先順位の高いのは3桁目
(S方向)となる。第2点のグリッド交点P2はパター
ンA=1010であり,パターンコードの第3桁目は0
であるためこの方向には進めない。次に優先順位が高い
方向は第2桁目であり,この桁は1となっているため,
第2桁目,つまり図3におけるE方向(右の方向)に進
み,第3点候補をグリッド交点P3とする。
In terms of the bit sequence of the pattern code, the left-hand priority of the route search is expressed in the fourth digit → the third digit →
The second digit → the first digit → the fourth digit →... (However, the highest priority digit is a digit to the right with respect to the traveling direction). That is,
As for the priority, the digit shifted to the right with respect to the digit indicating the traveling direction has the highest priority. At the grid intersection P2 of the second point (pattern A = 1010), the grid intersection P which is the starting point
Since the traveling direction from 1 (pattern 6 = 0110) is the fourth digit, the next highest priority is the third digit (S direction). The grid intersection P2 of the second point is pattern A = 1010, and the third digit of the pattern code is 0.
Therefore, we cannot proceed in this direction. The direction with the next highest priority is the second digit, and since this digit is 1,
Proceeding to the second digit, that is, the direction E (rightward direction) in FIG. 3, the third point candidate is set as the grid intersection P3.

【0034】上記と同様に第2点と第3点とのグリッド
交点間の接続状態をチェックする。第2点のグリッド交
点P2はグリッド交点P3からみてW方向(左)である
ため,先ほどと同様にパターンコードのビット列表現で
第4桁目をチェックする。グリッド交点P3は,パター
ンE=1110であるため,第4桁目が1となっており
接続していると判断する。さらに第4点候補について考
える。第3点では第2点からの進行方向が第4桁目であ
ったので,最も優先順位の高い方向は第3桁目である。
グリッド交点P3は,パターンE=1110で,第3桁
目は1となっているので,線分は存在しておりこの方向
が,第4点目の最初の探索方向として選択される。この
経路探索を繰り返し,開始点に到達した時点で探索を終
了する。続いて,次の開始点を探索し,同様に閉領域抽
出のための経路探索を行っていく。
In the same manner as above, the connection state between the grid intersections of the second point and the third point is checked. Since the grid intersection P2 of the second point is in the W direction (left) when viewed from the grid intersection P3, the fourth digit is checked by the bit string expression of the pattern code in the same manner as described above. Since the grid intersection P3 has the pattern E = 1110, the fourth digit is 1, and it is determined that the grid intersection P3 is connected. Further consider the fourth point candidate. At the third point, the traveling direction from the second point is the fourth digit, so the direction with the highest priority is the third digit.
Since the grid intersection P3 has the pattern E = 1110 and the third digit is 1, a line segment exists, and this direction is selected as the first search direction of the fourth point. This route search is repeated, and the search ends when the start point is reached. Subsequently, the next start point is searched, and a route search for extracting a closed region is performed in the same manner.

【0035】図9は,閉領域抽出処理の処理フローチャ
ートである。ステップS41では,パターンマップから
探索の開始点を検出し,それを処理対象のグリッド交点
Ps とする。
FIG. 9 is a processing flowchart of the closed area extraction processing. In step S41, a search start point is detected from the pattern map, and is set as a grid intersection Ps to be processed.

【0036】ステップS42では,次点への経路の探索
方向の優先順位に従って,現在のグリッド交点Ps の状
態パターンから次のグリッド交点Pe を決定する。ステ
ップS43では,次のグリッド交点Pe の状態パターン
から,現在のグリッド交点Ps と次のグリッド交点Pe
との間の線分の存在を確認する。
In step S42, the next grid intersection Pe is determined from the current state pattern of the grid intersection Ps according to the priority of the search direction of the route to the next point. In step S43, the current grid intersection Ps and the next grid intersection Pe are determined from the state pattern of the next grid intersection Pe.
Check the existence of a line segment between and.

【0037】ステップS44では,線分の存在を確認で
きたかどうかを判定し,確認できた場合にはステップS
45の処理へ進み,確認できない場合にはステップS4
2へ戻り,次の優先順位の探索方向について経路を探索
する。
In step S44, it is determined whether or not the existence of the line segment has been confirmed.
Proceeds to the process of step 45, and if it cannot be confirmed, step S4
Returning to step 2, the route is searched for the search direction of the next priority.

【0038】ステップS45では,2つのグリッド交点
Ps とグリッド交点Pe 間の線分を経路とし,グリッド
交点Pe を次の処理対象のグリッド交点Ps とする。ス
テップS46では,グリッド交点Ps が探索の開始点で
あるかどうかを判定する。グリッド交点Ps が探索の開
始点であれば,ステップS47の処理を行い,グリッド
交点Ps が開始点でなければ,ステップS42へ戻る。
In step S45, a line segment between the two grid intersections Ps and the grid intersection Pe is set as a path, and the grid intersection Pe is set as the next grid intersection Ps to be processed. In step S46, it is determined whether or not the grid intersection Ps is a search start point. If the grid intersection Ps is the start point of the search, the process of step S47 is performed. If the grid intersection Ps is not the start point, the process returns to step S42.

【0039】ステップS47では,決定された経路を閉
領域の輪郭として抽出する。ステップS48では,他に
開始点候補があるかどうかを判定し,他に開始点候補が
あればステップS41へ戻って同様に処理を繰り返し,
なければ処理を終了する。
In step S47, the determined route is extracted as the contour of the closed area. In step S48, it is determined whether or not there is another start point candidate. If there is another start point candidate, the process returns to step S41 to repeat the same processing.
If not, the process ends.

【0040】この閉領域抽出処理20の特徴は,図8に
示すように,次方向の探索優先順位を進行方向に対して
左回り(または右回り)の一定の順序としていること,
パターンマップ上のパターンコードを使って,線分の有
無をチェックし,経路を探索すること,パターンコード
を使って閉領域を探索しているため,線分の間の途切れ
やかすれに影響されないこと,パターンコードの各桁
が,図3に示すようにグリッド交点の各方向の線分と対
応しているため,次方向探索が容易であることである。
The feature of this closed region extraction processing 20 is that, as shown in FIG. 8, the search priority in the next direction is a fixed order counterclockwise (or clockwise) with respect to the traveling direction.
Use the pattern code on the pattern map to check for the presence or absence of a line segment and search for a route. Since the closed area is searched using the pattern code, the line is not affected by breaks or blurring between line segments. , Each digit of the pattern code corresponds to a line segment in each direction of the grid intersection, as shown in FIG. 3, so that the next direction search is easy.

【0041】以上のように,本発明はグリッド交点の状
態パターンを使って閉領域探索を行っているため,線分
途中の切れやかすれに影響されずに閉領域の抽出を行う
ことができる。
As described above, in the present invention, since the closed area search is performed using the state pattern of the grid intersection, the closed area can be extracted without being affected by the cut or blur in the middle of the line segment.

【0042】[0042]

【発明の効果】本発明によれば,パターンマップ作成処
理により,手書きによる線の蛇行を修正するとともに,
線の切れやかすれを減少させることができる。また,閉
領域抽出処理により,線の切れやかすれに影響されにく
くするとともに,閉領域の輪郭をなす線分以外の雑音に
よる影響を除外して,閉領域抽出処理の精度を高めるこ
とができる。
According to the present invention, the meandering of the handwritten line is corrected by the pattern map creation processing.
Line breaks and blurring can be reduced. Further, the closed region extraction processing makes it possible to reduce the influence of noise other than the line segment forming the contour of the closed region while reducing the influence of line breaks or blurring, thereby improving the accuracy of the closed region extraction processing.

【0043】また,グリッド交点の状態を示すパターン
コードを,その各桁が各線分の方向に対応したものと
し,次方向の探索優先順位を考慮して定めた桁の並びで
表すことにより,次方向の探索を容易にかつ効率よく行
うことができる。
Further, the pattern code indicating the state of the grid intersection is represented by a sequence of digits determined in consideration of the search priority in the next direction, with each digit corresponding to the direction of each line segment. Direction search can be performed easily and efficiently.

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

【図1】本発明の処理の流れを説明する図である。FIG. 1 is a diagram illustrating the flow of processing according to the present invention.

【図2】図面用紙に記される補助線の例を示す図であ
る。
FIG. 2 is a diagram illustrating an example of an auxiliary line written on a drawing sheet.

【図3】グリッド交点のパターンコード化の例を説明す
る図である。
FIG. 3 is a diagram illustrating an example of pattern coding of grid intersections.

【図4】グリッド交点の状態パターンの例を示す図であ
る。
FIG. 4 is a diagram illustrating an example of a state pattern of a grid intersection;

【図5】グリッド交点付近における線分の有無の判定方
法の例を説明する図である。
FIG. 5 is a diagram illustrating an example of a method for determining the presence or absence of a line segment near a grid intersection;

【図6】パターンマップの例を示す図である。FIG. 6 is a diagram showing an example of a pattern map.

【図7】パターンマップ作成処理の処理フローチャート
である。
FIG. 7 is a processing flowchart of a pattern map creation process.

【図8】経路探索方向の優先順位を説明する図である。FIG. 8 is a diagram illustrating the priority order of the route search directions.

【図9】閉領域抽出処理の処理フローチャートである。FIG. 9 is a processing flowchart of a closed region extraction process.

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

10 パターンマップ作成処理 20 閉領域抽出処理 10 Pattern map creation processing 20 Closed area extraction processing

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06T 7/00 - 7/60 ──────────────────────────────────────────────────続 き Continuation of front page (58) Field surveyed (Int. Cl. 7 , DB name) G06T 7/ 00-7/60

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 グリッド線が印刷された用紙上に、手書
きまたは印刷された図面の閉領域を抽出する方法であっ
て、 グリッド交点から複数の方向に延びるグリッド線上の各
々の方向に線分の探索領域を設定し、この探索領域を線
分の方向と垂直な方向に画素を1列ずつ走査し、黒画素
が1個以上存在する列の数が所定のしきい値を越えてい
るか否かにより前記各方向に対して線分が存在するか否
かを判定し、線分の有無に応じて符号を割り当て、グリ
ッド交点から延びるグリッド線の数に応じた桁数より成
り前記桁数の各桁がそれぞれ所定の方向のグリッド線分
から左回り又は右回りに現れるグリッド線分に対応づけ
て構成されたグリッド交点の状態パターンを前記線分の
有無に応じて割り当てられた符号をそれぞれ設定するこ
とで決定し、全グリッド交点について状態パターンを決
定してパターンマップを作成する過程と、 前記パターンマップを探索して予め定めた状態パターン
と一致する状態パターンを持つグリッド交点Psを開始
点とし、予め定めた方向の線分に対応する桁から左回り
又は右回りの優先順位に従って前記グリッド交点Psの
状態パターンを経路探索して次のグリッド交点Peを求
め、前記グリッド交点Peの状態パターンにおいて前記
グリッド交点Psの方向に対応する桁位置に線分が存在
するか確認し、確認出来ない場合には前記グリッド交点
Psの状態パターンを次の優先順位の桁から経路探索し
てグリッド交点Peを求める処理をし、確認出来た場合
には前記グリッド交点Peを新たなグリッド交点Psとし
て前記新たなグリッド交点Psが探索の開始点であるか
判定し、前記新たなグリッド交点Psが探索の開始点で
なければ前記新たなグリッド交点Psの状態パターンに
おいて前記グリッド交点Psの方向に対応する桁位置の
次の優先順位の桁から経路探索して次のグリッド交点P
eを求める処理をし、前記新たなグリッド交点Psが探索
の開始点であれば求めた経路を閉領域の輪郭として抽出
する過程とを有することを特徴とする図面閉領域の抽出
方法。
1. A method for extracting a closed area of a handwritten or printed drawing on a sheet on which grid lines are printed, comprising: a line segment extending in a plurality of directions from a grid intersection in each direction. A search area is set, and pixels are scanned one by one in the search area in a direction perpendicular to the direction of the line segment. Whether or not the number of columns having one or more black pixels exceeds a predetermined threshold value wherein determining whether a line segment exists for each direction, the assigned codes according to whether or not the line segment, glyceryl
From the number of digits corresponding to the number of grid lines
Each digit of the number of digits is a grid line segment in a predetermined direction.
To grid lines that appear counterclockwise or clockwise from
The state pattern of the grid intersection composed of
Set the code assigned according to the presence or absence
And determining a state pattern for all grid intersections to create a pattern map; and searching the pattern map for a predetermined state pattern.
Start grid intersection Ps with state pattern that matches
A point, counterclockwise from the digit corresponding to the line segment in the predetermined direction
Or, according to the clockwise priority, the grid intersection Ps
Find the next grid intersection Pe by searching the state pattern
In the state pattern of the grid intersection Pe,
Line segment exists at the digit position corresponding to the direction of grid intersection Ps
Check if it does
Search the route of the state pattern of Ps from the next priority digit.
To find the grid intersection Pe and confirm it
The above grid intersection Pe as a new grid intersection Ps
Whether the new grid intersection Ps is the starting point of the search
It is determined that the new grid intersection Ps is the starting point of the search.
If not, the state pattern of the new grid intersection Ps
Of the digit position corresponding to the direction of the grid intersection Ps
The route is searched from the digit of the next priority and the next grid intersection P
e, and the new grid intersection Ps is searched.
Extracting the determined path as the contour of the closed area if the start point is a start point of the drawing.
JP30236795A 1995-11-21 1995-11-21 Extraction method of drawing closed area Expired - Lifetime JP3177138B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30236795A JP3177138B2 (en) 1995-11-21 1995-11-21 Extraction method of drawing closed area

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30236795A JP3177138B2 (en) 1995-11-21 1995-11-21 Extraction method of drawing closed area

Publications (2)

Publication Number Publication Date
JPH09147105A JPH09147105A (en) 1997-06-06
JP3177138B2 true JP3177138B2 (en) 2001-06-18

Family

ID=17908053

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30236795A Expired - Lifetime JP3177138B2 (en) 1995-11-21 1995-11-21 Extraction method of drawing closed area

Country Status (1)

Country Link
JP (1) JP3177138B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7352902B2 (en) * 2003-09-24 2008-04-01 Microsoft Corporation System and method for detecting a hand-drawn object in ink input
JP4788780B2 (en) * 2009-01-29 2011-10-05 大日本印刷株式会社 Information processing system, program and electronic pen form
US9140559B2 (en) * 2009-10-01 2015-09-22 Qualcomm Incorporated Routing graphs for buildings using schematics
CN107248176B (en) * 2017-06-30 2020-06-23 联想(北京)有限公司 Indoor map construction method and electronic equipment

Also Published As

Publication number Publication date
JPH09147105A (en) 1997-06-06

Similar Documents

Publication Publication Date Title
JP2940496B2 (en) Pattern matching encoding apparatus and method
JP2951814B2 (en) Image extraction method
GB2190778A (en) Character recognition with variable subdivision of a character region
EP0843275A2 (en) Pattern extraction apparatus and method for extracting patterns
CA2401065C (en) Document matching and annotation lifting
US20020051574A1 (en) Character recognition method, program and recording medium
JP3177138B2 (en) Extraction method of drawing closed area
US7502510B2 (en) Vector-graphic data processing method and drawing apparatus
JP3837193B2 (en) Character line extraction method and apparatus
US5228095A (en) Apparatus for recognizing printed characters
JP3936436B2 (en) Table recognition method
US7095891B1 (en) Pattern segmentation apparatus and pattern recognition apparatus
JP2868134B2 (en) Image processing method and apparatus
JP4282467B2 (en) Image area separation method
JP3020662B2 (en) Character line segmentation device and character recognition device
JPH02138674A (en) Method and device processing document
US5666440A (en) Method and apparatus for extracting outline data from bi-level image data
JP2993533B2 (en) Information processing device and character recognition device
JP4763113B2 (en) High speed labeling method
JP3104355B2 (en) Feature extraction device
JPH09134404A (en) Bar graph recognizing device
JP2716291B2 (en) Paper information input device
JP2856989B2 (en) Inner / outer loop identification method for region boundaries
JP2004334913A (en) Document recognition device and document recognition method
KR100334624B1 (en) Clustering based document image segmentation method

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090406

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090406

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100406

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110406

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120406

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130406

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140406

Year of fee payment: 13

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

EXPY Cancellation because of completion of term