JPH0778829B2 - Figure extraction method - Google Patents
Figure extraction methodInfo
- Publication number
- JPH0778829B2 JPH0778829B2 JP61060888A JP6088886A JPH0778829B2 JP H0778829 B2 JPH0778829 B2 JP H0778829B2 JP 61060888 A JP61060888 A JP 61060888A JP 6088886 A JP6088886 A JP 6088886A JP H0778829 B2 JPH0778829 B2 JP H0778829B2
- Authority
- JP
- Japan
- Prior art keywords
- tracking
- line
- coordinate
- tracked
- image
- 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
Links
Landscapes
- Image Input (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Description
(発明の属する技術分野) 本発明は、地図や図面などの線画から、滑らかな曲線
(以下、単調曲線と呼ぶ)で構成される図形を自動抽出
する方式に関するものである。 (従来の技術) 従来、地図や図面を画像として計算機に入力した画像か
ら、単調曲線で構成される図形(例えば、地図の道路、
等高線、回路図の結線)を抽出する方式は、直線抽出を
主体とした方式であり、地図等の任意形状をした自由曲
線から構成された図面に対して有効な方式が確立されて
いなかった。 (発明の目的) 本発明は、計算機に入力されたディジタル画像を細線化
して得られる中心線から、線の追跡により直線的でない
単調曲線も含めて抽出することを目的とする。 このような目的を達成するために、本発明は、中心線の
分岐点でない点から、 (a)処理対象である近傍点の個数が1つである点に到
達したならば追跡を停止することと、 (b)中心線の分岐点に到達したとき、既に追跡された
部分に対して滑らかな方向があれば滑らかな方向に追跡
を続け、さもなければ追跡を停止することと、 (c)追跡された点の中にx座標が追跡開始点のx座標
に等しいものが存在し、かつ追跡された点のなかにy座
標が追跡開始点のy座標に等しいものが存在するならば
追跡を停止することと、 (d)追跡された点のなかにx座標が追跡開始点のx座
標に等しいものが存在せず、かつ追跡された線がx方向
に閾値以上の長さを持つならば追跡を停止することと、 (e)追跡された点の中にy座標が追跡開始点のy座標
に等しいものが存在せず、かつ追跡された線がy方向に
閾値以上の長さを持つならば追跡を停止することを追跡
規則として中心線上の点を追跡し、追跡規則(d)又は
(e)により追跡が停止して得られた線を単調曲線の一
部分であると判定し、さらにその両端から追跡規則の
(a)と(b)だけを用いて中心線上の点をさらに追跡
し、得られた線を一本の単調曲線とする。 さらに、本発明は、一本の単調曲線を1枚の画像全体に
ついて実行する際に、予め線の線幅を計測して外部より
与える複数の線幅範囲に従い画素又はベクトルを分類し
ておき、まず、線幅の最も太い範囲に属する画素又はベ
クトルのみを抽出対象として単調曲線抽出を行い、次に
太い方から2つの線幅範囲に属する画素又はベクトルを
抽出対象として単調曲線抽出を行い、以下同様に1つず
つ線幅範囲を広げて単調曲線抽出を行うことにより、単
調曲線を詳細に分類することを容易にする。 (発明の構成および作用) 第1図は本発明の原理を説明するための図であり、イメ
ージデータに対して1本の単調曲線の抽出を1枚の画像
全体に実行する際の制御手順を説明する例である。 イメージデータは直交格子上で標本化され、その画素の
座標は行番号と列番号により表わされる。すなわち、左
上の画素を(1,1)とし、水平方向は列番号により、垂
直方向は行番号により表わす。 第1図では、線幅を、0.4mm以上、0.4mm未満0.3mm以
上、0.3mm未満0.2mm以上、0.2mm未満0.1mm以上、0.1mm
未満の5つの範囲に分けて、 抽出対象とする画素の線幅Wを、0.4mm以上、0.3mm以
上、0.2mm以上、0.1mm以上、すべての線幅と変えて、そ
れぞれにおいてラスタ走査を行って単調曲線を抽出す
る。 線幅W以上を有する画素に対するラスタ走査1回では、
単調曲線追跡の始点(i,j)を検出し、その始点から追
跡処理により1本の単調曲線を抽出する。 ここで、W以上の線幅を有する画素からなる単調曲線を
抽出する際、その値を超えた線幅値を有する画素のう
ち、既に単調曲線を構成するか否かについて調べたもの
は、追跡済みとして再び単調曲線の始点になることはな
い。 これにより、既に追跡された画素が追跡の始点にされる
ことはない。地図や図面などでは、異なった線幅で各種
の図形を表すため、本方式は図形の認識を容易にする。 第2図は本発明は方式原理を説明する図であり、1本の
単調曲線の抽出を1枚の画像のイメージデータ全体に実
行する際の制御手順を説明する図で、1は背景、2は線
図形の中心線である。 本発明における1本の単調曲線の抽出は、第2図に示す
追跡規則を用いて以下の3つの手順を実行することによ
り実現される。 なお、背景上にある画素を値が0である0−画素、線図
形の中心線上にある画素を値が1つである1−画素とす
る。また、近傍にある1−画素の個数が3つ以上である
1−画素を分岐点と呼ぶ。TECHNICAL FIELD The present invention relates to a method for automatically extracting a figure composed of a smooth curve (hereinafter referred to as a monotone curve) from a line drawing such as a map or a drawing. (Prior Art) Conventionally, an image that is input to a computer as a map or a drawing is used to generate a figure (for example, a map road,
The method of extracting contour lines, connections of circuit diagrams) is mainly a method of extracting straight lines, and an effective method has not been established for drawings composed of free-form curves of arbitrary shapes such as maps. (Object of the Invention) An object of the present invention is to extract a non-linear monotone curve from a center line obtained by thinning a digital image input to a computer, by tracing the line. In order to achieve such an object, according to the present invention, (a) when the number of neighboring points to be processed reaches one from a non-branch point of the center line, the tracking is stopped. (B) When reaching the branch point of the center line, if there is a smooth direction with respect to the already tracked portion, continue the tracking in the smooth direction, otherwise stop the tracking; and (c) If there is a tracked point whose x-coordinate is equal to the x-coordinate of the tracking start point, and there is one among the tracked points whose y-coordinate is equal to the y-coordinate of the tracking start point, then trace it. Stopping, and (d) if no traced point has an x coordinate equal to the x coordinate of the trace start point, and the traced line has a length in the x direction that is greater than or equal to a threshold. Stopping the tracking, and (e) in the tracked points, the y coordinate is the starting point of the tracking. If there is nothing equal to the coordinates and the traced line has a length equal to or greater than the threshold value in the y direction, the point on the center line is traced using the tracking rule to stop the tracking, and the tracking rule (d) or The line obtained by stopping the tracking in (e) is determined to be a part of the monotone curve, and the points on the center line are further traced from both ends using only (a) and (b) of the tracking rule. , The obtained line is one monotone curve. Further, according to the present invention, when one monotone curve is executed for one image as a whole, the line widths of lines are measured in advance and pixels or vectors are classified according to a plurality of line width ranges given from the outside. First, only the pixels or vectors belonging to the thickest range of the line width are extracted as the extraction targets, and then the pixels or vectors belonging to the two line width ranges from the thicker one are extracted as the extraction targets. Similarly, by expanding the line width range one by one and extracting the monotone curve, it becomes easy to classify the monotone curve in detail. (Structure and Operation of the Invention) FIG. 1 is a diagram for explaining the principle of the present invention, showing a control procedure for executing extraction of one monotone curve from image data over one image. It is an example to explain. The image data is sampled on an orthogonal grid, and the pixel coordinates are represented by row numbers and column numbers. That is, the upper left pixel is (1,1), and the horizontal direction is represented by the column number, and the vertical direction is represented by the row number. In Fig. 1, the line width is 0.4mm or more, less than 0.4mm 0.3mm or more, less than 0.3mm 0.2mm or more, less than 0.2mm 0.1mm or more, 0.1mm
The line width W of the pixel to be extracted is divided into five ranges, which are less than 0.4 mm, 0.4 mm or more, 0.3 mm or more, 0.2 mm or more, 0.1 mm or more, and all line widths, and raster scanning is performed for each. To extract a monotone curve. In one raster scan for pixels having a line width W or more,
The starting point (i, j) of the monotone curve tracing is detected, and one monotone curve is extracted from the starting point by tracing processing. Here, when extracting a monotone curve composed of pixels having a line width of W or more, among the pixels having a line width value exceeding that value, those which have already been investigated for forming a monotone curve are It will not be the starting point of the monotone curve again as it has been completed. This ensures that already tracked pixels are not the starting point for tracking. This method facilitates the recognition of figures, since various figures are represented by different line widths in maps and drawings. FIG. 2 is a diagram for explaining the system principle of the present invention, and is a diagram for explaining a control procedure when executing extraction of one monotone curve for the entire image data of one image, where 1 is a background and 2 is a background. Is the center line of the line figure. The extraction of one monotone curve in the present invention is realized by executing the following three procedures using the tracking rule shown in FIG. A pixel on the background is a 0-pixel having a value of 0, and a pixel on the center line of the line figure is a 1-pixel having a value of 1. Further, a 1-pixel in which the number of 1-pixels in the vicinity is 3 or more is called a branch point.
【手順1】 分岐点でない画素(i,j)から次の追跡規則(a)から
(e)に従い、W以上の線幅をもつ線に属し、かつ単調
曲線として未抽出である画素を追跡する。 (a)第2図(a)に示すように、抽出対象である近傍
画素の個数が1である画素(il,jl)に到達したなら
ば、処理を終了する。 (b)第2図(b)に示すように、分岐点である画素
(il,jl)に到達したならば滑らかな方向を選ぶ。 滑らかな方向がなければ処理を終了する。3個以上の分
岐数を持つ分岐点に到達したと仮定すると、具体的には
滑らかな方向の選択は次のように行う(詳細は第5図を
用いて説明する)。 分岐点である画素(il,jl)より一定個数Tだけ前に追
跡された画素(il-T,jl-T)と、画素(il,jl)より同
数Tだけ後に追跡することが可能なN個の画素(p1,
q1),・・・,(pN,qN)を抽出する。ただし、W以上
の線幅を持つ画素のみ追跡するため、一般にNは分岐数
より小さい。 画素(p1,q1),…,(pN,qN)を抽出する過程でさら
に分岐が生ずる可能性がある。その際、画素(il-T,j
l-T)から画素(il,jl)へのベクトルの方向に最も近
い方向を選択して、画素(p1,q1),…,(pN,qN)を
抽出する。次に、画素(il-T,jl-T)から画素(il,
jl)へのベクトルと、画素(il,jl)から画素(p1,
q1),…,(pN,qN)のそれぞれへのベクトルのなす角
度を式 により計算し、α°以下で0°に最も近いベクトルを選
択する。但し、U1=il−il-T,U2=pr−il,V1=jl−j
l-T,V2=qr−jlである(1≦r≦N)。αは与えられ
た角度に関するしきい値である。 画素(il,jl)から画素(pr,qr)へのベクトルが選択
されたとすると、画素(pr,qr)が追跡されるように画
素(il,jl)の次の追跡点を決める。 (c)第2図(c)に示すように、(i,j)から注目追
跡点(il,jl)までの追跡点の中に〔(i,j)を除
く〕、行座標が開始点の行座標iに等しいものが存在
し、かつ列座標が開始点の列座標jに等しいものが存在
するならば、(il,jl)において処理を終了する。 (d)第2図(d)に示すように、(i,j)から注目追
跡点(il,jl)までの追跡点の中に〔(i,j)を除
く〕、列座標が開始点の列座標jに等しいものが存在せ
ず、かつ追跡された線が列方向に閾値以上の長さを持つ
ならば、(il,jl)において手順1を終了する。 (e)第2図(e)に示すように、(i,j)から注目追
跡点(il,jl)までの追跡点の中に〔(i,j)を除
く〕、行座標が開始点の行座標iに等しいものが存在せ
ず、かつ追跡された線が行方向に閾値以上の長さを持つ
ならば、(il,jl)において手順1を終了する。[Procedure 1] A pixel (i, j) that is not a branch point is traced according to the following tracking rules (a) to (e), and a pixel that belongs to a line having a line width of W or more and is not extracted as a monotone curve is traced. . (A) As shown in FIG. 2 (a), when the number of neighboring pixels to be extracted reaches 1 (i l , j l ), the process ends. (B) As shown in FIG. 2 (b), when the pixel (i l , j l ) which is the branch point is reached, a smooth direction is selected. If there is no smooth direction, the process ends. Assuming that a branch point having three or more branches has been reached, the smooth direction is specifically selected as follows (details will be described with reference to FIG. 5). A branch point pixel (i l, j l) pixels tracked before by a certain number of T from (i lT, j lT) and, can be traced pixel (i l, j l) than after the same number T N pixels (p 1 ,
q 1 ), ..., (p N , q N ) are extracted. However, N is generally smaller than the number of branches because only pixels having a line width of W or more are traced. Further branching may occur in the process of extracting pixels (p 1 , q 1 ), ..., (p N , q N ). At that time, the pixel (i lT , j
The pixel (p 1 , q 1 ), ..., (P N , q N ) is extracted by selecting the direction that is closest to the vector direction from lT ) to the pixel (i l , j l ). Next, from pixel (i lT , j lT ) to pixel (i l ,
vector to j l ) and pixel (i l , j l ) to pixel (p 1 ,
q 1 ), ..., (p N , q N ) Then, the vector closest to 0 ° below α ° is selected. However, U 1 = i l −i lT , U 2 = p r −i l , V 1 = j l −j
lT , V 2 = q r −j l (1 ≦ r ≦ N). α is a threshold value for a given angle. If a vector from pixel (i l , j l ) to pixel (p r , q r ) is chosen, the next pixel (i l , j l ) is tracked so that pixel (p r , q r ) is tracked. Determine the tracking point for. (C) As shown in FIG. 2 (c), the line coordinates are (excluding (i, j)) in the tracking points from (i, j) to the tracking point of interest (i l , j l ). If there is one that is equal to the row coordinate i of the starting point and one whose column coordinate is equal to the column coordinate j of the starting point, the process ends at (i l , j l ). (D) As shown in FIG. 2 (d), the column coordinates are [excluding (i, j)] in the tracking points from (i, j) to the tracking point (i l , j l ) of interest. If there is nothing equal to the column coordinate j of the starting point, and if the traced line has a length equal to or greater than the threshold value in the column direction, the procedure 1 is terminated at (i l , j l ). (E) As shown in FIG. 2 (e), the line coordinates are (excluding (i, j)) in the tracking points from (i, j) to the target tracking point (i l , j l ). If there is nothing equal to the row coordinate i of the starting point and the traced line has a length equal to or greater than the threshold value in the row direction, the procedure 1 is terminated at (i l , j l ).
【手順2】 手順1において追跡規則(d)又は(e)が成り立つと
きのみ、手順2と3を実行する。手順1により最後に追
跡された画素から上記手順1の追跡規則(a)と(b)
により、w以上の線幅をもつ線に属し、かつ単調曲線と
して未抽出である画素を追跡する。[Procedure 2] Procedures 2 and 3 are executed only when the tracking rule (d) or (e) is satisfied in the procedure 1. The tracking rules (a) and (b) of the above procedure 1 are calculated from the pixel lastly traced by the procedure 1.
Thus, pixels that belong to a line having a line width of w or more and are not extracted as a monotone curve are traced.
【手順3】 追跡開始画素(i,j)の近傍にあり、手順1で(i,j)の
次に追跡された画素と異なる画素から上記の追跡規則
(a)と(b)により、W以上の線幅をもつ線に属し、
かつ単調曲線として未抽出である画素を追跡する。手順
1から3まで進ことにより得られた点列を1本の単調曲
線とする。すなわち、本発明では追跡規則(d)または
(e)が成り立つ曲線を単調曲線としている。 第3図は、本発明の一実施例の構成を示すブロック図で
ある。 第3図において、3は画像入力部、4は画像メモリ部、
5は細線化部、6は線幅測定部、7は単調曲線抽出部、
8は点列メモリ部、9は画像出力部、10は制御部であ
る。 画像入力部3は、画像をファクシミリ、ドラムスキャ
ナ、TVカメラなどで標本化、量子化して、ディジタル画
像に変換して入力する部分である。 画像メモリ部4は、画像入力部3から与えられたディジ
タル画像を蓄積する部分でありランダムアクセスメモリ
などから構成される。 細線化部5は、画像メモリ部4に蓄積されているディジ
タル入力画像に含まれる線図形を幅1画素の中心線に変
換して、中心線上にある画素が1−画素、その他の画素
が0−画素である細線化画像として画像メモリ部4に格
納する。 細線化の方法については、いくつかの方法が知られてい
る(電子通信学会技術報告、PRL75−66など)が、それ
らのいずれでもよい。 線幅測定部6は、画像メモリ部4に蓄積されている細線
化画像の1−画素について、ディジタル入力画像におい
て垂直方向、水平方向、45°方向の図形部分の幅を測定
して、その最小値を線幅とし、予め与えられた線幅の範
囲に対応づけた値を細線化画像の1−画素に付与して線
幅付細線化画像として画像メモリ部4に格納する。 単調曲線抽出部7は、画像メモリ4に蓄積されている細
線化画像からすべての単調曲線を抽出してそれを点列メ
モリ部8に書き込むことを、画像メモリ部4に蓄積され
ている線幅付細線化画像を参照して行う。 点列メモリ部8は、行座標と列座標の対で規定される画
素のアドレスの系列を蓄積する部分である。 画像出力部9は、点列メモリ部8にある点列を表示する
部分であり、プリンタ、ディスプレイなどである。 制御部10は、画像メモリ部4に蓄積されている線図形デ
ータから単調曲線が抽出されるように全体を制御する部
分である。 これらの動作は以下のとおりである。 まず、制御部10の指示により、画像入力部3は線図形を
入力して、画像メモリ部4に格納する。 次に、制御部10の指示により、細線化部5は、画像メモ
リ部4に蓄積されている線図形を中心線に変換して、画
像メモリ部4に細線化画像として入力線図形とは別に格
納する。 次に、制御部10の指示により、線幅測定部6は画像メモ
リ部4に蓄積されている入力線図形と細線化画像から線
幅付細線化画像を求めて、入力線図形及び細線化画像と
は別に画像メモリ部4に格納する。 次に、制御部10の指示により、単調曲線抽出部7は、画
像メモリ部4に蓄積されている細線化画像と線幅付細線
化画像から、単調曲線を一本ずつ抽出し、一本の単調曲
線が抽出されるたびに、点列メモリ部8に単調曲線を構
成する画素の座標系列を出力する。 最後に、制御部10の指示により、画像出力部9は点列メ
モリ部8に格納されている画素の値を“1"、その他の画
素の値を“0"として、画像として紙などに出力する。 第4図は、単調曲線抽出部7の構成を説明する図であ
り、71は画像走査部、72は中心線追跡部、73は単調性判
定部、74は中心線検出部、75は単調曲線抽出制御部であ
る。 画像走査部71は、画像メモリ部4に蓄積されている細線
化画像と線幅付細線化画像を同時にラスタ走査して、分
岐点でなく、かつ未追跡であり、かつ線幅W以上を持つ
画素を抽出して、その座標を単調曲線抽出制御部75に出
力する。 中心線追跡部72は、単調曲線抽出制御部75から与えられ
る、追跡の注目画素(il,jl)の座標と注目画素より1
つ前に追跡された画素〔追跡された順に画素座標の添字
の値を増やす場合は(il-1,jl-1)、追跡された順に画
素座標の添字の値を減らす場合は(il+1,jl+1)〕の座
標から、 画像メモリ部4に蓄積されている細線化画像と線幅付細
線化画像を参照して次に追跡する画素〔追跡された順に
画素座標の添字の値を増やす場合は(il+1,jl+1)、追
跡された順に画素座標の添字の値を減らす場合は
(il-1,jl-1)〕を求め、細線化画像上においてその画
素を追跡済みとしてマークし、その画素の座標を単調曲
線抽出制御部75に出力する。 1つ前に追跡された画素が(il-1,jl-1)であるとき、
中心線追跡部72が(il+1,jl+1)を求める処理手順を第
5図に示す。 第5図は中心線追跡部の処理手順を示す図である。 1つ前に追跡された画素が(il+1,jl+1)であるとき
は、画素の座標を表わす記法中の+と−を反転すること
により容易に得られるので省略する。 単調性判定部73は、単調曲線抽出制御部75から追跡され
た画素列の座標が与えられ、上記の手順1の追跡規則
(c)から(e)の条件が成立したか否かを単調曲線抽
出制御部75に出力する。 中心線検出部74は、単調曲線抽出制御部75から与えられ
た画素の座標から、画像メモリ部4に蓄積されている細
線化画像と線幅付細線化画像において、中心線にあるこ
と、単調曲線として未抽出であること、線幅W以上の線
に属することをすべて満足する画素を抽出して、それら
の中から(ik,jk)の近傍を(ik,jk−1)から反時計
回りに検査して最初に検出する画素(ik+1,jk+1)を求
め、細線化画像上において画素(ik+1,jk+1)と(ik,
jk)を追跡済みとしてマークし、画素(ik+1,jk+1)の
座標を単調曲線抽出制御部75に出力する。 単調曲線抽出制御部75は、画像走査部71を使って第1図
に示すように画像メモリ部4に蓄積されている細線化画
像全体について単調曲線抽出が行われるように制御す
る。 すなわち、画像走査部71に細線化画像と線幅付細線化画
像を同時にラスタ走査させ、分岐点でなく、かつ未追跡
であり、かつ線幅W以上をもつ1−画素(i,j)を一本
の単調曲線の始点とする。 一本の単調曲線の抽出は、単調曲線抽出制御部75が追跡
された画素の座標を記憶して、第6図に示されるように
制御することにより実現される。 第6図は単調曲線抽出制御部の制御手順を示す図であ
る。 第7図は1本の単調曲線の抽出を1枚の画像のベクトル
データ全体に実行する際の制御手順を説明する図であ
る。 なお、2値画像を細線化して得られる中心線イメージデ
ータをベクトル化したデータに対して、上記の第1図は
第7図のように、上記手順1から3は手順1′から3′
のように簡単化できる。[Procedure 3] From the pixel which is in the vicinity of the tracking start pixel (i, j) and is different from the pixel tracked next to (i, j) in the procedure 1, according to the above tracking rules (a) and (b), W Belongs to a line with the above line width,
In addition, pixels that have not been extracted are tracked as a monotone curve. The sequence of points obtained by proceeding from steps 1 to 3 is used as one monotone curve. That is, in the present invention, a curve that satisfies the tracking rule (d) or (e) is a monotone curve. FIG. 3 is a block diagram showing the configuration of an embodiment of the present invention. In FIG. 3, 3 is an image input unit, 4 is an image memory unit,
5 is a thinning section, 6 is a line width measuring section, 7 is a monotone curve extracting section,
Reference numeral 8 is a point sequence memory unit, 9 is an image output unit, and 10 is a control unit. The image input unit 3 is a unit for sampling and quantizing an image with a facsimile, a drum scanner, a TV camera, etc., converting it into a digital image, and inputting it. The image memory unit 4 is a unit that stores the digital image supplied from the image input unit 3, and is composed of a random access memory or the like. The thinning unit 5 converts a line figure included in the digital input image stored in the image memory unit 4 into a center line having a width of 1 pixel, and the pixel on the center line is 1-pixel and the other pixels are 0. Store in the image memory unit 4 as a thinned image that is a pixel. Regarding the thinning method, some methods are known (Technical Report of IEICE, PRL 75-66, etc.), but any of them may be used. The line width measuring unit 6 measures the width of the graphic portion in the vertical direction, the horizontal direction, and the 45 ° direction in the digital input image with respect to 1-pixel of the thinned image stored in the image memory unit 4, and determines the minimum value. The value is set as the line width, and a value corresponding to a predetermined range of the line width is given to 1-pixel of the thinned image and stored in the image memory unit 4 as the thinned image with the line width. The monotone curve extraction unit 7 extracts all the monotone curves from the thinned image accumulated in the image memory 4 and writes the monotone curves in the point sequence memory unit 8 by calculating the line width accumulated in the image memory unit 4. This is performed by referring to the thinned image. The point sequence memory unit 8 is a unit for accumulating a series of pixel addresses defined by a pair of row coordinates and column coordinates. The image output unit 9 is a unit that displays the point sequence in the point sequence memory unit 8 and is a printer, a display, or the like. The control unit 10 is a unit that controls the whole so that a monotone curve is extracted from the line graphic data accumulated in the image memory unit 4. These operations are as follows. First, according to an instruction from the control unit 10, the image input unit 3 inputs a line graphic and stores it in the image memory unit 4. Next, according to an instruction from the control unit 10, the line thinning unit 5 converts the line graphics accumulated in the image memory unit 4 into a center line, and separates the line graphics in the image memory unit 4 as a thin line image separately from the input line graphics. Store. Next, according to an instruction from the control unit 10, the line width measuring unit 6 obtains a thinned image with a line width from the input line graphic and the thinned image stored in the image memory unit 4, and calculates the input line graphic and the thinned image. It is stored separately in the image memory unit 4. Next, according to an instruction from the control unit 10, the monotone curve extraction unit 7 extracts monotone curves one by one from the thin line image and the line width thin line image accumulated in the image memory unit 4, and extracts one Every time a monotone curve is extracted, the coordinate series of pixels forming the monotone curve is output to the point sequence memory unit 8. Finally, according to an instruction from the control unit 10, the image output unit 9 sets the pixel value stored in the point sequence memory unit 8 to “1” and the other pixel values to “0”, and outputs the image as an image to paper or the like. To do. FIG. 4 is a diagram for explaining the configuration of the monotone curve extraction unit 7, where 71 is an image scanning unit, 72 is a center line tracking unit, 73 is a monotonicity determination unit, 74 is a center line detection unit, and 75 is a monotone curve. It is an extraction control unit. The image scanning unit 71 simultaneously raster-scans the thinned image and the thinned image with the line width accumulated in the image memory unit 4, is not a branch point, is untracked, and has a line width W or more. Pixels are extracted and their coordinates are output to the monotone curve extraction control unit 75. The center line tracking unit 72 receives 1 from the coordinates of the pixel of interest (i l , j l ) of tracking and the pixel of interest, which is given from the monotone curve extraction control unit 75.
The last tracked pixel [(i l-1 , j l-1 ) to increase the value of the pixel coordinate subscript in the tracked order, and (i to decrease the value of the pixel coordinate subscript in the tracked order l + 1 , j l + 1 )], the pixel to be tracked next with reference to the thinned image and the thinned image with line width accumulated in the image memory unit 4 To increase the subscript value (i l + 1 , j l + 1 ), to decrease the subscript value of the pixel coordinates in the traced order, obtain (i l-1 , j l-1 )] The pixel is marked as tracked on the image, and the coordinates of the pixel are output to the monotone curve extraction control unit 75. When the last tracked pixel is (i l-1 , j l-1 ),
FIG. 5 shows a processing procedure in which the center line tracking unit 72 obtains (i l + 1 , j l + 1 ). FIG. 5 is a diagram showing a processing procedure of the center line tracking unit. When the previously tracked pixel is (i l + 1 , j l + 1 ), it is easily obtained by inverting + and − in the notation representing the coordinates of the pixel, and therefore it is omitted. The monotonicity determination unit 73 is given the coordinates of the pixel row tracked by the monotonic curve extraction control unit 75, and determines whether or not the conditions of the tracking rules (c) to (e) of the above procedure 1 are satisfied. Output to the extraction control unit 75. The center line detection unit 74 determines that the thin line image and the thin line image with line width stored in the image memory unit 4 are on the center line based on the pixel coordinates given from the monotone curve extraction control unit 75. it is unextracted as curves, and extracts all satisfied pixels that belong to or more lines line width W, among them (i k, j k) in the vicinity of (i k, j k -1) Then, the pixel (i k + 1 , j k + 1 ) to be detected first is obtained by inspecting counterclockwise from, and the pixels (i k + 1 , j k + 1 ) and (i k ,
j k ) is marked as tracked, and the coordinates of the pixel (i k + 1 , j k + 1 ) are output to the monotone curve extraction control unit 75. The monotone curve extraction control unit 75 controls the image scanning unit 71 so that the monotone curve extraction is performed on the entire thinned image stored in the image memory unit 4 as shown in FIG. That is, the image scanning unit 71 simultaneously raster-scans a thinned image and a thinned image with a line width to find 1-pixel (i, j) that is not a branch point, is untracked, and has a linewidth of W or more. It is the starting point of one monotone curve. The extraction of one monotone curve is realized by the monotonic curve extraction control unit 75 storing the coordinates of the tracked pixels and controlling them as shown in FIG. FIG. 6 is a diagram showing a control procedure of the monotone curve extraction controller. FIG. 7 is a diagram for explaining the control procedure when the extraction of one monotone curve is executed for the entire vector data of one image. It should be noted that for the data obtained by vectorizing the center line image data obtained by thinning the binary image, the above steps 1 to 3 are the steps 1'to 3'as shown in FIG.
Can be simplified as follows.
【手順1′】 開始ベクトルから次の追跡規則(a′)から(e′)に
従い、W以上の線幅をもつ線に属し、かつ単調曲線とし
て未抽出であるベクトルを追跡する。 但し、開始ベクトルの2つの節点を(ik,jk)と
(ik+1,jk+1)とし、追跡方向は(ik,jk)から
(ik+1,jk+1)とする。 既に追跡されたベクトル列の端にあり(ik,jk)に等し
くないものを(il,jl)とする。 (a′)処理対象であり、かつ接続しているベクトルの
個数が1であるベクトルに到達したならば、処理を終了
する。 (b′)処理対象でないものも含めて次に追跡できるベ
クトルの個数が2つ以上であるベクトルに到達したなら
ば、注目しているベクトルの方向に滑らかな方向をもつ
ベクトルを選び追跡する。 滑らかな方向がなければ、処理を終了する。すなわち、
注目するベクトルとなす角度がα°以下で0°に最も近
いベクトルを求める。 (c′)追跡されたベクトルの節点(ir,jr)の中に
〔(ik,jk)を除く〕、ik+1−ikとir−ikの正負符号が
異なるか又はir=ikであるものが存在し、jk+1−jkとjr
−jkの正負符号が異なるか又はjr=jkであるものが存在
するならば、処理を終了する。 (d′)追跡されたベクトルの節点(ir,jr)の中に
〔(ik,jk)を除く〕、jk+1−jkとjr−jkの正負符号が
異なるか又はjr=jkであるものが存在せず、かつ|jr−
jk|が閾値以上の長さを持つならば、この手順を終了す
る。 (e′)追跡されたベクトルの節点(ir,jk)の中に
〔(ik,jk)を除く〕、ik+1−ikとir−ikの正負符号が
異なるか又はir=ikであるものが存在せず、かつ|ir−
ik|が閾値以上の長さを持つならば、この手順を終了す
る。[Procedure 1 '] According to the following tracing rules (a') to (e ') from the start vector, a vector which belongs to a line having a line width of W or more and which has not been extracted as a monotone curve is traced. However, the two nodes of the start vector are (i k , j k ) and (i k + 1 , j k + 1 ), and the tracking direction is from (i k , j k ) to (i k + 1 , j k + 1 ). Let (i l , j l ) be at the end of the already tracked vector sequence and not equal to (i k , j k ). (A ') If the number of vectors to be processed and the number of connected vectors is 1, the process is terminated. (B ') When the number of vectors that can be traced next, including those not to be processed, reaches two or more, a vector having a smooth direction in the direction of the vector of interest is selected and traced. If there is no smooth direction, the process ends. That is,
A vector that is closest to 0 ° when the angle formed with the vector of interest is α ° or less is obtained. (C ') Within the node (i r , j r ) of the tracked vector [excluding (i k , j k )], i k + 1 −i k and i r −i k have different signs. Or i r = i k exists, and j k + 1 −j k and j r
If there is a sign of −j k that is different or if j r = j k exists, the process ends. (D ') Within the node (i r , j r ) of the tracked vector [excluding (i k , j k )], j k + 1 −j k and j r −j k have different signs. Or there is no one with j r = j k , and | j r −
If j k | has a length equal to or greater than the threshold value, the procedure ends. (E ′) In the tracked vector node (i r , j k ) [excluding (i k , j k )], i k + 1 −i k and i r −i k have different signs. Or there is no i r = i k and | i r −
If i k | has a length equal to or greater than the threshold value, the procedure ends.
【手順2′】 手順1′において追跡規則(d′)又は(e′)が成り
立つときのみ、手順2′と3′を実行する。手順1′に
おいて最後に追跡されたベクトルから上記の追跡規則
(a′)と(b′)により、w以上の線幅をもつ線に属
し、かつ単調曲線として未抽出であるベクトルを追跡す
る。[Procedure 2 ′] Procedures 2 ′ and 3 ′ are executed only when the tracking rule (d ′) or (e ′) is satisfied in the procedure 1 ′. A vector which belongs to a line having a line width of w or more and has not been extracted as a monotone curve is traced from the vector traced lastly in the procedure 1'by the above-mentioned tracing rules (a ') and (b').
【手順3′】 開始ベクトルから手順1′と反対方向へ上記の追跡規則
(a′)と(b′)により、W以上の線幅をもつ線に属
し、かつ単調曲線として未抽出である画素追跡する。手
順1から3により得られたベクトル列を1本の単調曲線
とする。 (発明の効果) 以上述べたように、本発明によれば、線をできるだけ滑
らかな方向に追跡し、線のx方向及びy方向への長さに
より単調性を判定しているため、直線を主体としない、
単調な自由曲線を精度良く抽出できる。 また、単調曲線を線幅毎に分けて抽出しているため、抽
出された単調曲線の分類を精度良く行うことを可能にす
る。[Procedure 3 '] Pixels that belong to a line having a line width of W or more and have not been extracted as a monotone curve according to the above-described tracking rules (a') and (b ') in the direction opposite to the procedure 1'from the start vector. Chase. The vector sequence obtained by steps 1 to 3 is used as one monotone curve. (Effects of the Invention) As described above, according to the present invention, a line is traced in a direction as smooth as possible, and monotonicity is determined by the lengths of the line in the x direction and the y direction. Not subject,
It is possible to accurately extract a monotonous free curve. Moreover, since the monotone curves are extracted separately for each line width, it is possible to accurately classify the extracted monotone curves.
第1図は本発明の原理を説明する図、第2図は1本の単
調曲線の抽出を1枚の画像のイメージデータ全体に実行
する際の制御手順を説明する図、第3図は本発明の構成
を示す一実施例のブロック図、第4図は第3図の構成要
素である単調曲線抽出部の構成をさらに説明する図、第
5図は中心線追跡部の処理手順を示す図、第6図は単調
曲線抽出制御部の制御手順を示す図、第7図は1本の単
調曲線の抽出を1枚の画像のベクトルデータ全体に実行
する際の制御手順を説明する図である。 1…背景、2…線図形の中心線、3…画像入力部、4…
画像メモリ部、5…細線化部、6…線幅測定部、7…単
調曲線抽出部、8…点列メモリ部、9…画像出力部、10
…制御部、71…画像走査部、72…中心線追跡部、73…単
調性判定部、74…中心線検出部、75…単調曲線抽出制御
部。FIG. 1 is a diagram for explaining the principle of the present invention, FIG. 2 is a diagram for explaining the control procedure when executing extraction of one monotone curve for the entire image data of one image, and FIG. FIG. 4 is a block diagram of an embodiment showing the configuration of the invention, FIG. 4 is a diagram further explaining the configuration of a monotone curve extraction unit which is a constituent element of FIG. 3, and FIG. 5 is a diagram showing a processing procedure of a center line tracking unit. FIG. 6 is a diagram showing a control procedure of the monotone curve extraction control unit, and FIG. 7 is a diagram illustrating a control procedure when the extraction of one monotone curve is executed for the entire vector data of one image. . 1 ... Background, 2 ... Center line of line figure, 3 ... Image input section, 4 ...
Image memory unit, 5 ... Thinning unit, 6 ... Line width measuring unit, 7 ... Monotone curve extracting unit, 8 ... Point sequence memory unit, 9 ... Image output unit, 10
Control unit 71 Image scanning unit 72 Center line tracking unit 73 Monotonicity determination unit 74 Center line detecting unit 75 Monotonic curve extraction control unit
フロントページの続き (51)Int.Cl.6 識別記号 庁内整理番号 FI 技術表示箇所 G06T 7/00 7623−5L G06F 15/60 350 D 15/64 A Continuation of the front page (51) Int.Cl. 6 Identification number Office reference number FI Technical display location G06T 7/00 7623-5L G06F 15/60 350 D 15/64 A
Claims (2)
心線イメージデータ又はそれをベクトル化したデータよ
り、単調曲線を自動抽出する方法において、 中心線の分岐点でない点から、 (a)抽出対象である近傍点の個数が1である点に到達
したならば追跡を停止することと、 (b)中心線の分岐点に到達したとき、既に追跡された
部分に対して滑らかな方向があれば滑らかな方向に追跡
を続け、さもなければ追跡を停止することとと、 (c)追跡された点の中にx座標が追跡開始点のx座標
に等しいものが存在し、かつ追跡された点の中にy座標
が追跡開始点のy座標に等しいものが存在するならば追
跡を停止することと、 (d)追跡された点の中にx座標が追跡開始点のx座標
に等しいものが存在せず、かつ追跡された線がx方向に
閾値以上の長さを持つならば追跡を停止することと、 (e)追跡された点の中にy座標が追跡開始点のy座標
に等しいものが存在せず、かつ追跡された線がy方向に
閾値以上の長さを持つならば追跡を停止することを追跡
規則として中心線上の点を追跡し、 追跡規則(d)又は(e)により追跡が停止して得られ
た線を単調曲線の一部分であると判定し、 さらにその両端から追跡規則の(a)と(b)だけを用
いて中心線上の点をさらに追跡し、得られた線を一本の
単調曲線とすることを特徴とする図形抽出方法。1. A method of automatically extracting a monotone curve from centerline image data obtained by thinning binary line graphic data or data obtained by vectorizing the data, wherein (a) When the number of neighboring points to be extracted reaches one, the tracking is stopped, and (b) when the bifurcation point of the center line is reached, a smooth direction with respect to the already tracked part is obtained. If so, continue tracking in a smooth direction, otherwise stop tracking, and (c) there is a tracked point whose x coordinate is equal to the x coordinate of the tracking start point and is tracked. If there is a y-coordinate that is equal to the y-coordinate of the tracking start point among the traced points, stop the tracking, and (d) in the tracked points, the x-coordinate is equal to the x-coordinate of the tracking start point. There is nothing and the traced line is in the x direction Stop tracking if it has a length greater than or equal to a threshold, and (e) there is no tracked point whose y coordinate is equal to the y coordinate of the tracking start point and the tracked line is y A point on the center line is traced with a tracking rule that the tracking is stopped if the direction has a length equal to or more than a threshold, and a line obtained by the tracking being stopped by the tracking rule (d) or (e) is a monotone curve. It is determined that the line on the center line is further traced from both ends using only the tracking rules (a) and (b), and the obtained line is made into one monotone curve. Figure extraction method.
る際に、予め線の線幅を計測して外部より与える複数の
線幅範囲、線幅範囲1から線幅範囲Nに従い画素又はベ
クトルを分類しておき、 まず、線幅範囲1に属する画素又はベクトルのみを抽出
の対象として単調曲線抽出を行い、 次に線幅範囲1と2に属する画素又はベクトルを抽出の
対象として単調曲線抽出を行い、 以下同様に1つずつ線幅範囲を広げて線幅範囲1からN
がすべて抽出対象となるまで単調曲線抽出を行うことを
特徴とする特許請求の範囲第(1)項記載の図形抽出方
法。2. Pixels or vectors according to a plurality of line width ranges, line width range 1 to line width range N, which are provided from the outside by measuring the line widths of lines in advance when performing graphic extraction for an entire image. First, monotonic curve extraction is performed by extracting only pixels or vectors belonging to the line width range 1 and then monotone curve extraction is performed by extracting pixels or vectors belonging to the line width ranges 1 and 2. Then, similarly, expand the line width range one by one in the same manner, and
The graphic extraction method according to claim (1), characterized in that the monotone curve extraction is performed until all are extracted.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP61060888A JPH0778829B2 (en) | 1986-03-20 | 1986-03-20 | Figure extraction method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP61060888A JPH0778829B2 (en) | 1986-03-20 | 1986-03-20 | Figure extraction method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS62219173A JPS62219173A (en) | 1987-09-26 |
| JPH0778829B2 true JPH0778829B2 (en) | 1995-08-23 |
Family
ID=13155348
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP61060888A Expired - Fee Related JPH0778829B2 (en) | 1986-03-20 | 1986-03-20 | Figure extraction method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0778829B2 (en) |
-
1986
- 1986-03-20 JP JP61060888A patent/JPH0778829B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPS62219173A (en) | 1987-09-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR101207127B1 (en) | Method and apparatus for preprocessing of character recognition | |
| CN113223176A (en) | Method and device for acquiring multi-dimensional pipeline characteristic parameters | |
| US6728407B1 (en) | Method for automatically determining trackers along contour and storage medium storing program for implementing the same | |
| US6650362B1 (en) | Movement detecting apparatus with feature point extractor based on luminance gradient in current frame | |
| JPH0778829B2 (en) | Figure extraction method | |
| JP6055952B1 (en) | Image inspection apparatus, image inspection method, and program | |
| JP5563390B2 (en) | Image processing apparatus, control method therefor, and program | |
| JP2882314B2 (en) | Line figure recognition method | |
| JPH07193716A (en) | Edge emphasizing device | |
| JP2587812B2 (en) | Figure extraction method | |
| JPH10312460A (en) | Image processing method and high-precision image processing device | |
| JP2000182056A (en) | Picture processor | |
| JPH05290162A (en) | Diagram branch point connecting method for image input device | |
| JP2977259B2 (en) | Skew detection method | |
| JPH022189B2 (en) | ||
| JPH053627B2 (en) | ||
| JPH08194825A (en) | Contour information extraction device | |
| JPH06168341A (en) | Method and device for processing three-dimensional model | |
| JP2856465B2 (en) | Image generation processing method | |
| CN121962358A (en) | Devices, equipment, media, and program products for generating road centerline information | |
| JPH0243220B2 (en) | ||
| JPH08305861A (en) | Outline vector generating method | |
| JPH08335270A (en) | Motion vector estimation method | |
| JP2003281553A (en) | Split vector concatenation program and method | |
| JPH06221824A (en) | 3D measuring device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |