JP2782977B2 - Line figure vectorization method and apparatus - Google Patents

Line figure vectorization method and apparatus

Info

Publication number
JP2782977B2
JP2782977B2 JP3119540A JP11954091A JP2782977B2 JP 2782977 B2 JP2782977 B2 JP 2782977B2 JP 3119540 A JP3119540 A JP 3119540A JP 11954091 A JP11954091 A JP 11954091A JP 2782977 B2 JP2782977 B2 JP 2782977B2
Authority
JP
Japan
Prior art keywords
interest
point
points
contour
sub
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
JP3119540A
Other languages
Japanese (ja)
Other versions
JPH04277876A (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.)
NEC Corp
Original Assignee
Nippon Electric 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP3119540A priority Critical patent/JP2782977B2/en
Publication of JPH04277876A publication Critical patent/JPH04277876A/en
Application granted granted Critical
Publication of JP2782977B2 publication Critical patent/JP2782977B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • 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 and an apparatus for vectorizing a line graphic obtained by quantization with an image scanner or the like, for example, raster data of various design drawings into vector data.

【0002】[0002]

【従来の技術】従来、イメージスキャナ等で入力した図
面を入力して図形を短線分の集合で近似したベクトルデ
ータに変換する処理として、次に述べるようなさまざま
な方法が提案されている。
2. Description of the Related Art Conventionally, there have been proposed various methods for converting a graphic into vector data approximated by a set of short lines by inputting a drawing input by an image scanner or the like.

【0003】第1の方法は、図形の細線化処理を用いて
得られた細線化画像を追跡してベクトルデータを生成す
る方法である。細線化処理はディジタル画像上で図形を
周辺の黒画素から1画素だけ内側に消去する操作を線幅
が1画素になるまで繰り返し行う処理である。線幅1の
線画像は容易に追跡することができるので、追跡時に近
似処理を施し、ベクトルデータを得ることができる。細
線化の代表的なアルゴリズムについては文献“Thin
ing algrithms onrectangul
ar, hexagonal and triangu
lar arrays”(E.S.Deutsch,
C.ACM,vol.15,no.9,1972,p
p.827−837)等の中で述べられている。
A first method is a method of generating vector data by tracking a thinned image obtained by using a graphic thinning process. The thinning process is a process of repeatedly erasing a figure on a digital image by one pixel from surrounding black pixels until the line width becomes one pixel. Since a line image having a line width of 1 can easily be tracked, vector data can be obtained by performing approximation processing during tracking. For a typical algorithm for thinning, see “Thin
ing algorithms onrectangul
ar, hexagonal and triangu
lar arrays "(ES Deutsch,
C. ACM, vol. 15, no. 9,1972, p
p. 827-837).

【0004】第2の方法として、ソフトウェア上での処
理速度を重視し、ディジタル画像上で図形の輪郭追跡を
行った後、輪郭画像を短線分近似したデータを利用する
方法がある。この短線分データでは、黒画素(図形部
分)を挟んで対向する短ベクトルペアが約180°の方
向差を持つという性質から短ベクトルペアを検出し、こ
の短ベクトルペアの中点位置を算出することにより、図
形の芯線検出を行う。この場合、輪郭の近似短線分集合
から黒画素を挟んで対向する短ベクトルペアを検索する
処理に極めて大きな演算を要するが、輪郭線近似短線分
データをBD木を用いて管理することにより総当たりで
検索することを回避して、効率を高める方法が提案され
ている。詳細には文献“多次元データ構造を用いた図面
処理”(大沢,坂内,電子通信学会論文集(D)J68
−D,No.4)に述べられている。
[0004] As a second method, there is a method in which processing speed on software is emphasized, a contour of a figure is traced on a digital image, and then data obtained by approximating a short line segment of the contour image is used. In the short line segment data, the short vector pair is detected from the property that the short vector pair facing each other across the black pixel (graphic part) has a direction difference of about 180 °, and the midpoint position of the short vector pair is calculated. Thus, the center line of the figure is detected. In this case, an extremely large operation is required for the process of searching for a short vector pair opposite to the black pixel from the set of approximate short line segments of the outline, but the outline approximate short line data is managed by using a BD tree, and a round robin is obtained. There has been proposed a method of increasing the efficiency by avoiding the search by using. For details, see the document “Drawing processing using multidimensional data structure” (Osawa, Sakauchi, IEICE Transactions (D) J68
-D, No. 4).

【0005】また、第3の方法として、図形の黒画素領
域をはみ出さない最大円弧を図形黒画素領域内で移動さ
せて中心点の軌跡を検出する方法が報告されている。こ
の方法に関しては精度が高いものの演算コストが極めて
大きいので、演算コスト低減のために最大円弧の代わり
に最大矩形を利用して同様な処理を行う方法が報告され
ている。
As a third method, there has been reported a method of detecting a locus of a center point by moving a maximum arc that does not protrude from a black pixel region of a figure in the black pixel region of the figure. Although this method has high accuracy but extremely high calculation cost, a method of performing the same processing using a maximum rectangle instead of a maximum arc to reduce the calculation cost has been reported.

【0006】[0006]

【発明が解決しようとする課題】上記の従来方法として
第1の方法では、画像のラスタスキャンを、消去する画
素の層数だけ繰り返し行わなければならず、演算コスト
が膨大になり、実用的な時間で処理するためには専用ハ
ードウェアを必要とする上、細線化歪の影響で図形の角
が鈍り、鋭角なコーナー部分の構造が十分保存されない
という問題点がある。
According to the first conventional method as described above, raster scanning of an image must be repeated as many times as the number of layers of pixels to be erased. In order to perform processing in time, dedicated hardware is required, and the corners of the figure become dull due to the influence of the thinning distortion, and the structure of the sharp corner portion is not sufficiently preserved.

【0007】また、第2の方法では、膨大な輪郭線近似
短ベクトルを基にしたペアベクトル探索の精度が十分で
ないという問題点がある。つまり、輪郭線近似短ベクト
ル間の距離と相互の方向関係のみを手がかりとする探索
では、局所的な輪郭線の凹凸が大きく影響し、特に複雑
な構造を有する画像において、ペアベクトル検出不可能
となる場合が多くなるのである。
Further, the second method has a problem that the accuracy of searching for a pair vector based on an enormous outline approximating short vector is not sufficient. In other words, in a search using only the distance between the contour approximating short vectors and the mutual directional relationship as a clue, local irregularities of the contour greatly affect, and particularly in an image having a complicated structure, the pair vector cannot be detected. More often.

【0008】第3の方法は、第1,第2の方法に較べ、
高い精度が得られるが非常に大きな演算量を要する。こ
れは最大円を矩形にしても同様である。
[0008] The third method, compared to the first and second methods,
High accuracy is obtained, but a very large amount of calculation is required. This is the same when the maximum circle is rectangular.

【0009】本発明の目的は、上記の問題を解決し、演
算量を比較的小さく抑えながらも高精度のベクトルデー
タを生成する線図形ベクトル化方式および装置を提供す
ることにある。
An object of the present invention is to solve the above-mentioned problem and to provide a line graphic vectorization method and apparatus for generating vector data with high precision while keeping the amount of calculation relatively small.

【0010】[0010]

【課題を解決するための手段】本発明は、線図形をイメ
ージスキャナ等で量子化して得た2値ラスタデータの白
画素と黒画素の境界を全て右回りあるいは全てその逆回
りに追跡して抽出した輪郭情報について、任意の輪郭画
素を主着目点とし、主着目点から図形を挟んで最短の距
離に位置する輪郭画素を副着目点とした時、主着目点を
移動しながら対応する副着目点を検索し、両着目点の中
間点を結ぶ曲線を芯線として検出する線図形ベクトル化
方法において、主着目点と副着目点との距離が所定値内
である時は、主着目点を前記輪郭情報のデータ並び順に
移動し、副着目点を前記輪郭情報のデータ並びと逆順に
移動することにより両着目点を検出し、前記両着目点間
の距離が所定値を超えた場合には、次に続く主着目点の
位置を、検出済みの芯線の近似多項式から推定して、推
定結果に基づいて新たな主着目点を検出することを特徴
とする。
According to the present invention, the boundary between white pixels and black pixels of binary raster data obtained by quantizing a line figure by an image scanner or the like is traced clockwise or clockwise in reverse. Regarding the extracted contour information, when an arbitrary contour pixel is set as a main point of interest and a contour pixel located at the shortest distance from the main point of interest across a figure is set as a sub-point of interest, the corresponding sub-pixel is moved while moving the main point of interest. In the line figure vectorization method of searching for a point of interest and detecting a curve connecting the middle point between the two points of interest as a core line, when the distance between the main point of interest and the sub-point of interest is within a predetermined value, the main point of interest is Moves in the data order of the contour information, and detects the two points of interest by moving the sub-points of interest in reverse order to the data arrangement of the contour information.If the distance between the two points of interest exceeds a predetermined value, , The position of the next main point of interest has been detected It estimated from the approximate polynomial of the core wire, and detecting a new primary point of interest on the basis of the estimation result.

【0011】また本発明は、線図形をイメージスキャナ
等で量子化して得た2値ラスタデータの白画素と黒画素
の境界を全て右回りあるいは全てその逆回りに追跡して
抽出した輪郭情報について、任意の輪郭画素を主着目点
とし、主着目点から図形を挟んで最短の距離に位置する
輪郭画素を副着目点とした時、主着目点を移動しながら
対応する副着目点を検索し、両着目点の中間点を結ぶ曲
を芯線として検出するように構成された線図形ベクト
ル化装置において、画像を入力して2値のラスタデータ
を得る画像入力手段と、上記ラスタデータを記憶する画
像記憶手段と、ラスタデータから輪郭情報を検出する輪
郭情報検出手段と、検出した輪郭情報を記憶する輪郭情
報記憶手段と、輪郭情報から主着目点を輪郭情報のデー
タ並び順に一定間隔で抽出する主着目点抽出手段と、対
応する副着目点を決定するために、前記輪郭情報記憶手
段から一つ前の副着目点を始点として前記輪郭情報のデ
ータ並びと逆順にデータを取り出し、距離算出手段を用
いて両着目点間の距離が最短となる点を検出する副着目
点検出手段と、得られた副着目点と対応する主着目点間
の距離と所定しきい値とを比較し、所定しきい値内であ
れば、処理を芯線抽出手段へ移し、所定しきい値を超え
ていれば、主着目点位置推定手段に処理を移す判定手段
と、前記判定手段の結果に従い、検出済み芯線から主着
目点を推定する主着目点位置推定手段と、判定手段の結
果に従い、前記両着目点間の中点を芯線上の点として抽
出する芯線抽出手段と、検出された芯線情報を記憶する
芯線情報記憶手段を備えることを特徴とする。
The present invention also relates to contour information extracted by tracking all the boundaries between white pixels and black pixels in binary raster data obtained by quantizing a line figure by an image scanner or the like in a clockwise direction or in a reverse direction. When an arbitrary contour pixel is set as a main point of interest and a contour pixel located at the shortest distance across the figure from the main point of interest is set as a sub point of interest, a corresponding sub point of interest is searched while moving the main point of interest. , A song connecting the midpoint between the two points of interest
In a line graphic vectorization apparatus configured to detect a line as a core line , image input means for inputting an image to obtain binary raster data, image storage means for storing the raster data, Contour information detecting means for detecting information, contour information storage means for storing the detected contour information, and main point of interest extracting means for extracting main points of interest from the contour information at regular intervals in the data arrangement order of the contour information. In order to determine a sub-point of interest, data is taken out from the contour information storage means in the reverse order of the data arrangement of the contour information with the immediately preceding sub-point of interest as a starting point, and the distance between the two points of interest is calculated using a distance calculating means. Is compared with a predetermined threshold value, and the distance between the obtained sub-target point and the corresponding main target point is compared with a predetermined threshold value. The core wire Out and transferred to the unit, if exceeding a predetermined threshold value, the main and determining means moves the processing to the target point position estimation unit, a result according mainly focused point to estimate the primary target point from discovered core position of said determining means In accordance with the result of the estimating means, the determining means, there is provided a skeleton extracting means for extracting a midpoint between the two points of interest as a point on the skeleton, and a skeleton information storing means for storing detected skeleton information. .

