JP2689380B2 - Line figure folding device - Google Patents

Line figure folding device

Info

Publication number
JP2689380B2
JP2689380B2 JP62029593A JP2959387A JP2689380B2 JP 2689380 B2 JP2689380 B2 JP 2689380B2 JP 62029593 A JP62029593 A JP 62029593A JP 2959387 A JP2959387 A JP 2959387A JP 2689380 B2 JP2689380 B2 JP 2689380B2
Authority
JP
Japan
Prior art keywords
point
line
sequence
mechanism unit
distance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP62029593A
Other languages
Japanese (ja)
Other versions
JPS63198168A (en
Inventor
裕明 原田
正子 西嶋
能一 伊藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP62029593A priority Critical patent/JP2689380B2/en
Publication of JPS63198168A publication Critical patent/JPS63198168A/en
Application granted granted Critical
Publication of JP2689380B2 publication Critical patent/JP2689380B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Character Input (AREA)
  • Image Processing (AREA)

Description

【発明の詳細な説明】 〔概要〕 この発明は、線図形を折線化する線図形折線化装置に
おいて、細線化された細線化図形に対して折線近似する
際に、弧をなす細線化点列と弧をなす線分との距離が一
定の閾値よりも小さくなる点を順次折線で接続すること
によって線図形全体が非所望に歪んでしまうことを解決
するために、細線化する点列の総長および点列の両端を
結ぶ線分の長さに基づいて最適な閾値を決定して折線化
処理を行うことにより、品質の良好な折線を生成するよ
うにしている。 〔産業上の利用分野〕 本発明は、細線化する点列の総長および点列の両端を
結ぶ線分の長さに基づいて閾値を決定して折線化を行う
よう構成した線図形折線化装置に関するものである。 〔従来の技術と発明が解決しようとする問題点〕 文書や図面などのパターン情報を自動的に認識して正
確にコンピュータに入力するために、画像内に存在する
線図形をコンピュータにとって取り扱い易い折線データ
の形式に変換する必要がある。 従来、この折線化処理として、細線化・多角形近似方
式が広く使用されている。これは、線図形に対して細線
化処理を施した後、これに多角形近似を行う際に、弧を
なす細線化点列と、弦をなす線分との距離比較を一定の
閾値によって行っていた。例えば“6B"という文字に対
して、この閾値を大きく設定した場合には第9図(a)
に示すように線図形全体が非所望に粗く近似されてしま
い、他方、この閾値を小さく設定した場合には第9図
(b)に示すように直線が歪んだりして、不必要に細か
く近似されたりしてしまう。このように、線図形全体の
形状が歪んでしまったり、必要以上の折線数になってし
まうという問題点があった。この線図形の折線化に当た
っては、長い直線部のように粗く折線近似したい個所
と、シンボルや文字のように精度良く近似したい個所と
を分けて折線近似を行うことが望まれる。 〔問題点を解決するための手段〕 本発明は、前記問題点を解決するために、細線化され
た細線化図形の端点、分岐点および屈曲点からなる特徴
点を所定のマスクを用いて検出する特徴抽出機構部3
と、この特徴抽出機構部3によって検出された特徴点を
追跡し、この特徴点に関する距離情報を点カウンタ6に
格納すると共に、この特徴点に関する位置情報を点テー
ブル7に格納する線追跡機構部5と、点カウンタ6およ
び点テーブル7に格納された情報に基づいて近似精度を
決定する近似精度決定機構部8と、点テーブル7に登録
してある点列について距離計算を施す距離計算機構部9
とを設け、この距離計算機構部9によって距離計算され
た結果が、上記近似精度決定機構部8によって決定され
た近似精度よりも小さくなるまで順次繰り返し処理を行
い、その結果を出力するようにしている。 第1図は本発明の原理構成図を示す。図中画像メモリ
1は、細線化機構部10によって細線化された細線化図形
を格納するものである。 初期設定機構部2は、各種初期値および閾値などを設
定するものである。 特徴抽出機構部3は、画像メモリ1から読み出した細
線化図形の点列から端点、分岐点および屈曲点からなる
特徴点を検出し、この検出した特徴点情報を該当する点
列に対応づけて格納するものである。 マスクメモリ4は、特徴点を検出するためのマスクを
格納するものである。 線追跡機構部5は、細線化図形の点列を追跡して点列
の距離情報を点カウンタ5に格納すると共に、点列中の
特徴点の位置情報を点テーブル7に格納するものであ
る。 点カウンタ6は、点列の始点と終点との間の距離を算
出するための距離情報を格納するものである。 点テーブル7は、特徴点の位置情報などを格納するも
のである。 近似精度決定機構部8は、点カウンタ6および点テー
ブル7に格納された値から初期設定した所定の近似精度
(閾値)のいずれかを選択する態様で決定するものであ
る。 距離計算機構部9は、計算した各点列からの距離が、
近似精度決定機構部8によって決定された近似精度より
も小さくなるまで繰り返し距離計算を行って折線化を行
うものである。 細線化機構部10は、スキャナーなどによって生成され
た画像に対して既知の細線化処理を行うものである。 〔作用〕 次に動作を説明する。 第1図において、特徴抽出機構部3は、画像メモリ1
中から読み出した細線化図形の各点列に対してマスクメ
モリ4から読み出したマスクとの照合を行い、端点(始
点および終点を以下“端点”という)、分岐点および屈
曲点からなる特徴点を抽出し、この情報を各点列に対応
づけて格納する。線追跡機構部5は、細線化図形の点列
の追跡を行い、この追跡を行った点列の始点P0から終点
Pnまでの距離情報を点カウンタ6に格納すると共に、屈
曲点などの位置情報を点テーブル7に格納する。近似精
度決定機構部8は、この点カウンタ6および点テーブル
7に格納された距離情報および位置情報に基づいて、折
線化処理を行おうとする細線化図形毎に近似精度(折線
化する際の閾値)を決定する。距離計算機構部9は、点
テーブル7を参照して距離を計算し、これが決定された
近似精度よりも小さくなるまで、順次折線近似処理を行
い、その結果を出力する。 以上のように、折線化処理を行おうとする細線化図形
の点列の始終点間(端点である始点と終点間を以下“始
終点間”という)の距離dおよび始終点間の直線距離L
に基づいて近似精度を決定し、この近似精度よりも各点
列の距離が小さくなるまで繰り返し折線化処理を行うこ
とにより、細線化図形の形状に対応したふさわしい近似
精度を用いて折線化を行うことが可能となる。 〔実施例〕 次に、第2図ないし第8図を用いて本発明の1実施例
の構成および動作を詳細に説明する。 第2図は細線化図形例を示す。これは、既知の方法に
よって既に細線化された折線化すべき細線化点列をP
i(i=0ないしn)とし、これらの両端の端点をP0
よびPnとする。この細線化点列Piの点列に沿った距離を
L、始点PPと終点Pnとの間の直線距離をdとする。 第3図(a)、(b)および(c)は、端点、分岐点
および屈曲点からなる特徴点を検出するためのマスク例
を夫々示す。図中黒領域が細線化図形の点列に対応する
ときに一致するものと判別される。このマスクパターン
は、マスクメモリ4中に格納されている。尚、これらマ
スクに対して、90゜回転および鏡像パターンの点列に対
してもマッチングが行われる。 第4図は特徴点の表示例を示す。これは、特徴抽出機
構部3が細線化図形の点列に対して第3図(a)ないし
(c)のマスクのマッチングを行い、その結果を各点列
に対して格納するためのものである。図中画素値“0"
は、画像メモリ1中に格納された細線化図形の点列のう
ち、背景の白画素を示す。画素値“1"は特徴点に対応し
ない黒画素を示す。画素値“2"は端点例えば2図P0およ
びPnの黒画素を示す。画素値“3"は分岐点の黒画素を示
す。画素値“4"は屈曲点の黒画素を示す。 第5図は点カウンタ例を示す。これは、線追跡機構部
5が、細線化図形の点列の追跡を行い、ある点列の次の
点列が垂直および水平方向の時にn1の部分をインクレメ
ントし、ある点列の次の点列が45゜方向の時にn2の部分
をインクレメントして、点列の距離L(第2図距離L)
を算出するためのものである。 第6図は点テーブル例を示す。これは、線追跡機構部
5が、細線化図形の点列の追跡を行い、屈曲点(画素値
“4")が出現した場合にこの屈曲点の座標をXiおよびYi
を登録するものである。ここで、始点P0(X0、Y0)およ
び終点Pn(Xn、Yn)には、1を立てておく。尚、端点
(画素値“2")および分岐点(画素値“3")が出現した
場合には、ここで追跡を停止し、この点Pnを端点として
登録する。このように、点テーブル7は、端点、分岐
点、および屈曲点のみが登録され、同じ方向に続く第2
番目以降の点列が登録されないので弧を形成する全ての
点を記録して計算する場合よりもデータ量が削減され、
高速に演算処理を行うことが可能となる。 次に、第7図を用いて動作を詳細に説明する。 第7図において、図中は、初期設定を行う状態を示
す。これは、第1図初期設定機構部2から初期値k1
k2、k3、h1、およびh2を入力して設定することを意味し
ている。 図中は、画像読み込みを行う状態を示す。これは、
スキャナーを用いて原稿を走査して2値画像を生成し、
画像メモリ1中に格納することを意味している。 図中は、細線化を行う状態を示す。これは、画像メ
モリ1中に格納された2値画像中の線図形に対して既知
の細線化処理を施すことを意味している。これにより、
各線図形が第2図に示すような点列P0ないしPnによって
表現される。 図中は、特徴抽出を行う状態を示す。これは、既述
したように、特徴抽出機構部3が、点列P0ないしPnによ
って表される細線化図形に対して、第3図に示すマスク
とのマッチングを行い、この結果を第4図に示すような
画素値を用いて各点に格納することを意味している。 図中は、線追跡を行う状態を示す。これは、線追跡
機構部5が、特徴抽出された細線化図形の点列P0ないし
Pnの追跡を行い、これら点列間の距離情報を点カウンタ
6に既述したようにインクレメントする態様で格納する
と共に、始点P0、屈曲点Pi、終点Pnの位置情報などを第
6図に示すように点テーブル7に登録することを意味し
ている。 図中は、近似精度の決定を行う状態を示す。これ
は、第1に、開始点P0と終点Pnとを結ぶ線分の長さdを
下式を用いて計算する。 d={(X0−Xn+(Y0−Yn1/2 ……(1) ここで、(X0、Y0)は始点P0の座標、(Xn、Yn)は終
点Pnの座標を表す。 第2に、点カウンタ6に保持されているn1およびn2
値から下式を用いて始点P0と終点Pnとの間の弧の長さL
を計算する。 L=n1+(2)1/2×n2 ……(2) ここで、n1は既述したように垂直および水平方向に点
列が続いた数、n2は45゜方向に点列が続いた数を表す。 第3に、下式の条件を用いて折線化するための近似精
度(閾値)Hを決定する。 L≦k1 ……(3) d≦k2 ……(4) d/L≦k3 ……(5) 上記式(3)ないし(5)が満足された場合、 近似精度H=h1と決定する。 上記式(3)ないし(5)が満足されない場合、 近似精度H=h2(h2≧h1)と決定する。 図中は、距離計算を行う状態を示す。これは、図中
で決定した近似精度Hよりも、点テーブル7に登録さ
れている点列について計算した距離が小さくなるまで繰
り返し折線化処理を行うことを意味している。以下第8
図を用いて具体的に説明する。まず、点テーブル7に登
録されている始点P0と終点Pnとを線分で結び、各点から
この線分に垂線を引き、この垂線の距離の最大のもの例
えば第8図点Piからおろした垂線の距離hmaxを求める。
この求めたhmaxが、図中で決定した近似精度Hに比較
して小さい場合には、当該始点P0と終点Pnとを結ぶ線分
が求める折線である。一方、距離hmaxが近似精度Hより
も大きい場合には、この点Piに対応する点テーブル7中
の位置に“1"を格納し、始点P0とこの新たに登録した点
Piを終点として距離hmaxを求めると共に、この点Piと終
点Pnとに対しても同様に距離hmaxを求める。以下同様
に、この求めた距離hmaxが近似精度Hよりも小さくなる
まで、繰り返し実行する。そして、点テーブル7に登録
された“1"が登録された点を順次結ぶことにより、所望
の折線が得られる。 次に、初期値k1、k2、k3、h1、h2について具体的数値
例を用い、第10図の(a)、(c)を参照して詳細に説
明する。 処理対象は、第10図の(a)に示すように、既に細線
化処理を施して幅1画素になっている画像である。目的
は下部の直線部分(点列C)はできるだけ滑らかな線分
で、文字“6"の部分(点列A、B)はできるだけ細かな
線分で近似することにある。 第10図の(a)において、点列Aは点A1から点A10ま
での計10点、点列Bは点B1(点A10と同じ)から点B1に
戻ってくるまでの計18点、点列Cは点C1から点C24まで
の計24点から構成されているものとする。 第10図の(b)は、従来技術による線分の折線近似結
果(太線で表す)を示す。ここでは、近似をコントロー
ルする距離の閾値H(明細書第12頁第19行に記載)を例
として2.5(画素)に固定している。従来技術では図形
の込み具合や点列の長さなどをいっさい考慮しないで、
閾値Hのみで近似するため、点列Cは滑らかな線分とな
っている反面、点列A、点列Bは字体がくずれてしまっ
ている。 第10図の(c)は、本発明の技術を用い、第10図の
(a)について処理した結果を示す。実施例としてここ
では次のような初期値を設定した(明細書第10頁第18行
〜第20行、および第12頁第18行〜第13頁第6行の説明に
対応する)。 ・点列長の閾値 k1=20(画素) ・点列長の閾値 k2=20(画素) ・曲線度の閾値 k3=0.9 ・近似精度 h1=1.0(画素) ・近似精度 h2=2.5(画素) 第10図の(a)の右側に示すように、 ・点列Aについて ・弧の長さ(点列長)L=10.2 ・端点間距離 d=8.48 ・曲線度 d/L=0.83 ・点列Bについて ・弧の長さ(点列長)L=19 ・端点間距離 d=15.23 ・曲線度 d/L=0.80 ・点列Cについて ・弧の長さ(点列長)L=24.6 ・端点間距離 d=23 ・曲線度 d/L=0.93 以上のデータから明細書第12頁第18行〜第13頁第6行
までの条件(3)、(4)、(5)に当てはめて、それ
ぞれの値を設定すると、 ・点列Aは、条件(3)、(4)、(5)を満足するの
で、近似精度H=h1=1.0と決定される。 ・点列Bは、条件(3)、(4)、(5)を満足するの
で、近似精度H=h1=1.0と決定される。 ・点列Cは、条件(3)、(4)、(5)を満足しない
ので、近似精度H=h2=2.5と決定される。 このように決定された近似精度でそれぞれの点列A、
B、Cを折線近似処理を行うと第10図の(c)の太い直
線で結んだように、点A4、A7、B5、B10、B13が屈曲点と
して検出され、所望の折線形状が得られる。 〔発明の効果〕 以上説明したように、本発明によれば、細線化する点
列の総長および点列の両端を結ぶ線分の長さに基づいて
最適な閾値(近似精度)を決定し、この閾値よりも小さ
い距離が得られるまで距離計算を行う構成を採用してい
るため、長い直線部分のように粗く折線近似したい個所
と、文字などの細かく折線近似したい個所とを簡単な判
定で識別し、それぞれにふさわしい閾値を用いて折線化
を行い、品質の良好な折線を得ることができる。また、
特徴点として端点、分岐点、および屈曲点を検出し、こ
れらの点のみを点テーブル7に登録して距離計算の対象
とする構成を採用しているため、少ない計算処理によっ
て折線化処理を高速に行うことができる。
DETAILED DESCRIPTION OF THE INVENTION [Outline] The present invention relates to a line-figure polygonalization device for polygonalizing a line figure, and when performing line-approximation to a thinned figure that has been thinned, a thinned point sequence forming an arc. In order to solve the problem that the whole line figure is undesirably distorted by connecting the points where the distance between the line segment that forms the arc and the line segment that forms an arc becomes smaller than a certain threshold value in sequence, the total length of the point sequence to be thinned Also, an optimal threshold value is determined based on the length of a line segment that connects both ends of the point sequence and the folding process is performed to generate a polygonal line with good quality. [Field of Industrial Application] The present invention is a line figure folding device configured to determine a threshold value based on the total length of a point sequence to be thinned and the length of a line segment connecting both ends of the point sequence to perform line folding. It is about. [Problems to be Solved by Conventional Techniques and Inventions] In order to automatically recognize pattern information such as documents and drawings and accurately input it to a computer, a polygonal line existing in an image is easy to handle for a computer. Need to convert to data format. Conventionally, a thinning / polygonal approximation method has been widely used as this polygonalization processing. This is because after performing thinning processing on a line figure, when performing polygonal approximation to this, the distance comparison between the thinning point sequence forming an arc and the line segment forming the chord is performed using a certain threshold value. Was there. For example, when the threshold value is set large for the character "6B", it is shown in FIG. 9 (a).
As shown in Fig. 9, the whole line figure is undesirably coarsely approximated. On the other hand, when this threshold value is set to be small, the straight line is distorted as shown in Fig. 9 (b), and unnecessarily finely approximated. It will be done. As described above, there are problems in that the shape of the entire line figure is distorted or the number of broken lines becomes larger than necessary. In making a polygonal line of this line figure, it is desirable to perform the polygonal line approximation separately for a portion such as a long straight line portion to be roughly approximated to a polygonal line and a portion such as a symbol or a character to be accurately approximated. [Means for Solving Problems] In order to solve the above problems, the present invention detects a feature point including an end point, a branch point, and a bending point of a thinned thinned figure using a predetermined mask. Feature extraction mechanism section 3
And a line tracking mechanism unit that traces the feature points detected by the feature extraction mechanism unit 3, stores distance information about the feature points in the point counter 6, and stores position information about the feature points in the point table 7. 5, an approximation accuracy determination mechanism unit 8 that determines the approximation accuracy based on the information stored in the point counter 6 and the point table 7, and a distance calculation mechanism unit that calculates the distance for the point sequence registered in the point table 7. 9
Is provided, the distance calculation result is calculated by the distance calculation mechanism unit 9 until the result becomes smaller than the approximation precision determined by the approximation precision determination mechanism unit 8, and the result is output. There is. FIG. 1 shows a principle configuration diagram of the present invention. The image memory 1 in the figure stores thinned figures thinned by the thinning mechanism unit 10. The initial setting mechanism unit 2 sets various initial values and threshold values. The feature extraction mechanism unit 3 detects a feature point consisting of an end point, a branch point, and a bending point from the point sequence of the thinned figure read from the image memory 1, and associates the detected feature point information with the corresponding point sequence. It is something to store. The mask memory 4 stores a mask for detecting feature points. The line tracking mechanism unit 5 tracks the point sequence of the thinned figure, stores the distance information of the point sequence in the point counter 5, and stores the position information of the characteristic points in the point sequence in the point table 7. . The point counter 6 stores distance information for calculating the distance between the start point and the end point of the point sequence. The point table 7 stores position information of feature points and the like. The approximation precision determination mechanism unit 8 determines in a mode of selecting one of the predetermined approximation precision (threshold value) initialized from the values stored in the point counter 6 and the point table 7. The distance calculation mechanism unit 9 calculates that the calculated distance from each point sequence is
The linear distance is calculated by repeatedly calculating the distance until it becomes smaller than the approximation accuracy determined by the approximation accuracy determining mechanism unit 8. The thinning mechanism unit 10 performs known thinning processing on an image generated by a scanner or the like. [Operation] Next, the operation will be described. In FIG. 1, the feature extraction mechanism unit 3 includes an image memory 1
Each point sequence of the thinned figure read out from the inside is collated with the mask read out from the mask memory 4, and characteristic points consisting of end points (starting point and ending point are hereinafter referred to as “end points”), branch points and bending points are identified. It is extracted and this information is stored in association with each point sequence. The line tracing mechanism unit 5 traces the point sequence of the thinned figure, and starts from the start point P 0 to the end point of the traced point sequence.
The distance information up to P n is stored in the point counter 6, and the position information such as the bending point is stored in the point table 7. The approximation accuracy determination mechanism unit 8 uses the distance information and the position information stored in the point counter 6 and the point table 7 to calculate the approximation accuracy (threshold value at the time of polygonalization) for each thinned figure to be subjected to linearization processing. ) Is determined. The distance calculation mechanism unit 9 calculates the distance by referring to the point table 7, sequentially performs the polygonal line approximation processing until the distance becomes smaller than the determined approximation accuracy, and outputs the result. As described above, the distance d between the start and end points (between the start point and the end point, which is the end point, is referred to as “start and end point” below) of the point sequence of the thinned figure for which the linearization processing is to be performed, and the straight line distance L between the start and end points.
The approximation accuracy is determined based on the approximation accuracy, and iterative linearization processing is performed until the distance of each point sequence becomes smaller than this approximation accuracy, so that the approximation accuracy suitable for the shape of the thinned figure is used to perform the polygonalization. It becomes possible. [Embodiment] Next, the configuration and operation of one embodiment of the present invention will be described in detail with reference to FIG. 2 to FIG. FIG. 2 shows an example of a thinned graphic. This is the thinning point sequence to be broken that has already been thinned by the known method.
Let i (i = 0 to n) and the endpoints of these ends be P 0 and P n . Let L be the distance along the point sequence of this thinned point sequence P i , and d be the straight line distance between the start point P P and the end point P n . FIGS. 3 (a), (b) and (c) show mask examples for detecting feature points consisting of end points, branch points and bending points, respectively. When the black area in the figure corresponds to the point sequence of the thinned figure, it is determined that they match. This mask pattern is stored in the mask memory 4. It should be noted that these masks are rotated by 90 ° and matching is also performed on the point sequence of the mirror image pattern. FIG. 4 shows a display example of feature points. This is because the feature extraction mechanism unit 3 performs the mask matching shown in FIGS. 3A to 3C on the point sequence of the thinned figure and stores the result for each point sequence. is there. Pixel value “0” in the figure
Indicates a white pixel in the background of the point sequence of the thinned figure stored in the image memory 1. The pixel value "1" indicates a black pixel that does not correspond to a feature point. The pixel value "2" indicates an end point, for example, a black pixel at P 0 and P n in FIG. The pixel value “3” indicates a black pixel at the branch point. The pixel value “4” indicates a black pixel at the bending point. FIG. 5 shows an example of a point counter. This is because the line tracing mechanism unit 5 traces the point sequence of the thinned figure, increments n1 when the next point sequence of a certain point sequence is in the vertical and horizontal directions, and When the point sequence is in the 45 ° direction, the n2 part is incremented and the distance L of the point sequence (distance L in FIG. 2)
For calculating. FIG. 6 shows an example of a point table. This is because the line tracking mechanism unit 5 traces the point sequence of the thinned figure, and when a bending point (pixel value “4”) appears, the coordinates of this bending point are set to X i and Y i.
Is to be registered. Here, 1 is set at the start point P 0 (X 0 , Y 0 ) and the end point P n (X n , Y n ). When an end point (pixel value “2”) and a branch point (pixel value “3”) appear, tracking is stopped here and this point P n is registered as an end point. Thus, in the point table 7, only the end points, the branch points, and the inflection points are registered, and the second table continuing in the same direction is registered.
Since the point sequence after the th is not registered, the amount of data is reduced compared to the case where all the points forming an arc are recorded and calculated,
It is possible to perform arithmetic processing at high speed. Next, the operation will be described in detail with reference to FIG. In FIG. 7, the figure shows a state in which initial setting is performed. This is the initial value k 1 from the initial setting mechanism unit 2 in FIG.
It means to input and set k 2 , k 3 , h 1 , and h 2 . The figure shows a state in which an image is read. this is,
Scan a document with a scanner to generate a binary image,
It means storing in the image memory 1. The figure shows a state in which thinning is performed. This means that a known thinning process is performed on the line figure in the binary image stored in the image memory 1. This allows
Each line figure is represented by a series of points P 0 to P n as shown in FIG. The figure shows a state in which feature extraction is performed. As described above, the feature extraction mechanism unit 3 performs matching with the mask shown in FIG. 3 for the thinned figure represented by the point sequences P 0 to P n , and the result is This means storing at each point using pixel values as shown in FIG. The figure shows a state in which line tracing is performed. This is because the line tracking mechanism unit 5 uses the point sequence P 0 to P 0 to
P n is tracked and the distance information between these point sequences is stored in the point counter 6 in the incrementing manner as described above, and the position information of the start point P 0 , the bending point P i , the end point P n , etc. are stored. This means registration in the point table 7 as shown in FIG. The figure shows a state in which the approximation accuracy is determined. First, the length d of the line segment connecting the start point P 0 and the end point P n is calculated using the following formula. d = {(X 0 -X n ) 2 + (Y 0 -Y n) 2} 1/2 ...... (1) where, (X 0, Y 0) is the starting point P 0 coordinates, (X n, Y n ) represents the coordinates of the end point P n . Secondly, the length L of the arc between the start point P 0 and the end point P n is calculated from the values of n 1 and n 2 held in the point counter 6 using the following formula.
Is calculated. L = n 1 + (2) 1/2 × n 2 ...... (2) where n 1 is the number of consecutive points in the vertical and horizontal directions, as already mentioned, and n 2 is the point in the 45 ° direction. Represents the number of consecutive columns. Thirdly, the approximation accuracy (threshold value) H for making a broken line is determined using the condition of the following equation. L ≦ k 1 (3) d ≦ k 2 (4) d / L ≦ k 3 (5) When the above formulas (3) to (5) are satisfied, the approximation accuracy H = h 1 To decide. When the above equations (3) to (5) are not satisfied, it is determined that the approximation accuracy H = h 2 (h 2 ≧ h 1 ). The figure shows a state in which distance calculation is performed. This means that the folding process is repeatedly performed until the distance calculated for the point sequence registered in the point table 7 becomes smaller than the approximation accuracy H determined in the figure. 8th below
A specific description will be given with reference to the drawings. First, the starting point P 0 and the ending point P n registered in the point table 7 are connected by a line segment, a perpendicular line is drawn from each point to this line segment, and the maximum distance of this perpendicular line, for example, the point P i in FIG. Find the distance h max of the vertical line drawn from.
When the obtained h max is smaller than the approximation accuracy H determined in the figure, the line segment connecting the start point P 0 and the end point P n is the broken line to be obtained. On the other hand, when the distance h max is larger than the approximation accuracy H, “1” is stored at the position in the point table 7 corresponding to this point P i , and the start point P 0 and this newly registered point are stored.
The P i with obtaining a distance h max as an end point, obtaining the same manner distance h max against and this point P i and the ending point P n. Similarly, the process is repeated until the obtained distance h max becomes smaller than the approximation accuracy H. Then, a desired polygonal line is obtained by sequentially connecting the points registered with "1" registered in the point table 7. Next, the initial values k1, k2, k3, h1, and h2 will be described in detail with reference to (a) and (c) of FIG. 10 using specific numerical examples. As shown in FIG. 10 (a), the processing target is an image which has already been subjected to the thinning process and has a width of 1 pixel. The purpose is to approximate the lower straight line portion (point sequence C) by a line segment that is as smooth as possible, and the portion of the character "6" (point sequence A, B) by a line segment that is as fine as possible. In Fig. 10 (a), the point sequence A is 10 points in total from points A1 to A10, and the point sequence B is 18 points in total from point B1 (same as point A10) to returning to point B1. Row C is assumed to be composed of a total of 24 points from point C1 to point C24. FIG. 10 (b) shows a polygonal line approximation result (represented by a thick line) according to the prior art. Here, the distance threshold H (described on page 12, line 19 of the specification) for controlling the approximation is fixed at 2.5 (pixels) as an example. In the prior art, without taking into consideration the complexity of figures and the length of point sequences,
Since the approximation is performed only by the threshold value H, the point sequence C is a smooth line segment, while the character sequences of the point sequences A and B are collapsed. FIG. 10 (c) shows the result of processing on FIG. 10 (a) using the technique of the present invention. As an example, the following initial values were set here (corresponding to the description on page 10, line 18 to line 20, and page 12, line 18 to page 13, line 6 of the specification).・ Point sequence length threshold k1 = 20 (pixels) ・ Point sequence length threshold k2 = 20 (pixels) ・ Curticity threshold k3 = 0.9 ・ Approximation accuracy h1 = 1.0 (pixels) ・ Approximation accuracy h2 = 2.5 (pixels) As shown on the right side of (a) in Fig. 10, ・ About point sequence A ・ Arc length (point sequence length) L = 10.2 ・ Distance between end points d = 8.48 ・ Curveness d / L = 0.83 ・ Point sequence About B ・ Arc length (point sequence length) L = 19 ・ Distance between end points d = 15.23 ・ Curveness d / L = 0.80 ・ About point sequence C ・ Arc length (point sequence length) L = 24.6 ・ End point Distance d = 23 · Curvature d / L = 0.93 Apply the above data to the conditions (3), (4) and (5) from page 12 line 18 to page 13 line 6 of the specification, When the respective values are set, the point sequence A satisfies the conditions (3), (4), and (5), so it is determined that the approximation accuracy H = h1 = 1.0. Since the point sequence B satisfies the conditions (3), (4), and (5), it is determined that the approximation accuracy H = h1 = 1.0. Since the point sequence C does not satisfy the conditions (3), (4), and (5), it is determined that the approximation accuracy H = h2 = 2.5. Each point sequence A, with the approximation accuracy determined in this way,
When B and C are subjected to the polygonal line approximation processing, the points A4, A7, B5, B10 and B13 are detected as bending points and the desired polygonal line shape is obtained as if they were connected by the thick straight line in (c) of FIG. . [Effects of the Invention] As described above, according to the present invention, the optimum threshold value (approximation accuracy) is determined based on the total length of the thinned point sequence and the length of the line segment connecting both ends of the point sequence, Since a configuration that calculates the distance until a distance smaller than this threshold is obtained, it is possible to easily discriminate between places where rough line approximation is desired, such as a long straight line portion, and where fine line approximation is desired, such as characters. However, it is possible to obtain a polygonal line with good quality by performing polygonal line formation using threshold values suitable for each. Also,
Since the end point, the branch point, and the bending point are detected as the characteristic points and only those points are registered in the point table 7 to be the object of the distance calculation, the polygonalization processing can be performed at a high speed with a small amount of calculation processing. Can be done.

【図面の簡単な説明】 第1図は本発明の原理構成図、第2図は細線化図形例、
第3図は特徴点検出マスク例、第4図は特徴点表示例、
第5図は点カウンタ例、第6図は点テーブル例、第7図
は本発明の動作説明フローチャート、第8図は折線化説
明図、第9図は従来装置の動作説明図、第10図は折線化
処理具体例説明図を示す。 図中1は画像メモリ、2は初期設定機構部、3は特徴抽
出機構部、4はマスクメモリ、5は線追跡機構部、6は
点カウンタ、7は点テーブル、8は近似精度決定機構
部、9は距離計算機構部、10は細線化機構部を表す。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram of the principle of the present invention, FIG. 2 is an example of a thinned figure,
FIG. 3 is an example of a feature point detection mask, FIG. 4 is an example of feature point display,
FIG. 5 is an example of a point counter, FIG. 6 is an example of a point table, FIG. 7 is a flowchart for explaining the operation of the present invention, FIG. 8 is a broken line explanatory view, FIG. 9 is an operation explanatory view of a conventional device, and FIG. Shows an explanatory diagram of a specific example of the linearization processing. In the figure, 1 is an image memory, 2 is an initial setting mechanism unit, 3 is a feature extraction mechanism unit, 4 is a mask memory, 5 is a line tracking mechanism unit, 6 is a point counter, 7 is a point table, and 8 is an approximate accuracy determination mechanism unit. , 9 represents a distance calculation mechanism unit, and 10 represents a thinning mechanism unit.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 伊藤 能一 川崎市中原区上小田中1015番地 富士通 株式会社内 (56)参考文献 特開 昭58−134747(JP,A) 特開 昭60−215283(JP,A) 特開 昭60−201475(JP,A) 特開 昭60−49483(JP,A) 特開 昭61−208585(JP,A)   ────────────────────────────────────────────────── ─── Continuation of front page    (72) Inventor Noichi Ito               Fujitsu, 1015 Ueodanaka, Nakahara-ku, Kawasaki-shi               Inside the corporation                (56) References JP-A-58-134747 (JP, A)                 JP-A-60-215283 (JP, A)                 JP 60-201475 (JP, A)                 JP-A-60-49483 (JP, A)                 JP 61-208585 (JP, A)

Claims (1)

(57)【特許請求の範囲】 1.線図形を細線化する線図形折線化装置において、 細線化された細線化図形の端点、分岐点および屈曲点か
らなる特徴点を所定のマスクを用いて検出する特徴抽出
機構部(3)と、 この特徴抽出機構部(3)によって検出された特徴点の
点列を追跡し、この点列によって構成される弧の長さで
ある点列長情報を点カウンタ(6)に格納すると共に、
各列の各点の点位置情報を点テーブル(7)に格納する
線追跡機構部(5)と、 上記点カウンタ(6)に格納された点列長情報によって
求めた始点から終点に向かう各点に沿った長さL、およ
び上記点テーブル(7)に格納された点位置情報中の始
点と終点を結んだ線分の長さdを求め、L、d、d/Lを
もとに近似精度を決定する近似精度決定機構(8)と、 上記点テーブル(7)に格納してある点列について、1
つの弧をなす連続した点列の始点と終点との間を結ぶ直
線(以下基準線という)から弧をなす各点への垂直距離
計算を施し、点列内において最大の距離になる点および
そのときの最大距離値を検出する距離決算機構部(9)
とを備え、 上記近似精度に基づいて上記基準線を近似線分と判定す
ることを特徴とする線図形折線化装置。
(57) [Claims] In a line figure folding device for thinning a line figure, a feature extraction mechanism section (3) for detecting a feature point consisting of an end point, a branch point, and a bending point of the thinned figure that has been thinned using a predetermined mask, The point sequence of the feature points detected by the feature extraction mechanism unit (3) is tracked, and the point sequence length information that is the length of the arc formed by the point sequence is stored in the point counter (6).
A line tracking mechanism unit (5) that stores point position information of each point in each column in a point table (7), and a line tracking mechanism unit (5) that moves from a start point to an end point obtained by the point sequence length information stored in the point counter (6). The length L along the point and the length d of the line segment connecting the start point and the end point in the point position information stored in the point table (7) are obtained, and based on L, d, d / L For the approximation accuracy determination mechanism (8) that determines the approximation accuracy and the point sequence stored in the point table (7), 1
Calculate the vertical distance from a straight line (hereinafter referred to as a reference line) that connects the start point and the end point of a continuous point sequence that forms one arc to each point that forms the arc, and the point with the maximum distance in the point sequence and its Distance settlement mechanism unit (9) to detect the maximum distance value when
And a line-figure polygonalization device, wherein the reference line is determined as an approximate line segment based on the approximation accuracy.
JP62029593A 1987-02-13 1987-02-13 Line figure folding device Expired - Lifetime JP2689380B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62029593A JP2689380B2 (en) 1987-02-13 1987-02-13 Line figure folding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62029593A JP2689380B2 (en) 1987-02-13 1987-02-13 Line figure folding device

Publications (2)

Publication Number Publication Date
JPS63198168A JPS63198168A (en) 1988-08-16
JP2689380B2 true JP2689380B2 (en) 1997-12-10

Family

ID=12280370

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62029593A Expired - Lifetime JP2689380B2 (en) 1987-02-13 1987-02-13 Line figure folding device

Country Status (1)

Country Link
JP (1) JP2689380B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02148184A (en) * 1988-11-29 1990-06-07 Nec Corp System for displaying graphics of continuous line at high speed
JP4908867B2 (en) * 2005-11-01 2012-04-04 株式会社日立ソリューションズ Geographic image processing system

Also Published As

Publication number Publication date
JPS63198168A (en) 1988-08-16

Similar Documents

Publication Publication Date Title
US7342572B2 (en) System and method for transforming an ordinary computer monitor into a touch screen
US6473523B1 (en) Portable text capturing method and device therefor
JP2940960B2 (en) Image tilt detection method and correction method, and image information processing apparatus
CN113748429A (en) Word recognition method, device and storage medium
JPH0935062A (en) Image processing method
JP2689380B2 (en) Line figure folding device
JP3066173B2 (en) Pattern matching method
JP2626528B2 (en) Figure recognition device
US20240104919A1 (en) Information processing apparatus and information processing method
HUT75820A (en) Method of stroke segmentation for handwritten input
JP3066137B2 (en) Pattern matching method
JP7232663B2 (en) Image processing device and image processing method
JP2846486B2 (en) Image input device
JP2559359B2 (en) Image structure storage method and image registration apparatus
JP2682416B2 (en) Figure recognition device
JP2954778B2 (en) Method for connecting line figure branch point of image input device
JP2661494B2 (en) Division point setting method
JPH0628476A (en) Processor for image signal
JP3311551B2 (en) Image data input processing method and apparatus
JP2587812B2 (en) Figure extraction method
JP2755299B2 (en) Image processing method
JP2633523B2 (en) Handwriting input device
JP2778439B2 (en) Figure recognition device
JP2935331B2 (en) Figure recognition device
JP2005071243A (en) Image processing apparatus, method and program