JPS607579A - Method and device for picture processing - Google Patents

Method and device for picture processing

Info

Publication number
JPS607579A
JPS607579A JP11491783A JP11491783A JPS607579A JP S607579 A JPS607579 A JP S607579A JP 11491783 A JP11491783 A JP 11491783A JP 11491783 A JP11491783 A JP 11491783A JP S607579 A JPS607579 A JP S607579A
Authority
JP
Japan
Prior art keywords
pixels
pixel
value
connection
circuit
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.)
Granted
Application number
JP11491783A
Other languages
Japanese (ja)
Other versions
JPH0420223B2 (en
Inventor
Yutaka Wada
豊 和田
Yasushi Kida
泰 木田
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.)
Sumitomo Electric Industries Ltd
Original Assignee
Sumitomo Electric Industries 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 Sumitomo Electric Industries Ltd filed Critical Sumitomo Electric Industries Ltd
Priority to JP11491783A priority Critical patent/JPS607579A/en
Publication of JPS607579A publication Critical patent/JPS607579A/en
Publication of JPH0420223B2 publication Critical patent/JPH0420223B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0007Image acquisition

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.

Description

【発明の詳細な説明】[Detailed description of the invention]

(7) 技 技 分 資 本発明は、名種の線を表わすべき2値画像から、線をチ
ェイン符号として取り出す画像処理方式に係る。本発明
の処理の対象となる画像は、線をあられす空間的に離散
化された2値画像である。 具体的には、 (1) 図面等の線画をテレビカメラ等で撮影して得ら
れた2値画像。 (2) 自動化機械、ロボットなどの視覚装置tや医用
機械に於て、撮影された画像(2値画像でない)に各種
の処理を施して得られる(2値画像)線画。 など、広汎な2値画像を対象とする。 2値画像とは、白と黒のいずれか一方の値を取る、とい
うことである。中間の(灰色)階調はない。 離散化というのは、空間を、有限の単位空間に分割し、
1単位空間では、変数が、単一の値を取る、という事で
ある。ここでは、さらに二次元平面を縦横の直線で分割
している。1単位の画素は小さな正方形又は長方形で、
縦横の寸法はそれぞれ同一になっていることか多い。 (イ) 従来技術の説明 図面などの線画を計n機に読みとらせ、何らかの判断を
おこなわせようとする場合、テレビカメラなどで図面を
撮影し、これを明暗によって2値化するとともに、空間
的に離散化した2値デジタル画像として語算様に入力す
ることが多い。 また、自動化機械、ロボット等の視覚装置や医用機器等
においても、画像処理するには、離散化された2値テジ
タル画像とする必要がある。対象G」線画ではなく、多
階調の濃淡画像やカラー画像は2値の線画となる。 このようにして得られた線画は、このままでは個々の点
(画素)の値の羅列にすぎない。線の太さも一定してお
らず、連続して:φく方向も分らない。一連の順序づけ
られた点の集合としての線が把握されているわけではな
い。この画像から直接に複雑な判断をおこなわせること
はできない。 各画素をグループ化し、順序何け、線として、位置、方
向、形、長さ、相互の接続関係などを把握しなければな
らない。これをチェイン符号化と言う。 チェイン符号とは、線を構成する画素を、端点から始め
て、ある画素から、それに隣接する次の画素へと、次々
にたどってゆき(これを追跡と呼ぶ)、この時の1つの
画素から次の画素への移動方向を、符じ・とじて順に並
べたものである。 たとえば、第1図(a)に示すように、ある画素から、
隣接する8つの画素−2の移動方向を0から7の符号で
表わす。すると、(b)の折れ線のチェイン符号は、 767007565 となる。 従来、チェイン符号を得る方法として、次の2つの方法
がとられてきた。 (1) 与えられた線画を直接追跡する。 (2) 与えられた線画に細線化処理を施し、その後追
跡を行う。 (1)の場合、つまり直接追跡する方法では、線上の点
を1点ないし数点与え、これを出発点及び始めの数ステ
ップとして、過去の進行方向を考慮しなから、周囲の画
素を調べて、次の進行方向を決定してゆく。 与えられた画像の線が太いと、線の幅内での片寄りや迷
いを生じる可能性がある。これを防ぐために、周囲を十
分広い範囲にわたって調べ、数ステップ先まて予7it
uを行ったりして進行方向を制御する。 このため、複雑な処理を必要とし、多くの画素を不規則
な順序で参照するため、処理及び記憶の両面で時間かか
かりすぎる。 線画像の線か十分に細い場合には、このような欠点はか
なり軽減される。しかし、原画像は多様であって、必ず
しも細い線で構成されているわけてはない。 47(m実に望ましい結果を得るためには、やはり複雑
な処理を必要とする。 このような問題を避けるため、(2)の方法が取られる
。 細線化の具体的な方法は様々なものが知られており、こ
こでは述べない。 (2)の方法に於て、細線化が完全におこなわれるなら
ば、元の線画の持つ線の接続関係が保存され、かつそれ
に必要な画素のみを残して、他のものは線から除かれる
。 この結果、追跡時には比較的狭い範囲を調べるだけて済
む。追跡処理に伴う時間的なロスを少くすることができ
る。 しかし、それてもなお、分岐点付近では、進み得る方向
が復数存在するので、これらのうち、どれを選択するの
か、あるいはその画素で分岐するのかを適切に決定して
ゆく必要がある。 この判断を誤まると、第2図(a)のように不要なルー
プを作ったり、又は(b)、(C)のように、線の連結
関係か保存されなかったりする。 このような誤りを避けるために、分岐点付近では、やや
広い範囲を調べたり、周辺の各画素が既に追跡されてい
るか否か、既にされている場合には、分岐かおこなわれ
ているか否か、等をaaべたりする必要がある。 このように、直接追跡するものにしても、JILI!化
後に追跡するものにしても、追跡時に進行方向を決定し
てゆく方法は処理か複Mf(である。また、周辺の画素
を調べる必要から、多くの画素を不規則な順序で記憶か
ら読み出すため、高速化が困難であった。 (つ)発明の目的 本発明は、 (1)細称化に先立って、1画素のみの孔を埋め、これ
を細線化して、分岐点の周辺の存在しうるパターンを限
定しておき、 (2)追跡をおこなわず、周辺の情報のみから各画素の
接続を個別に決定しく記憶の読み出しは規則的で良い)
、 (3) 不要な微小ループのない、しかも線の接続関係
を正しく反映したチェイン′t〕号を高速に得ること、 を目的としている。 国)発明の構成と定義 本発明は、線をあられす2値画像から、チェイン符号を
取り出す画像処理方式に関する。従来法と異なる点は、
追跡を行わないで、線の接続を決定する、という事であ
る。 本処理の対象となる画像を人力画像と呼ぶ。 入力画像は、2種類の値(例えば明と暗、白と黒なと)
のうちいずれかを持つ画素が格子状に並んだものである
。 格子状に画素が並んでいるから、既に離散化されている
わけである。また2値化処理も終っている。これを入力
画像として出発する。 2種類の値の一方の値を持つ画素は、線の一部で、他方
の値を持つ画素は地の一部である。 以下、線に属する画素の値を「1」、地に属する画素の
値を「0」として説明する。 ひとつの画素には8つの隣接画素がある。格子に沿った
4つの方向を「上」、「下」、「左」、「右」と呼び、
これらと45°の角度を持つ方向を「斜め」と呼ぶこと
にする。 画素Poの8つの近傍(隣接)画素を、第4図に示すよ
う、に、Poの右から反時計廻りにPl、P2、・・・
・・・P8とする。画素Piの値をX工と書く。 Poに対し、Pl、P3、P5、P7の4つの画素、つ
まり奇数の添字を有する隣接画素は右、上、左、下に位
置するが、これを4近傍と呼ぶ。 P1〜 P8の全てを含めて8近傍という。 画素人と画素Bの関係について定義する。画素Aか画素
Bの4(又は8)近傍にあれば、画素Bは画素人の4(
又は8)近傍にある。画素人とBとは4隣接(又は8隣
接)するという。 また、同じ値をもつ2つの画素AとBについて、画素A
から出発して、画素Aと同じ値を持つ4隣接(又は8瞬
接)する画素へ移動し、これを次々にくり返して画素B
に到ることかできるとき、画素Aと画素Bは4連結(又
は8連結)しているという。 つまり、4連結では上下左右の画素のみつなかっている
と考え、8連結では斜めの画素もつなかっていると考え
るのである。 値1の画素について8連結(4連結)の考え方をとるな
ら、値0の画素については4連結(8連結)の考え方を
とる。これは連結した値1の領域で囲まれた値0の領域
は、その外部と分離している(連結していない)と考え
るべきだからである。 画素Piの値をXiと書くこともあるが、画素Piの特
性函数であることを示すため、Piの値を函数f(Pi
)て表わずこともある。 f (Pi)= Xl(1) てあり、これは0か1か、2値のうちいずれかである。 次に連結数、(4)1.(8)を定義する。前者を4連
結を取った時の連結数といい、次のように定義する。 (8) 8連結を取った時の連結数N。は によって定義される。これは、画素P。か、いくつの領
域を連結しているか、を示す値である。Xはnの否定を
示す。x = l −xである。 8連結の連結数の方が重要であるので、これを簡単に説
明する。 (8) 連結数N。は、ある画素P。(XO=1)と、8近傍(
Pl、、P8)にある画素の内、Xj−1となる画素で
あって、互に分離されているものかいくつあるかを示す
・ (2j−1)4ま奇数を表オつし・”2j−1’ま
奇数番の近傍、つまり4近傍(上下左右)かOであると
き1になる。 4近傍つまり上下左右の画素の内、値Oのものがn個あ
れば、ΣX、 はnとなる。しかし、連J−1 結数はnとはいえない。もしも、Xl−1、X3ニ1で
あるとしても、これによって挾まれる斜めの画素X2が
(illoてあれば、Pl、P2、P3か全てOて、X
・=1となる画素がここに存在しない。Xj−1で分離
された画素がないので、xi=:’l(つまりXl−〇
)であることによって新たに連結された画素か生しるわ
けではない。 ところが名=1、マ、−1でX2−1であれば、P2と
P。とを結ぶ1連結が生ずる。 このように、x、=0、X、 =0てあって2コー1 
2j+1 も、x、−1なら連結数がひとつ増えX、二〇な2] 
2コ ら連結数が増えない。そこで、(3)式の第2項Σx、
x、x 、 を、:2−x 、から差引くのである02
J−12323+1 23 本発明の構成は、次の4つの処理からなる。 (1) 孔埋め処理 入力画像中に存在する大きさ1の孔を埋める。 (2)細線化処理 幅の広い線から不要な画素を取り除き、必要最少限の画
素のみを残す。 値1の領域の連結性(8連結)及び値0の領域の連結性
(4連結)を保存し、値1の領域の単結境界点は、1隣
接する値1の画素をただひとつしか持たないようにする
。 (3)接続決定処理 各画素と隣接画素とを接続する。その画素の周囲8画素
の値と、斜め位置の4画素のいずれか力く閉塞点である
かとうかの合計9ビツトの情報から決定して記憶する。 (4)追跡処理 この結果に基づいて線を追跡してチェイン符号を得る。 以下に、4つの処理について個々に説明を加える。 @−)孔埋め処理 非常に単純な処理である。 上下左右の全てを値1の画素で囲まれた値Oの画素を、
値1に変更する。これか孔埋め処理である。 第3図t’a)に孔埋め処理の必要な配置を示す。中心
のOの画素は、上下左右を1の画素で囲まれている。斜
めの画素(×を付した)の値は0ても1ても良い。この
時0を1に変更し、孔を無くす、という事である。 つまりXo−0て、X、X3 X5 X7 ” ]の時
、Xo−1に変更する、という事である。 」二下左右の画素の値が1であり、中心の値X。か0で
あるとすると、ここてループかてきてしまう。 しかし、この、ループは1つの画素を中に含むたりであ
る。このような小さし・ループは実際の画像には存在し
ないはずであるから、無意味である、と判断して良い。 Xoか0になったのは何らかの雑音の影響であると考え
られる。 そこで中央の孔を埋めるためX。=1に変更する。 こうして微小ループ(大きさ1の)の発生を防ぎ、その
結果分岐部分に生ずるパターンの数を制限する事ができ
る。 第3図(a)は孔埋め処理前の配置を、第3図(b)は
孔埋め処理後の配置を示している。 (力)細線化処理 幅の広い線から不要な画素を取り除き、必要最少限のi
!!iI素のみを残す処理である。 既に述べたように、画像処理方式として、細線化処理を
した後に画素の接続を追跡してゆく手法か知られている
。細線化処理はいくつかの公知の方(去か存在する。 細線化処理は本発明を実行するに当って、必要な処理で
はあるか、公知の細線化処理方法を用いても差支えない
。 細線化処理に要求される一般的条件は以下のよってある
。 (1)liIili広線のなるへく中央部分を残し、大
幅な変形や位置ずれを防く。 (2)連結関係を保存する。 (3)線長の短縮を最少限に抑える。 このような要求に応えるものとして、構外の細線化手法
か知られている。これはラスター走査順の遂次処理から
成っており、実行が容易である。 効率も良い。結果として得られる細線画の性質が明確で
ある。 構外の方法を説明する。 (3)式で示される8連結の連結数を用いる。簡単のた
め(8)という添字を除き、Noと書く。定義は同しで
、Poに関し、 である。さらに、値1である8近傍の画素数N、G次の
ように定義する。 Na(Pa)−1Σ X 、 (5) −11 Naを簡単に近傍数、Noを連結数と呼ぶ。NaとN。 の区別は極めて重要である。NaはOから8まてのであ
るので、4以下の整数である。8個の近傍画素の環を互
に分離するには、1切断について最低ひとつの、値0の
画素(Xj=0)が必要である。 値0の画素(X・二〇)と、値1の画素(Xj=1)の
和が8である。従って連結数は4以下でなければならな
い。(簡単のため変数P。を省く)O≦Na≦8(5) 0≦Iマ。≦4(6) さらに、分離された値1の画素の集まりは、その中に必
ず値1の画素をひとつ以上含むので、町 ≧ No(7
) である。 N、個の分離された値1の画素が存在するが、分離する
ために、X−0の画素が最低ひとつ必要である。従って
、X=0の画素が少くともN、個なければ、I(6個の
連結数は生じない。x=Qの画素がN0個以上あれば、
X≦1の画素は(8−No)以下である。つまり Na ≦ 8− No(8) である。 Noは連結数と呼んでおり、その画素を取り除くことに
よって分離される値1の画素の群の数をあられす。たた
し、分kll シているかどうかは連結しているかとう
がて判断されるので、8連結と4連結のどちらの考え方
をとるかによって異なる。また、その画素を取り除くこ
とによって孔を生じる場合には、その孔の数を引いたも
のが連結数である。実際には孔は1個しか生じ得ないし
、孔を生じるという事はその画素が連結した値1の画素
で囲まれているという事であるから値1の群の数も1で
しかあり得ない。従って、孔を生じる場合はNoは0で
ある。 逆に、No−0であるという事は、近傍に値1の画素が
存在しない(孤立点)か、そうでなければその画素を取
り除く事によって孔が生じることを意味する。孤立点は
線には寄与しないので処理の対象としない。ここでは8
連結をとっているので、孔か生しるためには(つまり連
結した値1の画素で囲まれているためには)少くとも」
二下左右の4画素か値Iであることが必要である。従っ
てN、−〇(Pす≦1)については、 Na ≧ 4(9) のパターンを対象とすれば良い。 以上(5)′〜(9)式は、NaとN。の定義によって
生じる制限であるか、細線化処理によってさらに別の制
限か加わる。次にこれについて説明する。 構外の細線化処理は、次の3つの部分処理を繰返し実行
することによりなされる。 (1)値1を持つ画素(xo=i)を次の3種類に分類
する。 A−[Po lX3゜X5=01 B=(po (x3 、X5==lかつX7 。Xl 
≦0 )Cその他 (x3x5x7x1=l )(11
) 画面の左上から順に、まず右へ、右端に達したら、
次の行を左端から右へとの順序で、PoEA かつ N
。(Po )= 1かつ Na(Po)+ 1 の画素P。の値を0に変更してゆく。画面右下の角に達
するまで行う。 (曲 (11)と逆の順序で(画面右下の角から左へ進
み左端に余ると、1行上の右端から左端へ、さらに2行
」二の右端から左端へ・・・・・・)PoEBかつN。 (Po)=1かつf嘔(Po)*tの画素P。の値を0
に変更してゆく。画面左上の角に達するまで行う。 以上(I)〜(it)の処理を(II)、li)で値が
変更される画素がなくなるまで繰返す。 このようにすると細線化がなされる。 まず(1)の過程で、Cの画素は左右上下を値1の画素
で囲まれているもので(If。−0)ある。これは、内
部の点であり、除去すると孔を生じてしまうので、以下
の処理で境界上に出てくるまで、一時除去しておく。 A、Bは上下左右のいずれかの画素が値0である。この
内連結数が1で、近傍数が1以上のものは、この画素と
、近傍の値1の画素か一群となっている、ということで
ある。この画素を除いて(値を0にしても)も近傍画素
の連結関係は保存される。そこで細線化のため、NC”
” 1 、Na ’P LのものをOにするのである。 No−1、Na=1のものは端点であるので残している
。 A、Bについて処理の順序が違うのは、細線化処理のか
たよりを少くするためである。 同等の(A、B群に属し、No=1、Na41. )画
素があっても、先に処理を受けるものは除去されやすい
し、後に処理を受けるものは、(既に周囲の値1の画素
が減っているから)除去されGこくい。 そこで構外は、A、B群で処理の順序を逆にしている。 しかしなから、順序の違いによって、値が1から0へ変
更される画素が大きく異なる、という事はない。 簡略な方法として、A、B群ともに、同時に画面左上か
ら右へ、次の行も左から右へ、と(1)うふうに処理し
てゆく事もてきる。 本発明者はむしろ、簡略なアルゴリズムの方がより便利
であると思う。走査の故が減るからである。部分処理は
以下の如くである。 (1)値1を持つ画素(XO=1)を次の2種類に分プ
Xiする。 A−I Po l X3X5X7Xl = 0 、 )
C= ! Po 1X3X5x7X1” 1 ](11
)画面の左上から順に、まず右へ、右端に達したら、次
の行を左端から右端へ・・・・・・という順序で、Po
EA かつ Nc(Po )”−tかつNa(Po)4
1 の画素P。の値を0に変更して(ゆく。画面右下の角に
達するまで行う。 以上(1)、(11)の部分処理を(11)で、値か変
更される画素かなくなるまで繰返す。 第11図は細線化処理の1例を示す。(a)が処理前の
2値画像であり、(b)が簡略アルゴリズムで細線化処
理をした後の画像である。(a)に於て、幅が21Jl
!I素あるいは3画素あったものが、全て幅1画素の細
線になっている。 (ト)接続決定処理(一般原則) 本発明の中心をなすのが、接続決定処理である。 連結関係にある画素を追跡してゆ〈従来方法と大きく異
なり、3×3の局所的領域(Po〜P8)の画素の配置
によって接続を決定する。 この処理は、孔埋め、細線化処理の結果として残った画
像には、次の2つの性質があり、この性質に立脚してな
される。 K性 質II 値0てN。−0の点は、近傍画素が全て値0(Na=0
)である。 K性 質2刃 値1てN。−1の点は必ず端点(t’Ta =1 )で
ある。 性質1は、孔埋め処理をしたからこのようになる。No
:0というのは、Pl、P3、P5、P7が全て値1で
あるか、又は近傍8画素P1〜P8が全て値0であるか
のいずれかである。孔埋めによって前者の場合はありえ
ない。従って、値OてN。−0なら近傍画素は全て0で
ある。これは「地」の部分である。 性質2は細線化処理による。細線化で、値1でNo=1
、Na=+1の点は全て除かれた。値1で、N0=1て
あって残るものは1IJa−= iのものだけである。 近傍画素の内ひとつだけが値1なのであるから、これは
端点である。 値1の画素で残るものは、次のものである。 (1) No=2.3.4のものの全て(2) N。−
1、I(a−1(端点)(3) No= oのものの全
て 細線化はNo=1でNaN3のものを全て除く操作であ
ったから、N=0.2,3.4のものは残るわりである
。 No1Naについて、いくつかの組合せが許される。既
に述べたように、不等式(5)、(6)〜(9)を満さ
なければならないから、No、I(aの組合せは限定さ
れる。 孤立点(l−= o 、 Po =1)は始めがらない
ものとする(あっても接続に関与しないので無視する)
ので、Na1= Qも省かれる。 第12図はNa、Noの許されない組合せを示す表であ
る。禁止される組合せを斜線で示した。横方向にN。の
値、縦方向にNaの値を取っている。 右」二方の欄はく7)式のため禁止される。右下方の欄
は(8)式のため禁じられ、左端上3欄は(9)式のた
め禁じられる。No−1の下がら7欄は細線化のため除
かれている。 残った組合せは、 N =Q について Na=415+6,718Iマ 
−1 について ■ち=1 N −2について Na=2.8,4,5.6N =3
 について 1?a=3,4,5N =4 について 
Na= 4 である。 実際にこれらの組合せについて3×3の画素パターンを
書いてみる。Poは中心の(値1の)画素であり、これ
を示すため白丸で、他の近傍画素(値1)は黒丸で示す
。丸のない所は値0である。 第13図はこのような許される組合せについて、具体的
な画素パターンを表わすもので、Noを主分類に使って
いる。 横方向にN。の値を、上から下へIこの値を示す。 ひとつの欄は3×3の(PoN P8)パターンで、回
転、鏡像による変化によって一致するパターンは、ひと
つだけを代表として示す。 Noか同一てNaがひとつ増すものは、偶数番目の画素
(P2.P4、P6、P8 )が値0から1へ変化すれ
ば良い。このような関係にあるものを上から下へ向う矢
印で示した。 第5図は近傍数Xqaを主分類に使い、連結数N。を割
分類に使ってパターンを整理したものである。 第13図と内容は同一である。 このように細線化処理後に残りうるパターンは32種類
しかない。 さらに、図中(第5図、第13図)に於てα、β、γと
番号付けした3パターンは、存在しえない。 これらは、周辺の画素の値を決めてゆくと、値0である
斜め画素(P2 P4 P6 P8 )が、値1の4つ
の画素で囲まれることになり、No二〇でP二1、N、
〜0となってしまうから、性質1に反する。 αのパターンについて、第14図によって説明する。黒
丸、白丸のかわりに11」と書く。第14図(a)かα
の出発点のパターンである。 Plの左にP。、下にP8か、X−1として存在する。 細線化の時にPlが消去されないためには、Plの斜右
上に値1の画素がなければならない。そうでなければN
。−1、Na 4 tとなって消去されるからである。 同様にP3の斜右上にも値1の画素がなければならない
。 すると第14図中)のような周辺のパターンが存在しな
ければならないことになる。こうなると、X2−〇の画
素かN。=0でN、 40である、つまり孔が残ること
になる。孔は孔埋め処理で消失しているはすであるし、
4111m化によって孔は発生しないから、このような
事はありえない。つまりパターンαはh干されないパタ
ーンである。 βについては第15図によって説明する。(a)は出発
パターンで、黒丸、白丸は1、丸のない部分は0で表わ
した。同様にXi ”” 1 、X3 = 1の画素が
消えないために、それぞれの斜右上に値1の画素がなけ
ればならず、周辺の画素の分布は(′b)のようになる
。するとX2=0が孔になる。孔が発生するはずはない
ので、結局βパターンも許されない事が分る。 rについては第16図(a)、(b)で示す。同じ理由
によってγパターンも許されない。 32柚煩の考えうるパターンの内、3パターンは5′1
され舛いのであるから、29種類が残るパターンである
。 29種類のパターンの中でも、さらにa、b、c。 d、e、fの6つのパターンは特殊である。a〜rのパ
ターンは値1の4つの画素が微少の正方形を形作ってい
る。このようなものは接続決定が難しい。これについて
は後に述べる。 残すの23パターンについては、容易に接続を決定する
ことができる。 接続決定処理は以下のようにする。
(7) Techniques The capital invention relates to an image processing method for extracting lines as chain codes from a binary image that should represent famous lines. The image to be processed by the present invention is a spatially discretized binary image in which lines are formed. Specifically, (1) A binary image obtained by photographing line drawings such as drawings with a television camera, etc. (2) A line drawing (binary image) obtained by performing various processing on an image (not a binary image) taken by a visual device such as an automated machine or a robot or a medical machine. It targets a wide range of binary images, such as A binary image means that it takes either white or black values. There are no intermediate (gray) shades. Discretization means dividing space into finite unit spaces,
In a unit space, a variable takes a single value. Here, the two-dimensional plane is further divided by vertical and horizontal straight lines. One unit of pixel is a small square or rectangle.
The vertical and horizontal dimensions are often the same. (b) When trying to have a drawing machine read line drawings such as explanatory drawings of the prior art and make some kind of judgment, the drawing is photographed with a television camera, etc., and it is binarized based on brightness and space. It is often input as a binary digital image that has been discretized. Further, in order to perform image processing in automated machines, robots, visual devices, medical equipment, etc., it is necessary to convert the image into a discretized binary digital image. "Object G" is not a line drawing, but a multi-gradation grayscale image or a color image is a binary line drawing. The line drawing obtained in this way is nothing more than a list of values of individual points (pixels). The thickness of the lines is not constant, and the direction of the lines is not known. Lines are not understood as a series of ordered points. Complex judgments cannot be made directly from this image. It is necessary to group each pixel and understand its order, line, position, direction, shape, length, mutual connection relationship, etc. This is called chain encoding. A chain code is a system in which the pixels that make up a line are traced one after another, starting from the end point, from one pixel to the next pixel adjacent to it (this is called tracing), and from one pixel at this time to the next pixel. The direction of movement to the pixel is arranged in order with signs and closing. For example, as shown in FIG. 1(a), from a certain pixel,
The movement directions of the eight adjacent pixels -2 are represented by codes from 0 to 7. Then, the chain code of the polygonal line in (b) becomes 767007565. Conventionally, the following two methods have been used to obtain chain codes. (1) Directly trace the given line drawing. (2) Perform line thinning processing on the given line drawing, and then perform tracking. In the case of (1), that is, the direct tracking method, one or several points on the line are given, and this is used as the starting point and the first few steps, and surrounding pixels are examined without considering the past direction of travel. Then, decide the next direction of travel. If the lines in a given image are thick, there is a possibility that the line will be shifted or lost within the width of the line. To prevent this, survey the surrounding area over a sufficiently large area and plan ahead several steps ahead.
Control the direction of travel by doing things such as u. This requires complex processing and refers to many pixels in an irregular order, which takes too much time both in terms of processing and storage. If the lines in the line image are sufficiently thin, these drawbacks can be significantly reduced. However, the original image is diverse and is not necessarily composed of thin lines. 47 (In fact, complex processing is still required to obtain the desired result. To avoid such problems, method (2) is used. There are various specific methods for thinning the wire. This is well known and will not be discussed here. In method (2), if line thinning is completely performed, the line connection relationships of the original line drawing will be preserved, and only the pixels necessary for this will be left. and other objects are removed from the line.As a result, only a relatively narrow range needs to be examined during tracking, which reduces the time loss associated with the tracking process.However, it is still possible to There are multiple possible directions in the vicinity, so it is necessary to appropriately decide which of these directions to choose or whether to branch at that pixel. This may create unnecessary loops as shown in Figure (a), or the connection relationships between lines may not be preserved as shown in Figures (b) and (C). , it is necessary to check a rather wide range, check whether each surrounding pixel has already been tracked, and if so, whether or not branching has been performed. In addition, whether it is directly tracked or tracked after JILI!, the method of determining the traveling direction during tracking is processing or multiple Mf (. Also, since it is necessary to check the surrounding pixels, Since many pixels are read out from memory in an irregular order, it is difficult to increase the speed. By thinning this, the patterns that can exist around the branch point are limited, and (2) without tracking, the connection of each pixel is determined individually only from surrounding information, and memory readout is regular. good)
, (3) The purpose is to quickly obtain a chain 't] that is free from unnecessary minute loops and that accurately reflects the connection relationships of the lines. The present invention relates to an image processing method for extracting chain codes from a binary image containing lines. The difference from the conventional method is that
This means that the line connections are determined without tracing. The image to be subjected to this processing is called a human image. The input image has two types of values (for example, bright and dark, white and black)
Pixels having one of these are arranged in a grid pattern. Since the pixels are arranged in a grid, they have already been discretized. The binarization process has also been completed. We start with this as the input image. A pixel having one of the two values is part of the line, and a pixel having the other value is part of the ground. In the following description, the value of a pixel belonging to a line is assumed to be "1", and the value of a pixel belonging to a ground is "0". One pixel has eight neighboring pixels. The four directions along the grid are called "top", "bottom", "left", and "right".
A direction having an angle of 45 degrees with these will be called "oblique". As shown in FIG. 4, the eight neighboring (adjacent) pixels of the pixel Po are Pl, P2, . . . counterclockwise from the right of the pixel Po.
...Set as P8. The value of pixel Pi is written as X engineering. With respect to Po, four pixels Pl, P3, P5, and P7, that is, adjacent pixels having odd subscripts, are located on the right, above, left, and below, and these are called four neighbors. The 8-neighborhood includes all of P1 to P8. The relationship between pixels and pixel B will be defined. If pixel A is near 4 (or 8) of pixel B, pixel B is 4 (or 8) near pixel B.
or 8) nearby. It is said that pixel person and B are 4 adjacent (or 8 adjacent). Also, regarding two pixels A and B having the same value, pixel A
Starting from pixel A, move to 4 adjacent (or 8 instantaneous contact) pixels that have the same value as pixel A, and repeat this one after another to move to pixel B.
When this can be achieved, pixels A and B are said to be 4-connected (or 8-connected). In other words, in a 4-connection, only pixels on the top, bottom, left and right sides are connected, and in an 8-connection, diagonal pixels are also considered to be connected. If an 8-connection (4-connection) concept is used for pixels with a value of 1, a 4-connection (8-connection) concept is used for pixels with a value of 0. This is because an area with a value of 0 surrounded by a connected area with a value of 1 should be considered to be separate from the outside (not connected). The value of pixel Pi is sometimes written as Xi, but to indicate that it is a characteristic function of pixel Pi, the value of Pi is written as a function f(Pi
) may not be expressed. f (Pi)=Xl(1), which is either 0, 1, or a binary value. Next, the number of connections, (4)1. Define (8). The former is called the number of connections when four connections are taken, and is defined as follows. (8) Number of connections N when 8 connections are taken. is defined by. This is pixel P. This value indicates how many areas are connected. X indicates negation of n. x = l - x. Since the number of 8 connections is more important, this will be briefly explained. (8) Number of connections N. is a certain pixel P. (XO=1) and the 8-neighborhood (
Among the pixels in Pl, P8), indicate how many pixels are Xj-1 and are separated from each other. (2j-1) 4 indicates an odd number. 2j-1' becomes 1 when there are odd-numbered neighbors, that is, 4 neighbors (top, bottom, left, and right) or O. If n of the 4 neighbors, that is, top, bottom, left, and right pixels, have the value O, then ΣX, is n However, the number of connections J-1 cannot be said to be n. Even if Xl-1, X3-1, the diagonal pixel X2 sandwiched by these is P2, P3, all O, X
・There is no pixel where = 1 exists here. Since there is no pixel separated by Xj-1, xi=:'l (that is, Xl-〇) does not result in newly connected pixels. However, if name = 1, ma, -1 and X2-1, then P2 and P. A connection is created between the two. In this way, x, = 0, X, = 0 and 2 lines 1
2j+1 also, if x, -1, the number of connections increases by one, and X, 202]
The number of connections from 2 units does not increase. Therefore, the second term Σx in equation (3),
Subtract x, x, from :2-x, which is 02
J-12323+1 23 The configuration of the present invention consists of the following four processes. (1) Hole filling process Holes of size 1 that exist in the input image are filled. (2) Thinning process Remove unnecessary pixels from a wide line, leaving only the minimum necessary pixels. The connectivity of the area with value 1 (8 connections) and the connectivity of the area with value 0 (4 connections) are preserved, and a single boundary point of the area with value 1 has only one pixel with value 1 adjacent to it. Make sure not to. (3) Connection determination process Each pixel is connected to adjacent pixels. A total of 9 bits of information is determined and stored, including the values of the 8 pixels surrounding the pixel and which of the 4 pixels at the diagonal position is the blockage point. (4) Tracing process Based on this result, trace the line to obtain a chain code. The four processes will be explained individually below. @-) Hole filling process This is a very simple process. A pixel of value O surrounded by pixels of value 1 on all sides,
Change the value to 1. This is a hole filling process. Figure 3 t'a) shows the necessary arrangement for hole filling processing. The center pixel O is surrounded by 1 pixels on the top, bottom, left and right. The value of the diagonal pixel (marked with an x) may be 0 or 1. At this time, change 0 to 1 and eliminate the hole. In other words, when Xo-0 is X, X3 X5 If it is 0, a loop will occur here. However, this loop may contain one pixel. Since such a small loop should not exist in an actual image, it can be determined that it is meaningless. The reason why it became Xo or 0 is considered to be due to the influence of some kind of noise. So I made an X to fill the hole in the center. =1. In this way, it is possible to prevent the occurrence of minute loops (with a size of 1) and, as a result, to limit the number of patterns generated at the branch portion. FIG. 3(a) shows the arrangement before the hole filling process, and FIG. 3(b) shows the arrangement after the hole filling process. (Strength) Line thinning process Removes unnecessary pixels from wide lines to minimize i
! ! This is a process that leaves only the iI element. As already mentioned, a known image processing method is one in which connections of pixels are traced after line thinning processing. There are several known methods for thinning the line.Thinning is a necessary process when carrying out the present invention, and there is no problem in using a known method for thinning the line.Thin line The general conditions required for the conversion process are as follows: (1) Leave the central part of the liIili wide line to prevent significant deformation or positional shift. (2) Preserve the connection relationship. ( 3) Minimize line length reduction. To meet this requirement, an off-site line thinning method is known. This method consists of sequential processing in raster scanning order, and is easy to implement. It is also efficient. The properties of the resulting thin line drawing are clear. An off-site method will be explained. The number of connections of 8 connections shown in equation (3) is used. For simplicity, the subscript (8) is used. The definition is the same, and regarding Po, it is written as No.Furthermore, the number of pixels N and G in the 8 neighborhood with the value 1 is defined as follows: Na(Pa)−1ΣX, (5) -11 Na is simply called the number of neighbors, and No is called the number of connections.The distinction between Na and N is extremely important.Since Na is from O to 8, it is an integer less than or equal to 4.8 neighbors To separate rings of pixels from each other, at least one pixel with value 0 (Xj = 0) is required per cut. = 1) is 8. Therefore, the number of connections must be 4 or less. (Variable P is omitted for simplicity) O≦Na≦8 (5) 0≦Ima.≦4 (6) Furthermore , a group of separated pixels with a value of 1 always includes one or more pixels with a value of 1, so Town ≧ No(7
). There are N separated pixels of value 1, but at least one pixel of X-0 is required for separation. Therefore, if there are at least N pixels of X=0, I(6 connections will not occur. If there are N0 or more pixels of
The pixels where X≦1 are (8-No) or less. That is, Na≦8−No(8). No. is called the number of connections, and is the number of groups of pixels with a value of 1 that are separated by removing that pixel. However, whether it is connected or not is determined depending on whether it is connected or not, so it depends on whether you are thinking of 8-connection or 4-connection. Furthermore, if a hole is created by removing that pixel, the number of connections is obtained by subtracting the number of holes. In reality, there can only be one hole, and creating a hole means that the pixel is surrounded by connected pixels with a value of 1, so the number of groups with a value of 1 can only be 1. . Therefore, when holes are formed, No is 0. Conversely, No-0 means that there is no pixel with a value of 1 in the vicinity (an isolated point), or that a hole is created by removing that pixel. Isolated points do not contribute to the line and are therefore not processed. here 8
Since they are connected, in order to have a hole (in other words, to be surrounded by connected pixels with a value of 1), at least
It is necessary that the four pixels on the two bottom left and right sides have the value I. Therefore, for N, -〇(P≦1), the pattern of Na≧4(9) may be targeted. The above equations (5)' to (9) represent Na and N. This is either a limitation caused by the definition of , or another limitation is added by the thinning process. This will be explained next. The thinning process outside the premises is performed by repeatedly performing the following three partial processes. (1) Classify pixels having a value of 1 (xo=i) into the following three types. A-[PolX3°X5=01 B=(po (x3, X5==l and X7.Xl
≦0 ) C other (x3x5x7x1=l ) (11
) Starting from the top left of the screen, first move to the right, and when you reach the right edge,
Next row, in order from left to right, PoEA and N
. Pixel P where (Po)=1 and Na(Po)+1. Change the value of to 0. Do this until you reach the bottom right corner of the screen. (In the reverse order of song (11), proceed from the bottom right corner of the screen to the left, and when there is excess on the left edge, go one line up from the right edge to the left edge, and then 2 more lines.) From the second right edge to the left edge... ) PoEB and N. (Po) = 1 and f om (Po) * t pixel P. value is 0.
will be changed to. Do this until you reach the top left corner of the screen. The above processes (I) to (it) are repeated until there are no more pixels whose values are changed in (II) and li). In this way, thinning is achieved. First, in the process (1), the pixel C is surrounded by pixels having a value of 1 on the left, right, top and bottom (If.-0). This is an internal point, and removing it will create a hole, so it is temporarily removed until it appears on the boundary in the following process. In A and B, either the top, bottom, left or right pixels have a value of 0. Among these, if the number of connections is 1 and the number of neighbors is 1 or more, this pixel and a neighboring pixel with a value of 1 form a group. Even if this pixel is excluded (even if the value is set to 0), the connection relationship between neighboring pixels is preserved. Therefore, in order to make the wire thinner, NC”
" 1, Na 'P L is changed to O. No. 1, Na = 1 is left as it is an end point. The reason why the processing order is different for A and B is because of the thinning process. This is to reduce the bias.Even if there are pixels that are equivalent (belonging to groups A and B, No.=1, Na41.), those that are processed first are likely to be removed, and those that are processed later are (Because the surrounding pixels with a value of 1 have already decreased), the number of G is removed. Therefore, outside the premises, the processing order is reversed for groups A and B. However, due to the difference in order, the value of 1 is There is no big difference in the pixels changed from 0 to 0.As a simple method, for both groups A and B, move from the top left of the screen to the right at the same time, and the next row also from left to right. In fact, the inventor believes that a simpler algorithm is more convenient because it reduces scanning errors.The partial processing is as follows: (1) Value Divide the pixel with 1 (XO=1) into the following two types: A-I Pol X3X5X7Xl = 0, )
C=! Po 1X3X5x7X1" 1 ] (11
) From the top left of the screen, first move to the right, then move the next line from the left to the right, and so on.
EA and Nc(Po)”-t and Na(Po)4
1 pixel P. Change the value of (continue) to 0 until you reach the bottom right corner of the screen. Repeat the partial processing of (1) and (11) in (11) until there are no more pixels whose values will be changed. Figure 11 shows an example of line thinning processing. (a) is a binary image before processing, and (b) is an image after line thinning processing using a simplified algorithm. In (a), Width is 21Jl
! What used to be I elements or 3 pixels are now all thin lines with a width of 1 pixel. (G) Connection determination processing (general principles) The core of the present invention is the connection determination processing. Pixels in a connected relationship are tracked and connections are determined by the arrangement of pixels in a 3×3 local area (Po to P8), which is significantly different from the conventional method. This processing is performed based on the following two properties of the image remaining as a result of hole filling and thinning processing. K property quality II value 0 is N. A point of −0 means that all neighboring pixels have a value of 0 (Na=0
). K property quality 2 blade value 1teN. The −1 point is always an end point (t'Ta = 1). Property 1 becomes like this because the hole filling process was performed. No
:0 means that either Pl, P3, P5, and P7 all have a value of 1, or all of the eight neighboring pixels P1 to P8 have a value of 0. The former case is impossible due to hole filling. Therefore, the value OteN. If it is -0, all neighboring pixels are 0. This is the "earth" part. Property 2 is due to the thinning process. For thinning, value 1 and No=1
, all points with Na=+1 were removed. With a value of 1, N0=1 and the only thing left is 1IJa-=i. Since only one of the neighboring pixels has the value 1, this is an end point. The remaining pixels with value 1 are as follows. (1) All of No=2.3.4 (2) N. −
1, I (a-1 (endpoint) (3) All the lines with No=o were thinned by removing all the lines with No=1 and NaN3, so the lines with N=0.2 and 3.4 remain. Several combinations are allowed for No1Na.As mentioned above, the inequalities (5), (6) to (9) must be satisfied, so the combinations of No, I(a) are limited. Isolated points (l- = o, Po = 1) are not initiated (even if they exist, they are ignored because they are not involved in the connection).
Therefore, Na1=Q is also omitted. FIG. 12 is a table showing impermissible combinations of Na and No. Prohibited combinations are indicated by diagonal lines. N laterally. The value of Na is taken in the vertical direction. The two columns on the right side are prohibited due to formula 7). The lower right column is prohibited because it is formula (8), and the top three columns on the left are prohibited because it is formula (9). The bottom 7 columns of No. 1 have been removed to make the lines thinner. The remaining combinations are Na=415+6,718I ma for N=Q.
For -1 ■Chi=1 N For -2 Na=2.8,4,5.6N =3
About 1? For a=3,4,5N=4
Na=4. Let's actually draw a 3x3 pixel pattern for these combinations. Po is the central pixel (value 1) and is indicated by a white circle, and other neighboring pixels (value 1) are indicated by black circles. Areas without circles have a value of 0. FIG. 13 shows specific pixel patterns for such permissible combinations, and No is used as the main classification. N laterally. The value of I is shown from top to bottom. One column is a 3×3 (PoN P8) pattern, and only one pattern that matches due to changes due to rotation or mirror image is shown as a representative. If the value is No or Na is increased by one, it is sufficient that the even numbered pixels (P2, P4, P6, P8) change from the value 0 to 1. Items with this kind of relationship are indicated by arrows pointing from top to bottom. In Figure 5, the number of neighbors Xqa is used for main classification, and the number of connections is N. The patterns are organized using the following for classification. The contents are the same as FIG. 13. In this way, there are only 32 types of patterns that can remain after the thinning process. Furthermore, the three patterns numbered α, β, and γ in the figures (FIGS. 5 and 13) cannot exist. When determining the values of surrounding pixels, a diagonal pixel (P2 P4 P6 P8) with a value of 0 will be surrounded by four pixels with a value of 1, so that the number 20 becomes P21, N ,
Since it becomes 0, it goes against Property 1. The pattern of α will be explained with reference to FIG. Instead of black circles and white circles, write 11. Figure 14(a) or α
This is the starting point pattern. P to the left of Pl. , below as P8 or X-1. In order for Pl not to be erased during line thinning, there must be a pixel with a value of 1 to the diagonal upper right of Pl. Otherwise N
. This is because it becomes -1, Na 4 t and is erased. Similarly, there must be a pixel with a value of 1 at the upper right corner of P3. Then, a peripheral pattern like the one shown in FIG. 14 must exist. In this case, the pixel of X2-〇 is N. = 0 and N is 40, that is, a hole remains. The holes have disappeared due to the hole filling process,
This is impossible because holes are not generated due to the 4111m extension. In other words, pattern α is a pattern that is not dried. β will be explained with reference to FIG. (a) is the starting pattern, black circles and white circles are represented by 1, and areas without circles are represented by 0. Similarly, in order for the pixels of Xi ``'' 1 and X3 = 1 to not disappear, there must be a pixel with a value of 1 diagonally to the upper right of each, and the distribution of surrounding pixels will be as shown in ('b). Then, X2=0 becomes a hole. Since no holes should occur, it turns out that the β pattern is not allowed after all. r is shown in FIGS. 16(a) and (b). The γ pattern is also not allowed for the same reason. Among the possible patterns of 32 Yufu, 3 are 5'1
Since the pattern is extinct, only 29 patterns remain. Among the 29 types of patterns, there are also a, b, and c. The six patterns d, e, and f are special. In the patterns a to r, four pixels with a value of 1 form a minute square. It is difficult to determine the connection of something like this. This will be discussed later. Connections can be easily determined for the remaining 23 patterns. The connection determination process is as follows.

【条 件1月 11jll 禦間の決定に矛盾がない事。すなわち、画
素Aを中心とする3×3パターンにおいて、画素Aと画
素Bが接続されるのであれば、画素Bを中心とする3×
3パターンにおいても画素Bが画素人に接続されねばな
らない。 K条 件2)1 連結関係を保存すること。すなわち、値1て連結な1つ
の領域に属する任意の2画素は、互に直接又は間接に接
続されなくてはならない。 K条 件3)1 不要なループを生じないこと。すなわち、接続がループ
を構成した場合には、その内側に孔(値0の領域)が存
在しなくてはならない。 これら3つの条件を満すため、前記23種類のパターン
に対して、次の2原則をたてることができる。 一接&原則− ■原 則1刀 上下左右の(値1の)画素には必ず接続する事。 K原 則2刀 斜めの位1aにある(値1の)画素には、中心画素の上
下左右にある4画素のうち、その画素に隣接する2画素
が共に0である時に限って接続する。 原則1.2は、中心画素P。と近傍画素の値1のものと
を接続する時、上下左右の4近傍が優先する、という事
を述べている。4近傍がある場合、中心画素は4近傍(
pl、p、、p5、p7)と接続される。 斜めの画素は、この4近傍の画素と上下左右方向の線で
接続される。つまり、PoからPl、P、からP2へと
接続される。4近傍があるとき、斜めの画素と中心画素
とは間接的に接続される。 4近傍が0の時、斜めの画素は、Poと直接斜線によっ
て結ばれる。 上下左右の4近傍が、斜めの4画素に優先するのは、条
件2を満す必要性から由来する。斜めの接続は、上下左
右の接続を2つ組合せることによって構成できる。しか
し、上下左右の接続は、斜めの接続をいくつ組合しても
、これを再構成する事ができない。 第6図に、23種類のパターンに対して、原則1.2を
適用して、接続決定したものを示す。このように3×3
の単位パターン内だけの考察によって、中心画素P。と
近傍画素との接続を決定することができる。 第6図に於ては、中心画素(白丸で表わす)と近傍画素
の接続を線分で示している。近傍画素同士の接続は、3
×3の単位パターンの中心をその画素に移してから考察
され、決定される。 中心画素と結ばれていない近傍画素は孤立点であるわけ
てはなく、中心画素に結ばれた他の近傍画素と結ばれる
。 汐)接続決定処理(例外側) 第5図、第13図に現われるa〜fの6つのパターンは
、値1である小正方形(2×2パターンが全て値1)を
有する。このようなパターンは前節の原則1.2を適用
すると、小正方形の孔のないループか生してしまう。こ
れは条件3を満足することができない。 そこで、a−fのパターンに対し例外側を作る必要があ
る。 2×2パターンか全て値1であるものは、第7図に示す
5つのパターンP1、P2、・・・・・・、P5ノ内ノ
一部にすぎない。5つのパターンしか細線化後には残り
得ない。 これを仮に密集パターンと呼ぶ。 パターンP1について説明する。2×2の値1の4つの
画素の右上のものを50とする。画素50の右を51、
右上を52、上を53とする。細線化によって画素50
が消えないためには、とこに値1の画素がなければなら
ないか9という事である。 51〜53に画素(値1の)かなければ、画素50はN
。−1、Na、+1であるので、細線化で消失すべきて
あった。 斜上の52に値1の画素があれば、画素50はN。 =2、N、4=1であるから、細線化の後も、画素5゜
は生き残ることができる。 51に値1の画素がある場合はとうか?52.53が値
0であるとすると、画素50はN。−1、Naキ1であ
るので、細線化で消えてしまう。51と53が値1で、
52が値0であればどうか?この場合、No=0となる
ので、細線化によって消えない。 51.52.53の全てが値1であればどうか?この場
合、画素53が生き残るため、左斜上の59が値1でな
ければならない。そうであると、画素53のの左の54
が孔になってしまう。細線化によって孔がてきるはずが
ないので、これは否定される。 結局、画素50が細線化後生きのこるためには、52(
斜め)に値1の画素かあるが、又は、右51、上53に
値1の画素かあるが、である。つまり、画 。 素50の3つの近傍について I(51,52,53) = (0、■、0)■(51
,52,53)=(、1,0,1)であるときのみ、画
素5oは細線化後も存在しうる。 ここでは画素50を2×2の正方形の右上のものとして
考察したが、他の3つの画素についても同じ事かいえる
。 パターンP1は、4つの2×21!i!I素を生き残ら
せるため、4隅の接続として全て配tiflを採用した
ものである。No=2である。 パターンP2は、3つについては配置Iを、1つについ
ては配置■を採用している。前記3つの画素については
NO−2であるがら生き残る。残すの■i8!!l素は
N。−0であるから生き残る。 パターンP3は、2×2の値1のパターンの内、対角方
向の2つについては配置1 (Nc =2 )を、残り
の2つについては配置II (N0二〇)を採用してい
る。 2×2の値1の画素についてはこれ以上の接続の態様は
存在しない。 今度は、2×3の小パターンが全て値1であるP4パタ
ーンを考えよう。2×3の4隅の画素については、既に
考察したので、3つ続きの中央の画素60の生き残り条
件を考えよう。60の右61、右上を62、上を63、
左上を64、左を65とする。 60の上3画素62.63.64が値0てあれば、画素
60についてN。−1、Na〜1であるから、細線化に
よって消失すべきであった。 63か値1てあれば、画素6oについてN0=oとなる
ので、60は生き残ることができる。 結局パターンP4は、3×2の密集パターンの4曜につ
いては、前記の配置Iを、中間の画素については、」二
をイ直1とする。 III (62,63,64)=(0,1,0)の配置
を採用したものである。 4隅の61.65について、前述の配置IIを採用する
事もできるはずである。このようにしたものが、パター
ンP5である。つまり、P4に於て、63を0とし、か
わりに61.65の右、上、左の68.6264.69
を値1とする。このような場合でも、63は値1てなけ
ればならない(そうでないと60が消えてしまう)。す
ると、新たに62.63.64を生き残らせるために、
さらに3つの値1の画素が必要になり、これを付加した
ものがパターンP5である。 パターンP5は3×3の値1である画素を含んでいる。 4隅については配置■を、中間の画素については配置[
■を適用し、それぞれN−2、No=Oとして、細線化
後も生き残るようになっている。 P5が最も大きい密集パターンである。これ以上大きい
密集パターンは存在しない。 ゛3×43×4値1の画
素が密集する事はない。 P5に於て、71.75を値1にして、3×4の値1の
パターンを作ったとする。すると隣りの70 % 73
かN。−]、Na 六1となり、消失してしまう事にな
る。 結局、2×2以上の小行列が値1である密集、<ターン
はP1〜 P3の4×4パターン、P4の4×5パター
ン、P5の5×5パターンしかない。つマリ5種句しか
ない。 前述のa〜fの6つのパターンは1P1〜P5の密集パ
ターンの一部にすぎない、という事が分る。 全体の密集パターンP1〜 P5について望ましい接続
を与えることができれば、これらの部分パターンa〜f
の接続は、その一部として決定する事ができる。 ここで岐路に立つ事になる。 前節で述べたように、通常のパターン(密集パターン以
外のもの)については、3×3の小領域だけを見て、一
意的に接続決定できた。密集パターンはP□〜P5シか
ない事が分っている。密集パターンの望ましい接続は既
に与えられているとする。密集パターンの寸法は4×4
から5×5まである。 ひとつの接続決定法は、次のように述べる事ができる。 1通常のパターンについては3×3の小領域りけから接
続決定し、密集パターンについては、密集パターンの全
体(4×4から5×5の領域)を見て接続決定する。」 というものである。本発明はこのような非局所的な方法
を用いない。今ひとつの方法け、「いかなるパターンで
あっても、3×3の小領域だけから、接続決定する。密
集パターンP、〜P5の一部分a −fのパターンにつ
いては、3×3の小領域での観察によって、接続決定す
るようにできる。」 というものである。本発明は、こちらの局所的な方法を
採用する。このため、P1〜P5とa −fのパターン
の関係について、さらに深く考察しなければならない。 a −fの接続について例外側を作るため、次の2つの
手順を定めよう。 K手 j1屓1Σ 密集パターンP□〜P5及びその回転について、条件1
〜3を満たずように接続を定める。この時、これらパタ
ーンの外部の画素と隣接している画素の接続については
、原則1.2をも満たすものとしなければならない(外
部の画素との間で条件1を満たずため)。 【手 順2Σ 密集パターンP1〜P5を3×3の部分パターンa〜f
に分解し、手順1の結果に従ってa〜fの中心画素の接
続を定める。 密集パターンP1〜P5の内イ1;接続については、予
めこれを決定しておく事かできる。曲角jて述べた条件
2(連結関係保存)、条件3(不要ループ排除)を満た
ずため、密集パターン内の全ての画素はループを作らな
いよう、直接、間接に接続されていなければならない。 さらに、ス・J称性の高い方か良い。 このためには、ある一点に接続を集中させた方が良い。 この点から、連結線が放射状に出るのでループを作らず
、対称性を高くてきるのである。 このような考察に基いて、P1〜 P5の接続を、第8
図のように決定する。値1の画素を黒丸で示す。 線分によって各画素の接続を表わす。ここでは、回転し
ててきるパターンも全て表現した。 Poと P5は4回対称性かあるので、ひとつしか描か
れていない。P、に於て、ひとつの点に4本の線を集中
させている。ループかなく、鏡映対称性を保つ。他にも
ループがなく、2回対称性のある接続もあるが、Plの
接続はこのように決めておく。 P2は回転による対称性が全くないので、4つの回転ノ
バリエーションがある。しかし、接続は全て同一である
。 P2以後に於て、黒丸を白丸で囲んだ二重丸が現われる
。これは上下左右を値1て囲まれた閉塞点(N、=O)
を示している。P2ては閉塞点に接続を集中させている
。 P3、P4は2回対称性があるので、2つの回転バリエ
ーションがある。接続は同一である。 P3は2つの閉塞点を持ち、これか対角方向にある。閉
塞点を結ぶ線分の垂直二等分線を引いて、この線上のひ
とつの画素に、連結線を集中している。 P4は、上下左右方向に2つの閉塞点を持つ。 P5は、5つの閉塞点を持つ。中央の閉塞点から、バカ
へ放射状に接続している。 パターンP1〜 P5が、どの部分パターンa −fを
含むかを考える。第8図又は第7図と、第5図又は第1
3図を突合すことによって、これを調べる事がてきる。 Plは部分パターンaのみを含む。 P2は3つのパターンa、b、cを含む。 P3は2つのパターンb、eを含む。 P4は2つのパターンC−%dを含む。 P5は3つのパターンd、e、fを含む。 第8図の右欄にこのようなパターンの所属関係を示した
。 逆方向から考えよう。 部分パターンaは、Pl、P2に含まれつる。Pl、P
2を3×3の小領域に分割しても、Plには閉塞点がな
く、P2にはひとつの閉塞点がある。従って、閉塞点の
有無によって、Plか P2かを区別できる。 部分パターンaか、Pl、P2のいずれかに含まれるか
が分れば飄P1、P2のどの部分であるか分る。すると
1予め決めたPl、P2の接続をそのままとってaの接
続を決定できる。 部分パターンbは、P2、P3に含まれうる。P2は閉
塞点が1、P3は閉塞点が2つある。P2、P3は4×
4パターンであるから、これを4つの3×3パターンに
分けても、閉塞点は全ての3×3パターンに現われる。 従って3×3パターンを見る事により閉塞点の数を知り
、bが所属しているのが、P2であるかあるいはP3で
あるかを決定できる。これを決定できれば、P2、P3
の接続から、パターンbの接続を決める事ができる。 部分パターンdはP4とP5に含まれる。P4の閉塞点
は2、P5の閉塞点は5である。しかし、P5は5×5
の寸法を持っているから、3×3のパターンに切る時、
切りようによって、含まれる閉塞点の斂は、3.4ある
いは5個となり一定しない。 一定しないか3以上であるから、その他のパターンと区
別できる。 このようにして、例外的な部分パターンa〜fがある時
、この/ぐターンがPINP5のどれに含まれるかをパ
ターン七閉塞点数から決定する。所属すべき密集ツクタ
ーンPl〜 P、が分れば、接続はP。 〜P5の予め定めた接続から容易に決定することかでき
る。 手順1、手順2を実行する前の部分処理を述べる。 ■部分処、E!1jll 各画素P。について閉塞点であるか否かの判定を行う。 Vo ” Xo XI X3 Xs X7が1であれ′
ば閉塞点である。0てあれば閉塞点てはない。 K部分処理2刀 各画素P。について、斜めの位置に閉塞点があるか否か
の判定を行う。 zo ” 3’2 + 、)’4 + ’16+ ’/
8(+は論理和を意味する) K部分処理3】 各画素P、について自分自身のZ及び周辺のX(zOP
X11X29X39X4IX5IX6gX79X8)の
9ビツトの情報から、その画素の接続を決める。 第9図はa〜fのパターンの接続を上述の手順、部分処
理に従って決定したものである。 パターンS、はPlか P2に属し、閉塞点があればP
2である。Plであるとすれば第8図にその接続か予め
決めであるから、これによって接続(3×3パターン)
を決定できる。 閉塞点かあればP2に属するので、第8図のP2の接続
を見て、3×3の部分の接続を決定できる。 パターンaのPl、P2は上下に同し画素配置を示して
いる。しかし閉塞点の(白黒丸)有無によって、接続が
異なっていることに注意すべきである。 他のパターンに於ても同じことてb−fについて、上下
に同一画素配置で、閉塞点のみ異なるものを示している
。閉塞点の故か異なる。 しかも、閉塞点の数の違いは、必ず中心画素からみて斜
めの画素に、閉塞点かあるか、無いかの差となって現わ
れる。これが大事なことで、部分処理2はこの性質を利
用している。 ツクターンbについて調べてみる。中心画素が閉塞点で
ある。P2は斜めに閉塞点がなく、P3は斜めに閉塞点
がある。 パターンCについて調べる。P2の場合、斜めに閉塞点
かない。P、の場合、斜めに1%”[点がある。 パターンdについては、P4、P5かありうる。斜めの
閉塞点は、P4にはなく、P5には2つある。z。 の定義は斜め閉塞点の論理和であるから、P4について
2゜−0、P5について2゜−1となり、同様に切然と
区別できる。 パターンfについてはP5の中心部しか対応するものが
ないので、直ちに接続が決定される。 繰返し述べると、a〜fの部分パターンについては、中
心画素と8近傍の値(Xo〜X8)により、a−fのど
れであるかを決定でき、斜め閉塞点の有無2゜から、P
1〜 P5のとの部分かを決める事かてき、従って接続
を確定することができる。 (ケ)追跡処理 穴埋め、細線化、接続決定処理を行ったので、最後の追
跡処理をする。 従来方法の追跡と異なるところは、本発明では既に接続
か決っており、単に接続線をたどるだけで追跡できる、
という事である。従って、追跡処理はh4j単で近隣の
画素の配置などを考X=に入れる必要はない。 追跡処理は次の5つの過程を繰返すことによって実行さ
れる。 (1) 端点又は分岐点から出発し、 (2) その画素の、予め接続決定された接続線の中か
ら適当にひとつを選び、これを消去し、又は使用済みで
あることの記録を行って、接続相手の画素へ移動する。 (3) 移動に際して、移動方向をあられず符号をチェ
イン初号として記録する。 (4)移動した先の画素の接続の内、移動前の画素との
接続について、消去又は使用済みであることの記録を行
う。 (5)端点、又は分岐点である場合は(1)へ、そうで
なければ(2)へ戻る。 以上の処理を必要なたけ行えば良い。単純なループの場
合には、ループ上の任意の1画素から出発ずれば良い。 (コ)本発明の装置(遂次処理) 画像処理の方法について前節までに詳しく説明した。 ここでは、画像処理のための装置について説明する。第
10図は画像処理装置の構成図である。 1は孔埋め処理回路、2aは細線化分類回路、2bは細
線化回路、3は接続決定回路、4は追跡回路である。5
は画像メモリ、6はA群メモリ、7は8群メモリ、8は
接続符号化メモリ、9はチェイン符号メモリ、10は制
御回路、11はアドレス!1ilJ御回路である。 (1)画像メモリ5に二値化された各画素の値を記憶し
ておき、これを順次読み出して、孔埋め処理回路1に与
える。 孔埋め処理回路1は内部に遅延回路を有し、各画素につ
いて、その画素及び周辺8画素(8近傍)の値を同時に
得られるようになっており、簡単な処理回路によって孔
埋め処理を行い、結果を画像メモリに返すと同時に、細
線化分類回路2aに与える。 細線化分類回路2aは、孔埋め処理回路1と同様に遅延
回路を有し、前述した細線化のための分類を行う。 A群はX3゜X5−0、B群はx3.x5=lかつX7
゜Xl−0の画素である。(これは構外の細線化手法を
使ってする場合であるがh簡易アルゴリズムを使う場合
は、A、、B群を分りる必要はない。)この結果は、A
群メモリ6、及び8群メモリ7に記憶される。 以上の処理を各画素について行うと、画像メモリ5には
孔埋め処理後の画素の値が記憶される。 A群メモリ6.8群メモリ7には、各画素がそれぞれA
、B群に属するか否かが記憶される。 (2)次に画像メモリ5から画素の値を順次読み出し、
同時にA群メモリ6から、各画素がA群に存するか否か
のj〃報を読み出して、細線化回路2bに与える5、 細線化回路2bは、遅延回路と、細線化条件判定回路を
有し、細線化条件を満たすA群の点を消去して、画像メ
モリ5に返ず。 (3)順序を逆にして、8群メモリ1を用いて同様の処
理を行なう。 この時、細線化回路2bの出力は、画像メモリ5と同時
に、細線化分類回路2a及び接続決定回路3に与えられ
、次の細線化の繰返しに備えると同時に、接続の決定も
行う。 接続決定回路3は、遅延回路と、遅延回路を有する閉塞
点検出回路と、これらからのデータから接続を表わす符
号を作る論理回路(又はROM )を有し、接続符号を
接続符号メモリ8に記憶させてゆく。 また接続決定回路3は、細線化終了判定回路を有し、細
線化がさらに行えるパターンを検出して制御回路10に
知らせる。 制御回路10は、(3)の処理の間、細線化終了判定回
路からの信号を見ており、細線化が終っていない場合に
は、(3)の終了後、(2)へ戻って、細線化を繰返す
。 一方、1)II誹化が終了したと判定された場合には、
接続符号メモリ8には正しい接続符号が格納された事に
なるので、次の追跡処理へ進む。 (4)接続符号メモリ8から接続ね号を読み出し、追跡
回路4に与える。 追跡回路4は、前回の進行方向を記憶しておくレジスタ
、前回の進行方向と対応する接続を接続符号から取り除
く1次マスク回路、この結果から次の進行方間を表わす
符号を作る方向符号生成回路、この方向に対応する接続
を接続符号から取り除く2次マスク回路を有し、方向符
号をチェイン符号メモリ9とアドレス制御回路11に与
える。 同時に接続符号を2つのマスク回路で修正して接続符号
メモリ8に返す。 アドレス制御回路11は方向符号に基づいて、接続符号
メモリ8のアドレスを変更し、次の画素へ処理を移動さ
せる。 このようにして追跡を行い、チェイン符号メモリ9にチ
ェイン符号を作ってゆく。 Q) 本発明の装置f (パイプライン処理)前節に於
て、本発明の画像処理装置について、遂時処理する場合
について説明した。同じ構成で、パイプライン処理を行
うようにすると、接続の決定のための時間的なオーバー
ヘッドは殆んどない。 接続の決定までの処理では、メモリの読み出し、書き込
みは予め定められた順序で良いので、メモリの高速化も
可能である。 また、細線化に並列処理型の方式を用いれば、追跡以外
は各画素について並列に実行しうるので、非常に高速に
行う事かできる。 (り効 果 予め3u跡を行うのではなく、細線化して、接続決定し
てから追跡する。このため、従来の方法のように、多く
の画素を不規則な順序で記憶から読み出し、追跡決定し
てゆく必要がない。予め接続決定するから、追跡は簡単
である。 接続決定処理も、3×3の小領域の画素の値と、斜近傍
に閉塞点があるがとぅがの9ビツトの情報だけてなされ
る。読み出すべき画素の数が少い。 従って、両速処理が可能となる。 このように、本発明によれば、線の連続性を正しく反映
したチェイン符号を、不要なループを生じることなく、
高速に41三成することができる。
[Conditions: January 11, 2019 There must be no contradiction in Mutsuma's decisions. In other words, if pixel A and pixel B are connected in a 3x3 pattern centered on pixel A, then a 3x3 pattern centered on pixel B is connected.
Even in the three patterns, pixel B must be connected to the pixel. K Condition 2) 1 The connection relationship must be preserved. That is, any two pixels belonging to one connected region with a value of 1 must be directly or indirectly connected to each other. K Condition 3) 1 No unnecessary loops should occur. That is, if the connections form a loop, there must be a hole (a region with a value of 0) inside the loop. In order to satisfy these three conditions, the following two principles can be established for the 23 types of patterns. Ikkou & Principle - ■Principle 1 Be sure to connect to the top, bottom, left and right pixels (value 1). K principle A pixel (value 1) located diagonally at position 1a is connected only when two pixels adjacent to that pixel among the four pixels on the top, bottom, left and right of the center pixel are both 0. Principle 1.2 is the center pixel P. It states that when connecting a pixel with a neighboring pixel having a value of 1, priority is given to the four neighboring pixels on the top, bottom, left and right. If there are 4 neighbors, the center pixel has 4 neighbors (
pl, p, , p5, p7). The diagonal pixel is connected to these four neighboring pixels by lines in the vertical and horizontal directions. In other words, Po is connected to Pl, and P is connected to P2. When there are four neighbors, the diagonal pixels and the center pixel are indirectly connected. When the 4-neighborhood is 0, diagonal pixels are directly connected to Po by a diagonal line. The reason why the four neighboring pixels on the upper, lower, left and right sides have priority over the four diagonal pixels is due to the necessity of satisfying condition 2. A diagonal connection can be constructed by combining two connections, top, bottom, left and right. However, the vertical and horizontal connections cannot be reconfigured no matter how many diagonal connections are combined. FIG. 6 shows connections determined by applying Principle 1.2 to 23 types of patterns. 3×3 like this
By considering only within the unit pattern, the central pixel P. The connection between the pixel and the neighboring pixel can be determined. In FIG. 6, connections between the central pixel (represented by a white circle) and neighboring pixels are shown by line segments. Connections between neighboring pixels are 3
After moving the center of the ×3 unit pattern to that pixel, it is considered and determined. Neighboring pixels that are not connected to the center pixel are not isolated points, but are connected to other nearby pixels that are connected to the center pixel. (shio) Connection determination processing (example outside) The six patterns a to f appearing in FIGS. 5 and 13 have small squares with a value of 1 (all 2×2 patterns have a value of 1). Applying principle 1.2 of the previous section to such a pattern will result in small square loops without holes. This cannot satisfy condition 3. Therefore, it is necessary to create an exception outer side for the pattern a-f. The 2×2 pattern, in which all values are 1, is only a part of the five patterns P1, P2, . . . , P5 shown in FIG. Only five patterns can remain after thinning. This is tentatively called a dense pattern. Pattern P1 will be explained. The upper right one of the four pixels with a value of 1 in 2×2 is set to 50. 51 to the right of pixel 50,
Let the upper right be 52 and the top be 53. 50 pixels due to thinning
In order for this not to disappear, there must be a pixel with a value of 1 or 9. If there is no pixel (value 1) in 51-53, pixel 50 is N
. -1, Na, and +1, so it should have disappeared by thinning. If there is a pixel with value 1 at 52 on the diagonal upper side, pixel 50 is N. Since =2, N, and 4=1, the pixel 5° can survive even after thinning. What if there is a pixel with value 1 in 51? If 52.53 is the value 0, then the pixel 50 is N. -1, Naki 1, so it disappears when the line is thinned. 51 and 53 have the value 1,
What if 52 is the value 0? In this case, since No=0, it will not disappear by thinning. What if all of 51, 52, and 53 have the value 1? In this case, in order for pixel 53 to survive, 59 on the diagonal upper left must have a value of 1. If so, 54 to the left of pixel 53
becomes a hole. This is denied because there is no way that holes would be created by thinning the wire. In the end, in order for pixel 50 to survive after thinning, 52 (
There are pixels with a value of 1 on the diagonal), or there are pixels with a value of 1 on the right 51 and top 53. In other words, the picture. For the three neighborhoods of prime 50, I (51, 52, 53) = (0, ■, 0) ■ (51
, 52, 53)=(, 1, 0, 1), the pixel 5o can exist even after thinning. Although pixel 50 is considered here as the upper right corner of a 2×2 square, the same is true for the other three pixels. Pattern P1 is four 2x21! i! In order to keep the I element alive, all four corner connections are made using TIFL. No.=2. Pattern P2 employs arrangement I for three and arrangement ■ for one. The three pixels survive although they are NO-2. Leave ■i8! ! The l element is N. It survives because it is -0. Pattern P3 adopts arrangement 1 (Nc = 2) for the two diagonal patterns among the 2×2 patterns with value 1, and arrangement II (N020) for the remaining two. . For pixels with a value of 1 in 2×2, no further connection mode exists. Next, let us consider a P4 pattern in which all 2×3 small patterns have a value of 1. Since we have already considered the four corner pixels of 2×3, let us consider the survival conditions for the central pixel 60 of the triplet. 61 to the right of 60, 62 to the upper right, 63 to the top,
Let the upper left be 64 and the left be 65. If the upper three pixels 62, 63, and 64 of 60 have a value of 0, then N for pixel 60. -1, Na~1, so it should have disappeared by thinning. If 63 or the value is 1, then N0=o for pixel 6o, so 60 can survive. In the end, the pattern P4 uses the above-mentioned arrangement I for the four pixels of the 3×2 dense pattern, and uses the arrangement I for the intermediate pixels. III (62, 63, 64) = (0, 1, 0) arrangement is adopted. Regarding 61.65 at the four corners, it should be possible to adopt the above-mentioned arrangement II. This pattern is pattern P5. In other words, in P4, 63 is set to 0, and instead of 68.6264.69 to the right, above, and left of 61.65.
Let be the value 1. Even in this case, 63 must have the value 1 (otherwise 60 will disappear). Then, in order to make 62.63.64 survive,
Three more pixels with a value of 1 are required, and the pattern P5 is obtained by adding these pixels. Pattern P5 includes 3×3 pixels with a value of 1. Place ■ for the four corners, place [ for the middle pixel
(2) is applied, and by setting N-2 and No=O, respectively, it is made to survive even after thinning. P5 is the largest dense pattern. There are no larger dense patterns.゛3×43×4 pixels with a value of 1 will not be crowded together. Assume that in P5, 71.75 is set to the value 1 to create a 3×4 pattern with the value 1. Then 70% of the neighbor 73
OrN. -], Na becomes 61 and disappears. In the end, there are only 4×4 patterns of P1 to P3, 4×5 patterns of P4, and 5×5 patterns of P5 for dense <turns in which small matrices of 2×2 or more have a value of 1. There are only five kinds of tsumari phrases. It can be seen that the six patterns a to f described above are only a part of the dense patterns 1P1 to P5. If desirable connections can be provided for the entire dense patterns P1 to P5, these partial patterns a to f
connections can be determined as part of it. You will come to a crossroads here. As mentioned in the previous section, for normal patterns (other than dense patterns), connections could be uniquely determined by looking at only 3x3 small areas. It is known that there is no dense pattern from P□ to P5. It is assumed that the desired connections of the dense pattern have already been given. The dimensions of the dense pattern are 4x4
There are sizes ranging from 5×5. One connection determination method can be stated as follows. 1. For a normal pattern, the connection is determined by looking at a 3×3 small area, and for a dense pattern, the connection is determined by looking at the entire dense pattern (4×4 to 5×5 area). ”. The present invention does not use such non-local methods. Another method is to determine the connection only from a 3x3 small area, no matter what the pattern is. By observation, we can determine the connections." The present invention adopts this local method. Therefore, it is necessary to consider more deeply the relationship between P1 to P5 and the patterns a to f. In order to create an exception for the connection a - f, let us define the following two procedures. K-move j1 1Σ Regarding the dense patterns P□ to P5 and their rotation, condition 1
-Determine the connections so that 3. At this time, the connections between pixels outside these patterns and adjacent pixels must also satisfy principle 1.2 (because condition 1 is not satisfied with the outside pixels). [Procedure 2Σ Concentrate patterns P1 to P5 into 3×3 partial patterns a to f
According to the result of step 1, the connection of center pixels a to f is determined. Among the dense patterns P1 to P5, connection 1 can be determined in advance. Since conditions 2 (preservation of connected relationships) and condition 3 (elimination of unnecessary loops) described in curve j are not satisfied, all pixels in the dense pattern must be directly or indirectly connected to avoid creating loops. . Furthermore, it is better to have a high S/J symmetry. For this purpose, it is better to concentrate the connections at one point. From this point, the connecting lines radiate out, creating no loops and creating a high level of symmetry. Based on these considerations, the connections of P1 to P5 were
Decide as shown. Pixels with a value of 1 are indicated by black circles. The connection of each pixel is represented by a line segment. Here, all rotating patterns are also expressed. Po and P5 have 4-fold symmetry, so only one is drawn. At P, four lines are concentrated at one point. There are no loops and mirror symmetry is maintained. There are other connections that do not have a loop and have two-fold symmetry, but the connection of Pl is determined in this way. Since P2 has no rotational symmetry, there are four rotational variations. However, all connections are the same. After P2, a double circle with a black circle surrounded by a white circle appears. This is a blockage point (N, = O) surrounded by a value of 1 on the top, bottom, left and right.
It shows. In P2, connections are concentrated at blockage points. Since P3 and P4 have two-fold symmetry, there are two rotational variations. The connections are the same. P3 has two occlusion points, which are diagonally opposite. A perpendicular bisector of the line segment connecting the occlusion points is drawn, and the connecting lines are concentrated at one pixel on this line. P4 has two occlusion points in the vertical, horizontal, and horizontal directions. P5 has five occlusion points. From the central blockage point, it connects radially to Baka. Consider which partial patterns a to f are included in patterns P1 to P5. Figure 8 or Figure 7 and Figure 5 or Figure 1
This can be investigated by comparing the three figures. Pl includes only partial pattern a. P2 includes three patterns a, b, and c. P3 includes two patterns b and e. P4 includes two patterns C-%d. P5 includes three patterns d, e, and f. The right column of FIG. 8 shows the affiliation of such patterns. Let's think from the opposite direction. Partial pattern a is included in Pl and P2. Pl, P
Even if 2 is divided into 3×3 small regions, Pl has no blockage point, and P2 has one blockage point. Therefore, it is possible to distinguish between Pl and P2 depending on the presence or absence of a blockage point. If it is known whether it is included in the partial pattern a, Pl, or P2, then it can be determined which part of the pattern P1 or P2 it is included in. Then, the connection of a can be determined by taking the predetermined connections of Pl and P2 as they are. Partial pattern b may be included in P2 and P3. P2 has one blockage point, and P3 has two blockage points. P2 and P3 are 4×
Since there are four patterns, even if this is divided into four 3x3 patterns, the occlusion point will appear in all the 3x3 patterns. Therefore, by looking at the 3×3 pattern, it is possible to know the number of blockage points and determine whether b belongs to P2 or P3. If this can be determined, P2, P3
The connection of pattern b can be determined from the connection of . Partial pattern d is included in P4 and P5. The blockage point of P4 is 2, and the blockage point of P5 is 5. However, P5 is 5×5
Since it has the dimensions, when cutting it into a 3x3 pattern,
Depending on how the cut is made, the number of occlusion points included is 3.4 or 5, which is not constant. Since it is not constant or is 3 or more, it can be distinguished from other patterns. In this way, when there is an exceptional partial pattern a to f, it is determined in which of the PINP5 this /g turn is included based on the number of pattern seven blockage points. If you know the dense connection Pl~P to which it should belong, the connection is P. It can be easily determined from the predetermined connections of ~P5. Partial processing before executing steps 1 and 2 will be described. ■Parts, E! 1jll each pixel P. It is determined whether the point is a blockage point or not. Vo ” Xo XI X3 Xs If X7 is 1'
This is the blockage point. If it is 0, there is no blockage point. K partial processing 2 swords each pixel P. , it is determined whether or not there is a blockage point at an oblique position. zo ” 3'2 + ,)'4 + '16+ '/
8 (+ means logical sum) K partial processing 3] For each pixel P, its own Z and surrounding X (zOP
The connection of that pixel is determined from the 9-bit information: FIG. 9 shows the connection of patterns a to f determined according to the above-described procedure and partial processing. Pattern S belongs to Pl or P2, and if there is a blockage point, P
It is 2. If it is Pl, the connection is determined in advance in Figure 8, so the connection (3x3 pattern) is made by this.
can be determined. If there is a blockage point, it belongs to P2, so the connection of the 3×3 portion can be determined by looking at the connection of P2 in FIG. Pl and P2 of pattern a indicate the same pixel arrangement on the upper and lower sides. However, it should be noted that the connections differ depending on the presence or absence of blockage points (black and white circles). The same is true for other patterns as well, with the same pixel arrangement on the top and bottom but only different occlusion points. It's different probably because of the blockage point. Moreover, the difference in the number of occlusion points always appears as a difference in whether pixels diagonal from the center pixel have occlusion points or not. This is important, and partial processing 2 utilizes this property. Let's look into Tsukutan b. The center pixel is the occlusion point. P2 does not have a diagonal blockage point, and P3 has a diagonal blockage point. Check out pattern C. In the case of P2, there is no diagonal blockage point. In the case of P, there is a 1%" [point diagonally. For pattern d, there can be either P4 or P5. There is no diagonal occlusion point in P4, and there are two in P5. The definition of z. Since it is a logical sum of diagonal blockage points, it becomes 2°-0 for P4 and 2°-1 for P5, which can be clearly distinguished in the same way.As for pattern f, there is only a corresponding one at the center of P5, so immediately The connection is determined. To reiterate, for the partial patterns a to f, it can be determined which one of a to f they are based on the central pixel and the values of the 8 neighbors (Xo to X8), and the presence or absence of diagonal blockage points can be determined. From 2°, P
1 to P5, and thus the connection can be established. (vi) Tracking processing Now that the hole filling, thinning, and connection determination processing has been performed, the final tracking processing is performed. The difference from tracing in conventional methods is that in the present invention, the connection has already been determined and can be traced simply by following the connection line.
That's what it means. Therefore, the tracking process is simply h4j, and there is no need to consider the arrangement of neighboring pixels in X=. The tracking process is executed by repeating the following five steps. (1) Starting from the end point or branching point, (2) Selecting one of the predetermined connection lines for that pixel and erasing it or recording that it has been used. , move to the connected pixel. (3) When moving, record the moving direction as the first code of the chain. (4) Among the connections of the pixel to which the pixel has been moved, the connection with the pixel before the movement is deleted or recorded as being used. (5) If it is an end point or a branch point, go to (1); otherwise, go to (2). It is sufficient to perform the above processing as many times as necessary. In the case of a simple loop, it is sufficient to start from any one pixel on the loop. (g) Apparatus of the present invention (sequential processing) The image processing method has been described in detail in the previous sections. Here, a device for image processing will be described. FIG. 10 is a block diagram of the image processing device. 1 is a hole filling processing circuit, 2a is a thinning classification circuit, 2b is a thinning circuit, 3 is a connection determination circuit, and 4 is a tracking circuit. 5
is the image memory, 6 is the A group memory, 7 is the 8 group memory, 8 is the connection encoding memory, 9 is the chain code memory, 10 is the control circuit, and 11 is the address! 1ilJ control circuit. (1) The binarized values of each pixel are stored in the image memory 5, read out sequentially, and provided to the hole-filling processing circuit 1. The hole-filling processing circuit 1 has an internal delay circuit so that for each pixel, the values of that pixel and 8 surrounding pixels (8 neighboring pixels) can be obtained simultaneously, and the hole-filling processing is performed using a simple processing circuit. , the result is returned to the image memory, and at the same time is given to the thinning classification circuit 2a. The thinning classification circuit 2a has a delay circuit like the hole filling processing circuit 1, and performs the above-described classification for thinning. Group A is x3°x5-0, group B is x3. x5=l and X7
It is a pixel of °Xl-0. (This is the case when using an off-site thinning method, but when using the simple algorithm, there is no need to separate groups A, B.) This result is
It is stored in the group memory 6 and the 8th group memory 7. When the above processing is performed for each pixel, the value of the pixel after the hole filling process is stored in the image memory 5. In the A group memory 6 and 8 group memory 7, each pixel is
, whether it belongs to group B or not is stored. (2) Next, sequentially read the pixel values from the image memory 5,
At the same time, information on whether each pixel exists in the A group is read from the A group memory 6 and given to the thinning circuit 2b.The thinning circuit 2b has a delay circuit and a thinning condition determination circuit. Then, the points of group A that satisfy the thinning conditions are deleted and returned to the image memory 5. (3) Reverse the order and perform the same process using the 8 group memory 1. At this time, the output of the thinning circuit 2b is given to the image memory 5, as well as the thinning classification circuit 2a and the connection determination circuit 3, to prepare for the next repetition of thinning and to determine the connection. The connection determination circuit 3 has a delay circuit, a blockage point detection circuit having the delay circuit, and a logic circuit (or ROM) that generates a code representing a connection from data from these circuits, and stores the connection code in a connection code memory 8. I'll let it happen. Further, the connection determining circuit 3 includes a thinning completion determination circuit, detects a pattern that can be further thinned, and notifies the control circuit 10 of the pattern. During the process of (3), the control circuit 10 monitors the signal from the thinning completion determination circuit, and if the thinning is not completed, after completing (3), returns to (2). Repeat thinning. On the other hand, if it is determined that 1) II slander has been completed,
Since the correct connection code has been stored in the connection code memory 8, the process proceeds to the next tracking process. (4) Read the connection code from the connection code memory 8 and provide it to the tracking circuit 4. The tracking circuit 4 includes a register that stores the previous direction of travel, a primary mask circuit that removes the connection corresponding to the previous direction of travel from the connection code, and a direction code generator that generates a code representing the next direction of travel from this result. The circuit has a secondary mask circuit which removes the connection corresponding to this direction from the connection code and provides the direction code to the chain code memory 9 and the address control circuit 11. At the same time, the connection code is corrected by two mask circuits and returned to the connection code memory 8. The address control circuit 11 changes the address of the connection code memory 8 based on the direction code, and moves the processing to the next pixel. In this way, tracking is performed and a chain code is created in the chain code memory 9. Q) Apparatus f of the present invention (Pipeline processing) In the previous section, the case where the image processing apparatus of the present invention performs simultaneous processing was explained. If pipeline processing is performed with the same configuration, there will be almost no time overhead for connection determination. In the processing up to determining the connection, reading and writing to the memory may be performed in a predetermined order, so it is possible to increase the speed of the memory. Furthermore, if a parallel processing type method is used for line thinning, processes other than tracking can be executed in parallel for each pixel, so it can be performed at extremely high speed. (The effect of There is no need to do this. Tracking is easy because the connection is determined in advance. The connection determination process is also based on the pixel values of a 3 x 3 small area and the 9-bit data, although there is a blockage point near the diagonal. The number of pixels to be read out is small. Therefore, dual-speed processing is possible. As described above, according to the present invention, a chain code that correctly reflects the continuity of a line can be created without unnecessary without creating a loop.
You can make 41 triples at high speed.

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

第11ズ(a)はチェイン符号の定義の一例を示す3×
3画素図。矢印は移動の方向を示し、数字は、この方向
に付されるチェイン符号である。(bJは値jの画素の
分布の一例とチェイン符号を付すべき方向を示す矢印を
表わす画像図。 第2図は、分岐点に於る接続の過不足の例を示す。(3
月才無意味な小ループができている。(b月産接続され
るべき分岐点が接続さねてぃない。(C)はやはり接続
が足りない例を示す。 第3図は大きさlの孔が存在する3×3画素図には孔埋
めをする、という事を説明する。(a)は孔埋め前で、
■)は孔埋め後を示す。 第4図は中心画素Poと周辺画素P1〜 P8の表記を
示す説明図。 第5図は細線化処理後に残る32種類の3×3画素パタ
ーン図。周辺画素(値1の)数Naを主分類とし、連結
数N。を画分類に用いた。中心画素を白丸、周辺(値1
)画素を黒丸で示す。 第6図は2×2密集パターンの一部でない通常のパター
ンの接続側を示すパターン図。周辺画素数Naを主分類
に、連結数N0を画分類に使う。中心画素を白丸、周辺
(値1)画素を黒丸で示す。左2行は端点、中間4行は
継続点、右2行は分岐点を示し、中心画素からの接続の
数は、それぞれ、■、2.3又は4本である。 @7図は2X2の画素が全てlである茫MSパターンの
可能な5つのパターンP、〜P5を示す画素図。 第8図は密集パターンP1〜 P5の接続図。白黒二重
丸は閉塞点て、P1〜P5の図の右端に、これらパター
ンが含みうる部分パターンa〜fが示しである。 第9図は部分パターンa −fの閉塞点の存在によって
接続を決定すべき接続側画素図。 第10図は本発明の画像処理装置の回路構成図。 第11図は細線化処理の一例を示す画像図。(a)は細
線化処理前、(b)は細線化処理後の画素分布を示す。 第12図は連結@ xqoと周辺の値Iのig素数Na
との組合せにより、禁止されるものがあることを示す図
。斜線を施した組合せは禁止される。(7)、(8)、
e)はそれぞれ対応する不等式によって禁止される事を
示す。「細線化」とあるのは細線化処理によって消えて
しまうものを表わしている。 第13図は第5図と同じく細線化処理後に許される32
種類の3×3画素バクーン図。第5図と異なる点は、主
分類に連結数N。を、画分類に近傍画素数Naを用いた
点である。矢印は同一連結数を保ちながら、ひとつの画
素に1を加える事により近傍画素数をNa+1とするも
のを示している。α〜γはへILJ辺の画素パターンを
考慮すると、禁止されるパターン。a −fは2×2の
画素が全て値1である密集パターンを一部に含むパター
ンである。 第14図は、パターンαが禁止される事を説明する画素
配置図。第5図、第13図で黒丸、白丸で表わしていた
値1の画素をここでは数字1で示す。 「地」の部分は、第5図、第13図では単に空白で示し
ていたか、ここでは数字0で示している。孔「0」を強
調するためである。(a)はパターンαの3×3小領域
、(b)はパターンαを維持するため、0の右、」二に
1が必要であり、このため孔r01が発生ずることを示
す小領域画素図。 第15図はパターンβが禁止されることを説明する画素
配置図。(a’ )はβの3×3画素図。(′b)は周
辺の画素も含めた図で孔「0」が発生している画素図。 第16図はパターンγが禁止されることを説明する画素
配置図。(a)はγパターン図。(′b)はγパターン
の周辺も含めた画素図。 1 ・・・・・・・ 孔埋め処理回路 2a ・・・・・・・・・ 細線化分類回路2b ・・
・・・・・・・ 細線化回路3 ・・・・・・・・・ 
接続決定回路4 ・・・・・・・ 追跡回路 5 ・・・・・・・・・ 画像メモリ 6 ・・・・・・・・・ A群メモリ 7 ・・・・・・・・・ B &’lメモリ8 ・・・
・・・・・ 接続符号メモリ9 ・・・・・・・・・ 
チェイン(へ)号メモリ10 ・・・・・・・ 制御回
路 11−・・・・・・・・ アドレス制御1す1路黒丸・
・・・・・ (iti 1の画素白丸・・・・・・・・
 値1の中心画素Po ・・・・・・・・ 中心画素 P1〜P8・・・・・・ 近傍I1.j!+素(la−
f ・・・・・・ 2×2の値1の画素を含む部分パタ
ーン P1〜P5・・・・・・ 2×2の値1の画素を含むパ
ターンを一部分として含む 密集パターン D Φ °Oi −の 0 0 1) −OU ℃ Φ →− 第11図 (a) 439− 第12図 第14図 (a)。!、(b) 手続補正書哨発)6゛ 特許庁長官者 杉 和 夫 殿 1、事件の表示 特願昭58−114917 2、発明の名称 画像処理方法と装置 3、補正をする者 事件との関係 特許出願人 居 所大阪市東区北浜5丁目15番地 名 称 (213)住友電気工業株式会社代表者社長 
川 上 哲 部 4、代 理 人 曇537 住 所 大阪市東成区中道3丁目15番16号毎日東ビ
ル704 雷06 (974)6321明細書の「発明
の詳細な説明」の41Th+1補正の内容 明利j書第25頁第11行目 「・・・なくなるまで繰返す。」のあとに改行して次の
文を付加する。 「ただし、この簡略法は特定の幾何学的パターンで不具
合を生じる。例えば横幅が偶数画素である矩形はこの簡
略法では消されてしまう。従ってこのようなパターンが
存在しないことが保証されている場合に限って前記の1
ハj略法が有効であって、さらに一般には前述の厳密な
アルゴリズムが用いられるべきである。」A
The 11th item (a) shows an example of the definition of a chain code, 3×
3 pixel diagram. The arrow indicates the direction of movement, and the number is the chain code attached to this direction. (bJ is an image diagram showing an example of the distribution of pixels with value j and an arrow indicating the direction in which a chain code should be added. Figure 2 shows an example of excess or deficiency of connections at a branch point. (3
A meaningless little loop has been created. (The branch point that should be connected is not connected. (C) shows an example where the connection is insufficient. Figure 3 shows a 3x3 pixel diagram in which there is a hole of size l. Explain that hole filling is done.(a) is before hole filling.
■) shows after hole filling. FIG. 4 is an explanatory diagram showing the notation of the central pixel Po and the peripheral pixels P1 to P8. FIG. 5 is a diagram of 32 types of 3×3 pixel patterns remaining after thinning processing. The number of peripheral pixels (with value 1) Na is the main classification, and the number of connections is N. was used for image classification. The center pixel is a white circle, the periphery (value 1
) Pixels are indicated by black circles. FIG. 6 is a pattern diagram showing the connection side of a normal pattern that is not part of a 2×2 dense pattern. The number of peripheral pixels Na is used for main classification, and the number of connections N0 is used for image classification. The center pixel is shown as a white circle, and the peripheral (value 1) pixels are shown as black circles. The left two lines indicate end points, the middle four lines indicate continuation points, and the right two lines indicate branch points, and the number of connections from the center pixel is ■, 2.3, or 4, respectively. @7 Figure is a pixel diagram showing five possible patterns P, ~P5 of the 2×2 pixel of the Tsumari MS pattern. FIG. 8 is a connection diagram of dense patterns P1 to P5. The black and white double circles are occlusion points, and the right end of the diagram for P1 to P5 indicates partial patterns a to f that these patterns may include. FIG. 9 is a connection-side pixel diagram in which connection is to be determined based on the presence of blockage points of partial patterns a to f. FIG. 10 is a circuit configuration diagram of the image processing apparatus of the present invention. FIG. 11 is an image diagram showing an example of line thinning processing. (a) shows the pixel distribution before the thinning process, and (b) shows the pixel distribution after the thinning process. Figure 12 shows the connection @xqo and the ig prime number Na of the surrounding value I.
A diagram showing that some things are prohibited in combination with. Combinations marked with diagonal lines are prohibited. (7), (8),
e) indicates that it is prohibited by the corresponding inequality. The term "thinning" refers to what disappears through the thinning process. Figure 13 is the same as Figure 5, which is 32 that is allowed after the thinning process.
3x3 pixel Bakun diagram of types. The difference from Figure 5 is the number of connections N in the main classification. The point is that the number Na of neighboring pixels is used for image classification. The arrow indicates that the number of neighboring pixels is set to Na+1 by adding 1 to one pixel while maintaining the same number of connections. α to γ are patterns that are prohibited when considering the pixel pattern on the ILJ side. A to f are patterns that partially include a dense pattern in which all 2×2 pixels have a value of 1. FIG. 14 is a pixel layout diagram explaining that pattern α is prohibited. Pixels with a value of 1, which were indicated by black circles and white circles in FIGS. 5 and 13, are indicated by the number 1 here. The "ground" part was simply shown as a blank in Figures 5 and 13, or is shown here with the number 0. This is to emphasize the hole "0". (a) is a 3x3 small area of pattern α, (b) is a small area pixel showing that in order to maintain pattern α, 1 is required to the right of 0, and therefore hole r01 is generated. figure. FIG. 15 is a pixel layout diagram explaining that pattern β is prohibited. (a') is a 3x3 pixel diagram of β. ('b) is a pixel diagram including surrounding pixels, where hole "0" has occurred. FIG. 16 is a pixel layout diagram explaining that pattern γ is prohibited. (a) is a γ pattern diagram. ('b) is a pixel diagram including the periphery of the γ pattern. 1... Hole filling processing circuit 2a... Thinning classification circuit 2b...
・・・・・・ Thinning circuit 3 ・・・・・・・・・
Connection determination circuit 4 ...... Tracking circuit 5 ...... Image memory 6 ...... Group A memory 7 ...... B &'l memory 8...
・・・・・・ Connection code memory 9 ・・・・・・・・・
Chain memory 10... Control circuit 11-... Address control 1-1 road black circle.
(iti 1 pixel white circle)
Center pixel Po with value 1... Center pixels P1 to P8... Neighborhood I1. j! + element (la-
f...Partial patterns P1 to P5 including 2×2 pixels with a value of 1 Dense pattern D Φ °Oi − which partially includes a pattern including 2×2 pixels with a value of 1 0 0 1) -OU °C Φ →- Figure 11 (a) 439- Figure 12 Figure 14 (a). ! , (b) Procedural amendment sent) 6. Commissioner of the Japan Patent Office Kazuo Sugi 1. Indication of the case Patent application 1987-114917 2. Name of the invention Image processing method and device 3. Person making the amendment Related Patent Applicant Residence 5-15 Kitahama, Higashi-ku, Osaka Name (213) Representative President of Sumitomo Electric Industries, Ltd.
Satoshi Kawakami Department 4, Agent 537 Hitodumi Address 704 Mainichi Higashi Building, 3-15-16 Nakamichi, Higashinari-ku, Osaka Rai 06 (974) 6321 Contents of the 41Th+1 amendment to the "Detailed Description of the Invention" in the Specification After the 11th line of Akiri J, page 25, ``...Repeat until there is nothing left.'', add a new line and add the following sentence. "However, this simplified method causes problems with certain geometric patterns. For example, rectangles with an even number of pixels in width are erased by this simplified method. Therefore, it is guaranteed that such patterns do not exist. 1 above only if
The Hj strategy is effective, and more generally the exact algorithm described above should be used. ”A

Claims (6)

【特許請求の範囲】[Claims] (1)縦横方向に離散化され値1又は値0のいずれかの
値を持つ多数の画素の集合よりなる線を表わすべきデジ
タル2値[■像から線をチェイン符号としてとり出す画
像処理方法に於て、画像内に存在し値0て上下左右を値
1の画素で囲まれる大きさが1画素分の孔を埋める孔埋
め処理と、分離された値1の近傍画素群数を与える連結
数N0か1て、値1の近傍画素数Naが2以上である値
1の画素を順次値0に変更し、変更される画素がなくな
るまで繰返す細線化処理と、上下左右を値1の画素で囲
まれた値1の画素を閉塞点とし、細線化処理後の画像中
に3×3パターンを考え中心画素Poの値と近傍8画素
P1〜P8の値と、Poの斜め位置の閉塞点の有蕪によ
り、その画素P。と近傍画素P1〜P8の接続を決定す
る接続決定処理と、端点又は分岐点から出発し予め決定
された接続に従って画素を追跡しチェイン符号を得る操
作を、接続されていない画素がなくなるまで繰返す追跡
処理とより構成される事を特徴とする画像処理方法。
(1) Digital binary value that represents a line consisting of a set of many pixels that are discretized in the vertical and horizontal directions and have a value of either 1 or 0 [■ Image processing method that extracts lines from an image as chain codes] In this case, there is a hole-filling process that fills a hole of size 1 pixel that exists in the image and is surrounded by pixels with a value of 1 on the top, bottom, left and right sides, and a connection number that gives the number of separated neighboring pixel groups with a value of 1. N0 or 1, the pixels with value 1 whose neighboring pixel number Na is 2 or more are sequentially changed to 0, and the thinning process is repeated until there are no pixels left to be changed, and the top, bottom, left and right are pixels with value 1. The surrounded pixel with value 1 is set as the occlusion point, and a 3×3 pattern is considered in the image after thinning processing, and the value of the center pixel Po, the values of the neighboring 8 pixels P1 to P8, and the occlusion point at the diagonal position of Po are calculated. According to the pixel P. A connection determination process that determines connections between and neighboring pixels P1 to P8, and an operation that starts from an end point or a branch point and traces pixels according to a predetermined connection to obtain a chain code, which is repeated until there are no unconnected pixels. An image processing method characterized by comprising processing.
(2) 連結数N。が、近傍8画素Piの値Xiの否定
をXiとして、 (X9−Xl) て定義される特許請求の範囲第(1)項記載の画像処理
方法。
(2) Number of connections N. The image processing method according to claim 1, wherein is defined as (X9-Xl), where Xi is the negation of the value Xi of eight neighboring pixels Pi.
(3) 連結数N。が、近傍8画素の値Xiによって、
て定義される特許請求の範囲第(1)項記載の画像処理
方法。
(3) Number of connections N. However, depending on the value Xi of the 8 neighboring pixels,
An image processing method as defined in claim (1).
(4)接続決定処理は、2×2パターンが全て値■であ
る密集部分パターンミルf以外の3×3パターンについ
て、中心画素と左右上下の画素を接続し、斜めの画素は
隣接する左右上下に値1の画素かない場合のみ接続する
ようにした特許請求の範囲第(2)項記載の画像処理方
法。
(4) Connection determination processing connects the center pixel to the left, right, top, and bottom pixels for 3×3 patterns other than the dense partial pattern mill f in which all 2×2 patterns have the value ■, and diagonal pixels are connected to the adjacent left, right, top, and bottom The image processing method according to claim 2, wherein the image processing method is connected only when there is no pixel with a value of 1.
(5)接続決定処理は、2×2パターンが全て値1であ
る部分パターンa〜fか、5つの可能す密集パターンP
1〜P5のいずれかの一部分であることを中心画素、近
傍画素の値と斜め方向の閉塞点の有無により判定し、予
め定められた密集パターンP1〜P5の接続に従い部分
パターンa −fの接続を決定するようにした特許請求
の範囲第(4)項記載の画像処理方法。
(5) Connection determination processing is performed using partial patterns a to f in which all 2×2 patterns have a value of 1, or five possible dense patterns P.
1 to P5 is determined based on the values of the center pixel, neighboring pixels, and the presence or absence of obstructing points in the diagonal direction, and the partial patterns a to f are connected according to the connection of predetermined dense patterns P1 to P5. An image processing method according to claim (4), wherein:
(6)縦横方向に離散化され値1又は値0のいずれかの
値を持つ多数の画素の値を記憶する画像メモリ5と、画
像メモJ) 5に記憶された各画素及び近傍画素の値を
読み出し値0で上下左右を値1の画素で囲まれた画素の
値を1とし画像メモリ5に記憶させる孔埋め処理回路1
と、各画素P。の近傍画素の向上P3と左P5がいずれ
か0であるA群の画素と、P3、P5は1であるがP7
とPlのいずれかが0であるB群の画素とを分類する細
線化分類回路2aと、A群の画素を記憶するA群メモリ
6と、B群の画素を記憶する8群メモリ7と、画像メモ
リ5とA群メモリ6.8群メモリ7から順次画素とその
近傍画素の値を読み出して近傍画素数Naが2以上で、
連結数が1である画素の値を0に変更する細線化回路2
bと、上下左右が値1の画素で囲まれた値1の閉塞点を
検出する閉塞点検出回路と細線化終了判定回路とを有し
中心画素と近傍画素の値及び斜め位置の閉塞点の有無か
ら中心画素Poと近傍画素P1〜P8の接続を決定する
接続決定回路3と、接続決定された画素につき接続符号
を記憶する接続符号メモリ8と、細線化終了判定回路が
細線化終了信号を出すまで繰返し細線化回路を機能させ
る制御回路10と、前回の進行方向を記憶しておくレジ
スタ、前回の進行方向と対応する接続を接続符号から取
り除く1次マスク回路、この結果から次の進行方向を表
わす符号を作る方向符号生成回路、この方向に対応する
接続を接に?εt1号から取り除く2次マスク回路を有
し接続符号メモリ8から接続符号を読み出す追跡回路4
と、追跡回路4の方向符号生成回路からの方向符号を記
憶するチェイン符号メモリ9と、接続符号メモリ8の読
み出すべきアドレスを指定し追跡回路4へ接続符−じを
順次与え追跡回路4からの信号によりアドレスを次の画
素へと修正するアドレス制御回路11とよりなる事を特
徴とする画像処理装置。
(6) An image memory 5 that stores the values of a large number of pixels that are discretized in the vertical and horizontal directions and have either the value 1 or the value 0, and the values of each pixel and neighboring pixels stored in the image memo J) 5. A hole-filling processing circuit 1 reads out the value 0, sets the value of the pixel surrounded by pixels with the value 1 on the top, bottom, left and right as 1, and stores it in the image memory 5.
and each pixel P. Improvement of neighboring pixels P3 and left P5 are both 0, and P3 and P5 are 1, but P7
A thinning classification circuit 2a that classifies pixels of the B group in which either P1 or Pl is 0, an A group memory 6 that stores the A group pixels, and an 8 group memory 7 that stores the B group pixels. The values of pixels and their neighboring pixels are read out sequentially from the image memory 5, the A group memory 6, and the 8 group memory 7, and if the number of neighboring pixels Na is 2 or more,
Thinning circuit 2 that changes the value of a pixel whose number of connections is 1 to 0
b, a blockage point detection circuit that detects a blockage point with a value of 1 surrounded by pixels with a value of 1 on the top, bottom, left and right sides, and a thinning completion determination circuit, and detects the values of the center pixel and neighboring pixels and the blockage points at diagonal positions. A connection determining circuit 3 determines the connection between the central pixel Po and neighboring pixels P1 to P8 based on the presence or absence, a connection code memory 8 stores a connection code for each pixel whose connection has been determined, and a thinning end determination circuit outputs a thinning end signal. A control circuit 10 that repeatedly functions the thinning circuit until the line is released, a register that stores the previous direction of movement, a primary mask circuit that removes the connection corresponding to the previous direction of movement from the connection code, and a next direction of movement based on this result. Direction code generation circuit that creates a code representing this direction, connected to the connection corresponding to this direction? Tracking circuit 4 that has a secondary mask circuit to remove from εt1 and reads the connection code from the connection code memory 8
Then, the chain code memory 9 for storing the direction code from the direction code generation circuit of the tracking circuit 4 and the address to be read from the connection code memory 8 are specified, and the connection code is sequentially given to the tracking circuit 4. An image processing device comprising an address control circuit 11 that corrects an address to the next pixel based on a signal.
JP11491783A 1983-06-24 1983-06-24 Method and device for picture processing Granted JPS607579A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11491783A JPS607579A (en) 1983-06-24 1983-06-24 Method and device for picture processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11491783A JPS607579A (en) 1983-06-24 1983-06-24 Method and device for picture processing

Publications (2)

Publication Number Publication Date
JPS607579A true JPS607579A (en) 1985-01-16
JPH0420223B2 JPH0420223B2 (en) 1992-04-02

Family

ID=14649859

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11491783A Granted JPS607579A (en) 1983-06-24 1983-06-24 Method and device for picture processing

Country Status (1)

Country Link
JP (1) JPS607579A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62160577A (en) * 1986-01-09 1987-07-16 Mitsubishi Electric Corp Picture processor
JPH03149673A (en) * 1989-11-07 1991-06-26 Fujitsu Ltd Line figure vectorization method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS48102926A (en) * 1972-04-07 1973-12-24
JPS5386532A (en) * 1976-12-20 1978-07-31 Ibm Image encoder

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS48102926A (en) * 1972-04-07 1973-12-24
JPS5386532A (en) * 1976-12-20 1978-07-31 Ibm Image encoder

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62160577A (en) * 1986-01-09 1987-07-16 Mitsubishi Electric Corp Picture processor
JPH03149673A (en) * 1989-11-07 1991-06-26 Fujitsu Ltd Line figure vectorization method

Also Published As

Publication number Publication date
JPH0420223B2 (en) 1992-04-02

Similar Documents

Publication Publication Date Title
US4566128A (en) Method for data compression for two-value picture image
US4908872A (en) Method and apparatus for extracting pattern contours in image processing
US4776023A (en) Pattern inspection method
Mandeville Novel method for analysis of printed circuit images
JP5854802B2 (en) Image processing apparatus, image processing method, and computer program
JPH07117498B2 (en) Inspection system
Banaeyan et al. Pyramidal connected component labeling by irregular graph pyramid
JPS607579A (en) Method and device for picture processing
JP2810660B2 (en) Particle image analyzer
US6804413B1 (en) Image processing device and method for combining images obtained from separate-pickup
Longbotham et al. Nondestructive reverse engineering of trace maps in multilayered PCBs
JPS59191667A (en) Picture data converting system
JPH06148089A (en) Crack measurement processor
Mandeville Morphic analysis of printed circuit images
CN118366051A (en) Optimization method and device for fusion and filtering of remote sensing image objects based on overlapped blocks
James et al. Image Dilution using Harris Corner Detection and Geometric Kernels
Latecki Digital topology of multicolor images
KR100266309B1 (en) Closed Curve Extraction Method
JPS638512B2 (en)
JPH07104955B2 (en) Line figure shaping method
TW202240533A (en) Image splicing method
JPH0130181B2 (en)
JPH0570874B2 (en)
JPS62280981A (en) Pattern defect inspection device
JPS61134792A (en) Binary image trimming apparatus