【0012】[0012]

【実施例】請求項1の線図形ベクトル化方法について、
図を用いて説明する。図2、図3および図4は本発明の
作用を説明する図である。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
This will be described with reference to the drawings. 2, 3 and 4 are views for explaining the operation of the present invention.

【0013】本発明のラスタ−ベクトル変換では右回り
か左回りかのどちらかで全ての輪郭黒画素を追跡して得
た輪郭情報を利用する方法をとっているが、今、輪郭情
報が検出されているとして説明を行う。ここで述べてい
る輪郭情報とは輪郭画素の座標値とその画素の属する物
体のラベル値を追跡で検出された順に一列に並べた配列
データである。また、黒画素を挟んで最短距離を成す輪
郭上の2つの画素を、主着目点と副着目点と呼ぶ。この
両着目点の検出は、輪郭上をトレースしながら一定間隔
で主着目点を検出して行く過程で各主着目点に対応する
副着目点を順次検索すればできる。この方法では、この
時の処理を効率良く行う方法について述べる。両着目点
が検出できれば、それらの中点座標を算出することによ
り芯線データを抽出できる。以下、分岐点が現れない部
分に対する処理方法と、分岐点がある部分に対する処理
方法について順に説明する。 (分岐の無い部分での芯線化)副着目点を検索する処理
は一般に演算コストの非常にかかる処理であるが、分岐
構造の無い部分に対し、直接ラスタデータを参照せず、
輪郭情報のデータ並び順を利用して検索範囲を限定し、
演算コストを削減する。主着目点検出は、輪郭情報の配
列データの内容を順方向に一定間隔で読み出すことによ
り行う。また、副着目点検出は、一つ前の副着目点から
逆順に一定範囲内で座標値データを読み出し、対応する
主着目点との距離を算出し、最小値を取るデータを検出
することにより行う。
In the raster-vector conversion of the present invention, a method is used in which contour information obtained by tracking all contour black pixels in either clockwise or counterclockwise direction is used. The description will be made assuming that it has been performed. The contour information described here is array data in which the coordinate values of the contour pixels and the label values of the object to which the pixels belong are arranged in a line in the order detected by tracking. Also, two pixels on the contour forming the shortest distance across the black pixel are called a main point of interest and a sub point of interest. The two points of interest can be detected by sequentially searching for sub-points of interest corresponding to each main point of interest in the process of detecting main points of interest at regular intervals while tracing the contour. In this method, a method for efficiently performing the processing at this time will be described. If both points of interest can be detected, the skeleton data can be extracted by calculating the coordinates of the midpoint. Hereinafter, a processing method for a part where a branch point does not appear and a processing method for a part where a branch point exists will be described in order. (Centering at a portion without branch) The process of searching for a sub-point of interest is generally a process that requires a very high computational cost. However, for a portion without a branch structure, raster data is not directly referred to.
The search range is limited using the data arrangement order of the contour information,
Reduce computation costs. The main point of interest is detected by reading the contents of the array data of the outline information at regular intervals in the forward direction. The secondary point of interest detection is performed by reading coordinate value data within a certain range in reverse order from the immediately preceding secondary point of interest, calculating the distance to the corresponding primary point of interest, and detecting the data that takes the minimum value. Do.

【0014】以上の処理で具体的にどのようなデータが
抽出されるかを示すために図2を使って説明する。ここ
で、{a}は輪郭画素の集合であり、要素として座標値
a(x,y)をとる。また、図2で記号○で示される画
素は、輪郭画素、記号●で示される画素は輪郭画素の中
の主着目点、記号◎で示される画素は副着目点である。
記号×で示される点は検出された芯線通過位置を示す点
列である。aiは主着目点座標値であり、ajはこれに対
応する副着目点座標値である。上記輪郭情報においてa
iはi番目のデータであり、ajはj番目のデータであ
る。図では、輪郭情報をデータ並び順に一定間隔T(図
ではT=4)で読み出して得られる主着目点の位置がa
i,ai+T,ai+2Tとして記されている。ここで、Tの値
は入力図形および画像データの解像度に依存して決まる
値である。おおよそ平均線幅より若干長い値を設定す
る。
FIG. 2 will be used to specifically show what data is extracted in the above processing. Here, {a} is a set of contour pixels, and takes a coordinate value a (x, y) as an element. In FIG. 2, the pixel indicated by the symbol ○ is a contour pixel, the pixel indicated by the symbol ● is a main point of interest in the contour pixel, and the pixel indicated by the symbol ◎ is a sub-point of interest.
The point indicated by the symbol x is a sequence of points indicating the detected center line passing position. a i is the coordinate value of the main point of interest, and a j is the coordinate value of the corresponding point of interest. In the outline information, a
i is the i-th data and a j is the j-th data. In the figure, the position of the main point of interest obtained by reading the contour information in the data arrangement order at a constant interval T (T = 4 in the figure) is a
i , a i + T and a i + 2T . Here, the value of T is a value determined depending on the resolution of the input graphic and the image data. Set a value slightly longer than the average line width.

