JP2683026B2 - Line figure vectorization device - Google Patents

Line figure vectorization device

Info

Publication number
JP2683026B2
JP2683026B2 JP9298088A JP9298088A JP2683026B2 JP 2683026 B2 JP2683026 B2 JP 2683026B2 JP 9298088 A JP9298088 A JP 9298088A JP 9298088 A JP9298088 A JP 9298088A JP 2683026 B2 JP2683026 B2 JP 2683026B2
Authority
JP
Japan
Prior art keywords
contour
line
vector
loop
data
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 - Fee Related
Application number
JP9298088A
Other languages
Japanese (ja)
Other versions
JPH01263883A (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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP9298088A priority Critical patent/JP2683026B2/en
Publication of JPH01263883A publication Critical patent/JPH01263883A/en
Application granted granted Critical
Publication of JP2683026B2 publication Critical patent/JP2683026B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Description

【発明の詳細な説明】 技術分野 本発明は、デジタル・スキヤナで読取つた2値の線図
形画像をベクトルデータに変換し、CAD、コンピユータ
等の処理に適したものとする文字認識、図面認識等にお
ける線図形ベクトル化装置に関する。
Description: TECHNICAL FIELD The present invention converts a binary line figure image read by a digital scanner into vector data and makes it suitable for processing of CAD, computer, etc. Character recognition, drawing recognition, etc. The present invention relates to a line graphic vectorization device.

従来技術 一般に、地図、図面、文字等の種々の線図形画像をコ
ンピユータ等で扱う場合、デジタル・スキヤナで読取つ
た2値の画像データのまま用いると、メモリが膨大にな
るだけでなく、拡大・縮小等を含む図形編集等に不便で
ある。この点、このような2値の画像データを始末と終
点とで規制するベクトルデータの組合せに変換すれば、
メモリ容量を軽減し得るとともに、図形の編集作業が容
易となり便利である。より具体的には、デジタルスキヤ
ナ出力のCAD等への入力機器として用いることができ
る。
2. Description of the Related Art Generally, when various line drawing images such as maps, drawings, and characters are handled by a computer or the like, if binary image data read by a digital scanner is used as it is, not only the memory becomes huge but also the enlargement It is inconvenient for graphic editing including reduction. In this respect, if such binary image data is converted into a combination of vector data regulated at the end and the end,
This is convenient because the memory capacity can be reduced and the graphic editing operation is easy. More specifically, it can be used as an input device for a digital scanner output CAD or the like.

このような観点から、従来にあつても、線図形をベク
トル化することが考えられている。ここに、従来、一般
的によく知られている線図形についての2値の画像デー
タからベクトルデータへの変換方式としては、細線化
方式、輪郭線ベクトルによる芯線化方式がある。
From such a point of view, it has been conventionally considered to vectorize a line figure. Here, there are a thinning method and a skeleton method using a contour vector as a conversion method for converting binary image data of a line figure into vector data, which is generally well known in the past.

即ち、細線化方式は、線幅が1となるように幅方向
に1ずつ狭めていき、中心線を抽出する方式である。こ
れによれば、元の図形の連結性を変えることはない。即
ち、図形が切れたり孔を生ずることはない。しかし、処
理に時間がかかり、かつ、多大なメモリを必要とする。
また、細線化の例を示す第16図のように、本来の芯線1
の他に、短いヒゲ2やループ3を生成しやすい欠点があ
る。
That is, the thinning method is a method in which the center line is extracted by narrowing the width one by one so that the line width becomes one. This does not change the connectivity of the original figures. That is, the figure is not cut or a hole is not formed. However, it takes a long time to process and requires a large amount of memory.
Also, as shown in FIG. 16 showing an example of thinning, the original core wire 1
In addition to this, there is a drawback that short beards 2 and loops 3 are easily generated.

一方、輪郭線ベクトルによる芯線化方式は、例えば
特開昭62−286176号公報、特開昭62−286177号公報等に
より知られているもので、画像の輪郭を追跡してチエー
ンコード化した後、これをベクトル化し、その中から線
を形成するぺアとなるベクトルを抽出し、これらのペア
ベクトルの中心線を求める形で芯線化を行なう方式であ
る。この方式によれば、ソフトウエアでも高速で柔軟な
処理ができる。しかし、この方式の例を示す第17図のよ
うに、本来の芯線4の他に、符号5部分に示すような分
岐部分でのベクトルの分離や、符号6部分に示すような
短ベクトルの欠落を生じ、元の図形の連結性を変えてし
まう欠点がある。
On the other hand, a skeletonization method using a contour vector is known, for example, in Japanese Patent Laid-Open Nos. 62-286176 and 62-286177, and after the contour of an image is tracked and chain-coded. , This is a vectorization method, a vector forming a line forming a line is extracted from the vector, and a core line is formed by obtaining a center line of these pair vectors. According to this method, software can perform high-speed and flexible processing. However, as shown in FIG. 17 showing an example of this method, in addition to the original core line 4, vector separation at a branching portion as shown by reference numeral 5 and lack of a short vector as shown by reference numeral 6 Occurs, and the connectivity of the original figure is changed.

目的 本発明は、このような点に鑑みなされたもので、輪郭
線ベクトルによる芯線化方式を利用することにより、細
線化処理方式の如く処理時間がかかることなく、かつ、
アルゴリズムも簡単化でき、さらにはなるべく1本の線
分は数本のベクトルに分割することがなく、元の図形の
連結性を損なうことなく、正確にベクトル化できる線図
形ベクトル化装置を得ることを目的とする。
The present invention has been made in view of such a point, by using the core line forming method by the contour vector, without the processing time unlike the thinning processing method, and,
An algorithm can be simplified, and a line segment vectorization device that can accurately vectorize one line segment is not divided into several vectors as much as possible without impairing the connectivity of the original graphic. With the goal.

構成 本発明は、上記目的を達成するため、まず、線図形画
像をデジタルスキヤナにより読取つて得られる2値画像
データの輪郭部分をチエーンコードデータに変換した後
で直線近似し、直線近似された輪郭線ベクトルデータよ
り芯線ベクトルデータを得る輪郭線ベクトルによる芯線
化方式による線図形ベクトル化装置を前提とし、まず、
連続する輪郭線ベクトル間の角度に基づき端点又は分岐
点なる屈曲点を検出する屈曲点検出手段を設け、この屈
曲点検出手段により検出された連続する屈曲点間の輪郭
線ベクトル群を1つの要素とみなし直線か円弧かを判断
して輪郭線ベクトルを整形する輪郭整形手段を設け、こ
の輪郭整形手段により整形された輪郭要素から前記屈曲
点データに基づき単図形要素を抽出する単図形抽出手段
を設け、この単図形抽出手段により抽出された単図形を
芯線ベクトル化する単図形芯線化手段を設ける。
Structure In order to achieve the above object, the present invention first performs linear approximation by converting a contour portion of binary image data obtained by reading a line figure image with a digital scanner into chain code data and then performing linear approximation. Assuming a line figure vectorization device by a skeletonization method using a contour line vector, which obtains skeleton vector data from the contour vector data, first,
A bending point detecting means for detecting a bending point which is an end point or a branch point based on an angle between the continuous contour line vectors is provided, and the contour line vector group between the continuous bending points detected by the bending point detecting means is made into one element. And a single figure extracting means for extracting a single figure element based on the bending point data from the contour element shaped by the contour shaping means. Provided is a single figure skeletonizing means for skeletonizing the single figure extracted by the single figure extracting means.

又は、輪郭整形手段により整形された輪郭要素から屈
曲点データに基づきループ図形要素を抽出するループ図
形抽出手段を設け、このループ図形抽出手段により抽出
されたループ図形を芯線ベクトル化するループ図形芯線
化手段を設ける。
Alternatively, a loop figure extracting means for extracting a loop figure element from the contour element shaped by the contour shaping means on the basis of the bending point data is provided, and a loop figure skeleton for converting the loop figure extracted by the loop figure extracting means into a skeleton vector Provide means.

さらには、輪郭整形手段により整形された輪郭要素か
ら前記屈曲点データに基づき単図形要素を抽出する単図
形抽出手段と、ループ図形要素を抽出するループ図形抽
出手段とを設け、単図形抽出手段により抽出された単図
形を芯線ベクトル化する単図形芯線化手段と、ループ図
形を芯線ベクトル化するループ図形芯線化手段とを設
け、輪郭整形手段により整形された輪郭要素を単図形要
素とループ図形要素とに分割する図形分割手段を設け
る。
Furthermore, a single figure extracting means for extracting a single figure element from the contour element shaped by the contour shaping means based on the bending point data and a loop figure extracting means for extracting a loop figure element are provided, and the single figure extracting means is provided. A single figure skeletonizing means for converting the extracted single figure into a skeleton vector and a loop figure skeletonizing means for changing the loop figure into a skeleton vector are provided, and the contour element shaped by the contour shaping means is a single figure element and a loop figure element. A graphic dividing means for dividing into and is provided.

以下、本発明の一実施例を第1図ないし第15図に基づ
いて説明する。
An embodiment of the present invention will be described below with reference to FIGS. 1 to 15.

まず、本発明において用いる重要な用語の定義をす
る。
First, important terms used in the present invention will be defined.

「線図形」とは、文字、図面等のようにある範囲内の
線幅で書かれた図形をいう。例えば、第2図(a)〜
(c)に示すようなものである。
The "line figure" means a figure written with a line width within a certain range, such as characters and drawings. For example, FIG.
It is as shown in (c).

「単図形」とは1本の線で表され、第2図(a)に示
すように両端に端点を持つ線図形をいう。
The "single figure" is represented by one line, and is a line figure having endpoints at both ends as shown in FIG.

「ループ図形」とは第2図(b)に示すように閉ルー
プを形成する線図形をいう。
The “loop figure” means a line figure forming a closed loop as shown in FIG.

第2図(c)に示すようなこれらの組合わさつたもの
は、線図形中の「その他の図形」とする。
The combination of these as shown in FIG. 2 (c) is referred to as "other figure" in the line figure.

しかして、本実施例による線図形ベクトル化のための
構成及び概略処理を、フローチヤート的に示す第1図に
より説明する。まず、デジタルスキヤナ(図示せず)に
より読取られメモリ10に格納されたた2値の線画像デー
タ10aは、輪郭線追跡手段11に入力され、その輪郭部分
が追跡されて輪郭線チエーンコードデータ11aに変換さ
れる。この輪郭線のチエーンコードデータ11aは直線近
似手段12に入力され、ベクトル化されて、輪郭線ベクト
ルデータ12aに変換される。この輪郭線ベクトルデータ
は屈曲点検出手段13に入力され、その連続するベクトル
のなす角度から屈曲点が検出され、その屈曲点の性質か
らその屈曲点が端点又は分岐点の何れであるかが判断さ
れ、端点データ13aと分岐点データ13bとが出力される。
つぎに、輪郭整形手段14による処理に移る。この輪郭整
形手段14は直線近似手段12により出力された輪郭線ベク
トルデータ12aと屈曲点検出手段13により出力された端
点データ13a、分岐点データ13bより、連続する屈曲点間
の輪郭線ベクトル群をある誤差範囲内で1つのベクトル
に統合可能なものは統合して直線と判断し、統合可能で
ないものは曲線と判断して、輪郭要素データ14aを出力
する。これにより、輪郭線の整形がなされたことにな
る。このような輪郭要素データ14aと端点データ13a、分
岐点データ13bを用いて、芯線化手段15により芯線化を
行ない、芯線ベクトルデータ15aを出力する。最後に、
芯線ベクトル整形手段16に芯線ベクトルデータ15aを入
力させ、ある微小範囲内にあるベクトルの端点を1つに
統合し、芯線ベクトルデータを修正し、ベクトルデータ
16aを得る。
The configuration and schematic processing for line drawing vectorization according to this embodiment will be described with reference to FIG. First, the binary line image data 10a read by a digital scanner (not shown) and stored in the memory 10 is input to the contour line tracing means 11, and the contour portion is traced to the contour line chain code data. Converted to 11a. The chain code data 11a of the contour line is input to the straight line approximation means 12, is vectorized, and is converted into the contour line vector data 12a. The contour line vector data is input to the bending point detecting means 13, the bending point is detected from the angle formed by the continuous vectors, and it is determined from the property of the bending point whether the bending point is an end point or a branch point. Then, the end point data 13a and the branch point data 13b are output.
Next, the processing by the contour shaping means 14 is performed. This contour shaping means 14 uses the contour line vector data 12a output by the straight line approximation means 12, the end point data 13a output by the bending point detection means 13, and the branch point data 13b to form a contour line vector group between consecutive bending points. Those that can be integrated into one vector within a certain error range are integrated and determined as straight lines, and those that cannot be integrated are determined as curves, and the contour element data 14a is output. As a result, the contour line is shaped. The contour element data 14a, the end point data 13a, and the branch point data 13b are used to perform the skeletonization by the skeletonization means 15, and the skeleton vector data 15a is output. Finally,
The skeleton vector shaping means 16 is made to input the skeleton vector data 15a, the end points of the vector within a certain minute range are integrated into one, and the skeleton vector data is corrected to obtain the vector data.
You get 16a.

ここに、芯線化手段15の構成及び処理に特に特徴があ
り、この芯線化手段15はその機能により、単図形抽出手
段21、単図形芯線化手段22、輪郭要素修正手段23、ルー
プ図形抽出手段24、ループ図形芯線化手段25及び図形分
割手段26に区分されている。
Here, there is a particular feature in the configuration and processing of the skeletonizing means 15, and this skeletonizing means 15 has, depending on its function, a single figure extracting means 21, a single figure skeletonizing means 22, a contour element correcting means 23, a loop figure extracting means. 24, a loop figure skeletonizing means 25 and a figure dividing means 26.

まず、輪郭要素データ14a中から単図形抽出手段21に
より単図形を探し、単図形があれば単図形芯線化手段22
により当該単図形についての芯線化を行ない、芯線ベク
トルデータ15aを出力する。そして、輪郭要素修正手段2
3による処理に進み、無ければループ図形抽出手段24に
よる処理に進む。このループ図形抽出手段24では輪郭要
素データ14a中よりループ図形を探し、ループ図形があ
ればループ図形芯線化手段25により当該ループ図形につ
いての芯線化を行ない、芯線ベクトルデータ15aを出力
する。その後、同様に輪郭要素修正手段23による処理に
進む。その後、データエンドになつていなければ、図形
分割手段26の処理に進む。図形分割手段26は輪郭要素デ
ータ15aを調べ、単図形又はループ図形として抽出され
なかつた図形を短図形かループ図形に分割し、輪郭要素
データ15a、端点データ13a及び分岐点データ13bを修正
し、単図形抽出手段21又はループ図形抽出手段24以降の
処理を同様に繰返す。前記輪郭要素修正手段23では、単
図形芯線化手段22又はループ図形芯線化手段25により芯
線化した輪郭要素と分岐点でつながつていた輪郭要素
を、その芯線まで延長し、そこを端点として、輪郭要素
データと端点データを修正するものである。このような
処理は、輪郭要素データ14aが全て処理済みとなるまで
繰返される。
First, the single figure extracting means 21 searches for a single figure in the contour element data 14a, and if there is a single figure, the single figure skeletonizing means 22
The skeletonization is performed on the single figure and the skeleton vector data 15a is output. Then, the contour element correction means 2
If not, the process proceeds to the process by the loop figure extracting means 24. The loop figure extracting means 24 searches the contour element data 14a for a loop figure, and if there is a loop figure, the loop figure skeletonizing means 25 performs skeletonization on the loop figure and outputs skeleton vector data 15a. After that, similarly, the processing proceeds to the processing by the contour element correction means 23. After that, if the data end has not been reached, the process proceeds to the processing of the figure dividing means 26. The figure dividing means 26 examines the contour element data 15a, divides a figure not extracted as a single figure or a loop figure into a short figure or a loop figure, and corrects the contour element data 15a, the end point data 13a and the branch point data 13b, The processing after the single figure extracting means 21 or the loop figure extracting means 24 is similarly repeated. In the contour element correcting means 23, the contour element connected by the branch point with the contour element cored by the single figure skeletonizing means 22 or the loop figure skeletonizing means 25 is extended to the skeleton line, and as an end point, The contour element data and the end point data are corrected. Such processing is repeated until all the contour element data 14a have been processed.

つぎに、個々の手段による処理を具体的に説明する。
なお、輪郭線追跡から輪郭整形までの処理は、前述した
特開昭62−2861776号公報方式等に準ずるものである。
Next, the processing by each means will be specifically described.
The processing from contour line tracing to contour shaping is based on the method disclosed in Japanese Patent Laid-Open No. 62-2861776.

(a) 輪郭線追跡方法 メモリ10に入力され格納された2値画像データをラス
タ走査し、まだ、追跡していない輪郭画素を探し、第3
図に示すように外側の輪郭は反時計回り(A方向)に、
内側の輪郭は時計回り(B方向)に追跡していき、追跡
開始点P0に戻ると、1つの輪郭ループの終りとして、そ
の間のチエーンコードデータ11aを出力する。このよう
な追跡処理を、まだ追跡していない輪郭画素がなくなる
まで実行する。
(A) Contour line tracing method The binary image data input and stored in the memory 10 is raster-scanned to find contour pixels which are not yet traced, and the third
As shown in the figure, the outer contour is counterclockwise (direction A),
The inner contour is tracked in the clockwise direction (direction B), and when returning to the tracking start point P 0 , the chain code data 11a between them is output as the end of one contour loop. Such tracking processing is executed until there are no contour pixels that have not been tracked yet.

(b) 直線近似方法 輪郭追跡手段11により得られた第4図に示すようなあ
るチエーンコードCを、誤差がある閾値(許容誤差d)
内になるようにベクトル化していく。第4図中、V1が直
線近似後のベクトルを示す。このようなベクトルV1の直
線的に連続するものが、1つの輪郭線ベクトルV2とな
る。
(B) Straight Line Approximation Method A certain chain code C as shown in FIG. 4 obtained by the contour tracing means 11 is used as a threshold value (allowable error d).
Vectorize to be inside. In FIG. 4, V 1 represents the vector after linear approximation. A straight line of such vector V 1 becomes one contour line vector V 2 .

(c) 屈曲点検出方法 第5図に示す如く連続する輪郭線ベクトルV21,V22
の角度θの絶対値がある閾値以上の場合であれば、両
輪郭線ベクトルV21,V22間は直線的ではなく屈曲点P1
あるとみなす。ここに、屈曲点P1であつても、端点の場
合と分岐点の場合とあり、第6図に示すようにある屈曲
点P1に対する近傍点P2(屈曲点P1に向かう輪郭線ベクト
ルV21に対し例えば時計方向であつて、対となる輪郭線
ベクトルV22と等角度θとなるように想定した点)の
画素が黒か白かにより判定する。例えば、第6図で黒画
素領域は斜線を施して示すものとすれば、同図(a)に
示すように近傍点P2が白画像であれば、当該屈曲点は端
点P11であると判定する。一方、同図(b)に示すよう
に近傍点P2が黒画像であれば、当該屈曲点は分岐点P12
であると判定する。
(C) Bending point detection method As shown in FIG. 5, if the absolute value of the angle θ 1 between the continuous contour line vectors V 21 and V 22 is greater than a certain threshold value, both contour line vectors V 21 and V 22 It is considered that the space is not a straight line but a bending point P 1 . Here, even if thickness is bending point P 1, there as in the case of end point branch points, contour vector directed in the vicinity of point P 2 (bending point P 1 with respect to the bending point P 1 located as shown in Figure 6 For example, it is determined in a clockwise direction with respect to V 21 that a pixel at a point assumed to be at an angle θ 2 with the contour line vector V 22 forming a pair) is black or white. For example, if the black pixel area is shown by hatching in FIG. 6, and if the neighboring point P 2 is a white image as shown in FIG. 6A, the bending point is the end point P 11. judge. On the other hand, if the neighborhood points P 2 as shown in FIG. 9 (b) is a black image, the bending point is a branch point P 12
Is determined.

ここに、線画像の線幅が細い場合や、デジタルスキヤ
ナの読取密度が低い場合には、第7図(a)に示すよう
に線の一端に1つのみの端点P11が検出されるが、そう
でない場合には、第7図(b)に示すように線の一端に
2つの端点P11が検出される。
Here, when the line width of the line image is thin or when the reading density of the digital scanner is low, only one end point P 11 is detected at one end of the line as shown in FIG. 7 (a). However, if not, two end points P 11 are detected at one end of the line as shown in FIG. 7 (b).

(c) 輪郭整形方法 第8図(a)に示すように連続した屈曲点間の輪郭線
ベクトル群がある閾値内で直線化可能なものは、同図
(b)に示すように直線化(即ち、1本のベクトルに統
合し)、直線化が可能でないものは円弧としてそれらを
輪郭要素データ14aとして登録する。また、第9図
(a)に示す如く小なるベクトルV23を挾んで屈曲する
輪郭線ベクトルV21,V23,V22が探し出された場合には、
小ベクトルV23を無視し、その前後のベクトルV21,V22
交点を新たに屈曲点P1とし、第9図(b)に示すような
輪郭線ベクトルV21,V22となるように輪郭要素データを
分割する。これは、第10図(a)に示すように円弧状の
場合であつても同様であり、同図(b)に示す如く輪郭
整形され、新たな屈曲点が設定される。
(C) Contour shaping method As shown in FIG. 8 (a), a contour vector group between consecutive bending points that can be linearized within a certain threshold is linearized as shown in FIG. 8 (b). That is, (integrating into one vector), and those that cannot be linearized are registered as contour element data 14a as arcs. Further, when contour line vectors V 21 , V 23 , and V 22 that bend by sandwiching a small vector V 23 as shown in FIG. 9A are searched for,
The small vector V 23 is ignored, and the intersection point of the vectors V 21 and V 22 before and after the small vector is newly set as a bending point P 1 so that the contour line vectors V 21 and V 22 shown in FIG. 9B are obtained. Divide the contour element data. This is the same even in the case of the arc shape as shown in FIG. 10 (a), the contour is shaped as shown in FIG. 10 (b), and a new bending point is set.

(e) 単図形の抽出方法及び芯線化方法 まず、第11図(a)に示すように、ある端点を追跡開
始端点P11Aとし、この端点P11Aから輪郭要素Eのデータ
を順に追跡して他方の端点P11Bに行き着き、その後、他
方側の他の端点P11Cから往路とはほぼ逆方向に進んで開
始側の他の端点P11Dを経て追跡開始端点P11Aに戻れば、
その要素は両端に端点を持つ連続した線分であると判断
し、単図形として抽出する。第11図(b)のDは抽出さ
れた単図形要素を示す。そして、このような単図形要素
Dから中心を通るベクトルを求めて芯線ベクトルV3とす
る。このような追跡の途中で、第11図に示すように分岐
点P12が存在したとしても、それまでの追跡進行方向に
真直に進み、次の分岐点P12を探し、この分岐点P12の先
に今迄の進行方向と同じ又は逆方向(つまり、交差的で
ない方向であり、第11図の例では右向き又は左向き)の
輪郭要素Eがあれば追跡を続行する。例えば、第11図の
場合であれば、追跡開始端点P11Aから他方の端点P11B
間に6個の分岐点P12が存在するが、これらの分岐点P12
の存在により追跡を分断することなく、横線部分につい
て1つの連続した単図形Dとして抽出するものである。
(E) Single figure extraction method and skeletonization method First, as shown in FIG. 11 (a), a certain end point is set as a tracking start end point P11A, and the data of the contour element E is sequentially tracked from this end point P11A. If it arrives at the other end point P 11B , and then proceeds from the other end point P 11C on the other side in a direction substantially opposite to the outward path and returns to the tracking start end point P 11A via the other end point P 11D on the start side,
The element is determined to be a continuous line segment having endpoints at both ends, and extracted as a single figure. D in FIG. 11 (b) shows the extracted single figure element. Then, a vector passing through the center is obtained from such a single figure element D and set as a core line vector V 3 . Even if there is a branch point P 12 as shown in FIG. 11 in the course of such a tracking, it goes straight in the pursuing direction until then, searches for the next branch point P 12, and finds this branch point P 12 If there is a contour element E in the same direction as the previous traveling direction or in the opposite direction (that is, a non-intersecting direction, that is, rightward or leftward in the example of FIG. 11), the tracing is continued. For example, in the case of FIG. 11 , there are six branch points P 12 between the tracking start end point P 11A and the other end point P 11B , but these branch points P 12
With the presence of, the tracing is not divided and the horizontal line portion is extracted as one continuous single figure D.

つまり、この第11図は第17図に例示した如き図形の中
心部の処理を想定した例であり、本来1本の線画像を分
岐点P12で分割することなく芯線ベクトル化するもので
ある。
That is, this FIG. 11 is an example assuming the processing of the central portion of the graphic as illustrated in FIG. 17, and originally, one line image is converted into a core vector without being divided at the branch point P 12. .

(f) ループ図形の抽出方法及び芯線化方法 まず、第12図(a)に示すように、ある端点を追跡開
始端点P11Aとし、この端点P11Aから輪郭要素Eのデータ
を順に辿り、1つの閉ループを形成するベクトル群と、
そのベクトル群とある範囲内(許容線幅内)で平行な外
側又は内側の閉ループを検出する。これらの閉ループの
内で、分岐点P12で分断された部分を結線して第12図
(b)に示すように完全な2重閉ループ(抽出されたル
ープ図形となる)R1,R2を形成してから、これらの2重
閉ループR1,R2から平行なベクトルを検出してその中心
を通るベクトルを芯線ベクトルV4とする。これを、閉ル
ープ1周について実行してループ図形を芯線ベクトル化
する。
(F) Loop figure extracting method and skeletonizing method First, as shown in FIG. 12 (a), a certain end point is set as a tracking start end point P 11A, and the data of the contour element E is sequentially traced from this end point P 11A to 1 Vector groups forming two closed loops,
An outer closed loop or an inner closed loop parallel to the vector group within a certain range (within the allowable line width) is detected. Of these closed loops, the part divided at the branch point P 12 is connected to form a complete double closed loop (to be an extracted loop figure) R 1 and R 2 as shown in FIG. 12 (b). After forming, a parallel vector is detected from these double closed loops R 1 and R 2 and a vector passing through the center is defined as a core vector V 4 . This is executed for one round of the closed loop to convert the loop figure into a core line vector.

つまり、ループ図形の抽出においても、分岐点P1で分
断せずに処理が行なわれる。
That is, also in the extraction of the loop figure, the processing is performed without being divided at the branch point P 1 .

(g) 図形の分割方法 単図形でもループ図形でもない図形(第2図(c)参
照)については、いくつかの単図形、或いは単図形とル
ープ図形とに分割する。その手順は、まず、一方に端点
を持つ図形を探し、その輪郭を辿り分岐点に達したら、
そこで図形を分割し、そこを他方の端点として単図形を
作成する。これを一方に端点を持つ図形がなくなるまで
実行すると、第13図(a)に示すような図形を同図
(b)のループ図形+同図(c)の単図形の如く分割す
ることができる。また、このような分割部分の情報を保
持しておき、その情報をもとに芯線化後に結合すること
により、結線処理が容易にできる。
(G) Method of dividing a figure A figure that is neither a single figure nor a loop figure (see Fig. 2 (c)) is divided into several single figures or a single figure and a loop figure. The procedure is to first find a figure with an end point on one side, follow its contour, and reach the branch point,
Therefore, the figure is divided, and a single figure is created by using that as the other end point. If this is executed until there is no figure having an end point on one side, the figure shown in FIG. 13 (a) can be divided into the loop figure of FIG. 13 (b) + the single figure of FIG. 13 (c). . Further, by holding information on such divided portions and connecting them after core-forming based on the information, the connection processing can be facilitated.

ついて、このような構成及び方法に基づく実際的な芯
線ベクトル化の処理例1,2を説明する。第14図及び第15
図では、ベクトルの方向を示す矢印と分岐点は省略し
た。
Next, processing examples 1 and 2 of practical core line vectorization based on such a configuration and method will be described. Figures 14 and 15
In the figure, the arrow indicating the direction of the vector and the branch point are omitted.

A.処理例1 まず、第14図(a)に示すような輪郭要素Eのデータ
と端点P11及び分岐点P12のデータとに基づき、単図形抽
出手段21により同図(b)に示すように単図形を抽出す
る。Dが抽出された単図形を示す。これを芯線ベクトル
V3で示す如く、芯線ベクトル化する。ついで、同図
(c)に示す輪郭要素修正処理、即ち単図形Dと分岐点
P12によりつながつていた輪郭要素Eを芯線ベクトルV3
線上まで延長し、そこを端点P11とする。そして、同図
(d)に示すようにこの部分について再度単図形を抽出
して芯線ベクトル化する。その後の輪郭要素の修正では
抽出した単図形に分岐点がなかつたので、この場合に
は、修正は行なわれない。ついで、再度単図形を探す
が、本処理例では単図形がないので、今度はループ図形
抽出手段24によりループ図形を探す。そこで、第14図
(e)に示すように抽出したループ図形R1,R3に基づき
芯線ベクトルV4で示す如く芯線ベクトル化する。この場
合も、本処理例では、その後の輪郭要素修正では抽出し
たループ図形に分岐点がないので修正は行なわれない。
同図(e)までの処理により、本処理例では未処理の輪
郭要素がなくなるので、同図(f)に示すように芯線ベ
クトルV3,V4について整形処理が施され、ベクトルのみ
の結果が得られ、処理を終了する。
A. Processing Example 1 First, based on the data of the contour element E and the data of the end point P 11 and the branch point P 12 as shown in FIG. To extract a single figure. D shows the extracted single figure. This is the core line vector
As shown by V 3 , the core line is vectorized. Next, the contour element correction process shown in FIG.
The contour element E connected by P 12 is the core vector V 3
Extend to the line and use it as the end point P 11 . Then, as shown in FIG. 7D, a single figure is extracted again from this portion to be a core line vector. In the subsequent modification of the contour element, no branch point was found in the extracted single figure, so no modification is performed in this case. Then, the single figure is searched again, but since there is no single figure in this processing example, the loop figure extracting means 24 searches for the loop figure this time. Therefore, as shown in FIG. 14 (e), the core line vector is converted into the core line vector V 4 based on the extracted loop figures R 1 and R 3 . In this case as well, in this processing example, since there is no branch point in the extracted loop graphic in the subsequent contour element correction, the correction is not performed.
With the processing up to (e) in the figure, since there are no unprocessed contour elements in this processing example, shaping processing is performed on the core line vectors V 3 and V 4 as shown in (f) in the figure, and only the vector results are obtained. Is obtained, and the process ends.

B.処理例2 第15図(a)の如く輪郭要素Eからなる図形の場合、
単図形抽出処理及びループ図形抽出処理を順に実行して
も、単図形、ループ図形はともに見つからない。そこ
で、図形分割手段26により図形分割処理を行ない、例え
ば同図(b)に示すように2つの単図形と1つのループ
図形に分割する。P4が端点となる分割点を示す。つぎ
に、分割した単図形について同図(c)に示す如く芯線
ベクトル化処理を行なう。この場合、単図形には分岐点
がないので、後処理としての輪郭要素の修正は行なわれ
ない。この後、同図(d)に示すように、分割されたル
ープ図形について芯線ベクトル化処理を行なう。この場
合にはループ図形に分岐点P12があるので、同図(e)
に示すようにその部分の輪郭要素Eを芯線ベクトルV4
上まで延長し、新しい端点P12を求める。これにより、
同図(f)に示すように新たに単図形を抽出し、この単
図形について芯線ベクトル化処理を行なう。この処理に
より、未処理の輪郭要素Eがなくなるので、同図(g)
に示すように芯線ベクトルV3,V4間の結合等の芯線ベク
トル整形処理を行ない、一連の処理を終了する。
B. Processing example 2 In the case of a figure composed of the contour element E as shown in FIG.
Even if the single figure extracting process and the loop figure extracting process are sequentially executed, neither the single figure nor the loop figure is found. Therefore, the figure dividing means 26 performs figure dividing processing to divide into two single figures and one loop figure as shown in FIG. P 4 is the end point. Next, the core vectorization process is performed on the divided single figure as shown in FIG. In this case, since the single figure has no branch point, the contour element is not corrected as post-processing. After that, as shown in FIG. 3D, a core vectorization process is performed on the divided loop figure. In this case, there is a branch point P 12 in the loop figure, so the same figure (e)
As shown in, the contour element E of that portion is extended to the core vector V 4 and a new end point P 12 is obtained. This allows
As shown in (f) of the same figure, a new single figure is newly extracted, and a core line vectorization process is performed on this single figure. This processing eliminates the unprocessed contour element E, so that FIG.
As shown in, the core line vector shaping process such as the connection between the core line vectors V 3 and V 4 is performed, and the series of processes is completed.

なお、本実施例では単図形抽出手段21と単図形芯線化
手段22との対、ループ図形抽出手段24とループ図形芯線
化手段25との対の双方を備えた装置として構成したが、
これらを別個の装置に搭載して単図形芯線化専用機とル
ープ図形芯線化専用機とし、任意の線図形中から各々単
図形のみを抽出し、又はループ図形のみを抽出し、各々
の芯線化処理を行ない、後で合成処理する如く構成して
もよい。
In the present embodiment, a pair of the single figure extracting means 21 and the single figure skeletonizing means 22 and a pair of the loop figure extracting means 24 and the loop figure skeletonizing means 25 are provided as an apparatus.
These are installed in separate devices to make a single figure core line dedicated machine and a loop figure core line dedicated machine, and each single figure is extracted from any line figure, or only loop figure is extracted and each core line is made. The processing may be performed, and the composition processing may be performed later.

効果 本発明は、上述したように輪郭線ベクトルによる芯線
化方式を基本とするため、細線化方式による処理速度が
遅く、アルゴリズムが複雑である等の欠点を解消し得る
のはもちろん、従来の輪郭線ベクトルによる芯線化方式
との対比においても、屈曲点中の端点と分岐点とに着目
し、分岐点では処理を中断しない単図形抽出手段又はル
ープ図形抽出手段を設け、その結果、抽出された単図形
又はループ図形について芯線ベクトル化するように構成
したので、本来1本の連続した線画像を途中で分断する
ことなく芯線化できる可能性が高く、分岐点付近でのベ
クトルの結合処理を省略できるので、ベクトルの分離や
短ベクトルの欠落といつた芯線化ミスを軽減でき、この
ために処理時間がかかることもなく、また、図形分割手
段によりやむをえず分割した場合であつてもその分割時
に接続先のデータが得られるので、容易に再結合させる
ことができ、あらゆる線図形への対応が可能となる。
Effect Since the present invention is based on the skeletonization method by the contour line vector as described above, it is possible to solve the drawbacks such as the processing speed of the thinning method being slow and the algorithm being complicated, as well as the conventional contouring method. Also in the comparison with the core line method by the line vector, paying attention to the end point and the branch point in the bending point, the single figure extracting means or the loop figure extracting means which does not interrupt the processing at the branch point is provided, and the result is extracted. Since it is configured to convert the skeleton vector for a single figure or a loop figure, it is highly possible that one continuous line image can be skeletonized without being divided in the middle, and vector combining processing near the branch point is omitted. Since it is possible to reduce vector separation, short vector loss and misalignment of core lines, it does not take much processing time. Even in the case of division, the data of the connection destination can be obtained at the time of division, so that the data can be easily recombined and any line figure can be dealt with.

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

第1図ないし第15図は本発明の一実施例を示し、第1図
はブロツク構成図、第2図は図形の定義を示す説明図、
第3図は輪郭線追跡処理を示す説明図、第4図は直線近
似処理を示す説明図、第5図は屈曲点検出方法を示す説
明図、第6図は端点と分岐点との判別処理を示す説明
図、第7図は端点の形状例を示す説明図、第8図は輪郭
整形処理を示す説明図、第9図は輪郭整形及び屈曲点検
出処理を示す説明図、第10図は輪郭整形及び屈曲点検出
処理を示す説明図、第11図は単図形抽出及びその芯線化
処理を示す説明図、第12図はループ図形抽出及びその芯
線化処理を示す説明図、第13図は図形分割処理を示す説
明図、第14図は処理例1を順に示す説明図、第15図は処
理例2を順に示す説明図、第16図は従来の細線化方式を
示す説明図、第17図は従来の輪郭線ベクトルによる芯線
化方式を示す説明図である。 13……屈曲点検出手段、14……輪郭整形手段、21……単
図形抽出手段、22……単図形芯線化手段、24……ループ
図形抽出手段、25……ループ図形芯線化手段、26……図
形分割手段、10a……2値画像データ、11a……チエーン
コードデータ、12a……輪郭線ベクトルデータ、13a……
端点データ、13b……分岐点データ、14a……輪郭要素デ
ータ、15a……芯線ベクトルデータ、P1……屈曲点、P11
……端点、P12……分岐点、V2……輪郭線ベクトル、V3,
V4……芯線ベクトル
1 to 15 show an embodiment of the present invention, FIG. 1 is a block diagram, FIG. 2 is an explanatory diagram showing definition of a figure,
FIG. 3 is an explanatory diagram showing a contour line tracking process, FIG. 4 is an explanatory diagram showing a linear approximation process, FIG. 5 is an explanatory diagram showing a bending point detection method, and FIG. 6 is a discrimination process between an end point and a branch point. , FIG. 7 is an explanatory diagram showing an example of the shape of an end point, FIG. 8 is an explanatory diagram showing contour shaping processing, FIG. 9 is an explanatory diagram showing contour shaping and bending point detection processing, and FIG. 10 is Explanatory diagram showing contour shaping and bending point detection processing, FIG. 11 is an explanatory diagram showing single figure extraction and its skeletonization processing, FIG. 12 is an explanatory diagram showing loop figure extraction and its skeletonization processing, FIG. 13 is FIG. 14 is an explanatory diagram showing a graphic division process, FIG. 14 is an explanatory diagram showing a processing example 1 in order, FIG. 15 is an explanatory diagram showing a processing example 2 in order, and FIG. 16 is an explanatory diagram showing a conventional thinning method, The figure is an explanatory view showing a conventional skeletonization method using a contour line vector. 13 ... Bending point detecting means, 14 ... Contour shaping means, 21 ... Single figure extracting means, 22 ... Single figure skeletonizing means, 24 ... Loop figure extracting means, 25 ... Loop figure skeletonizing means, 26 ...... Figure dividing means, 10a ...... binary image data, 11a ...... chain code data, 12a ...... contour line vector data, 13a ......
Endpoint data, 13b ...... branching point data, 14a ...... outline element data, 15a ...... core vector data, P 1 ...... bending point, P 11
…… End point, P 12 …… Branch point, V 2 …… Contour line vector, V 3 ,
V 4 …… Core line vector

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】線図形画像をデジタルスキヤナにより読取
つて得られる2値画像データの輪郭部分をチエーンコー
ドデータに変換した後で直線近似し、直線近似された輪
郭線ベクトルデータより芯線ベクトルデータを得る線図
形ベクトル化装置において、連続する輪郭線ベクトル間
の角度に基づき端点又は分岐点なる屈曲点を検出する屈
曲点検出手段を設け、この屈曲点検出手段により検出さ
れた連続する屈曲点間の輪郭線ベクトル群を1つの要素
とみなし直線か円弧かを判断して輪郭線ベクトルを整形
する輪郭整形手段を設け、この輪郭整形手段により整形
された輪郭要素から前記屈曲点データに基づき単図形要
素を抽出する単図形抽出手段を設け、この単図形抽出手
段により抽出された単図形を芯線ベクトル化する単図形
芯線化手段を設けたことを特徴とする線図形ベクトル化
装置。
1. A contour image of binary image data obtained by reading a line figure image with a digital scanner is converted into chain code data, and then linear approximation is performed. Core line vector data is obtained from the linear approximation contour vector data. In the obtained line figure vectorization device, a bending point detecting means for detecting a bending point which is an end point or a branch point based on an angle between the continuous contour line vectors is provided, and between the continuous bending points detected by the bending point detecting means. A contour shaping means for shaping the contour vector by determining whether the contour vector group is one element and determining whether it is a straight line or a circular arc is provided, and a single figure element is formed from the contour element shaped by the contour shaping means based on the bending point data. And a single figure skeletonizing means for converting the single figure extracted by the single figure extracting means into a skeleton vector. Line drawing vectorization and wherein the.
【請求項2】線図形画像をデジタルスキヤナにより読取
つて得られる2値画像データの輪郭部分をチエーンコー
ドデータに変換した後で直線近似し、直線近似された輪
郭線ベクトルデータより芯線ベクトルデータを得る線図
形ベクトル化装置において、連続する輪郭線ベクトル間
の角度に基づき端点又は分岐点なる屈曲点を検出する屈
曲点検出手段を設け、この屈曲点検出手段により検出さ
れた連続する屈曲点間の輪郭線ベクトル群を1つの要素
とみなし直線か円弧かを判断して輪郭線ベクトルを整形
する輪郭整形手段を設け、この輪郭整形手段により整形
された輪郭要素から前記屈曲点データに基づきループ図
形要素を抽出するループ図形抽出手段を設け、このルー
プ図形抽出手段により抽出されたループ図形を芯線ベク
トル化するループ図形芯線化手段を設けたことを特徴と
する線図形ベクトル化装置。
2. A contour line portion of binary image data obtained by reading a line figure image by a digital scanner is converted into chain code data, and then linear approximation is performed. Core line vector data is obtained from the linearly approximated contour line vector data. In the obtained line figure vectorization device, a bending point detecting means for detecting a bending point which is an end point or a branch point based on an angle between the continuous contour line vectors is provided, and between the continuous bending points detected by the bending point detecting means. A contour shaping means for shaping the contour vector by judging whether the contour vector group is one element and determining whether it is a straight line or a circular arc is provided, and a loop graphic element is formed from the contour element shaped by this contour shaping means based on the bending point data. A loop figure extracting means for extracting the loop figure is provided, and the loop figure extracted by the loop figure extracting means is converted into a core vector. Line drawing vectorization apparatus characterized in that a form core means.
【請求項3】線図形画像をデジタルスキヤナにより読取
つて得られる2値画像データの輪郭部分をチエーンコー
ドデータに変換した後で直線近似し、直線近似された輪
郭線ベクトルデータより芯線ベクトルデータを得る線図
形ベクトル化装置において、連続する輪郭線ベクトル間
の角度に基づき端点又は分岐点なる屈曲点を検出する屈
曲点検出手段を設け、この屈曲点検出手段により検出さ
れた連続する屈曲点間の輪郭線ベクトル群を1つの要素
とみなし直線か円弧かを判断して輪郭線ベクトルを整形
する輪郭整形手段を設け、この輪郭整形手段により整形
された輪郭要素から前記屈曲点データに基づき単図形要
素を抽出する単図形抽出手段と、前記輪郭整形手段によ
り整形された輪郭要素から前記屈曲点データに基づきル
ープ図形要素を抽出するループ図形抽出手段とを設け、
前記単図形抽出手段により抽出された単図形を芯線ベク
トル化する単図形芯線化手段と、前記ループ図形抽出手
段により抽出されたループ図形を芯線ベクトル化するル
ープ図形芯線化手段とを設け、前記輪郭整形手段により
整形された輪郭要素を単図形要素とループ図形要素とに
分割する図形分割手段を設けたことを特徴とする線図形
ベクトル化装置。
3. A core portion of the binary image data obtained by reading a line figure image with a digital scanner is converted into chain code data and then linearly approximated. Core line vector data is obtained from the linearly approximated contour vector data. In the obtained line figure vectorization device, a bending point detecting means for detecting a bending point which is an end point or a branch point based on an angle between the continuous contour line vectors is provided, and between the continuous bending points detected by the bending point detecting means. A contour shaping means for shaping the contour vector by determining whether the contour vector group is one element and determining whether it is a straight line or a circular arc is provided, and a single figure element is formed from the contour element shaped by the contour shaping means based on the bending point data. And a loop figure element based on the bending point data from the contour element shaped by the contour shaping means. A loop shape extracting means is provided for,
A single figure skeletonizing means for skeletonizing the single figure extracted by the single figure slicing means and a loop figure skeletonizing means for skeletonizing the loop figure extracted by the loop figure extracting means are provided. A line graphic vectorization device comprising graphic dividing means for dividing a contour element shaped by a shaping means into a single graphic element and a loop graphic element.
JP9298088A 1988-04-15 1988-04-15 Line figure vectorization device Expired - Fee Related JP2683026B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9298088A JP2683026B2 (en) 1988-04-15 1988-04-15 Line figure vectorization device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9298088A JP2683026B2 (en) 1988-04-15 1988-04-15 Line figure vectorization device

Publications (2)

Publication Number Publication Date
JPH01263883A JPH01263883A (en) 1989-10-20
JP2683026B2 true JP2683026B2 (en) 1997-11-26

Family

ID=14069535

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9298088A Expired - Fee Related JP2683026B2 (en) 1988-04-15 1988-04-15 Line figure vectorization device

Country Status (1)

Country Link
JP (1) JP2683026B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4890915B2 (en) * 2006-03-31 2012-03-07 キヤノン株式会社 Image forming apparatus and control method thereof
JP4825836B2 (en) * 2008-03-24 2011-11-30 株式会社日立ソリューションズ Road map data creation system

Also Published As

Publication number Publication date
JPH01263883A (en) 1989-10-20

Similar Documents

Publication Publication Date Title
Tombre et al. Vectorization in graphics recognition: to thin or not to thin
JP2823882B2 (en) Line image vectorization method
GB2366108A (en) Vectorization of raster images
JP2683026B2 (en) Line figure vectorization device
JP2863530B2 (en) Line image recognition device
JPH07200735A (en) Graphic recognition device
JPH04255080A (en) Image input device
JP2867650B2 (en) Symbol candidate area detection method
JPS603073A (en) Pattern extraction system
JP2941322B2 (en) Drawing processing equipment
JPH0540827A (en) Line type recognition method for automatic drawing input device
JP2501832B2 (en) Extraction method of color mark area
JP2595361B2 (en) Inside / outside judgment method for figures consisting of broken lines
JPH05250469A (en) Broken line processing system for image data
JPH02288978A (en) Drawing processing method
JPS5953969A (en) Linear figure vector-converting system
JP2803224B2 (en) Pattern matching method
JPH0434668A (en) Image processor
JPH043274A (en) Vector piece number reduction processing system
JPH05233798A (en) Image processing method
JPH04579A (en) Method for extracting feature point of graphic
JPH02264374A (en) Broken line extracting method
JPH0679350B2 (en) Line figure processing device
JPS62208181A (en) Graphic extracting system
KR19990027482A (en) How to set the relation of object structure straight lines in image in pattern recognition system

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees