JPH0362269A - Method and device for approximating line image - Google Patents
Method and device for approximating line imageInfo
- Publication number
- JPH0362269A JPH0362269A JP19877189A JP19877189A JPH0362269A JP H0362269 A JPH0362269 A JP H0362269A JP 19877189 A JP19877189 A JP 19877189A JP 19877189 A JP19877189 A JP 19877189A JP H0362269 A JPH0362269 A JP H0362269A
- Authority
- JP
- Japan
- Prior art keywords
- line
- linear
- approximation
- image
- approximate
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims description 48
- 238000000605 extraction Methods 0.000 claims description 37
- 239000000284 extract Substances 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000004590 computer program Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000007796 conventional method Methods 0.000 description 2
- 230000003247 decreasing effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 210000000988 bone and bone Anatomy 0.000 description 1
- 230000001771 impaired effect Effects 0.000 description 1
- 238000003909 pattern recognition Methods 0.000 description 1
- 102220042779 rs28372779 Human genes 0.000 description 1
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
Description
【発明の詳細な説明】
(産業上の利用分野)
本発明は紙面に描かれた図形を走査して入力された画像
を認識する図面認識方法およびその装置に関し、特に線
図形を含む画像の線構造を数値的に近似する方法および
その装置に関する。Detailed Description of the Invention (Industrial Field of Application) The present invention relates to a drawing recognition method and apparatus for recognizing input images by scanning figures drawn on paper, and in particular to a drawing recognition method and apparatus for recognizing input images by scanning figures drawn on paper, and in particular, the present invention relates to a drawing recognition method and apparatus for recognizing input images by scanning figures drawn on paper. This invention relates to a method and apparatus for numerically approximating a structure.
(従来の技術)
図面画像を認識する処理の第1段階として、図面画像中
の線図形を構成する直線や曲線の線構造を抽出すること
が一般に行われる。入力線画像の線構造を線分と円弧近
似する従来の代表的な方式としては、同一出願人の提案
になる方式が特願昭63−87120号に開示されてい
る。この方式は、図形を走査して得られた線画像から各
画素における方向の値を求め、線上に於て線形な平均方
向変化率を有する線形方向区間を求め、方向変化率が所
定の閾値以上の線形方向区間を円弧または円に、閾値未
満の線形方向区間を線分に近似する方式である。(Prior Art) As a first step in the process of recognizing a drawing image, the line structure of straight lines and curves that constitute line figures in the drawing image is generally extracted. As a typical conventional method for approximating the line structure of an input line image to line segments and circular arcs, a method proposed by the same applicant is disclosed in Japanese Patent Application No. 87120/1983. This method calculates the direction value at each pixel from a line image obtained by scanning a figure, finds a linear direction section that has a linear average direction change rate on the line, and then calculates a linear direction section that has a linear average direction change rate on the line. This method approximates the linear direction section of 0 to an arc or circle, and the linear direction section of less than a threshold to a line segment.
(発明が解決しようとする課題)
しかしながら、上述の従来方式は、以下に述べるような
問題点がある。第3図(a)と(b)を用いて説明する
。第3図(a>は2つの線図形を含む入力画像であり、
第3図(b)はこの線画像の各画素における方向を短線
骨で模式的に表した図である。(Problems to be Solved by the Invention) However, the above-mentioned conventional system has the following problems. This will be explained using FIGS. 3(a) and 3(b). FIG. 3 (a> is an input image containing two line figures,
FIG. 3(b) is a diagram schematically representing the direction of each pixel of this line image using a short line bone.
線画像から求めた各画素での方向には多少の誤差を含む
ので、第3図(a)のように直交する2線分の角点にお
いて第3図(b)の区間L1のように滑らかに方向が変
化してしまう場合がある。Since the direction at each pixel determined from the line image contains some errors, it is smooth as shown in section L1 in Fig. 3(b) at the corner point of two orthogonal line segments as shown in Fig. 3(a). The direction may change.
この区間L1は、微小な円弧に対応した第3図(b)の
区間L2とほぼ同じ平均変化率を有するので、上記の従
来の線分円弧近似方式に用いられていた所定の閾値以上
の平均方向変化率を持つ区間を円弧近似する方式では、
区間L1と区間L2のいずれも円弧で近似されてしまう
、もしくはいずれもが線分で近似されてしまう。Since this section L1 has almost the same average rate of change as the section L2 in FIG. In the method of approximating an interval with a direction change rate as an arc,
Both the section L1 and the section L2 are approximated by circular arcs, or both are approximated by line segments.
即ち、従来の線分円弧近似方式では線形方向区間の平均
方向変化率によってのみ線分であるか円弧であるかが判
定されるので、方向の抽出結果に含まれる誤差に影響さ
れ易いという問題点があった。In other words, in the conventional line segment arc approximation method, whether it is a line segment or a circular arc is determined only based on the average direction change rate of the linear direction section, so there is a problem that it is easily affected by errors included in the direction extraction results. was there.
本発明の目的は、上記の問題点を解決し、方向の抽出結
果の誤差に影響されに<<、微小な円弧や線分の角点を
正しく近似できる線画像近似方法および装置を提供する
ことにある。SUMMARY OF THE INVENTION An object of the present invention is to provide a line image approximation method and apparatus that can solve the above problems and accurately approximate corner points of minute arcs and line segments without being affected by errors in the direction extraction results. It is in.
(課題を解決するための手段)
前述の課題を解決するため本発明による線画像近似方法
は、線図形を走査して得られた線画像の中心線点を表す
中心線画像と、線画像の各画素における線の方向を表す
方向画像から入力線画像を線分と円弧で近似する線図形
近似方法において、中心線画像上で任意の特徴点から他
の特徴点に至る点列の位置座標を近似点列として抽出す
る近似点列抽出処理と、前記近似点列における方向画像
の方向の値を用いて、線形な平均方向変化を有する複数
の線形方向区間に近似点列を分割し、各線形方向区間の
平均方向変化率と線形性誤差を算出する線形方向区間抽
出処理と、前記線形方向区間の近似点列の線分近似によ
る位置誤差、該近似点列の円弧近似による位置誤差、線
形方向区間の方向の線形性誤差、および近似点列長に対
する線形方向区間長の割合に基づいて前記線形方向区間
が線分であるか円弧であるかを判定して近似を行う線分
円弧判定処理とを含むことを特徴とする線画像近似方法
である。(Means for Solving the Problem) In order to solve the above-mentioned problem, the line image approximation method according to the present invention uses a center line image representing the center line point of a line image obtained by scanning a line figure, and a center line image representing the center line point of the line image obtained by scanning a line figure. In a line figure approximation method that approximates an input line image using line segments and arcs from a direction image representing the direction of the line at each pixel, the position coordinates of a point sequence from an arbitrary feature point to another feature point on the center line image are calculated. Using an approximate point sequence extraction process to extract an approximate point sequence and the direction value of the direction image in the approximate point sequence, the approximate point sequence is divided into a plurality of linear direction sections having a linear average direction change, and each linear Linear direction section extraction processing that calculates the average direction change rate and linearity error of the direction section, position error due to line segment approximation of the approximate point sequence of the linear direction section, position error due to arc approximation of the approximate point sequence, linear direction Line segment/arc determination processing that performs approximation by determining whether the linear direction section is a line segment or a circular arc based on the linearity error in the direction of the section and the ratio of the linear direction section length to the approximate point sequence length; This is a line image approximation method characterized by including the following.
また、本発明による線画像近似装置は、紙面上に記録さ
れた線図形を走査して得られる線画像から求められる線
の中心線点および前記線画像の各位置における線の局所
的方向をそれぞれ記憶する中心線メモリおよび方向画像
メモリを少なくとも備える線画像近似装置において、前
記中心線メモリから読出される任意の特徴点から他の特
徴点に至る中心線点の位?IfJu標を近似点列として
出力する近似点列抽出手段と、該近似点列に対応した位
置における方向値を前記画像メモリから読出す方向系列
読出し手段と、前記方向系列上での方向値の変化を線形
近似して線形な平均方向変化を有する複数の線形方向区
間に近似点列を分割すると共に各線形方向区間の平均方
向変化率と線形性誤差を算出する線形方向区間抽出手段
と、前記線形方向区間ごとに近似点列の線分近似による
位置誤差、該近似点列の円弧近似による位置誤差、線形
方向区間の方向の線形性誤差、および近似点列長に対す
る線形方向区間長の、割合に基づいて該線形方向区間が
線分であるか円弧であるかを判定する線分円弧判定手段
とを備えて戒る線画像近似装置である。The line image approximation device according to the present invention also calculates the center line point of the line and the local direction of the line at each position of the line image, which are obtained from a line image obtained by scanning a line figure recorded on a paper surface. In a line image approximation device including at least a centerline memory and a direction image memory for storing, the number of centerline points from an arbitrary feature point to another feature point read from the centerline memory? Approximate point sequence extraction means for outputting IfJu marks as an approximate point sequence; direction sequence reading means for reading out direction values at positions corresponding to the approximate point sequence from the image memory; and changes in direction values on the direction sequence. linear direction section extracting means for linearly approximating and dividing the approximate point sequence into a plurality of linear direction sections having linear average direction changes, and calculating the average direction change rate and linearity error of each linear direction section; For each direction interval, the position error due to line segment approximation of the approximate point sequence, the position error due to arc approximation of the approximate point sequence, the linearity error in the direction of the linear direction interval, and the ratio of the linear direction interval length to the approximate point sequence length. A line image approximation device is provided with a line segment/arc determining means for determining whether the linear direction section is a line segment or a circular arc based on the linear direction section.
(実施例)
次に本発明における実施例について図面を参照して説明
する。(Example) Next, an example of the present invention will be described with reference to the drawings.
第1図は本発明における一実施例の処理手順を示す。FIG. 1 shows a processing procedure of an embodiment of the present invention.
処理開始に伴って、まず、線画像の中心線を求める中心
線抽出処理を行い(ステップ101〉、線画像の線の中
心を通る連結した画素から成る中心線画像を求める。中
心線抽出処理の手順は、細線化を行う公知の手法を用い
て実現される0例えば文献「画像認識の基礎[1]J(
森俊二・坂倉栂子共著、1986年)に示された細線化
の手順を用いることができる。また、線の両側の輪郭線
の中点を順に追跡する公知の手順でもよい。Upon starting the process, first, center line extraction processing is performed to obtain the center line of the line image (step 101), and a center line image consisting of connected pixels passing through the center of the line of the line image is obtained. The procedure is realized using a known method of line thinning.
The thinning procedure shown in Shunji Mori and Toshiko Sakakura (co-authored, 1986) can be used. Alternatively, a known procedure may be used in which the midpoints of the contour lines on both sides of the line are sequentially traced.
次に、方向画像生成処理を行い、線画像の各画素におけ
る線の方向を求める(ステップ102)。Next, a direction image generation process is performed to find the direction of the line at each pixel of the line image (step 102).
各画素における方向を求める第1の手順としては、同一
出願人により提案され、特願昭62−285043号に
開示されている。予めT個の方向に対する信頼性を局所
マツチングにより求め、これを合成して各画素の方向と
その信頼性を求める手順を用いることができる。The first procedure for determining the direction at each pixel was proposed by the same applicant and disclosed in Japanese Patent Application No. 62-285043. A procedure can be used in which the reliability for T directions is determined in advance by local matching, and the results are combined to determine the direction of each pixel and its reliability.
以下では簡単のため、位置(x、y)における線画像の
値を、
F (x、y) 、1≦X≦M、1≦y≦Nで表す、尚
、Xおよびyは線画像上での位置座標であり、右方向を
X軸、下方向をY軸とする0MおよびNはそれぞれ線画
像の横および縦の大きさである。In the following, for simplicity, the value of the line image at position (x, y) is expressed as F (x, y), 1≦X≦M, 1≦y≦N, where X and y are on the line image. 0M and N are the horizontal and vertical sizes of the line image, respectively, with the right direction being the X axis and the bottom direction being the Y axis.
パラメータWを予期される線幅を基に定められる視野を
表す数、パラメータTを予め設定された信頼性を求める
べき相異なる方向の数とするとき、まず、位置(x、y
)を中心とした縦横の幅がWの範囲にある画像、即ち、
WxWの局所線素面像f (t、5)(1≦t、s≦W
)に対して、局所線素画1f内に所定の方向線素が中心
に存在する信頼性V r (x 、 y) (1=
1〜T )を求める。When the parameter W is a number representing the field of view determined based on the expected line width, and the parameter T is the number of different directions in which a preset reliability is to be determined, first, the position (x, y
), whose vertical and horizontal widths are within the range of W, i.e.,
WxW local line elemental image f (t, 5) (1≦t, s≦W
), the reliability that a predetermined direction line element exists in the center within the local line element pixel 1f V r (x, y) (1=
1 to T).
ここで、局所線素画像f内に設定された方向線素が存在
する信頼性を求める方法としては、パターン認識技術で
用いられるマツチング手法、例えば予め設定された方向
線素のパターンの固有値展開による類似度法などの公知
の方法で実現される。Here, as a method for determining the reliability that the directional line element set in the local line element image f exists, a matching method used in pattern recognition technology, for example, by eigenvalue expansion of a pattern of directional line elements set in advance. This is realized using a known method such as a similarity method.
例えばT=4、即ち、縦、横、右下がりの斜め、右上が
りの斜めの4つの方向線素に対する辞書を作成しておき
、局所線素画像fに対して各辞書との類似度を求めれば
よい。For example, create dictionaries for T = 4, that is, four directional line elements: vertical, horizontal, diagonal downward to the right, and diagonal upward to the right, and calculate the similarity with each dictionary for the local line element image f. Bye.
次に、T個の方向に対する信頼性を以下の式に従って合
成する。これにより、位置(x、y)における線の方向
θ(x、y)が求められる。Next, the reliability for T directions is combined according to the following formula. As a result, the direction θ(x, y) of the line at the position (x, y) is determined.
Sz (x、y) =Σ V+ (x、y)*C03
(2*^rc++)(1)Sy (x、y) =Σ
V+ (X、V)”5IN(21Ar1J+ )
(2)θ(X、/) =TAH−”(S、 (
x、V)/ S、 (x、y))/2 (3)ここで
Arg、は第0番目の方向線素の角度であり、例えば上
記T=4の方向線素を選択した場合(こ は 、 A
r g I = O、A r g
2 = yr / 2 。Sz (x, y) =Σ V+ (x, y)*C03
(2*^rc++) (1) Sy (x, y) = Σ
V+ (X, V)”5IN(21Ar1J+)
(2) θ(X, /) = TAH-”(S, (
x, V)/S, (x, y))/2 (3) Here, Arg is the angle of the 0th direction line element. For example, if the above direction line element T=4 is selected (this 、A
r g I = O, A r g
2 = yr/2.
Arg3=i/4.Arga =3g/4である。Arg3=i/4. Arga=3g/4.
各画素における方向を求める第2の方法として、局所線
画像f (x、y)(1≦X+V≦W)の慣性主軸を求
める方法を用いてもよい、即ち、以下の式で定まる方向
θを画素(x、y)の方向とする方法でもよい。As a second method for determining the direction at each pixel, a method for determining the principal axis of inertia of the local line image f (x, y) (1≦X+V≦W) may be used. In other words, the direction θ determined by the following formula may be used. A method in which the direction of the pixel (x, y) is used may also be used.
【眞 =2; Σ t xr(x、y)]/Eゆ
(5)次に、近似点列抽出処理を行い
、以下の手順[1]ないし[4]により近似すべき中心
線点の座標の系列から成る近似点列Sを求める(ステッ
プ103)、ここで、特徴点を分岐点または端点とし、
中心線点の1点pの8近傍に他の中心線点が1点ある点
Pを端点、また、中心線点の1点pの8近傍に他の中心
線点が3点以上存在する点pを分岐点とする。[Shin = 2; Σ t xr(x, y)]/Eyu
(5) Next, perform approximate point sequence extraction processing and obtain an approximate point sequence S consisting of a series of coordinates of center line points to be approximated by the following steps [1] to [4] (step 103). , let the feature points be branch points or end points,
A point P where there is one other center line point in the 8 vicinity of one point p of the center line point is an end point, and a point P where there are three or more other center line points in the 8 neighborhood of one point p of the center line point Let p be a branching point.
[1]近似されていない中心線点が連結している任意の
特徴点を選択し、これを近似点列Sの始点poとする。[1] Select an arbitrary feature point to which non-approximated center line points are connected, and set this as the starting point po of the approximate point sequence S.
[2]poに連結する中心線点のうち、近似されていな
い中心線点の一つをpIとし、pIを近似点列Sに加え
る。1=1とする。[2] Among the center line points connected to po, one of the center line points that is not approximated is set as pI, and pI is added to the approximate point sequence S. 1=1.
[3] pIが特徴点ならば終了する。[3] If pI is a feature point, end.
[4]p+に連結する中心線点のうち、近似点列Sに含
まれていない点をp r+1 とし、これを近似点列S
に加える。1をi+1に置き換え、[3]へ。[4] Among the center line points connected to p+, let p r+1 be the point that is not included in the approximate point sequence S, and use this as the approximate point sequence S
Add to. Replace 1 with i+1 and go to [3].
これにより、近似点列Sの一つが5=(po+pr 、
p堂・・・・・・p、)として求められる。As a result, one of the approximate point sequences S is 5=(po+pr,
It is determined as p-do...p,).
次に、線形方向区間抽出処理を行う(ステップ104)
、近似点列S上での方向画像の値の系列りをD=(θ0
.θ1.θt・・・・・・θ、)とするとき、方向系列
りから方向の変化が線形である線形方向区間、即ち方向
に変化がない区間または方向の変化が一次式で表される
区間り、(1≦m≦K)を求める。更に線形方向区間り
、の始点のlの値S、および終点のiの値e1、始点と
終点に対応する中心線点の位置座標である2つの端点座
標E、、= (Xs++ yst)とEm*= (X
stl ’l 112→、および線形方向区間り、内の
穴内変化の平均値である平均方向変化率MT、を求める
。Next, linear direction section extraction processing is performed (step 104).
, the sequence of values of the direction image on the approximate point sequence S is D=(θ0
.. θ1. When θt...θ,), a linear direction section in which the change in direction is linear from the direction series, that is, a section where there is no change in direction or a section where change in direction is expressed by a linear equation, Find (1≦m≦K). Furthermore, the value S of l at the starting point of the linear direction section, the value e1 of i at the end point, and the two end point coordinates E, which are the position coordinates of the center line points corresponding to the starting point and the ending point, = (Xs++ yst) and Em *= (X
stl 'l 112→, and the average direction change rate MT, which is the average value of the in-hole change in the linear direction section RI, is determined.
平均方向変化率は単位長さ当りの方向の変化量であり、
単位はラジアン/ドツト(radian/dat)とす
る、ドツトは単位長さの単位である。ここで方向の変化
を線形近似する手順には、平面上に分布する点列を直線
近似する方法を応用して実現する0例えば文献「セグメ
ンテーション・オブ・プレイン・カーブスJ (”5
eaIlention of Plane Cur−v
es”、T、Pavlidis and S、L、Ho
rowitz、IEEE Trans。The average rate of change in direction is the amount of change in direction per unit length,
The unit is radian/dat, where a dot is a unit of length. Here, the procedure for linearly approximating the change in direction is achieved by applying a method of linearly approximating a sequence of points distributed on a plane.
eaIlention of Plane Cur-v
es”, T. Pavlidis and S. L. Ho.
rowitz, IEEE Trans.
Vol、C−23,No、8.pp、86G−870[
1974)) ニ示された手順を用いることができる。Vol, C-23, No. 8. pp, 86G-870 [
1974)) can be used.
即ち、1およびθを2つの直交軸とする平面(1,θ)
上でのθ1の点列の配置を複数の線分で近似することに
よって、線形方向区間の範囲と平均方向変化率が求めら
れる。尚、これにより得られる線形方向区間り。That is, the plane (1, θ) with 1 and θ as two orthogonal axes
By approximating the arrangement of the point sequence of θ1 above with a plurality of line segments, the range of the linear direction section and the average rate of change in direction can be determined. Note that the linear direction section obtained by this is as follows.
(1≦m≦K)の近似直線L1の式を
θ、= M T −X i+β、 (1
1)とする、また、線形方向区間り、の方向の線形性誤
差A 4 r r
を以下の式で求める。The equation of the approximate straight line L1 (1≦m≦K) is θ, = M T −X i+β, (1
1), and the linearity error A 4 r r in the direction of the linear direction section is determined by the following equation.
IxlはXの絶対値
次に、線分円弧判定処理を行い(ステップ105)、K
個の線形方向区間り、の各々が線分であるか円弧である
かを判定し、線分近似または円弧近似結果を出力する。Ixl is the absolute value of X. Next, line segment arc determination processing is performed (step 105), and K
It is determined whether each of the linear direction sections is a line segment or a circular arc, and a line segment approximation or circular arc approximation result is output.
まず、線形区間D1の2つの端点座標E1およびE、2
を通り、半径R1がR,=1/l MT−の円の中心点
O1を求める。これを満たす円の中心点として2つの候
補点01および0112が求められるが、ベクトルO@
IB @1の偏角ベクトル01E1の偏角の変化量の符
号が、平均方向変化率MT、の符号と一致する中心点0
1を選ぶことによって正しい中心点0.が求まる。即ち
、Ar9(v)をベクトルVのX軸の正の向きがら右回
りを正とする方向で計測した偏角、Sign (x )
を値Xの符号とするとき、
Sign ((Arc+(0,t E 、z)−Atc
+(0、t E sil ))=Sign(HT m)
(13)なる中心点Os+
が求めるべき中心点0.となる。First, the two end point coordinates E1 and E,2 of the linear section D1
, and find the center point O1 of a circle whose radius R1 is R, = 1/l MT-. Two candidate points 01 and 0112 are found as the center point of the circle that satisfies this, but the vector O@
Center point 0 where the sign of the change in the declination angle of the declination vector 01E1 of IB @1 matches the sign of the average direction change rate MT.
The correct center point by choosing 1 is 0. is found. That is, the deflection angle of Ar9(v) measured in the positive direction of the X-axis of the vector V, Sign (x)
When is the sign of the value X, Sign ((Arc+(0, tE, z)−Atc
+(0, t E sil ))=Sign(HT m)
(13) The center point Os+
The center point to be found is 0. becomes.
この中心点O1の座標を(0□、0□)とする。Let the coordinates of this center point O1 be (0□, 0□).
次に、線形方向区間り、に対応する近似点列の位置座標
より、以下の式に従って、近似点列の線分近似誤差し、
1、および円弧近似誤差C* r rを求める。但し、
近似点列p、の座標を(p +−,p ty)とする。Next, from the position coordinates of the approximate point sequence corresponding to the linear direction interval, calculate the line segment approximation error of the approximate point sequence according to the following formula,
1, and the circular arc approximation error C* r r. however,
Let the coordinates of the approximate point sequence p be (p + -, p ty).
+(p、、−po、) (p、、−p、、) l
) 0−’(14)
ただし^=((P、、−PG、) 2 +(P、、−
PG、) ” ) 0・S−Q、、) 2−1.2
))0・5(15)
この線分近似誤差り、11および円弧近似誤差C61,
を用いて、以下の条件に依って第1の線分円弧判定を行
う、ただし、Bは予め定められた定数である。+(p,,-po,) (p,,-p,,) l
) 0-'(14) However, ^=((P,,-PG,) 2 +(P,,-
PG,) ”) 0・S-Q,,) 2-1.2
))0・5(15) This line segment approximation error 11 and arc approximation error C61,
The first line segment arc determination is performed using the following conditions, where B is a predetermined constant.
(1)もし1. B * Cerr < L errを
満たすならば線形方向区間り、を円iまたは円であると
判定し、円弧近似を行う、即ち、中心点O1と2つの端
点E1およびEatをそれぞれ結ぶ方向θ、Iおよびθ
、2を円弧の開始角および終了角として求め、中心点0
1、半径R、、開始角θ1、終了角θ、2を円弧近似結
果として出力する。(1) If 1. If B * Cerr < L err is satisfied, the linear direction section is determined to be a circle i or a circle, and circular arc approximation is performed. That is, the directions θ and I connecting the center point O1 and the two end points E1 and Eat, respectively. and θ
, 2 as the starting and ending angles of the arc, and the center point 0
1. Output radius R, starting angle θ1, ending angle θ, 2 as arc approximation results.
(2)もし、+ B ” L err < Cerrを
満たすならば線形方向区間り、を線分であると判定し、
線分近似を行う、即ち、2つの端点座標E atおよび
Eatを線分近似結果として出力する。(2) If + B ” L err < Cerr is satisfied, the linear direction interval is determined to be a line segment,
Line segment approximation is performed, that is, two end point coordinates E at and Eat are output as the line segment approximation result.
これにより、条件(1)または(2)を満たすときは線
分円弧判定が行われ、近似結果が求められる。As a result, when condition (1) or (2) is satisfied, line segment arc determination is performed and an approximate result is obtained.
条件(1)および(2)のいずれも満たさないときは、
以下の条件によって第2の線分円弧判定を行う。If neither condition (1) or (2) is met,
The second line segment arc determination is performed under the following conditions.
(3) R−1−/ P −<R−<Ft−−−* P
−且つDT、、、/P、<DT、を満たすならば線形方
向区間り、を円弧または円であると判定し、円弧近似を
行う、即ち、中心点O1と2つの端点E1およびEss
をそれぞれ結ぶ方向θ、Iおよび0.1を円弧の開始角
および終了角として求め、中心点01、半径R、、開始
角θ、I、終了角θnを円弧近似結果として出力する。(3) R-1-/P-<R-<Ft---*P
- and if DT, , /P, < DT, then the linear direction section is determined to be an arc or a circle, and circular arc approximation is performed, that is, the center point O1 and the two end points E1 and Ess
The directions θ, I, and 0.1 connecting these are determined as the starting angle and ending angle of the arc, and the center point 01, radius R, starting angle θ, I, and ending angle θn are output as the arc approximation result.
ここで、Rm l m、Rwax 、DTmtsは予め
定められた定数であり、方向変化量DT、および信頼性
P。Here, Rm l m, Rwax, and DTmts are predetermined constants, the direction change amount DT, and the reliability P.
は以下の式で定まる値である。is a value determined by the following formula.
口T、 =HT 、 In 、 (
16)P、=(φ、 (A、、、 )−φ2 (ns
+ n)) ’°5(17)
ここでφ1 (x)はXに関して単調減少な関数であり
、例えば、
φl (x)=1/ (x+1 )”’ (18)を
選ぶことができる。また、φx (x、y)はXに関
して単調増加、yに関して単調減少な関数であ、す、例
えば、
φt(x、y)=(x/y)”’ (19)を選ぶこ
とができる。Mouth T, =HT, In, (
16) P, = (φ, (A,,, )−φ2 (ns
+ n)) '°5 (17) Here, φ1 (x) is a monotonically decreasing function with respect to X, and for example, we can choose φl (x)=1/ (x+1)'' (18). , φx (x, y) are functions that are monotonically increasing with respect to X and monotonically decreasing with respect to y. For example, φt(x, y)=(x/y)'' (19) can be chosen.
(4)それ以外ならば、線形方向区間り、を線分である
と判定し、線分近似を行う、即ち、2つの端点座標E1
およびEatを線分近似・結果として出力する。(4) Otherwise, determine that the linear direction interval is a line segment, and perform line segment approximation, that is, the two end point coordinates E1
and Eat are output as line segment approximation results.
以上により、一つの近似点列Sについて線分円弧近似が
行われる。中心線画像にまだ近似されていない中心線点
が存在する場合は近似点列抽出処理から以降を繰り返し
て他の近似点列に対して同様の処理を行う、存在しない
場合は全ての処理を終了する。これにより全線画像が線
分円弧近似される。As described above, line segment arc approximation is performed for one approximate point sequence S. If there are center line points in the center line image that have not been approximated yet, repeat the steps from the approximate point sequence extraction process and perform the same process on other approximate point sequences; if there are no approximate point sequences, end all processing. do. As a result, the entire line image is approximated by a line segment arc.
尚、第1図および上記の説明においては中心線抽出処理
の次に方向画像生成処理を行っているが、上記の説明か
ら明らかなようにこの2つの処理は独立に行えるので、
順序を逆に行ってもよいし、同時に行ってもよい。In FIG. 1 and the above explanation, the direction image generation process is performed after the center line extraction process, but as is clear from the above explanation, these two processes can be performed independently.
The steps may be performed in the reverse order or at the same time.
第2図は本発明における線画像近似装置の機能ブロック
図である。FIG. 2 is a functional block diagram of the line image approximation device according to the present invention.
画像入力装置1は、図形を走査して線画像を入力し記憶
する。中心線抽出装置2は画像入力装置1内の線画像か
ら線の中心点を求める中心線メモリ3は、該中心線点お
よび近似済みの点を記憶する。方向画像生成装置4は、
画像入力装置1内の線画像から各画素における局所的な
方向を求めて方向画像を生成する。方向画像メモリ5は
、該方向画像を記憶する。近似点列抽出装置6は該中心
線メモリ3から中心線点を読出して近似すべき中心線点
の系列を求める。方向系列読出し装置7は、該近似点列
に対応した位置における方向値の系列からなる方向系列
を方向画像メモリ5から読出す。The image input device 1 scans a figure, inputs and stores line images. The center line extraction device 2 finds the center point of a line from the line image in the image input device 1. The center line memory 3 stores the center line point and approximated points. The direction image generation device 4 is
A direction image is generated by determining the local direction at each pixel from the line image in the image input device 1. The direction image memory 5 stores the direction image. Approximate point sequence extraction device 6 reads center line points from center line memory 3 and obtains a sequence of center line points to be approximated. The direction series reading device 7 reads out from the direction image memory 5 a direction series consisting of a series of direction values at positions corresponding to the approximate point series.
線形方向区間抽出装置8は、方向系列上での方向値の変
化を線形近似して線形な平均方向変化率を有する線形方
向区間に近似点列を分割すると共に各線形方向区間の平
均方向変化率と線形性誤差を算出する。形状数値化9は
、線形方向区間ごとに円弧または円の半径と中心点座標
を算出する。線分円弧判定装置10は、線形方向区間の
近似点列の線分近似による位置座標、該近似点列の円弧
近似による位置座標、線形方向区間の方向の線形性誤差
、および近似点列置に対する線形方向区間長の割合に基
づいて該線形方向区間が線分であるか円弧であるかを判
定して近似を行う、制御装置11は、画像入力装置工な
いし線分円弧判定装置10を起動し一連の処理の実行を
制御する。以下より具体的に動作を説明する。The linear direction section extraction device 8 linearly approximates changes in direction values on the direction series, divides the approximate point sequence into linear direction sections having a linear average direction change rate, and calculates the average direction change rate of each linear direction section. and calculate the linearity error. Shape digitization 9 calculates the radius and center point coordinates of an arc or circle for each linear direction section. The line segment arc determination device 10 determines the position coordinates of a series of approximate points in a linear direction section by line segment approximation, the position coordinates of the series of approximate points by arc approximation, the linearity error in the direction of the linear direction section, and the position coordinates of the approximate point sequence. The control device 11 starts the image input device or the line segment/arc determination device 10, which determines whether the linear direction section is a line segment or a circular arc based on the ratio of the length of the linear direction section and performs approximation. Control the execution of a series of processes. The operation will be explained in more detail below.
制御装置11はまず画像入力装置1を起動して、画像を
入力し数値化した線画像として記憶させる。The control device 11 first starts the image input device 1, inputs an image, and stores it as a numerically converted line image.
線画像を以下では簡単のため、位置座標(x、y)にお
ける線画像の値を、
F(x、y)、1≦X≦M、1≦y≦Nで表す、尚、X
およびyは線画像上での位置座標であり、右・方向をX
軸、下方向をY軸とする0MおよびNはそれぞれ線画像
の横および縦の大きさである0画像入力装置1は、光学
的スキャナもしくは撮像管を用いた撮像装置とそれから
得られる信号を数値に変換する変換器、およびその数値
を記憶するRAMやディスク型ファイル装置などの書換
え可能な記憶装置によって容易に構成される。In order to simplify the line image below, the value of the line image at the position coordinates (x, y) is expressed as F(x, y), 1≦X≦M, 1≦y≦N, where X
and y are the position coordinates on the line image, and the right direction is
The horizontal and vertical dimensions of the line image are 0, with the downward direction being the Y axis. It can be easily configured using a converter that converts the value into a value, and a rewritable storage device such as a RAM or a disk-type file device that stores the value.
画像入力装置1内に線画像が記憶されると、制御装置1
1は中心線抽出装置2を起動し、入力線画像の線の中心
を通る連結した中心線点を求める。When the line image is stored in the image input device 1, the control device 1
1 activates the centerline extraction device 2 and finds connected centerline points passing through the center of the line of the input line image.
中心線抽出装置2は、細線化を行う公知の手法を用いて
実現される0例えば文献「画像認識の基礎[1]J
(森俊二・坂倉栂子共著、1986年)に示された細線
化の手順をマイクロコンピュータに代表される電子計算
機のプログラムで実現し、これを画像入力装置1内に記
憶された入力画像に対して実行することにより容易に実
現できる。The center line extraction device 2 is realized using a known thinning method.
(Co-authored by Shunji Mori and Yuko Sakakura, 1986) was realized using a computer program such as a microcomputer, and this was applied to the input image stored in the image input device 1. This can be easily achieved by executing the following.
中心線抽出装置2は求めた中心線点を中心線メモリ3に
格納する。中心線メモリ3は中心線点である画素と中心
線点でない画素を区別でき、また、後述する近似済みの
点と近似済みでない点を区別できる形式で記憶する装置
であり、RAMやディスク型ファイル装置などの書換え
可能な記憶装置によって容易に構成される9例えば中心
線メモリ3は中心線点である画素を1、中心線点でない
画素を0で表した中心線画像と、近似済みの点を1、未
近似の点をOで表した近似済み画像の2枚の2値画像を
記憶する形態で実現される。また、例えば、中心線点で
あるが近似されていない点を0、中心線点でなく近似さ
れていない点を1、中心線点であり近似済みの点を3で
表すように組合せを多値で表した形式で記憶する形態で
もよい、尚、中心線抽出装置2が電子計算機のプログラ
ムと記憶装置によって構成される場合には、中心線メモ
リ3を同一の電子計算機のメモリ内に設けることもでき
る。The centerline extraction device 2 stores the obtained centerline points in the centerline memory 3. The centerline memory 3 is a device that stores data in a format that can distinguish between pixels that are centerline points and pixels that are not centerline points, and also distinguish between approximated points and non-approximated points, which will be described later. For example, the centerline memory 3 stores a centerline image in which pixels that are centerline points are represented by 1 and pixels that are not centerline points are represented by 0, and approximated points are represented by 0. 1. It is realized by storing two binary images of approximated images in which unapproximated points are represented by O. Also, for example, a combination can be multi-valued such that a point that is a centerline point but has not been approximated is represented by 0, a point that is not a centerline point but not approximated is represented by 1, and a point that is a centerline point and has been approximated is represented by 3. Note that if the centerline extraction device 2 is configured by a computer program and a storage device, the centerline memory 3 may be provided in the memory of the same computer. can.
次に、制御装置11は方向画像生成装置4を起動する。Next, the control device 11 activates the direction image generation device 4.
方向画像生成装置4は、線画像F(x、y)の各点(x
、y)について、点(x、y)を中心とした所定の局所
範囲にある局所線画taf(t。The direction image generation device 4 generates each point (x, y) of the line image F(x, y).
, y), the local line drawing taf(t.
s)、例えば局所範囲を横縦の幅がWの矩形とする場合
には、
f(t、5)=F(x+t−1−W/2.y+5−1−
W/2)、1≦t、s≦nを線画像入力装置1から読出
し、局所線画像f (t、s)の方向θ(x、y)を求
める。線画像Fの全ての点についてこれを行い、方向画
像θ(x、y)(1≦X≦M、1≦y≦N)を生成する
。尚、方向画像生成装置4を実現するには、第1の発明
の式(1)ないし式(3〉に示した方法または(4)な
いし式(10)に示した方法をマイクロコンピュータに
代表される電子計算機上のプログラムによって実現し、
画像入力装置1に記憶された線画像に対して処理するこ
とによって容易に実現されうる。方向画像メモリWt4
は求めた方向画像θ(x、y)を方向画像メモリ5に格
納する。s), for example, when the local range is a rectangle with horizontal and vertical widths of W, f(t, 5)=F(x+t-1-W/2.y+5-1-
W/2), 1≦t, and s≦n are read out from the line image input device 1, and the direction θ(x, y) of the local line image f (t, s) is determined. This is performed for all points of the line image F to generate a direction image θ(x, y) (1≦X≦M, 1≦y≦N). In order to realize the direction image generation device 4, the methods shown in equations (1) to (3) or the methods shown in equations (4) to (10) of the first invention can be implemented using a microcomputer, for example. realized by a program on an electronic computer,
This can be easily realized by processing a line image stored in the image input device 1. Direction image memory Wt4
stores the obtained direction image θ(x, y) in the direction image memory 5.
方向画像メモリ5は、RAMやディスク型ファイル装置
などの書換え可能な記憶装置によって容易に構成されて
もよいし、方向画像生成装置4が電子計算機のプログラ
ムと記憶装置によって構成される場合には方向画像メモ
リ5を同一の電子計算機の記憶装置内に設けてもよい。The direction image memory 5 may be easily constituted by a rewritable storage device such as a RAM or a disk-type file device, or when the direction image generation device 4 is constituted by a computer program and a storage device, the direction image memory 5 The image memory 5 may be provided within the storage device of the same computer.
次に制御装置11は、近似区間抽出装置6を起動し、近
似区間抽出装置6は以下の動作を行い、近似すべき中心
線点の座標の系列から戒る近似点列Sを求める。尚、上
記の中心線メモリ3には中心線点である画素を1、中心
線点でない画素をOで表した中心線画像g (x、y)
と、近似済みの点を1、未近似の点をOで表した近似済
み画像h (x、y)の2枚の2値画像を記憶する形態
で実現されており、処理の開始に伴って近似済み画@h
(x、y)は全てOに初期化されている場合について
説明する。Next, the control device 11 starts the approximation section extraction device 6, and the approximation section extraction device 6 performs the following operations to obtain a sequence of approximate points S from the sequence of coordinates of the center line points to be approximated. The centerline memory 3 stores a centerline image g (x, y) in which pixels that are centerline points are represented by 1 and pixels that are not centerline points are represented by O.
This is realized by storing two binary images of the approximated image h (x, y) in which approximated points are represented by 1 and unapproximated points are represented by O. Approximated picture @h
A case will be explained in which (x, y) are all initialized to O.
[11a=1.b=1として、[3]の動作を行う。[11a=1. Set b=1 and perform the operation [3].
[2]a<Mならばaをa+1に置き換える。[2] If a<M, replace a with a+1.
方a=Mならばaを1に、bをb+1に置き換える。こ
こでa=M、b=Nになったら制御装置11に終了信号
を送る。そうでないならば[3]の動作を行う。If a=M, replace a with 1 and replace b with b+1. Here, when a=M and b=N, a termination signal is sent to the control device 11. If not, perform operation [3].
[3]中心線メモリ3からg(a、b’)を読出し、g
(a、b)=1ならば[4]の動作を行う、そうでな
ければ[2]の動作を行う。[3] Read g(a, b') from center line memory 3, and
If (a, b)=1, operation [4] is performed; otherwise, operation [2] is performed.
〔4]中心線メモリ3からg (a−1,b−1)。[4] Center line memory 3 to g (a-1, b-1).
g(a、b−1)、g(a+1.b−1)。g(a, b-1), g(a+1.b-1).
g (a−1+ b)+ g (a+1.b)。g (a-1+b)+g(a+1.b).
g (a 1.b+1)+ g (a、b十t)。g (a 1. b + 1) + g (a, b tent).
g (a+1.b+1)の8つの値を読出し、これらの
値のうち1つ又は3つが1ならば次に[5]の動作を行
う、そうでなければ[2]の動作を行う。g Read eight values of (a+1.b+1), and if one or three of these values are 1, then perform operation [5], otherwise perform operation [2].
[5] (c、 d)を(a−1,bl)(a 、b
1 ) + (a + 1 * b 1 ) *
(a−1,b)、(a+1.b)
(a−1,b+1)、(a、b+1)。[5] (c, d) (a-1, bl) (a, b
1 ) + (a + 1 * b 1 ) *
(a-1, b), (a+1.b) (a-1, b+1), (a, b+1).
(a+1.b+1)のいずれかとするとき、中心線メモ
リ3からh (c、d)を読出してh (c、d)=0
であるような(c、d)を求める。このような(c、d
)が存在しないならば[2]の動作を行う、存在するな
らば(a、b)を方向系列読出し装置7と線形方向区間
抽出装置8へ出力すると共に、(a、b)を(px、p
y)に記憶して[6]の動作を行う。(a+1.b+1), read h (c, d) from the center line memory 3 and h (c, d)=0
Find (c, d) such that Something like this (c, d
) does not exist, perform the operation [2]; if it exists, output (a, b) to the direction sequence reading device 7 and linear direction section extraction device 8, and convert (a, b) to (px, p
y) and perform the operation [6].
[6] (c、d)を方向系列読出し装置7と線形方
向区間抽出装置8へ出力する0次に中心線メモリ3から
g (c−1,d 1) 。[6] g (c-1, d 1) from the zero-order centerline memory 3 which outputs (c, d) to the direction sequence reading device 7 and the linear direction section extracting device 8.
g (c、d−1)、g (c+1.d−1)。g (c, d-1), g (c+1.d-1).
g (c−1,d)、g (c+1.d)g (C−1
,d+1)、g (C,d+1)。g (c-1,d), g (c+1.d)g (C-1
, d+1), g (C, d+1).
g (c+1.d+1)の8つの値を読出し、これらの
値のうち1つ又は3つが1ならば終了するそうでなけれ
ばh (c、d)を1に書き換え、[7]の動作を行う
。g Read the 8 values of (c+1.d+1), and if one or three of these values are 1, the process ends. Otherwise, rewrite h (c, d) to 1 and perform the operation in [7] .
[7] (e、 f)を(c 1.d 1) +
(c。[7] (e, f) (c 1.d 1) +
(c.
d 1 ) 、(c +1 + d 1 ) 、(
c 1 。d 1 ), (c +1 + d 1 ), (
c1.
d)、(c+1.d)、(c−i、d+1)(C,d+
1)、(c+1.d+1)のいずれかとするとき、中心
線メモリ3からg(e、f)をみ出してg(e、f)=
1且つ(e、f)≠(px、py)であるような(e、
f)求める。(c、d)を新たな(px、py)に置き
換え、(e、f)を新たな(c、d)に置き換えて[6
]の動作を行う。d), (c+1.d), (ci, d+1) (C, d+
1), (c+1.d+1), then extract g(e, f) from the center line memory 3 and get g(e, f)=
1 and (e, f)≠(px, py).
f) Find. Replace (c, d) with new (px, py), replace (e, f) with new (c, d) [6
].
以上により、一つの特徴点間の近似点列が抽出され、方
向系列読出し装置7と線形方向区間抽出装置8へ出力さ
れる。As described above, a sequence of approximate points between one feature point is extracted and output to the direction sequence reading device 7 and the linear direction section extraction device 8.
近似区間抽出装置6が近似点列を出力すると、方向系列
読出し装置7は近似点列の各々に対応した位置にある方
向画像の値を方向画像メモリ5から順次読出し、方向系
列として線形方向区間抽出装置8へ出力する。即ち、近
似区間抽出装置6が出力した近似区間Sが、
5=((x+ 、y+ )、(X2 、Y2 )、−−
−−−−(xm 、y、 ))であるとき、方向系列読
出し装置7は、方向系列りとして、
0=(θ(X+ +V+ )、θ(X21V2 )s”
θ(x、 +ym ))=(θ1,1≦i≦n)
を方向画像メモリ5から読出して線形方向区間抽出装置
8へ出力する。When the approximate interval extracting device 6 outputs the approximate point sequence, the direction sequence reading device 7 sequentially reads out the values of the direction image at the position corresponding to each approximate point sequence from the direction image memory 5, and extracts the linear direction interval as a direction series. Output to device 8. That is, the approximate interval S output by the approximate interval extraction device 6 is as follows: 5=((x+, y+), (X2, Y2), --
-----(xm, y, )), the direction sequence reading device 7 reads the direction sequence as follows:
θ(x, +ym))=(θ1, 1≦i≦n) is read out from the direction image memory 5 and output to the linear direction section extraction device 8.
次に制御装置11は線形方向区間抽出装置8を起動し、
近似区間Sにおける方向系列りから、方向値の変化が線
形である線形区間、即ち、方向に変化がない区間または
方向の変化が一次式で表される区間り、(1≦m≦K〉
を求める。更に線形方向区間Dヨの始点lの値saおよ
び終点の1の値e、、、始点と終点に対応する中心線点
の位置座標である2つの端点座標E a+= (x m
l 、 y +mt )とE a2=(X m2+ 3
’ 112) 、線形方向区間り、内内方向変化の平均
値である平均方向変化率MT、、式(12)で定まる線
形性誤差A、2.を求める。平均方向変化率は単位長さ
当りの方向の変化量であり、単位はラジアン/ドツト
(radian/dot) トする。また、ドツトは単
位長さの単位である。Next, the control device 11 starts the linear direction section extraction device 8,
From the direction series in the approximate interval S, we can find a linear interval in which the change in direction value is linear, that is, an interval in which there is no change in direction or an interval in which the change in direction is expressed by a linear equation, (1≦m≦K〉
seek. Furthermore, the value sa of the starting point l of the linear direction section D yo and the value e of 1 of the end point, , two end point coordinates E a+= (x m
l , y + mt ) and E a2=(X m2+ 3
'112) , the average direction change rate MT, which is the average value of the inward direction change in the linear direction section, the linearity error A determined by equation (12), 2. seek. The average rate of change in direction is the amount of change in direction per unit length, and the unit is radian/dot.
(radian/dot) Also, a dot is a unit of unit length.
線形方向区間抽出装置8において方向変化を線形近似す
るには、第1図に示す実施例に於て線形方向区間抽出処
理で説明した手順をマイクロコンピュータに代表される
電子計算機のプログラムで実現し、これを電子計算機内
のメモリまたは外部記憶装置に読込まれた近似区間の中
心線点の位置座標列と方向列に対して・実行することに
より容易に実現できる。In order to linearly approximate the direction change in the linear direction section extraction device 8, the procedure explained in the linear direction section extraction process in the embodiment shown in FIG. This can be easily realized by executing this on the position coordinate string and direction string of the center line points of the approximation section that have been read into the memory within the computer or an external storage device.
線形方向区間抽出装置8は、K個の線形方向区間り、の
各々について、求めた平均方向変化率MT、 、2つの
端点座標E sll Em2を形状数値化装置9へ出力
し、更に、線形方向区間り、に対応した部分近似点列の
座標S、と平均方向変化率MT、、線形性誤差A、11
.2つの端点M II E 1゜Eatおよび線形方向
区間抽出装置8に入力された近似点列の点数nを線分円
弧判定装置10に出力する。The linear direction section extraction device 8 outputs the obtained average direction change rate MT, , and two end point coordinates E sll Em2 for each of the K linear direction sections to the shape digitization device 9, and further outputs the linear direction The coordinates S of the partial approximate point sequence corresponding to the interval , and the average direction change rate MT, linearity error A, 11
.. The two end points M II E 1°Eat and the number n of the approximate point sequence input to the linear direction section extraction device 8 are output to the line segment arc determination device 10 .
形状数値化装置9は線形方向区間抽出装置8から入力さ
れる2つの端点座標E1およびElと平均方向変化MT
、から円または円弧の半径と中心点の位置を求める。The shape digitization device 9 calculates the two end point coordinates E1 and El inputted from the linear direction section extraction device 8 and the average direction change MT.
Find the radius and center point of a circle or arc from .
まず、半径R,をR1がR,=1/IMT。First, the radius R, R1 is R, = 1/IMT.
に従って求め、次に2つの端点座標E1およびEffi
2を通り、半径R1の円の中心点O1を求める。Then, the two end point coordinates E1 and Effi
2 and find the center point O1 of the circle with radius R1.
これを満たす円の中心点として2つの候補点O,Iおよ
び0.2が求められるが、ベクトルOer l E w
r 1の偏角とベクトルOs+E+a*の偏角の変化量
の符号が、平均方向変化率MT、の符号と一致する中心
点Omlを選ぶことによって正しい中心点O1が求まる
。即ち、Arg(V)をベクトルマのX軸の正の向きか
ら右回りを正とする方向で計測した偏角、Sign(x
)を値Xの符号とするとき、式(13)を満たす中心点
01が求めるべき中心点O1となる。Two candidate points O, I and 0.2 are found as the center point of the circle that satisfies this, but the vector Oer l E w
The correct center point O1 is found by selecting the center point Oml where the sign of the change in the declination angle of r1 and the declination angle of the vector Os+E+a* matches the sign of the average direction change rate MT. In other words, the deviation angle, Sign(x
) is the sign of the value X, the center point 01 that satisfies equation (13) becomes the center point O1 to be found.
形状数値化装置9は求めた半径R1と中心点0、の座標
(0,、、O,、)を線分円弧判定装置10に出力する
。尚、形状数値化装置9はマイクロコンピュータに代表
される電子計算機のプログラムで実現し、線形方向区間
抽出装置8から入力される値に対して上記の処理を実行
することにより容易に実現できる。The shape digitizing device 9 outputs the calculated radius R1 and the coordinates (0,, O,,) of the center point 0 to the line segment arc determining device 10. Note that the shape digitization device 9 is realized by a program of an electronic computer such as a microcomputer, and can be easily realized by executing the above processing on the values input from the linear direction section extraction device 8.
線分円弧判定装置10は、線形方向区間抽出装置8から
入力される部分近似点列の座標S、と平均方向変化率M
T、 、線形性誤差A err % 2つの端点座標E
@11 Es2近似点列の点数n、および形状数値化
装置から入力される半径R1と中心点座標O1から各線
形方向区間り、が線分であるか円弧であるかを判定する
。The line segment arc determination device 10 calculates the coordinates S of the partial approximate point sequence input from the linear direction section extraction device 8 and the average direction change rate M.
T, , linearity error A err % two end point coordinates E
@11 Es2 It is determined whether each linear direction section is a line segment or a circular arc from the number n of the approximate point sequence, the radius R1 and the center point coordinates O1 input from the shape digitization device.
まず、部分近似点列S、の位置座標と半径R。First, the position coordinates and radius R of the partial approximate point sequence S.
より、式(14)および式(15)に従って近似点列の
線分近似誤差L 11 r rおよび円弧近似誤差Ce
r rを求める。According to equations (14) and (15), the line segment approximation error L 11 r r and the arc approximation error Ce of the approximate point sequence are
Find r r.
次にこの線分近似誤差L @ r Fおよび円弧近似誤
差Cerrを用いて、第1図に示す実施例で説明した条
件(1)および〈2)に従って第1の線分円弧判定を行
う。Next, using the line segment approximation error L@rF and the arc approximation error Cerr, a first line segment/arc determination is performed according to conditions (1) and <2) described in the embodiment shown in FIG.
これにより円弧であると判定された場合には、中心点O
aと2つの端点E ml + E s+2をそれぞれ結
ぶ方向θ1およびθ、2を円弧の開始角および終了角と
して求め、中心点01、半径R1、開始角θ1、終了角
θ0を円弧近似結果として出力する。If it is determined that it is a circular arc, the center point O
Find the directions θ1 and θ, 2 connecting a and the two end points E ml + E s+2, respectively, as the starting angle and ending angle of the arc, and output the center point 01, radius R1, starting angle θ1, and ending angle θ0 as the arc approximation result. do.
一方、線分であると判定された場合には2つの端点座標
E wa lおよびBatを線分近似結果として出力す
る。On the other hand, if it is determined that it is a line segment, two end point coordinates E wa l and Bat are output as the line segment approximation result.
第1の線分円弧判定でいづれにも判定できなかったとき
は、線形性誤差A111、平均方向変化率MT、、近似
点列の点数nおよび部分近似点列の点数n、を用いて、
第1図の実施例で説明した条件(3)および(4)に従
って第2の線分円弧判定を行う、これにより円弧である
と判定された場合には中心点Omと2つの端点E a
lおよびEffi2をそれぞれ結ぶ方向θ、Iおよびθ
、2を円弧の開始角および終了角として求め、中心点0
1、半径R1、開始角θ、I、終了θnを円弧近似結果
として出力する。一方、線分であると判定された場合に
は2つの端点座標E1およびE、を線分近似結果として
出力する。If the first line segment/arc determination fails, use the linearity error A111, the average direction change rate MT, the number n of the approximate point sequence, and the number n of the partial approximate point sequence,
The second line segment is determined as an arc according to conditions (3) and (4) explained in the example of FIG.
Directions θ, I and θ connecting l and Effi2, respectively
, 2 as the starting and ending angles of the arc, and the center point 0
1. Output the radius R1, start angle θ, I, and end θn as the circular arc approximation result. On the other hand, if it is determined that it is a line segment, the two end point coordinates E1 and E are output as the line segment approximation result.
制御装置11は、線形方向区間抽出装置8が抽出したに
個の線形方向区間について近似結果が線分円弧判定装置
10から出力されると、再び近似区間抽出装置6を起動
して、他の近似区間を抽出する。このとき、近似区間抽
出装置6から終了信号が制御装置11に送られると、1
1は全ての処理を終了する。これにより画像入力装置1
に記憶された全線画像が線分円弧近似される。When the line segment arc determining device 10 outputs the approximation results for the linear direction sections extracted by the linear direction section extracting device 8, the control device 11 starts up the approximate section extracting device 6 again and performs another approximation. Extract the interval. At this time, when an end signal is sent from the approximate interval extraction device 6 to the control device 11, 1
1 ends all processing. As a result, image input device 1
The entire line image stored in is approximated to a line segment arc.
(発明の効果〉
線画像上の平均方向変化率のみを用いて線分であるか円
弧であるかを判定する従来の方法では求めた方向の誤差
に影響され易い問題点があったのに対し、本発明におい
ては各近似区間の判定は平均方向変化率だけでなく、近
似結果と実際の中心線点との位置誤差も含めて判定して
いるため、微小な円弧や線分の角点などの方向が急激に
変化する点においても正しく判定することができる。(Effects of the invention) The conventional method of determining whether it is a line segment or an arc using only the average rate of change in direction on a line image had the problem of being susceptible to errors in the determined direction. In the present invention, each approximation section is determined not only based on the average direction change rate, but also the positional error between the approximation result and the actual center line point, so it is possible to determine Correct determination can be made even at points where the direction of the image changes rapidly.
また、入力された線画像の方向を線形近似することによ
って中心線を分割しているため、線分の部分と円弧の部
分を精度良く分離するという効果は損なわれない、従っ
て本発明は線分や円弧および円を含む線画像を、分岐点
や角点などの特徴点においても、あるいは曲率の大きな
円弧部分においても正しく近似することができる。In addition, since the center line is divided by linearly approximating the direction of the input line image, the effect of accurately separating the line segment portion and the circular arc portion is not impaired. It is possible to accurately approximate line images including lines, arcs, and circles at feature points such as branch points and corner points, or at arc portions with large curvature.
第1図は本発明の一実施例による線画像近似方法の手順
を表す図、第2図は本発明の他の実施例による線画像近
似装置の機能を表すブロック図、第3図は従来の手法に
よる動作を示す図である。
1・・・画像入力装置、2・・・中心線抽出装置、3・
・・中心線メモリ、4・・・方向画像生成装置、5・・
・方向画像メモ・す、6・・・近似点列抽出装置、7・
・・方向系列読出し装置、8・・・線形方向区間抽出装
置、9・・・形状数値化装置、10・・・線分円弧判定
装置、11・・・制御装置。FIG. 1 is a diagram showing the procedure of a line image approximation method according to an embodiment of the present invention, FIG. 2 is a block diagram showing the functions of a line image approximation device according to another embodiment of the present invention, and FIG. It is a figure showing operation by a method. 1... Image input device, 2... Center line extraction device, 3.
...Center line memory, 4...Direction image generation device, 5...
・Direction image memo・6...Approximate point sequence extraction device, 7・
...Direction series reading device, 8.. Linear direction section extraction device, 9.. Shape digitization device, 10.. Line segment arc determination device, 11.. Control device.
Claims (2)
す中心線画像と、線画像の各画素における線の方向を表
す方向画像から入力線画像を線分と円弧で近似する線図
形近似方法に於いて、 中心線画像上で任意の特徴点から他の特徴点に至る点列
の位置座標を近似点列として抽出する近似点列抽出処理
と、 前記近似点列における方向画像の方向の値を用いて、線
形な平均方向変化を有する複数の線形方向区間に近似点
列を分割し、各線形方向区間の平均方向変化率と線形性
誤差を算出する線形方向区間抽出処理と、 前記線形方向区間の近似点列の線分近似による位置誤差
、該近似点列の円弧近似による位置誤差、線形方向区間
の方向の線形性誤差、および近似点列長に対する線形方
向区間長の割合に基づいて前記線形方向区間が線分であ
るか円弧であるかを判定して近似を行う線分円弧判定処
理とを含むことを特徴とする線画像近似方法。(1) Approximate the input line image with line segments and circular arcs from the center line image representing the center line point of the line image obtained by scanning the line figure, and the direction image representing the direction of the line at each pixel of the line image. In the line figure approximation method, an approximate point sequence extraction process that extracts the positional coordinates of a point sequence from an arbitrary feature point to another feature point on a centerline image as an approximate point sequence; and a direction image in the approximate point sequence. A linear direction section extraction process that divides the approximate point sequence into a plurality of linear direction sections having a linear average direction change using the direction value, and calculates the average direction change rate and linearity error of each linear direction section. , a position error due to line segment approximation of the approximate point sequence of the linear direction section, a position error due to circular arc approximation of the approximate point sequence, a linearity error in the direction of the linear direction section, and a ratio of the linear direction section length to the approximate point sequence length. A line image approximation method comprising: a line segment/arc determination process of determining whether the linear direction section is a line segment or a circular arc based on the above and performing an approximation.
画像から求められる線の中心線点および前記線画像の各
位置における線の局所的方向をそれぞれ記憶する中心線
メモリおよび方向画像メモリを少なくとも備える線画像
近似装置において、前記中心線メモリから読出される任
意の特徴点から他の特徴点に至る中心線点の位置座標を
近似点列として出力する近似点列抽出手段と、該近似点
列に対応した位置における方向値を前記画像メモリから
読出す方向系列読出し手段と、前記方向系列上での方向
値の変化を線形近似して線形な平均方向変化を有する複
数の線形方向区間に近似点列を分割すると共に各線形方
向区間の平均方向変化率と線形性誤差を算出する線形方
向区間抽出手段と、前記線形方向区間ごとに近似点列の
線分近似による位置誤差、該近似点列の円弧近似による
位置誤差、線形方向区間の方向の線形性誤差、および近
似点列長に対する線形方向区間長の割合に基づいて該線
形方向区間が線分であるか円弧であるかを判定する線分
円弧判定手段とを備えて成る線画像近似装置。(2) A center line memory and a direction image that store the center line point of the line obtained from the line image obtained by scanning the line figure recorded on the paper surface and the local direction of the line at each position of the line image. A line image approximation device comprising at least a memory, comprising approximate point sequence extracting means for outputting positional coordinates of center line points from an arbitrary feature point read from the center line memory to another feature point as an approximate point sequence; direction series reading means for reading direction values at positions corresponding to the approximate point series from the image memory; and a plurality of linear direction sections having linear average direction changes by linearly approximating changes in direction values on the direction series. linear direction section extracting means that divides the approximate point sequence and calculates the average direction change rate and linearity error of each linear direction section; and a position error due to line segment approximation of the approximate point sequence for each linear direction section, Determine whether the linear direction section is a line segment or a circular arc based on the position error due to circular arc approximation of the point sequence, the linearity error in the direction of the linear direction section, and the ratio of the linear direction section length to the approximate point sequence length. A line image approximation device comprising: line segment/arc determining means.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP19877189A JPH0362269A (en) | 1989-07-31 | 1989-07-31 | Method and device for approximating line image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP19877189A JPH0362269A (en) | 1989-07-31 | 1989-07-31 | Method and device for approximating line image |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0362269A true JPH0362269A (en) | 1991-03-18 |
Family
ID=16396658
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP19877189A Pending JPH0362269A (en) | 1989-07-31 | 1989-07-31 | Method and device for approximating line image |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0362269A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007032683A (en) * | 2005-07-26 | 2007-02-08 | Toyo Valve Co Ltd | Butterfly valve |
US7180990B1 (en) | 1999-05-27 | 2007-02-20 | Mci, Llc | Prepaid telephone calling card with message recording capability |
JP4659927B1 (en) * | 2010-04-13 | 2011-03-30 | 株式会社巴技術研究所 | Butterfly valve body |
-
1989
- 1989-07-31 JP JP19877189A patent/JPH0362269A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7180990B1 (en) | 1999-05-27 | 2007-02-20 | Mci, Llc | Prepaid telephone calling card with message recording capability |
JP2007032683A (en) * | 2005-07-26 | 2007-02-08 | Toyo Valve Co Ltd | Butterfly valve |
JP4659927B1 (en) * | 2010-04-13 | 2011-03-30 | 株式会社巴技術研究所 | Butterfly valve body |
KR101476518B1 (en) * | 2010-04-13 | 2014-12-24 | 가부시키가이샤 도모에 기쥬츠 겐큐쇼 | Valve element of butterfly valve |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8340433B2 (en) | Image processing apparatus, electronic medium, and image processing method | |
CN111696130A (en) | Target tracking method, target tracking apparatus, and computer-readable storage medium | |
JPS60167069A (en) | Pattern recognizer | |
US4853885A (en) | Method of compressing character or pictorial image data using curve approximation | |
JPH0362269A (en) | Method and device for approximating line image | |
JPH04141783A (en) | Device and method for preparing electron beam graphic data | |
JP2845269B2 (en) | Figure shaping apparatus and figure shaping method | |
JPH11134509A (en) | Drawing recognition processing method and architectural drawing recognition processing method | |
JPH01134672A (en) | Divided image processing system | |
JPH1049688A (en) | Method for partial erasing method and partial detection method for picture data | |
KR101460350B1 (en) | Apparatus and method for recognizing maker recognition | |
JPH0624018B2 (en) | Ellipse detector | |
JPH04579A (en) | Method for extracting feature point of graphic | |
JPH10312460A (en) | Image processing method and high-precision image processing device | |
JP3344791B2 (en) | Line segment extraction method | |
JP2988697B2 (en) | Figure recognition method | |
JP2587812B2 (en) | Figure extraction method | |
JP2935331B2 (en) | Figure recognition device | |
CN113705430A (en) | Table detection method, device and equipment based on detection model and storage medium | |
JPH04141788A (en) | Device and method for thinning line distortion form automatic corrector | |
JPS63116279A (en) | Method for extracting building graphic from drawing reader | |
JPS5814709B2 (en) | Shape recognition method for closed shapes | |
JPH03168889A (en) | Character recognizing device | |
JPS61131085A (en) | Line figure identification processing method | |
JPH024031B2 (en) |