【0015】輪郭情報のi番目のデータから順にT間隔
でデータを読み出し、主着目点座標値ai,ai+T,a
i+2Tを検出した時、それぞれ対応する副着目点は、輪郭
情報データ並びの逆順に以下の条件で検索される。 〈検索条件〉aiからk番目の副着目点は、以下の式で
示される範囲内で最小距離dkをとる点である。
Data is read out at intervals of T in order from the i-th data of the contour information, and the coordinate values ai , ai + T , a
When i + 2T is detected, the corresponding sub-points of interest are searched in the reverse order of the outline information data arrangement under the following conditions. <Search Condition> The k-th sub-point of interest from a i is a point having the minimum distance d k within the range represented by the following equation.

【0016】[0016]

【数1】(Equation 1)

【0017】 [0017]

【0018】ただし、aiとajの座標値をそれぞれ(x
ai,yai)、(xaj,yaj)とした時、
Here, the coordinate values of a i and a j are (x
ai , yai ) and ( xaj , yaj ),

【数2】(Equation 2)

【0019】 [0019]

【0020】である。aj-mkは輪郭情報でajからmk
遡ったデータである。
## EQU1 ## a j-mk is m k pieces back data from a j contour information.

【0021】分岐等の構造が現れない区間で、つまり図
2では3組の主着目点と副着目点が順次検出されてい
る。
In a section where a structure such as a branch does not appear, that is, in FIG. 2, three sets of main points of interest and sub-points of interest are sequentially detected.

【0022】芯線を表す点列は以下の数3で算出する。The dot sequence representing the core line is calculated by the following equation (3).

【0023】[0023]

【数3】(Equation 3)

【0024】 [0024]

【0025】ただし、図2ではk=0,1,2をとる。However, in FIG. 2, k = 0, 1, and 2.

【0026】以上の方法により、分岐構造の無い部分に
おいては輪郭追跡結果の情報(輪郭情報)のデータ並び
順を利用して、少ない候補を対象とする距離計算(数
1)と中点位置計算(数3)のみで芯線抽出が可能であ
る。 (分岐のある部分での芯線化)次に、分岐のある部分に
対する処理について説明する。数1の値dkが所定のし
きい値Dを越えた場合には、それまでに抽出した芯線を
表す点列から近似曲線を求め、これを基に次の検索方向
を決定することが可能である。これにより、分岐構造が
あってもそれまで抽出した芯線が滑らかにつながる方向
に芯線抽出を続けて行うことができる。図2,図3およ
び図4を利用して具体的に説明する。
According to the above-described method, the distance calculation (Equation 1) and the midpoint position calculation for a small number of candidates are performed by using the data arrangement order of the information (contour information) of the contour tracing result in the portion having no branch structure. Core line extraction is possible only with (Equation 3). (Centralization at Branched Part) Next, processing for a branched part will be described. When the value d k of Equation 1 exceeds a predetermined threshold value D, an approximate curve is obtained from a series of points representing the core lines extracted so far, and the next search direction can be determined based on the approximate curve. It is. Thus, even if there is a branch structure, it is possible to continuously perform the core line extraction in a direction in which the extracted core lines are smoothly connected. This will be specifically described with reference to FIGS. 2, 3, and 4.

【0027】今、芯線を表す点列f0,f1,f2が抽出
済みであるとする。Dを予め経験的に定めたしきい値で
あるとすると、数1が
Now, it is assumed that a sequence of points f 0 , f 1 , f 2 representing the core line has been extracted. If D is a threshold value empirically determined in advance, Equation 1 becomes

【数4】(Equation 4)

【0028】 [0028]

【0029】を満たせばk番目の中点は分岐点にさしか
かっていると判定できる。図2で、k=3の時、数4が
満たされたとする。抽出済み点列fk、k={0,1,
2}の近似曲線
If the condition is satisfied, it can be determined that the k-th middle point is approaching the branch point. In FIG. 2, when k = 3, it is assumed that Equation 4 is satisfied. The extracted point sequence f k , k = {0,1,
2} approximation curve

【数5】(Equation 5)

【0030】 [0030]

【0031】を最小2乗近似により求め、これを推定芯
線Fとする(図3参照)。
Is obtained by least squares approximation, and this is used as an estimated core line F (see FIG. 3).

【0032】次に、近似曲線Fがf2の先で輪郭画素と
交わる点を検出し、検出輪郭画素の輪郭情報データ中で
の位置を求め、分岐の無い部分での芯線化処理に従い、
芯線を表す2点
Next, the point at which the approximate curve F intersects the contour pixel at the point beyond f 2 is detected, the position of the detected contour pixel in the contour information data is determined, and according to the centering process at the part without branch,
2 points representing the core line

