JPH0495180A - Segment/curve recognizing system - Google Patents

Segment/curve recognizing system

Info

Publication number
JPH0495180A
JPH0495180A JP20811990A JP20811990A JPH0495180A JP H0495180 A JPH0495180 A JP H0495180A JP 20811990 A JP20811990 A JP 20811990A JP 20811990 A JP20811990 A JP 20811990A JP H0495180 A JPH0495180 A JP H0495180A
Authority
JP
Japan
Prior art keywords
pixel
data
picture element
image
curve
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
Application number
JP20811990A
Other languages
Japanese (ja)
Inventor
Katsuhiko Itonori
糸乗 勝彦
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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP20811990A priority Critical patent/JPH0495180A/en
Publication of JPH0495180A publication Critical patent/JPH0495180A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

PURPOSE:To dispense with an image processing occupying much processing time and to exactly execute the segment/curve recognition in a short processing time by converting binary digital image data into a hierarchical data structure, and checking this data. CONSTITUTION:The system provided with a picture element connection data generating means 103 for scanning a binary digital image in the main scanning direction, and generating picture element connection data by setting a picture element varied to a picture element of an image from a background picture element as a picture element of a start point, and setting a picture element varied to the background picture element from the picture element of the image as a picture element of an end point, and a picture element block data generating means 105 for checking a mutual relation of picture element connection data, and generating an assembly of the picture element connection data having a prescribed relation as picture element block data. In such a state, the image is expressed by the picture element connection data and the picture element block data being an assembly of the picture element connection data, and based on these data, a segment and a curve are discriminated, respectively. In such a way, the linear segment and the curve in the image data can be recognized exactly and at a high speed without executing the image processing.

Description

【発明の詳細な説明】[Detailed description of the invention] 【産業上の利用分野】[Industrial application field]

この発明は、線図形画像を2値ディジタル−データとし
て読み込み、2値デイジタル・データから線分と曲線を
認識して取り出す、線分・曲線認識方式に関するもので
ある。
The present invention relates to a line segment/curve recognition method that reads line graphic images as binary digital data and recognizes and extracts line segments and curves from the binary digital data.

【従来の技術】[Conventional technology]

線分と曲線の識別を行う従来技術としては、線図形を短
線分化してシ1−トベクトルで表し、隣り合うシ罰−ト
ベクトル間の角度の変化を調べ、その変化がある所定値
以上のとき曲線と判定し、所定値以内のとき線分と判定
する手法があった(特開平1−116772号公報)。 また、他の従来技術として、折れ線データに対して曲線
のあてほめを行い曲線近似して表し、この曲線とシm 
−)ベクトルとで囲まれる部分の面積を計算し、この面
積に基づいて上記曲線を採用するかの可否を決定する手
法があった(特開昭62−251988号公報)。
Conventional techniques for identifying line segments and curves include segmenting a line figure into short lines, representing them as sheet vectors, checking the change in angle between adjacent sheet vectors, and detecting when the change exceeds a predetermined value. There is a method of determining it as a curve, and determining it as a line segment when it is within a predetermined value (Japanese Patent Laid-Open No. 1-116772). In addition, as another conventional technique, a curve is fitted to the polygonal line data, the curve is approximated, and the curve is expressed.
-) There is a method of calculating the area of the part surrounded by the vector and deciding whether or not to adopt the above curve based on this area (Japanese Patent Application Laid-Open No. 62-251988).

【発明が解決しようとする課題】[Problem to be solved by the invention]

しかし前者の方式の場合、線図形を構成する特徴点(交
差点、屈折点)をあらかじめ抽出し、その特定の区間内
が直線であるか、曲線であるかを認識する方式であって
、複数の直線あるいは直線と曲線が混合している区間を
認識することはできなかった。 また後者の方式の場合、曲線と直線の判定を行うために
、1m像中の全てのシ譚−ト・ベクトルに対して、曲線
の当てほめを行うために、処理に長時間を必要とした。 この発明は、上記従来技術の問題点を解消し、画像処理
を行うことなく、画像データ中の直線線分と曲線を正確
でしかも高速に認識することのできる線分・曲線認識方
式を実現することを目的とするものである。
However, in the case of the former method, the feature points (intersections, bending points) that make up the line figure are extracted in advance, and it is recognized whether the specific section is a straight line or a curved line. It was not possible to recognize straight lines or sections where straight lines and curves were mixed. In addition, in the case of the latter method, in order to determine whether a curve is a straight line or a straight line, a long processing time is required to fit the curve to all the seat vectors in the 1 m image. . The present invention solves the problems of the prior art described above and realizes a line segment/curve recognition method that can accurately and quickly recognize straight line segments and curves in image data without performing image processing. The purpose is to

【課題を解決するための手段】[Means to solve the problem]

本発明の線分・曲線認識方式は、2値ディジタル画像を
主走査方向に走査して、背景画素から画像の画素に変化
した画素を開始点の画素とし、画像の画素から背景画素
に変化した画素を終了点の画素とする画素連結データを
生成する画素連結データ生成手段(第1図103)と、 画素連結データの相互の関係を調べ、所定の関係を有す
る画素連結データの集まりを画素ブロックデータとして
生成する画素ブロックデータ生成手段(第1図105)
と、 生成された画素ブロックデータを調べ、その画素ブロッ
クが直線であるか、曲線であるかを識別する線分・1曲
線認識手段(第1図1..07、l O8,109,1
10)と を備えたものである。
The line segment/curve recognition method of the present invention scans a binary digital image in the main scanning direction, sets a pixel that has changed from a background pixel to an image pixel as a starting point pixel, and A pixel connected data generation means (103 in FIG. 1) that generates pixel connected data with a pixel as the end point pixel, and a pixel connected data generation means (103 in FIG. 1) that examines the mutual relationship of the pixel connected data and creates a pixel block of a collection of pixel connected data having a predetermined relationship. Pixel block data generation means for generating data (105 in FIG. 1)
and a line segment/one curve recognition means that examines the generated pixel block data and identifies whether the pixel block is a straight line or a curve (Fig. 1 1.07, l O8,109,1
10).