【数6】(Equation 6)

【0033】 [0033]

【0034】を算出する。これは、仮の芯線であるが、
検証のためにこの2点を結ぶ線分をベクトルとみなし以
下の処理を行う。
Is calculated. This is a temporary core,
For verification, a line segment connecting these two points is regarded as a vector, and the following processing is performed.

【0035】図3の推定芯線F上で、On the estimated core line F in FIG.

【数7】(Equation 7)

【0036】 [0036]

【0037】をとり、Take

【数8】(Equation 8)

【0038】 [0038]

【0039】と仮の主着目点より抽出したAnd extracted from the provisional main point of interest.

【数9】(Equation 9)

【0040】 [0040]

【0041】が以下の条件式(数10)を満たすかどう
かを調べる。
It is checked whether or not the following conditional expression (Equation 10) is satisfied.

【0042】[0042]

【数10】(Equation 10)

【0043】 [0043]

【0044】ただし、θTは値0.5程度のしきい値で
ある。条件式(数10)が満たされない場合は、主着目
点と副着目点との交換、近傍の別の輪郭画素への仮の主
着目点移動等を行い、条件を満たす点を検索する。条件
式が満たされる場合は、仮の主着目点および芯線情報を
正式なデータと見なして芯線抽出処理を続ける。図3の
例では芯線画素列が図4のように検出できる。
Here, θ T is a threshold value of about 0.5. If the conditional expression (Equation 10) is not satisfied, the main point of interest and the sub point of interest are exchanged, a temporary main point of interest is moved to another nearby contour pixel, and a point satisfying the condition is searched. When the conditional expression is satisfied, the tentative main point of interest and the skeleton information are regarded as formal data, and the skeleton extraction processing is continued. In the example of FIG. 3, the core line pixel column can be detected as shown in FIG.

【0045】以上の方法により、線図形中で分岐構造の
無い部分では、輪郭抽出処理で得られた輪郭情報データ
のデータ並び順を利用して、少ない候補に対する距離計
算のみで芯線抽出が可能である。また、分岐構造部分で
は、交差する線分を越えて滑らかに連続する方向に線抽
出が可能である。よって、従来方法で問題となる処理速
度と芯線抽出精度の点において、両者のバランスの良い
線図形ベクトル化方式およびその装置を提供することが
できる。
According to the above method, in a portion having no branching structure in a line figure, a core line can be extracted only by distance calculation for a small number of candidates using the data arrangement order of the contour information data obtained by the contour extraction processing. is there. Further, in the branch structure portion, line extraction can be performed in a direction that smoothly continues beyond the intersecting line segments. Therefore, it is possible to provide a line graphic vectorization method and a device thereof that are well-balanced in terms of processing speed and skeleton extraction accuracy, which are problems in the conventional method.

【0046】次に、請求項2の線図形ベクトル化装置の
実施例について図を用いて説明する。図1は線図形ベク
トル化装置の一実施例を示す図である。
Next, an embodiment of a line graphic vectorization apparatus according to claim 2 will be described with reference to the drawings. FIG. 1 is a diagram showing an embodiment of a line graphic vectorizing apparatus.

【0047】この線図形ベクトル化装置は、画像入力手
段1,画像記憶手段2,輪郭情報検出手段3,輪郭情報
記憶手段4,主着目点抽出手段5,副着目点検出手段
6,距離算出手段7,判定手段8,主着目点位置推定手
段9,芯線抽出手段10,芯線情報記憶手段11により
構成されている。
This line graphic vectorizing device comprises image input means 1, image storage means 2, contour information detecting means 3, contour information storing means 4, main point of interest extracting means 5, sub point of interest detecting means 6, distance calculating means. 7, a determination unit 8, a main point of interest position estimation unit 9, a skeleton extraction unit 10, and a skeleton information storage unit 11.

【0048】画像入力手段1は、紙面の線図形を読み取
って2値ラスタデータに変換する。紙面に光を照射し、
反射光を1次元CCDアレイ素子で光電変換し、A/D
コンバータで変換することによりディジタルデータを得
る構成をとる。ディジタルデータは、さらにコンパレー
タ等により適当なしきい値で2値化する。CCDアレイ
素子の機械走査により、2次元のラスタデータを得るこ
とができる構成になっている。得られたデータは画像記
憶手段2へ送られて保存される。
The image input means 1 reads a line figure on a paper surface and converts it into binary raster data. Irradiate the paper with light,
The reflected light is photoelectrically converted by a one-dimensional CCD array element, and A / D
The digital data is obtained by conversion by a converter. The digital data is further binarized by an appropriate threshold value using a comparator or the like. The configuration is such that two-dimensional raster data can be obtained by mechanical scanning of the CCD array element. The obtained data is sent to the image storage means 2 and stored.

【0049】画像記憶手段2は、画像入力手段1で得た
2値ラスタデータを記憶する。画像記憶手段は、メモリ
により構成される。
The image storage means 2 stores the binary raster data obtained by the image input means 1. The image storage means is constituted by a memory.

【0050】輪郭情報検出手段3は、画像記憶手段2か
らラスタデータを読み取り、横,縦方向にスキャンを行
い、白画素から黒画素あるいは黒画素から白画素へ変化
する位置の黒画素を開始点として、右回りあるいは左回
りに黒画素を追跡して輪郭情報を検出する。ここで、輪
郭情報とは物体単位でラベル付けされた輪郭画素の座標
値列である。CPUおよび図5で示される処理手順を有
するプログラムメモリおよび、ワークメモリ等により構
成できる。図5の処理手順を論理素子により構成するこ
とも可能である。輪郭情報は輪郭情報記憶手段4に書き
込まれる。
The contour information detecting means 3 reads the raster data from the image storing means 2, scans in the horizontal and vertical directions, and determines a black pixel at a position where a white pixel changes to a black pixel or a black pixel changes to a white pixel. The contour information is detected by tracking the black pixels clockwise or counterclockwise. Here, the outline information is a sequence of coordinate values of outline pixels labeled in object units. It can be constituted by a CPU, a program memory having the processing procedure shown in FIG. 5, a work memory, and the like. The processing procedure of FIG. 5 can be configured by a logic element. The contour information is written into the contour information storage means 4.

【0051】輪郭情報記憶手段4は、輪郭情報検出手段
3で得られた輪郭情報を記憶する。輪郭情報記憶手段
は、メモリによって構成される。
The contour information storage means 4 stores the contour information obtained by the contour information detecting means 3. The contour information storage means is constituted by a memory.

【0052】主着目点抽出手段5は、輪郭情報から主着
目点を抽出する。輪郭情報記憶手段4へのアクセス回路
を有し、その中で主着目点を検出し、そのデータの記憶
されるアドレスを出力する機能を持つ。処理の詳細につ
いては、請求項1の実施例の通りである。CPUと処理
手順を記憶したプログラムメモリとワークメモリを中心
とした回路として構成される。
The main point of interest extraction means 5 extracts a main point of interest from the contour information. It has an access circuit to the contour information storage means 4, and has a function of detecting a main point of interest therein and outputting an address where the data is stored. The details of the processing are as described in the first embodiment. It is configured as a circuit mainly including a CPU, a program memory storing a processing procedure, and a work memory.

【0053】副着目点検出手段6は、主着目点と図形を
挟んで存在する輪郭画素の中で最も近い距離にあるもの
を検出する。主着目点検出手段5から、主着目点のデー
タアドレスを受取り、これをもとに輪郭情報における座
標データ参照し、副着目点を求める機能を有する。最小
距離をとる画素の座標値が記憶されるデータアドレスお
よび検出距離値を出力する。処理手順の詳細については
請求項1の実施例に基づく。CPUおよび上記処理手順
を記憶したプログラムメモリ,ワークメモリ等から構成
される。
The sub-point-of-interest detection means 6 detects the contour pixel located at the closest distance from the main point-of-interest with respect to the figure. It has the function of receiving the data address of the main point of interest from the main point of interest detection means 5, referring to the coordinate data in the outline information based on this, and finding the sub point of interest. A data address at which the coordinate value of the pixel having the minimum distance is stored and a detection distance value are output. The details of the processing procedure are based on the first embodiment. It comprises a CPU, a program memory storing the above processing procedure, a work memory, and the like.

【0054】距離算出手段7は、主着目点と副着目点間
の距離を算出する。副着目点検出手段6から比較する2
つの画素の座標値を受取り、距離計算をして値を返す機
能を有する。ALU等により構成される。
The distance calculating means 7 calculates the distance between the main point of interest and the sub point of interest. 2 to be compared from the secondary point of interest detection means 6
It has the function of receiving the coordinate values of one pixel, calculating the distance, and returning the value. It is composed of ALU and the like.

【0055】判定手段8は、副着目点検出手段6で得ら
れた副着目点と対応する主着目点間の距離値をしきい値
と比較して、正しい対応点であるかどうかを判定する。
副着目点検出手段6から主着目点と副着目点間の距離値
を受取って記憶するレジスタを有する。また、請求項1
の実施例で述べたしきいD値を記憶するレジスタを有
し、両レジスタ値を比較するコンパレータと、コンパレ
ータの出力により、主着目点位置推定手段9と芯線抽出
手段10のどちらかに処理を移す制御回路を有する。交
差して存在する線分が存在した場合でも影響を受けずに
滑らかに連続する一本の直線方向に芯線を抽出するため
に必要な手段である。
The judging means 8 compares the distance value between the sub-interest point obtained by the sub-interest point detecting means 6 and the corresponding main point of interest with a threshold value to judge whether or not the point is a correct corresponding point. .
It has a register for receiving and storing the distance value between the main point of interest and the sub point of interest from the sub point of interest detection means 6. Claim 1
A register for storing the threshold D value described in the embodiment, and a comparator for comparing the two register values, and the output of the comparator determines whether the main point-of-interest position estimating means 9 or the skeleton extracting means 10 performs processing. It has a control circuit for transferring. This is a necessary means for extracting a core line in a single continuous straight line direction without being affected even if there is an intersecting line segment.

【0056】主着目点位置推定手段9は、判定手段8に
より起動され、主着目点抽出手段5をアクセスして次の
主着目点位置を推定する機能を有する。この手段の詳細
な処理内容は請求項1の実施例で述べられている通りで
あるが、CPUおよび上記処理手順を記憶したプログラ
ムメモリ,ワークメモリ等から構成される。
The main point-of-interest position estimating means 9 is activated by the determining means 8 and has a function of accessing the main point-of-interest extracting means 5 to estimate the position of the next main point of interest. The detailed processing contents of this means are as described in the embodiment of claim 1, and comprise a CPU, a program memory storing the above processing procedure, a work memory, and the like.

【0057】芯線抽出手段10も、判定手段8により起
動され、芯線の通る点の座標値を計算する。この処理は
主着目点と副着目点の中点を算出する。詳細に付いては
請求項1の記述の通りである。座標値を記憶するレジス
タおよびALUから構成される。
The skeleton extracting means 10 is also started by the judging means 8 and calculates the coordinate value of a point through which the skeleton passes. This process calculates the midpoint between the main point of interest and the sub point of interest. The details are as described in claim 1. It comprises a register for storing coordinate values and an ALU.