【作用】[Effect]

本発明は、前記目的を達成するために、画像を階層的な
データ構造に変換して、そのデータ構造を用いて線分・
曲線認識処理を行う。すなわち、画像を画素連結データ
と、画素連結データの集まりである画素ブロックデータ
により表現されるようにし、これらのデータをもとに線
分と曲線とをそれぞれ識別するものである。 画素連結データ生成手段において、画素連結データを生
成する。画素連結データは、2値ディジタル画像を主走
査方向に走査して、背景画素(白画素)から画像の画素
(黒画素)に変化した画素を開始点の画素とし、画像の
画素から背景画素に変化した画素を終了点の画素とする
ものでありいわゆる画像のラン情報である。 画素ブロックデータ生成手段は画素ブロックデータを生
成する。画素ブロックデータとは、所定の関係を有する
画素連結データの集まりをいう。 その所定の関係としては、例えば、 ■1つの画素連結データには2つ以上の画素連結データ
が連結しない、 ■1つの画素連結データの下に連結する画素連結データ
の長さは、1つ前の画素連結データの長さに対して、大
きく変化しない、 の2つの条件を満たすものがある。 線分・曲線認識手段は、各画素ブロックデータを基に、
画素ブロックが線分を表すものか曲線を表すものかをど
うかを識別する。その識別の具体例としては、例えば、
 ■後で述べる本発明の実施例のように、ブロックデー
タをその中に所定数だけ画素連結データを含むようなサ
ブ・ブロックに分割し、その各サブ・ブロックの一番上
と一番下の画素連結データの開始点と終了点の中点を求
めてベクトル・データとし、各画素ブロックデータ内の
ベクトルの方向の変化を調べて直線拳曲線の識別を行う
もの、■ 画素ブロックデータ内の各画素連結データの
特定の点(開始点あるいは中点)に対してハフ変換を行
うことで、その画素ブロックデータの直線性を識別する
もの、■ 画素ブロックのパターンマツチングにより識
別するもの等がある。 本発明によれば、画像データを画素連結データおよび画
素ブロックデータからなる階層的なデータ構造に変換し
て、そのデータ構造を用いて線分・曲線認識処理を行う
ようにしたので、線分・曲線認識処理を行う際に、処理
時間のかかる画像処理を行う必要がなく、短い処理時間
で正確な処理を行うことができる。
In order to achieve the above object, the present invention converts an image into a hierarchical data structure and uses that data structure to
Performs curve recognition processing. That is, an image is expressed by pixel connection data and pixel block data which is a collection of pixel connection data, and line segments and curves are respectively identified based on these data. The pixel connection data generation means generates pixel connection data. Pixel connection data is generated by scanning a binary digital image in the main scanning direction, using a pixel that changes from a background pixel (white pixel) to an image pixel (black pixel) as the starting point pixel, and converting the image pixel to the background pixel. The changed pixel is set as the end point pixel, and is so-called image run information. The pixel block data generation means generates pixel block data. Pixel block data refers to a collection of pixel connected data having a predetermined relationship. The predetermined relationship is, for example: 1. Two or more pixel connected data are not connected to one pixel connected data; 2. The length of pixel connected data connected under one pixel connected data is the same as the length of the previous pixel connected data. There is a method that satisfies the following two conditions: does not change significantly with respect to the length of the pixel connected data. The line segment/curve recognition means, based on each pixel block data,
Identify whether a pixel block represents a line segment or a curve. As a specific example of the identification, for example,
■As in the embodiment of the present invention described later, block data is divided into sub-blocks each containing a predetermined number of pixel-connected data, and the top and bottom of each sub-block are A method that determines the midpoint between the start point and end point of pixel connected data and uses it as vector data, and identifies changes in the direction of the vector in each pixel block data to identify straight curves. ■ Each pixel block data There are methods to identify the linearity of pixel block data by performing Hough transform on a specific point (starting point or midpoint) of pixel connected data, and methods to identify the linearity of pixel block data by pattern matching. . According to the present invention, image data is converted into a hierarchical data structure consisting of pixel connection data and pixel block data, and line segment/curve recognition processing is performed using this data structure. When performing curve recognition processing, there is no need to perform image processing that takes processing time, and accurate processing can be performed in a short processing time.

【実施例】【Example】

第1図は本発明の一実施例の構成を示すものである。本
実施例の線分・曲線認識方式は、画像入力部101、画
像データ記憶部102、画素連結データ生成部103、
画素連結データ記憶部104、画素ブロックデータ生成
部105、画素ブロックデータ記憶部lO6、サブ・ブ
ロック生成部107、サブ・ブロック記憶′部108、
単位ベクトル計算部109、線分・曲線認識部110、
画素ブロック分解部111、線分データ記憶部112、
曲線データ記憶部113からな−っている。 画像入力部101はイメージスキャナのような画像を2
値化して入力するものである。 画像データ記憶部102は画像入力部101から入力し
た画像データを記憶するものである。 画素連結データ生成部103は、画像データ記憶部10
2に記憶された2値ディジタル画像を主走査方向に走査
して、背景画素(白画素)から画像の画素(黒画素)に
変化した画素を開始点の画素とし、黒画素から白画素に
変化した画素を終了点の画素とする画素連結データを生
成するものである。 画素連結データ記憶部104は、画素連結データ生成部
103によって生成されたデータを記憶するものである
。 画素ブロックデータ生成部105は、上下方向(副走査
方向)に隣接する画素連結データを調べ、予め定めた関
係を有する画素連結データの集まりを画素ブロックデー
タとするものである。 画素ブロックデータ記憶部106は、画素ブロックデー
タ生成部105により生成された画素ブロックデータを
記憶するものである。 サブ−ブロック生成部107は、画素ブロックデータを
所定の亮さを持つサブ・ブロックに分解し、サブ・ブロ
ック記憶部108に記憶するものである。 単位ベクトル計算部109は、ある画素ブロックデータ
内の全てのサブ・ブロックに対してそのサブ・ブロック
を表す単位ベクトルを求めるものである。 線分・曲線認識部110は、単位ベクトル計算部109
で計算した全ての単位ベクトルの変化を調べ、複数の線
分/線要素(線分と曲線)を求めるものである。 画素ブロック分解部111は、複数の線分/線要素を含
む画素ブロックデータを単一の線分/線要素を表す画素
ブロックに分解し、線分を表す画素ブロックデータを線
分データ記憶部112に、曲線を表す画素ブロックデー
タを曲線データ記憶部113に格納するものである。 以下、第1図を参照しながら順をおって折線化処理の手
順を説明する。 画像入力部101で入力された、2値のディジタル画像
データは画像データ記憶部102に記憶される。画素連
結データ生成部103では、画像データ記憶部102の
内容から、画像のラン情報である画素連結データと、画
像中の上下方向に連結している画素連結データを表す画
素ブロックデータを抽出する。 第2図を用いて画素連結データの抽出手順を説明する。 なお、第4図は画素連結データを説明した図である。 画像をラスク方向(主走査方向)に走査し、画像の背景
画素値から線図形画素値に変化する画素1s(i、j)
を見つける(第2図ステップ201〜204)。すなわ
ち、まず画像の幅m1画像の高さn1黒画素値pxを設
定しくステップ201)、ラスク走査の開始位置をr 
=0+ J =Oとして設定する(ステップ202)。 走査位置の画素1s(i、、+)が黒画素値pxである
かを調べ(ステップ203 )、黒画素であるときは、
画素l5(i、j)を開始点として登録する(ステップ
204)。 さらに、走査を続けて線図形画素値から背景画素値に変
化する画素Ie(+、、+)≠pxを見つける(ステッ
プ205〜207)。すなわち、走査が一つの走査ライ
ンの終りに達したかどうかをi<mにより判定しくステ
ップ205)、終りに達していないときは線図形画素値
から背景画素値に変化したかどうかを判定しくステップ
206)、変化していなかったときは走査を1m票進め
(ステップ207) 、同様の処理を繰り返す。ステッ
プ206の判定で画素の変化があったときすなわちIe
(i、j)≠pxとなったときは画素1e(i、j)を
画素連結データの終了点として登録する(ステップ20
8)。このとき、rB像の右端まで線図形画素値から背
景画素値に変化する画素を見つけられないときは、その
走査ライン上で画素の連結が終っていると判断して、線
図形画素値から背景画素値に変化する画素をIe(m、
J)と決定する。 なお、画素の登録は、画素Isをt番目の画素連結デー
タの開始点5(t)、画素1eをt番目の画素連結デー
タの終了点E (t)として、画素連結データ記憶部1
04に記憶することにより行う。このとき、付加的な情
報として画素連結データの長さL (t)を−緒に登録
してもよい。さらに、この処理を続け、走査ラインが画
像の肩さ(n)を越えるまで続ける(ステップ211〜
213)。 次に上記で抽出した画素連結データと画像から、画素ブ
ロックデータの抽出を行う。第3図に画素ブロックデー
タ抽出処理に関する流れ図を示す。 まず、画素連結データの総数をmに設定しくステップ3
01)、画素連結データの番号nおよび画素ブロックデ
ータの番号jをOに設定する(ステップ302)。 画素連結データ記憶部104から、n番目の画素連結デ
ータdata(n)を取り出し、このデータが既にブロ
ックの一部として登録されているか否かを調べる(ステ
ップ303)。既に登録されているときは次の画素連結
データを取り出すためにn=n+ 1とする(ステップ
304)。nくmであるかどうかの判定によりすべての
画素連結データについて画素ブロック生成処理が終了し
たかどうかを判定する(ステップ305)。 未だ、ステップ303の判定において、登録されていな
かったと′きは、新しい画素ブロックデータの生成処理
を行う(ステップ306〜314)。 新しい画素ブロックデータの生成処理について詳細に説
明する。 画素連結データdata(n)が、画素ブロックに登録
されていなかったとき、新しい画素ブロックである画素
ブロックデータblock(i)に登録する(ステップ
306)。次に、変数nの値を後の利用のために一時的
に退避する(ステップ307)。 そして、この画素連結データdata(n)が次の2つ
の条件を満たしているか調べる(ステップ308)。 ■ 下方向に連結している連結画素データが1つだけ存
在する。 ■ 下方向に連結している連結画素データの長さが急に
変化しない。例えば、自分自身の長さの2倍以上、ある
いは1/2以下にならない。 条件■■を画素連結データdata(n)が満たしてい
ない場合、画素ブロックデータblock (n)は終
了しているとする。 画素連結データdata(n)が条件■■を満たしてい
るとき、このdata(n)に連結する画素連結データ
data(j)を画素連結データ記憶部104の中から
探す(ステップ309)。 次に画素連結データdata(j)に対して、次の条件
■を満たしているかを調べる(ステップ310)。 ■ 上に続く連結画素データはdata(n)のみであ
る。 画素連結データdata(j)が条件■を満たしている
とき、この画素連結データdata(j)を画素ブロッ
クデータblock(i)に追加登録する(ステップ3
11)。そして、新しく追加登録した画素連結データd
ata(j)に連結する画素連結データを探すために変
数nにjを設定しくステップ312)、ステップ308
に戻る。 以上のような処理を画素ブロックデータbl。 ck(i)が終了するまで続ける。この終了は、ステッ
プ308またはステップ310で、条件■〜■または■
を満たさなかったことをもって判定し、ステップ304
へ戻る。その際に、ステップ307で退避した値を変数
nに設定するとともに(ステップ313) 、変数iの
値をインクリメントしておく(ステップ314)。 そして、画素連結データ記憶部104から画素ブロック
データに登録していない画素連結データを探し、以上の
処理を続け、全ての画素連結データが画素ブロックデー
タに登録されるまで続ける。 本実施例では画素ブロックデータは、その内にある全て
の画素連結データを実際に持っているように説明したが
、実際の画素ブロックデータは、そのブロックが画像内
で占める領域の外接矩形で代表して表し、ブロック内に
含まれる画素連結データは、画素連結データ記憶部10
4における位置のみを記録している。 画像を画素ブロックデータで表した結果の一例を第5図
に示す。 次に、サブ・ブロック生成部107は、画素ブロックデ
ータ記憶部106に記憶されている全ての画素ブロック
データを所定の高さ(たとえば画素連結データN個分)
を持つサブ・ブロックに分解する。画素ブロックデータ
内の一番上にある画素連結データからN個分を1つのサ
ブ・ブロックとして抽出し、これを画素ブロックデータ
の最後の画素連結データに行き着(まで続ける。最後の
サブ・ブロックは、画素連結データをN個分取れないこ
とがあるが、残っている画素連結データで最後のサブ・
ブロックとする。 以上のようにしてサブ・ブロック生成部107で抽出さ
れた、全てのサブ番ブロックをサブ・ブロック記憶部1
08に記憶する。記憶されているサブ・ブロックは、次
の処理を簡単にするため、どの画素ブロックデータに属
しているかを表すデータを付加してお(必要がある。そ
のため、各サブ・ブロックは、自分の属している画素ブ
ロックデータが画素ブロックデータ記憶部106内のど
こに位置しているかの情報も抽出時に付加される。 次に、単位ベクトル計算部109においてサブ・ブロッ
ク記憶部108内の各サブ・ブロックを表す単位ベクト
ルを計算する。ただし、ここでは単位ベクトルのX成分
のみを計算する。第6図に、単位ベクトルについて説明
した図を示す。 単位ベクトルの計算方法について説明する。まず、サブ
・ブロック記憶部108から1つのサブ・ブロックを選
び、このサブ・ブロックの一番上と一番下の画素連結デ
ータの中点を抽出し、サブ・ブロックを表すベクトルデ
ータとする。このベクトルデータをA1長さをIAI、
Aの始点のX座標をAsx5終点をAexとすると、ベ
クトルAの単位ベクトルのX成分λは次式で求められる
。 λ= (Aex −Asx) / l A l −(式
1)次に線分・曲線認識部110における認識処理につ
いて説明する。単位ベクトル計算部109で計算した値
λをある画素ブロックデータについてグラフとして表す
と、第8図のような特徴的なグラフを得ることができる
。つまり、単一の線分からなる画素ブロックデータの場
合(第8図(a))、そのλのグラフはほぼ傾き0とな
り、曲線を表す画素ブロックデータの場合(第8図(C
))、そのλのグラフは増加あるいは減少となる。また
、複数の線分要素をもつ画素ブロックデータの場合(第
8図(b))は、線分要素の分だけ傾き0のグラフに分
割できることがわかる。したがって、λのグラフから幾
つかの傾きOのグラフに分解できるとき、画素ブロック
分解部111においてグラフの示す点で画素ブロックデ
ータを分割する。 曲線を表す画素ブロックデータの場合(第8図(C))
 、そのλのグラフは増加あるいは減少となることは、
次のことで説明できる。λの値は、第6図に示すように
、X軸とベクトルAのなす角をρとするとCOSρの値
を表している。円を画素ブロックデータに分解したとき
には、最悪の場合でも第7図のように4つの部分に分割
され、左右の曲線を表現している画素ブロックデータ内
のサブ・ブロックを表すベクトルとX軸のなす角ρは、
0≦ρ≦■(■≦ρ≦21)となるため、曲線を表す画
素ブロックデータについてのλのグラフは、必ず増加あ
るいは減少という傾きを持って現れる。 線分・曲線認識部110では、以上のように画素ブロッ
クデータについてのλのグラフを調べ、そのグラフが傾
きOのい(つかの部分に分割可能ならば、画素ブロック
分解部111において、グラフの表している分割点にお
いて分割して、分割各画素ブロックデータを線分データ
記憶部112に記憶し、そのグラフが単一の傾きOのグ
ラフを表していれば、そのまま線分データ記憶部112
に記憶し、グラフが増加あるいは減少の傾きを表してい
れば、曲線データ記憶部113に記憶する。 この実施例では、特に明記していないが、画素ブロック
データの中には、曲線にも線分にも判定できないような
画素ブロックデータが存在する。 このような、画素ブロックデータを記憶するために、画
像データ記憶部を線分データ記憶部、曲線データ記憶部
と同様に設けることも可能である。 また、この実施例では、曲線と線分の混在している画素
ブロックデータについて述べていないが、このような画
素ブロックデータについても、λのグラフは傾きOの部
分と増加あるいは減少の傾きを持つ部分を持つため、そ
れぞれの部分に分割することによって、線分を表す画素
ブロックデータと曲線を表す画素ブロックデータを得る
ことができる。 線分・曲線認識部110において、λのグラフの傾きが
Oであるとしても、第7図に示すような円の上下部分を
表す画素ブロックデータや矢印の部分は線分として表現
することはできない。このようなことを避けるために、
線分データ記憶部112に記憶する前に、そのデータが
線分を表しているか否かを判定する。具体的には、その
画素ブロックデータ内の画素連結データの長さを調べ、
同じ長さの画素連結データが多く存在すれば、その画素
ブロックデータは、線分データであると確定して線分デ
ータ記憶部112に記憶する。 また、第7図に示す円の場合、左右の部分のみを曲線を
表す画素ブロックデータと判定するが、残りの部分は線
分とも曲線とも判定されないまま残され、完全な円を認
識できない。しかし、曲線を表す画素ブロックデータに
隣接する画素ブロックデータを調べ、その画素ブロック
データが曲線を表すブロックデータか、線分とも曲線と
も判定されていない場合、これらの画素ブロックデータ
を統合することにより、完全な円を1つのデータとして
表現することができる。 2値ディジタル画像データを階層的なデータ構造に変換
し、このデータ内の単位ベクトルの方向の変化を調べる
ことにより、各データの表現する図形が、線分であるか
曲線であるかを認識すること。 また、この実施例では、線分−曲線の認識は、画素ブロ
ックデータをサブ・ブロックに分け、その単位ベクトル
により行っているが、この外にもハフ変換を用いて直線
・曲線の識別を行う方法や、画素ブロックのパターンマ
ツチングにより識別する方法がある。例えば、ハフ変換
を用いた場合、画素ブロック内の各画素連結データの特
定の点(開始点、あるいは中点)をハフ変換式p=x・
cosθ+yesinθにより、p−θ空間に変換する
。このとき、pは原点と画素連結データ上の点(x、y
)との距離、θは原点と画素連結データ上の点(x、y
)を結んだ線分とX座標軸との角度である。このp−θ
空間上の特徴からその画素ブロックが直線線分であるか
、また複数の直線線分を持つかを判定することができる
。また、曲線に対応したハフ変換式を用いることで、同
様に曲線の識別が可能である。
FIG. 1 shows the configuration of an embodiment of the present invention. The line segment/curve recognition method of this embodiment includes an image input section 101, an image data storage section 102, a pixel connection data generation section 103,
Pixel connected data storage section 104, pixel block data generation section 105, pixel block data storage section lO6, sub-block generation section 107, sub-block storage' section 108,
unit vector calculation section 109, line segment/curve recognition section 110,
Pixel block decomposition unit 111, line segment data storage unit 112,
It consists of a curve data storage section 113. An image input unit 101 inputs two images such as an image scanner.
It is input as a value. The image data storage unit 102 stores image data input from the image input unit 101. The pixel connected data generation unit 103
The binary digital image stored in 2 is scanned in the main scanning direction, and the pixel that changes from a background pixel (white pixel) to an image pixel (black pixel) is set as the starting point pixel, and the pixel changes from a black pixel to a white pixel. This is to generate pixel connection data that uses the pixel as the end point pixel. The pixel connection data storage section 104 stores data generated by the pixel connection data generation section 103. The pixel block data generation unit 105 examines pixel connected data adjacent in the vertical direction (sub-scanning direction) and generates a collection of pixel connected data having a predetermined relationship as pixel block data. The pixel block data storage section 106 stores the pixel block data generated by the pixel block data generation section 105. The sub-block generation section 107 decomposes pixel block data into sub-blocks having a predetermined brightness and stores them in the sub-block storage section 108. The unit vector calculation unit 109 calculates unit vectors representing all sub-blocks in a certain pixel block data. The line segment/curve recognition unit 110 includes a unit vector calculation unit 109
It examines changes in all unit vectors calculated in , and finds multiple line segments/line elements (line segments and curves). The pixel block decomposition unit 111 decomposes pixel block data including a plurality of line segments/line elements into pixel blocks representing a single line segment/line element, and stores the pixel block data representing the line segments in the line segment data storage unit 112. Second, pixel block data representing a curve is stored in the curve data storage section 113. Hereinafter, the procedure of the broken line processing will be explained in order with reference to FIG. Binary digital image data input by the image input unit 101 is stored in the image data storage unit 102. The pixel connected data generation unit 103 extracts pixel connected data, which is image run information, and pixel block data, which represents vertically connected pixel connected data in the image, from the contents of the image data storage unit 102. The extraction procedure of pixel connected data will be explained using FIG. Note that FIG. 4 is a diagram explaining pixel connection data. The image is scanned in the rask direction (main scanning direction), and the pixel 1s (i, j) changes from the background pixel value of the image to the line figure pixel value.
(Steps 201 to 204 in Figure 2). That is, first set the image width m1, image height n1, and the black pixel value px (step 201), and set the rask scan start position as r.
=0+J=O (step 202). It is checked whether the pixel 1s(i,,+) at the scanning position has a black pixel value px (step 203), and if it is a black pixel,
Pixel l5(i,j) is registered as a starting point (step 204). Further, scanning is continued to find a pixel Ie (+, , +)≠px whose value changes from a line figure pixel value to a background pixel value (steps 205 to 207). That is, it is determined whether the scanning has reached the end of one scanning line based on i<m (step 205), and if it has not reached the end, it is determined whether the line figure pixel value has changed to the background pixel value (step 205). 206), and if there is no change, the scanning is advanced by 1m votes (step 207), and the same process is repeated. When there is a pixel change in the determination at step 206, that is, Ie
When (i, j)≠px, the pixel 1e (i, j) is registered as the end point of the pixel connected data (step 20
8). At this time, if a pixel that changes from the line figure pixel value to the background pixel value cannot be found to the right end of the rB image, it is determined that the pixel connection has been completed on that scanning line, and the line figure pixel value changes to the background pixel value. The pixel that changes to the pixel value is Ie(m,
J). Note that pixel registration is performed in the pixel connected data storage unit 1 by setting the pixel Is as the starting point 5 (t) of the t-th pixel connected data, and setting the pixel 1e as the end point E (t) of the t-th pixel connected data.
This is done by storing it in 04. At this time, the length L (t) of the pixel connected data may also be registered as additional information. Further, this process continues until the scanning line exceeds the shoulder height (n) of the image (steps 211-
213). Next, pixel block data is extracted from the pixel connected data and image extracted above. FIG. 3 shows a flowchart regarding pixel block data extraction processing. First, set the total number of pixel connected data to m. Step 3
01), the pixel connected data number n and the pixel block data number j are set to O (step 302). The n-th pixel connected data data(n) is extracted from the pixel connected data storage unit 104, and it is checked whether this data has already been registered as part of a block (step 303). If it has already been registered, n=n+1 is set to retrieve the next pixel connected data (step 304). It is determined whether the pixel block generation process has been completed for all the pixel connected data by determining whether the pixel block is n m (step 305). If it is determined in step 303 that it has not been registered yet, new pixel block data generation processing is performed (steps 306 to 314). The process of generating new pixel block data will be explained in detail. When pixel connected data data(n) has not been registered in a pixel block, it is registered in pixel block data block(i), which is a new pixel block (step 306). Next, the value of variable n is temporarily saved for later use (step 307). Then, it is checked whether this pixel connected data data(n) satisfies the following two conditions (step 308). ■ There is only one piece of connected pixel data that is connected downward. ■ The length of the connected pixel data connected downward does not change suddenly. For example, it cannot be more than twice its own length or less than 1/2 its own length. If the pixel connected data data (n) does not satisfy the condition (■■), it is assumed that the pixel block data block (n) has ended. When the pixel connected data data(n) satisfies the condition ■■, the pixel connected data data(j) connected to this data(n) is searched from the pixel connected data storage unit 104 (step 309). Next, it is checked whether the pixel connected data data(j) satisfies the following condition (2) (step 310). (2) The connected pixel data that continues above is only data(n). When the pixel connected data data (j) satisfies the condition ■, this pixel connected data data (j) is additionally registered in the pixel block data block (i) (step 3
11). Then, the newly added and registered pixel connected data d
In order to search for pixel connection data connected to ata(j), set variable n to j (step 312), step 308
Return to The above processing is performed on the pixel block data bl. Continue until ck(i) is completed. This termination is performed in step 308 or step 310 under the conditions ■ to ■ or ■
It is determined that the condition is not satisfied, and step 304
Return to At this time, the value saved in step 307 is set to variable n (step 313), and the value of variable i is incremented (step 314). Then, the pixel connected data storage unit 104 is searched for pixel connected data that is not registered in the pixel block data, and the above processing is continued until all the pixel connected data are registered in the pixel block data. In this example, the pixel block data was explained as actually having all the pixel connected data within it, but the actual pixel block data is represented by the circumscribed rectangle of the area that the block occupies in the image. The pixel connected data included in the block is stored in the pixel connected data storage unit 10.
Only the position at 4 is recorded. An example of the result of representing an image using pixel block data is shown in FIG. Next, the sub-block generation unit 107 divides all the pixel block data stored in the pixel block data storage unit 106 into a predetermined height (for example, N pieces of pixel connected data).
Decompose into sub-blocks with . Extract N pieces of pixel connected data at the top of the pixel block data as one sub-block, and continue until the last pixel connected data of the pixel block data is reached.The last sub-block may not be able to obtain N pieces of pixel connected data, but the remaining pixel connected data can be used to extract the last sub-sub.
Block. All sub-numbered blocks extracted by the sub-block generation unit 107 as described above are stored in the sub-block storage unit 1.
Stored in 08. The stored sub-blocks must be appended with data indicating which pixel block data they belong to in order to simplify the next processing. Therefore, each sub-block is Information on where the pixel block data stored in the pixel block data is located in the pixel block data storage unit 106 is also added at the time of extraction. Next, in the unit vector calculation unit 109, each sub-block in the sub-block storage unit 108 Calculate the unit vector that represents the unit vector.However, here, only the X component of the unit vector is calculated.Figure 6 shows a diagram explaining the unit vector.The method of calculating the unit vector will be explained. Select one sub-block from section 108, extract the midpoint of the top and bottom pixel connected data of this sub-block, and use it as vector data representing the sub-block. Sawo IAI,
Assuming that the X coordinate of the starting point of A is Asx5 and the ending point is Aex, the X component λ of the unit vector of vector A is obtained by the following equation. λ= (Aex - Asx) / l A l - (Formula 1) Next, the recognition processing in the line segment/curve recognition unit 110 will be described. When the value λ calculated by the unit vector calculation unit 109 is expressed as a graph for certain pixel block data, a characteristic graph as shown in FIG. 8 can be obtained. In other words, in the case of pixel block data consisting of a single line segment (Fig. 8 (a)), the graph of λ has a slope of almost 0, and in the case of pixel block data representing a curve (Fig. 8 (C)
)), the graph of λ will either increase or decrease. Furthermore, it can be seen that in the case of pixel block data having a plurality of line segment elements (FIG. 8(b)), it can be divided into graphs with a slope of 0 by the number of line segment elements. Therefore, when the graph of λ can be decomposed into several graphs of slope O, the pixel block decomposition unit 111 divides the pixel block data at the points indicated by the graphs. In the case of pixel block data representing a curve (Figure 8 (C))
, the graph of λ increases or decreases.
This can be explained by the following. As shown in FIG. 6, the value of λ represents the value of COS ρ, where ρ is the angle formed by the X axis and the vector A. When a circle is decomposed into pixel block data, even in the worst case, it is divided into four parts as shown in Figure 7, and the vector representing the sub-block within the pixel block data expressing the left and right curves and the X axis The angle ρ made is
Since 0≦ρ≦■ (■≦ρ≦21), a graph of λ for pixel block data representing a curve always appears with an increasing or decreasing slope. The line/curve recognition unit 110 examines the graph of λ for the pixel block data as described above, and if the graph has a slope of O (if it can be divided into a few parts, the pixel block decomposition unit 111 divides the graph into small parts). The data of each divided pixel block is stored in the line segment data storage unit 112, and if the graph represents a graph with a single slope O, the data of each divided pixel block is stored in the line segment data storage unit 112 as is.
If the graph represents an increasing or decreasing slope, it is stored in the curve data storage unit 113. In this embodiment, although not specifically stated, there is pixel block data that cannot be determined as a curve or a line segment. In order to store such pixel block data, it is also possible to provide an image data storage section in the same way as the line segment data storage section and the curve data storage section. Furthermore, although this embodiment does not describe pixel block data in which curves and line segments are mixed, even for such pixel block data, the graph of λ has a slope of O and an increasing or decreasing slope. Since it has parts, by dividing it into each part, pixel block data representing a line segment and pixel block data representing a curve can be obtained. In the line segment/curve recognition unit 110, even if the slope of the graph of λ is O, the pixel block data representing the upper and lower parts of a circle or the arrow part as shown in FIG. 7 cannot be expressed as a line segment. . To avoid this,
Before storing the data in the line segment data storage unit 112, it is determined whether the data represents a line segment. Specifically, check the length of pixel connected data within the pixel block data,
If a large amount of pixel connected data of the same length exists, that pixel block data is determined to be line segment data and is stored in the line segment data storage unit 112. Further, in the case of the circle shown in FIG. 7, only the left and right portions are determined to be pixel block data representing a curve, but the remaining portions are left without being determined as either a line segment or a curve, making it impossible to recognize a complete circle. However, when examining pixel block data adjacent to pixel block data representing a curve, if the pixel block data is determined to be block data representing a curve, or is neither a line segment nor a curve, by integrating these pixel block data. , a complete circle can be expressed as one piece of data. By converting binary digital image data into a hierarchical data structure and examining changes in the direction of unit vectors within this data, it is possible to recognize whether the figure represented by each data is a line segment or a curve. thing. In addition, in this embodiment, recognition of line segments and curves is performed by dividing pixel block data into sub-blocks and using unit vectors thereof, but in addition to this, Hough transform is used to identify straight lines and curves. There is a method of identification using pattern matching of pixel blocks. For example, when using Hough transform, a specific point (starting point or midpoint) of each pixel connected data in a pixel block is calculated using the Hough transform formula p=x・
Converted to p-θ space by cosθ+yesinθ. At this time, p is the origin and the point on the pixel connection data (x, y
), θ is the distance between the origin and the point on the pixel connection data (x, y
) is the angle between the line segment connecting them and the X coordinate axis. This p-θ
From the spatial characteristics, it can be determined whether the pixel block is a straight line segment or has a plurality of straight line segments. Further, by using a Hough transform formula corresponding to the curve, it is possible to similarly identify the curve.

【発明の効果】【Effect of the invention】

本発明によれば、2値ディジタル画像データを階層的な
データ構造に変換し、このデータを調べることにより、
各データの表現する図形が、線分であるか曲線であるか
を認識するようにしたので、線分0曲線認識処理を行う
際に、処理時間のかかる画像処理を行う必要がなく、短
い処理時間で正確な線分・曲線認識を行うことができる
。 また、本発明によれば、画素ブロックデータという、あ
る程度まとまった大きさを持つデータを使用しているの
で、図形の局所的な変動に左右されずに線分と曲線を正
確に認識することができる。 また、万一誤認識が発生しても、画素ブロックデータは
画素連結データを含むので、各ブロック内の形状を容易
に知ることができ、認識処理に簡単にフィードバックを
かけることが可能である。
According to the present invention, by converting binary digital image data into a hierarchical data structure and examining this data,
Since the figure represented by each data is recognized as a line segment or a curve, there is no need to perform time-consuming image processing when performing line segment 0 curve recognition processing, resulting in a shorter processing time. Accurate line segment/curve recognition can be performed in a short amount of time. Furthermore, according to the present invention, since pixel block data, which has a certain size, is used, it is possible to accurately recognize line segments and curves without being affected by local variations in the figure. can. Furthermore, even if a recognition error occurs, since the pixel block data includes pixel connection data, the shape within each block can be easily known, and feedback can be easily applied to the recognition process.

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

第1図は、本発明の一実施例の構成を示すブロック図で
ある。 第2図は、実施例の画素連結データ生成部の処理につい
ての流れ図である。 第3図は、実施例の画素ブロックデー、夕生成部の処理
についての流れ図である。 第4図は、画素連結データについて説明した図である。 第5図は、画素ブロックデータを説明した図である。 第6図は、単位ベクトルについて説明した図である。 第7図は、曲線に対する画素ブロック・データを説明し
た図である。 第8図は、1つの画素ブロックデータ内での単位ベクト
ルの変化を示したグラフである。 101・・・画像入力部、102・・・画像データ記憶
部、103・・・画素連結データ生成部、104・・・
画素連結データ記憶部、105・・・画素ブロックデー
タ生成部、106・・・画素ブロックデータ記憶部、1
07・・・サブ書ブロック生成部、108・・・サブ・
ブロック記憶部、109・・・単位ベクトル計算部、1
10・・・線分・曲線認識部、111・・・画素ブロッ
ク分解部、112・・・線分データ記憶部、113・・
・曲線データ記憶部。 特許出願人 富士ゼロックス株式会社 代 理 人 弁理士 岩上昇 外2名
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention. FIG. 2 is a flowchart of the processing of the pixel connected data generation section of the embodiment. FIG. 3 is a flowchart of the processing of the pixel block generator of the embodiment. FIG. 4 is a diagram explaining pixel connection data. FIG. 5 is a diagram explaining pixel block data. FIG. 6 is a diagram explaining a unit vector. FIG. 7 is a diagram illustrating pixel block data for a curve. FIG. 8 is a graph showing changes in unit vectors within one pixel block data. 101... Image input section, 102... Image data storage section, 103... Pixel connection data generation section, 104...
Pixel connected data storage unit, 105... Pixel block data generation unit, 106... Pixel block data storage unit, 1
07...Sub-write block generation unit, 108...Sub-write block generation unit
Block storage unit, 109... Unit vector calculation unit, 1
10... Line segment/curve recognition section, 111... Pixel block decomposition section, 112... Line segment data storage section, 113...
・Curve data storage section. Patent applicant: Fuji Xerox Co., Ltd. Representative: Patent attorney: 2 people including Iwatori