【0058】芯線情報記憶手段11は、芯線抽出手段1
0で算出された芯線情報を記憶するメモリで構成され
る。
The skeleton information storage means 11 is a skeleton extraction means 1
The memory is configured to store the core line information calculated at 0.

【0059】以上の構成によりシステムを実現できる。A system can be realized by the above configuration.

【0060】[0060]

【発明の効果】本発明によれば、線図形中で分岐構造の
無い部分では、輪郭抽出処理で得られた輪郭情報データ
のデータ並び順を利用して、少ない候補に対する距離計
算のみで芯線抽出が可能である。また、分岐構造部分で
は、交差する線分を越えて滑らかに連続する方向に芯線
抽出が可能である。よって、従来方法で問題となる処理
コストと芯線抽出精度の問題点において、ソフトウェア
処理でも十分可能な演算コスト内で、実用上十分な精度
を保つことから、両者のバランスのとれた線図形ベクト
ル化方式およびその装置を提供することができる。
According to the present invention, in a portion having no branching structure in a line figure, a core line is extracted only by distance calculation for a small number of candidates using the data arrangement order of the outline information data obtained by the outline extraction processing. Is possible. Further, in the branch structure portion, the core line can be extracted in a direction that smoothly continues beyond the intersecting line segments. Therefore, in terms of the processing cost and the core line extraction accuracy, which are problems in the conventional method, the accuracy is kept sufficiently high for practical use within the operation cost that can be sufficiently processed by software processing. A method and an apparatus thereof can be provided.

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

【図1】本発明の線図形ベクトル化装置の一実施例を示
す機能ブロック図である。
FIG. 1 is a functional block diagram showing an embodiment of a line graphic vectorization apparatus according to the present invention.

【図2】線図形ベクトル化方式を説明するための図であ
る。
FIG. 2 is a diagram for explaining a line graphic vectorization method.

【図3】線図形ベクトル化方式を説明するための図であ
る。
FIG. 3 is a diagram for explaining a line graphic vectorization method;

【図4】線図形ベクトル化方式を説明するための図であ
る。
FIG. 4 is a diagram for explaining a line graphic vectorization method.

【図5】輪郭情報検出の処理手順を示すフローチャート
である。
FIG. 5 is a flowchart illustrating a processing procedure of contour information detection.

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

1 画像入力手段 2 画像記憶手段 3 輪郭情報検出手段 4 輪郭情報記憶手段 5 主着目点抽出手段 6 副着目点検出手段 7 距離算出手段 8 判定手段 9 主着目点位置推定手段 10 芯線抽出手段 11 芯線情報記憶手段 DESCRIPTION OF SYMBOLS 1 Image input means 2 Image storage means 3 Contour information detection means 4 Contour information storage means 5 Primary attention point extraction means 6 Secondary attention point detection means 7 Distance calculation means 8 Judgment means 9 Primary attention point position estimation means 10 Core line extraction means 11 Core wire Information storage means

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】線図形をイメージスキャナ等で量子化して
得た2値ラスタデータの白画素と黒画素の境界を全て右
回りあるいは全てその逆回りに追跡して抽出した輪郭情
報について、任意の輪郭画素を主着目点とし、主着目点
から図形を挟んで最短の距離に位置する輪郭画素を副着
目点とした時、主着目点を移動しながら対応する副着目
点を検索し、両着目点の中間点を結ぶ曲線を芯線として
検出する線図形ベクトル化方法において、主着目点と副
着目点との距離が所定値内である時は、主着目点を前記
輪郭情報のデータ並び順に移動し、副着目点を前記輪郭
情報のデータ並びと逆順に移動することにより両着目点
を検出し、前記両着目点間の距離が所定値を超えた場合
には、次に続く主着目点の位置を、検出済みの芯線の近
似多項式から推定して、推定結果に基づいて新たな主着
目点を検出することを特徴とする線図形ベクトル化方
法。
An outline information obtained by tracing all the boundaries between white pixels and black pixels of a binary raster data obtained by quantizing a line figure by an image scanner or the like in a clockwise direction or in a reverse direction thereof, and extracting arbitrary information. When the contour pixel is set as the main point of interest and the contour pixel located at the shortest distance from the main point of interest across the figure is set as the sub point of interest, the corresponding sub point of interest is searched while moving the main point of interest, and both points of interest are searched. In the line graphic vectorization method for detecting a curve connecting the midpoints of points as a core line, when the distance between the main point of interest and the sub point of interest is within a predetermined value, the main point of interest is moved in the data arrangement order of the contour information. Then, the two points of interest are detected by moving the sub point of interest in the reverse order to the data arrangement of the contour information, and when the distance between the two points of interest exceeds a predetermined value, Estimate position from approximate polynomial of detected core Te, line drawing vectorization method characterized by detecting a new primary point of interest on the basis of the estimation result.
【請求項2】線図形をイメージスキャナ等で量子化して
得た2値ラスタデータの白画素と黒画素の境界を全て右
回りあるいは全てその逆回りに追跡して抽出した輪郭情
報について、任意の輪郭画素を主着目点とし、主着目点
から図形を挟んで最短の距離に位置する輪郭画素を副着
目点とした時、主着目点を移動しながら対応する副着目
点を検索し、両着目点の中間点を結ぶ曲線を芯線として
検出するように構成された線図形ベクトル化装置におい
て、 画像を入力して2値のラスタデータを得る画像入力手段
と、 上記ラスタデータを記憶する画像記憶手段と、 ラスタデータから輪郭情報を検出する輪郭情報検出手段
と、 検出した輪郭情報を記憶する輪郭情報記憶手段と、 輪郭情報から主着目点を輪郭情報のデータ並び順に一定
間隔で抽出する主着目点抽出手段と、 対応する副着目点を決定するために、前記輪郭情報記憶
手段から一つ前の副着目点を始点として前記輪郭情報の
データ並びと逆順にデータを取り出し、距離算出手段を
用いて両着目点間の距離が最短となる点を検出する副着
目点検出手段と、 得られた副着目点と対応する主着目点間の距離と所定し
きい値とを比較し、所定しきい値内であれば、処理を芯
線抽出手段へ移し、所定しきい値を超えていれば、主着
目点位置推定手段に処理を移す判定手段と、 前記判定手段の結果に従い、検出済み芯線から主着目点
を推定する主着目点位置推定手段と、 判定手段の結果に従い、前記両着目点間の中点を芯線上
の点として抽出する芯線抽出手段と、 検出された芯線情報を記憶する芯線情報記憶手段を備え
ることを特徴とする線図形ベクトル化装置。
2. The method according to claim 1, wherein the boundary information of the binary raster data obtained by quantizing the line graphic with an image scanner or the like is traced all the clockwise or all in the opposite direction and extracted. When the contour pixel is set as the main point of interest and the contour pixel located at the shortest distance from the main point of interest across the figure is set as the sub point of interest, the corresponding sub point of interest is searched while moving the main point of interest, and both points of interest are searched. In a line graphic vectorization apparatus configured to detect a curve connecting the intermediate points of points as a core line, image input means for inputting an image to obtain binary raster data, and image storage means for storing the raster data Contour information detecting means for detecting contour information from the raster data; contour information storing means for storing the detected contour information; and extracting a main point of interest from the contour information at regular intervals in the data arrangement order of the contour information. A main point-of-interest extraction means, and to determine a corresponding sub-point of interest, extract data from the contour information storage means in the reverse order of the data arrangement of the contour information with the immediately preceding sub-point of interest as a starting point; A sub-point-of-interest detection means for detecting a point at which the distance between the two points of interest is the shortest, and comparing the distance between the obtained sub-point of interest and the corresponding main point of interest with a predetermined threshold value, If it is within the threshold value, the processing is shifted to the skeleton extracting means. If it exceeds the predetermined threshold value, the determining means shifts the processing to the main point of interest position estimating means. storing the main focus point position estimating means for estimating the main point of interest, according to the result of the determination means, wherein a centerline extraction means for extracting a midpoint between the two focused points as points on the core wire, the detected core information from Characterized by having a skeleton information storage means Graphic vector apparatus.
JP3119540A 1991-03-05 1991-03-05 Line figure vectorization method and apparatus Expired - Fee Related JP2782977B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3119540A JP2782977B2 (en) 1991-03-05 1991-03-05 Line figure vectorization method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3119540A JP2782977B2 (en) 1991-03-05 1991-03-05 Line figure vectorization method and apparatus

Publications (2)

Publication Number Publication Date
JPH04277876A JPH04277876A (en) 1992-10-02
JP2782977B2 true JP2782977B2 (en) 1998-08-06

Family

ID=14763821

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3119540A Expired - Fee Related JP2782977B2 (en) 1991-03-05 1991-03-05 Line figure vectorization method and apparatus

Country Status (1)

Country Link
JP (1) JP2782977B2 (en)

Also Published As

Publication number Publication date
JPH04277876A (en) 1992-10-02

Similar Documents

Publication Publication Date Title
Song et al. A Hough transform based line recognition method utilizing both parameter space and image space
JP3249605B2 (en) Document edge detection device
JP3841321B2 (en) Image registration method
US5892854A (en) Automatic image registration using binary moments
JP2008107860A (en) Method for estimating transformation between image pair, method for expressing image, device for this method, controller, and computer program
CN109712071B (en) Unmanned aerial vehicle image splicing and positioning method based on track constraint
Guan et al. A list-processing approach to compute Voronoi diagrams and the Euclidean distance transform
Chen et al. Perfecting vectorized mechanical drawings
Chen et al. A novel Fourier descriptor based image alignment algorithm for automatic optical inspection
JP2004508641A (en) Digital image segmentation
JP3066173B2 (en) Pattern matching method
JP2782977B2 (en) Line figure vectorization method and apparatus
JP4871918B2 (en) Image conversion apparatus, image conversion method, image conversion program, and computer-readable recording medium recording the image conversion program
Ramel et al. Automatic reading of handwritten chemical formulas from a structural representation of the image
JP2637764B2 (en) Fingerprint center detection method
JPH05157518A (en) Object recognizing apparatus
CN112085816B (en) Font curve generation method and device
JP4133246B2 (en) Image deformation information generation apparatus, image deformation information generation method, and image deformation information generation program
JP2992446B2 (en) Image recognition method and apparatus
JP2001243479A (en) Method and device for image processing and recording medium having image processing program recorded thereon
CN116863176B (en) Image template matching method for digital intelligent manufacturing
JP2604050B2 (en) Line figure recognition device
Wang et al. An improved corner detection algorithm based on Gaussian smoothing
JP4406974B2 (en) Image detection apparatus, image detection method, and recording medium
JP2650443B2 (en) Line figure vectorization method

Legal Events

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