Claims (1)

【特許請求の範囲】 2値ディジタル画像を主走査方向に走査して、背景画素
から画像の画素に変化した画素を開始点の画素とし、画
像の画素から背景画素に変化した画素を終了点の画素と
する画素連結データを生成する画素連結データ生成手段
と、 画素連結データの相互の関係を調べ、所定の関係を有す
る画素連結データの集まりを画素ブロックデータとして
生成する画素ブロックデータ生成手段と、 生成された画素ブロックデータを調べ、その画素ブロッ
クが直線であるか、曲線であるかを識別する線分・曲線
認識手段と を備えたことを特徴とする線分・曲線認識方式。
[Claims] A binary digital image is scanned in the main scanning direction, and a pixel that changes from a background pixel to an image pixel is set as a starting point pixel, and a pixel that changes from an image pixel to a background pixel is set as an end point pixel. pixel connected data generating means for generating pixel connected data to be used as pixels; pixel block data generating means for examining the mutual relationship of the pixel connected data and generating a collection of pixel connected data having a predetermined relationship as pixel block data; A line segment/curve recognition method comprising line segment/curve recognition means for examining generated pixel block data and identifying whether the pixel block is a straight line or a curve.
JP20811990A 1990-08-08 1990-08-08 Segment/curve recognizing system Pending JPH0495180A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20811990A JPH0495180A (en) 1990-08-08 1990-08-08 Segment/curve recognizing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20811990A JPH0495180A (en) 1990-08-08 1990-08-08 Segment/curve recognizing system

Publications (1)

Publication Number Publication Date
JPH0495180A true JPH0495180A (en) 1992-03-27

Family

ID=16550951

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20811990A Pending JPH0495180A (en) 1990-08-08 1990-08-08 Segment/curve recognizing system

Country Status (1)

Country Link
JP (1) JPH0495180A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102762903A (en) * 2010-01-21 2012-10-31 Smc株式会社 Flow control device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102762903A (en) * 2010-01-21 2012-10-31 Smc株式会社 Flow control device
US9115811B2 (en) 2010-01-21 2015-08-25 Smc Kabushiki Kaisha Flow control device

Similar Documents

Publication Publication Date Title
US6347156B1 (en) Device, method and storage medium for recognizing a document image
JP3748172B2 (en) Image processing device
US4757551A (en) Character recognition method and system capable of recognizing slant characters
US5048107A (en) Table region identification method
US5539840A (en) Multifont optical character recognition using a box connectivity approach
US8385651B2 (en) Character recognition device, image-reading device, computer readable medium, and character recognition method
US5841905A (en) Business form image identification using projected profiles of graphical lines and text string lines
JP4149464B2 (en) Image processing device
US8553985B2 (en) Image processing apparatus, image processing method and computer-readable medium
JP4867620B2 (en) Image processing apparatus and image processing program
JPH0495180A (en) Segment/curve recognizing system
JP3164835B2 (en) Pre-processing method and post-processing method in human image recognition
CN112419208A (en) Construction drawing review-based vector drawing compiling method and system
JP2832928B2 (en) Character recognition method
US6650775B1 (en) Method and apparatus for implementing a streaming two-dimensional digital image segmentation
JP3104355B2 (en) Feature extraction device
JPH0495178A (en) Linear graphic polygonal line conversion processing system
JP2789622B2 (en) Character / graphic area determination device
JPH03192487A (en) Pattern recognizing method
WO2000016264A1 (en) Line object vectorization in colour/grayscale images
CN117291944A (en) Image processing method and related equipment
JP2616994B2 (en) Feature extraction device
JPH09265530A (en) Dictionary generating method and color image recognizing method
CN117409027A (en) Image searching method, device, product, equipment and medium
JP2507949B2 (en) Character / graphic area determination device