JP4322999B2 - Connected region extraction apparatus and recording medium - Google Patents

Connected region extraction apparatus and recording medium Download PDF

Info

Publication number
JP4322999B2
JP4322999B2 JP12095299A JP12095299A JP4322999B2 JP 4322999 B2 JP4322999 B2 JP 4322999B2 JP 12095299 A JP12095299 A JP 12095299A JP 12095299 A JP12095299 A JP 12095299A JP 4322999 B2 JP4322999 B2 JP 4322999B2
Authority
JP
Japan
Prior art keywords
circumscribed rectangle
label
subdivision
circumscribed
overlap
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP12095299A
Other languages
Japanese (ja)
Other versions
JP2000311247A (en
Inventor
眞紀 矢吹
真一 江口
浩一 金元
勝利 小原
亘一 千葉
裕 勝又
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Fujitsu Frontech Ltd
Original Assignee
Fujitsu Ltd
Fujitsu Frontech Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd, Fujitsu Frontech Ltd filed Critical Fujitsu Ltd
Priority to JP12095299A priority Critical patent/JP4322999B2/en
Publication of JP2000311247A publication Critical patent/JP2000311247A/en
Application granted granted Critical
Publication of JP4322999B2 publication Critical patent/JP4322999B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Description

【0001】
【発明の属する技術分野】
近年、金融文書、ビジネス文書等の入力周辺機器として、文字認識装置OCR(以下、単に「OCR」という)の需要が増加している。本願発明は、このようなOCR等に利用されるものであり、例えば、OCRにおける文字切り出し処理に適用して有効な連結領域抽出装置及び記録媒体に関するものである。
【0002】
前記OCRにおける文字切り出し処理において、個々の文字の高い認識率を実現するためには、認識の前段階である「切り出し処理」が、その正確さの点で重要である。従来は、記帳等の文字記入位置を予め指定した文書(ドロップアウトカラーではなく、黒枠罫線と文字が同じような色、または濃度で書かれたもの)に対して、指定した範囲内に文字が綺麗に書かれてあれば、かなりの率で文字を自動認識できたが、少しでも指定した範囲を越えて、指定範囲を示す枠や罫線に接触したり、或いは、指定範囲を示す枠や罫線からはみ出しが生じると、著しく認識率が低下する、という問題が生じていた。
【0003】
そこで、このような問題に対して、罫線、枠に触れている文字から、文字だけを正確に切り出す技術の開発が要望されていた。なお、本願発明は、OCRだけでなく、印刷文字認識装置、図面認識における文字、記号の切り出し、画像中の罫線と物体、図形、文字の接触部分の分離等のように、直線と広い意味での図形が重なったパターンから、その図だけを抽出する技術にも利用可能である。
【0004】
【従来の技術】
以下、従来例を説明する。
【0005】
§1:従来例の一般的な説明
従来、2値画像データから画素が1つに繋がった連結領域(連結成分)を抽出し、その連結領域に基づいてラベル画像情報を作成する連結領域抽出装置が知られていた(例えば、特開平8−55219号公報、特開平7−325921号公報参照)。
【0006】
近年、2値画像データから画素の繋がった連結領域を抽出するラベリング手法は、画像を解析して画像中から文字や図形等を抽出する手段として重要になってきている。例えば、手書き文字認識装置(OCR)においては、複数文字から個々の文字を切り出す手段として、その前処理部にラベリング手法が使用されている。更に、検査や監視を目的とした画像処理の応用システムに幅広く実現されている。前記ラベリング手法については、例えば、特願平3−206574号公報、特願平5−237552号の明細書及び図面に記載されているようによく知られた技術なので説明は省略する。以下、特開平8−55219号公報に記載された発明の概要を従来例として説明する。
【0007】
§2:連結領域抽出装置の概要
前記連結領域抽出装置は、入力された2値画像データから画素の繋がった連結領域(連結成分)の外接矩形を算出し、各外接矩形にラベルを付してメモリに記憶する外接矩形算出手段と、前記外接矩形算出手段によって算出された各外接矩形について他の外接矩形との重なりの有無を判定する重なり判定手段と、前記重なり判定手段で重なり有りの判定がなされた場合、その外接矩形に再びラベリング処理を行って、そのラベル画像を作成し、そのラベル画像の外接矩形を親として、その内部に含まれるラベルを元に、子の外接矩形に細分割し、更にその子の外接矩形を内部に含まれるラベルの数が単一になるまで細分割する操作を繰り返し、ラベル数が単一になったときの各々の子の外接矩形の座標を求める細分割手段と、前記入力された2値画像、重なり無しと判定された外接矩形の座標と、及び細分割手段によって求められた親及び各々の子の外接矩形とからなるデータを出力する出力手段等を含んで構成される。
【0008】
前記連結領域抽出装置の処理概要は次の通りである。外接矩形算出手段は、入力された2値画像データから連結領域の外接矩形を算出し、各外接矩形にラベルを付して記憶する。次に、重なり判定手段は、外接矩形算出手段によって算出された各外接矩形について他の外接矩形との重なりの有無を判定し、重なり有りと判定された場合、更に細分割手段により再度のラベリング処理を行い、再分割処理を行う。
【0009】
この場合、細分割手段は、再度ラベリングされたラベル画像の外接矩形を親として、その内部に含まれるラベルを元に、子の外接矩形に細分割し(再度、外接矩形を算出し)、更に、子の外接矩形を内部に含まれるラベル数が単一になるまで細分割する操作を繰り返し、ラベル数が単一になったときの各々の子の外接矩形の座標を求める。出力手段は、入力された2値画像データと、重なり判定手段によって重なり無しと判定された外接矩形の座標と、細分割手段によって求められた親及び各々の子の外接矩形とからなるデータを出力する。
【0010】
§3:連結領域抽出処理の概要説明
図8は従来例の説明図(その1)である。以下、図8の具体例に基づき、前記連結領域抽出装置における連結領域抽出処理の概要を説明する。
【0011】
連結成分抽出部1は、入力した2値画像データから、画素の繋がった成分である連結成分(或いは連結領域)を抽出する。この時、抽出された連結成分に対しラベリング処理を行う。例えば、図示の例ではラベル1の連結成分とラベル2の連結成分が存在している。次に、連結成分細分割部2は、前記抽出された連結成分内に更に他の連結成分が含まれる時は、前記抽出された連結成分(2−1)を、その内部に含まれる各連結成分(2−2,2−3)の領域に細分割する。
【0012】
そして、細分割領域判定部3は、前記ラベルに基づいて細分割された各領域がどの連結成分のものか判定する。この例の場合、細分割領域(2−1)はラベル2の連結成分に属し、(2−2)はラベル1の連結成分に属し、(2−3)はラベル2の連結成分に属する、というように判定を行なう。
【0013】
そして、細分割領域記憶部4は、前記抽出された連結成分を細分割した各領域(細分割領域)の和、差等の算術式で表現し、記憶部(バッファメモリ等)に記憶する。例えば、ラベル2の領域=+(2−1)の領域−(2−2)の領域+(2−3)の領域、というようにしてこのデータを記憶部に記憶する。
【0014】
以上のように、一画面全体のラベル、又は他の連結成分と重なり部を有する連結成分のラベル画像を記憶した方式と違って、連結成分が細分割された領域の和、差等で表現することによって、記憶するラベル画像その数を減少、又は皆無にすることができる。
【0015】
§4:フローチャートによる処理の説明
図9は従来例の説明図(その2)である。以下、図9のフローチャートに基づいて詳細な処理を説明する。なお、図の(1) 〜(8) は各処理を示す。
【0016】
(1) :先ず、入力された2値画像データにラベリング処理(例えば、特願平3−206574号公報、特願平5−237552号の明細書及び図面参照)を施して、連結したパターン(連結成分)毎に、それらを区別するためのラベルが付いた、その連結パターンの外接矩形を算出する。この場合、外接矩形の意味は、画面上の座標及びラベルをその属性として含むことがある。
【0017】
(2) :次に、各ラベルの外接矩形がお互いに重なっているかどうかを判定する。すなわち、外接矩形の重なりを判定する。
【0018】
(3) :前記(2) の重なり判定の結果に基づいて、重なっていないラベル(非重なりラベル)に対しては、重なっていないラベル(番号)と、その外接矩形の対応関係を記憶部に記憶する。
【0019】
(4) :また、(2) の重なり判定の結果に基づいて、重なっているラベルについては、注目するラベル内の画像に対して再び連結パターン毎の外接矩形を算出する(重なり注目ラベル内再外接矩形算出処理を行う)。
【0020】
(5) :次に、注目ラベルの外接矩形は、再外接矩形算出のための画像サイズと一致することから、重なり注目ラベル以外のラベルの外接矩形(以下、この外接矩形のことを「雑音外接矩形」、又は「他の外接矩形」という)を算出する。
【0021】
(6) :雑音外接矩形内に含まれる複数個の連結パターンが1つであるか否かを確認する。具体的には、各雑音外接矩形を対象として、再び連結パターンの外接矩形を算出し、その外接矩形の数から単一ラベルか否かを確認する。
【0022】
(7) :複数個の外接矩形が全て単一ラベルの場合には、それらの雑音外接矩形を重なり注目ラベル内の雑音矩形として記憶部に記憶しておく。こうして、ラベル画像を復元する時には、重なり注目ラベルの外接矩形から雑音外接矩形を除いた領域が重なり注目ラベルの領域となる。
【0023】
(8) :複数個の雑音外接矩形が一つでも単一ラベル(即ち、注目ラベルと同一ラベル)でない場合、重なり注目ラベル内のラベル画像を記憶部に記憶する。このラベル画像は、重なり注目ラベルの矩形内画像に対してラベリング処理を行って算出するが、前記(4) の外接矩形算出の際に、ラベル画像の記憶を同時に行っても良い。
【0024】
このように、連結パターンを外接矩形だけでなく、ラベル画像と共に表現して出力する。このようにして出力された外接矩形及びラベル画像に基づいて、画像処理装置は画像解析、文書画像処理等を行う。
【0025】
§5:細分割処理例の説明
図10は従来例の説明図(その3)である。以下、図10に基づいて、細分割処理例を説明する。
【0026】
前記例では、重なり部で注目ラベル以外の外接矩形が単一である場合にのみ、注目ラベルの外接矩形を外接矩形の演算式で表現し、重なり部で注目ラベル以外の外接矩形が複数存在した場合には、ラベル画像を記憶した。しかし、この例では、ラベル画像の記憶に要するデータ量を削減するために、注目ラベル以外の外接矩形(雑音外接矩形)の内部に含まれるラベルが単一になるまで、細分割を繰り返す。
【0027】
この細分割処理では、先ず、注目ラベルの外接矩形内に存在する各外接矩形(雑音外接矩形)内のラベルが単一になるまで、雑音外接矩形を細分割する処理を繰り返す。この場合、注目ラベルの外接矩形を親(この例では、ラベル9)とすると、子1、子2・・・というように、注目ラベルの外接矩形は階層的に表現できる。
【0028】
この例では、左上の座標(X19,Y19)と、右下の座標(X29,Y29)で表された外接矩形がラベル9の親であり、左上の座標(X192,Y192)と、右下の座標(X292,Y292)で表された外接矩形が、ラベル1の子1であり、左上の座標(X193,Y193)と、右下の座標(X293,Y293)で表された外接矩形が、ラベル1−1の子2である。
【0029】
このようにして、注目ラベルの外接矩形内に存在する各外接矩形内のラベルが単一になるまで、雑音外接矩形を細分割する処理を繰り返す。そして、細分割した各領域(細分割領域)の和、差等の算術式で表現し、記憶部(バッファメモリ等)に記憶する。例えば、ラベル9の領域=+(9−1)の領域−(9−2)の領域+(9−3)の領域、というようにしてこのデータを記憶部に記憶する。
【0030】
【発明が解決しようとする課題】
前記のような従来のものにおいては、次のような課題があった。
【0031】
(1) :従来の細分割処理では、重なり有りと判定された外接矩形に対し、再度ラベリング処理を行なってラベル画像を作成し、該ラベル画像の外接矩形を親として、その内部に含まれるラベルを基に、子の外接矩形に細分割し、更に、その子の外接矩形を、内部に含まれるラベル数が単一になるまで細分割する操作を繰り返して行っていた。
【0032】
このため、重なり合った外接矩形内で、雑音以外の小さいラベルがあった場合に、部分ラベリング回数が増加し、細分割処理の時間が長くなっていた。
【0033】
(2) :従来の連結領域抽出処理でかすれた画像を扱う場合、かすれた画像は細かいラベルが多く存在するため、細分割処理においてラベリング処理や外接矩形の算出処理等を何度も処理を繰り返して行う必要があった。このため、処理時間が長くなっていた。
【0034】
本発明は、このような従来の課題を解決し、連結領域抽出処理全体の処理量を少なくして、処理の高速化を達成することを目的とする。
【0035】
【課題を解決するための手段】
図1は本発明の原理説明図である。本発明は前記の目的を達成するため、次のように構成した。
【0036】
(1) :入力された2値画像データから画素の繋がった連結領域の外接矩形を算出し、各外接矩形にラベルを付して記憶する外接矩形算出手段12Aと、前記外接矩形算出手段12Aにより算出された各外接矩形について、他の外接矩形との重なりの有無を判定する重なり判定手段13Aと、前記重なり判定手段13Aの判定で重なり有りと判定された外接矩形に対し、再度ラベリング処理を行なってラベル画像を作成し、該ラベル画像の外接矩形を親として、その内部に含まれるラベルを基に、子の外接矩形に細分割し、更に、その子の外接矩形を、内部に含まれるラベル数が単一になるまで細分割する操作を繰り返し、ラベル数が単一になったときの各々の子の外接矩形の座標を求める細分割手段15Aと、前記入力された2値画像データ、前記重なり判定手段の判定で重なり無しと判定された外接矩形の座標、及び、前記細分割手段によって求められた親及び各々の子の外接矩形とからなるデータを出力する出力手段16Aを備えた連結領域抽出装置において、前記重なり判定手段の判定で重なり有りと判定された外接矩形に対し、その外接矩形の縦方向、又は横方向のサイズを算出し、前記いずれかのサイズが2画素以下であった場合に、そのラベル内部に他の重なりラベルが無い単一ラベルであると判定する単一ラベル判定手段14Aを備えると共に、前記判定結果が単一ラベルであれば、その外接矩形の座標データを前記出力手段へ送り、単一ラベルでなければ、その外接矩形の座標データを前記細分割手段15Aへ送る機能を備えている。
【0037】
(2) :前記(1) の連結領域抽出装置において、前記細分割手段15Aは、前記外接矩形の細分割処理を行う過程で算出した外接矩形に対し、その外接矩形の縦方向、又は横方向のサイズを算出し、前記いずれかのサイズが2画素以下であった場合に、そのラベル内部に他の重なりラベルが無い単一ラベルであると判定する単一ラベル判定手段17Aを備えると共に、前記単一ラベル判定手段17Aの判定結果が単一ラベルであれば、その外接矩形についての細分割処理を終了させ、単一ラベルでなければ、その外接矩形についての細分割処理を行わせる機能を備えている。
【0038】
(3) :入力された2値画像データから画素の繋がった連結領域の外接矩形を算出し、各外接矩形にラベルを付して記憶する外接矩形算出手段12Aと、前記外接矩形算出手段12Aにより算出された各外接矩形について、他の外接矩形との重なりの有無を判定する重なり判定手段13Aと、前記重なり判定手段13Aの判定で重なり有りと判定された外接矩形に対し、再度ラベリング処理を行なってラベル画像を作成し、該ラベル画像の外接矩形を親として、その内部に含まれるラベルを基に、子の外接矩形に細分割し、更に、その子の外接矩形を内部に含まれるラベル数が単一になるまで細分割する操作を繰り返し、ラベル数が単一になったときの各々の子の外接矩形の座標を求める細分割手段15Aと、前記入力された2値画像データ、前記重なり判定手段の判定で重なり無しと判定された外接矩形の座標、及び、前記細分割手段によって求められた親及び各々の子の外接矩形とからなるデータを出力する出力手段16Aを備えた連結領域抽出装置に、前記重なり判定で、重なり有りと判定された外接矩形に対し、その外接矩形の縦方向、又は横方向のサイズを算出し、前記いずれかのサイズが2画素以下であった場合に、そのラベル内部に他の重なりラベルが無い単一ラベルであると判定する手順と、前記判定結果が単一ラベルであれば、その外接矩形の座標データを前記出力手段へ送り、単一ラベルでなければ、その外接矩形の座標データを前記細分割手段へ送る手順とを実現させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体。
【0039】
(作用)
前記構成に基づく本発明の作用を、図1に基づいて説明する。
【0040】
(a) :前記(1) では、外接矩形算出手段12Aは、入力された2値画像データから画素の繋がった連結領域(画素の連結成分)の外接矩形を算出し、各外接矩形にラベルを付して記憶する(例えば、図示しないワークメモリに記憶する)。次に、重なり判定手段13Aは、前記外接矩形算出手段12Aにより算出された各外接矩形について、他の外接矩形との重なりの有無を判定する。
【0041】
その結果、重なり無しであれば、外接矩形の座標を出力手段16Aへ送り、重なり有りであれば、その重なり有りと判定された外接矩形に対し、単一ラベル判定手段14Aが単一ラベルか否かを判定する。この場合、単一ラベル判定手段14Aは、前記外接矩形の縦方向、又は横方向のサイズを算出し、前記サイズが2画素以下であった場合に、そのラベル内部に他の重なりラベルが無い単一ラベルであると判定する。
【0042】
そして、単一ラベルであると判定した場合には、その外接矩形の座標データを前記出力手段16Aへ送り、単一ラベルでないと判定した場合は、その外接矩形の座標データを細分割手段15Aへ送る。
【0043】
その後、細分割手段15Aは、再度ラベリング処理を行なってラベル画像を作成し、該ラベル画像の外接矩形を親として、その内部に含まれるラベルを基に、子の外接矩形に細分割し、更に、その子の外接矩形を内部に含まれるラベル数が単一になるまで細分割する操作を繰り返し、ラベル数が単一になったときの各々の子の外接矩形の座標を求め、そのデータを出力手段へ送る。
【0044】
このように、重なり判定手段13Aで重なり有りと判定された外接矩形について、細分割手段15Aにより細分割処理を行う前に、単一ラベル判定手段14Aにより単一ラベルか否かの判定を行ない、単一ラベルと判定された場合は、細分割処理を行うことなく、該当する外接矩形の座標データを出力手段16Aへ出力する。
【0045】
このため、単一ラベルと判定された外接矩形についての余分な細分割処理を行う必要がなくなり、その分、処理量を少なくして処理の高速化を達成できる。すなわち、従来の細分割手段15Aでは、重なり有りと判定された外接矩形に対し、再度ラベリング処理を行なってラベル画像を作成し、該ラベル画像の外接矩形を親として、その内部に含まれるラベルを基に、子の外接矩形に細分割し、更に、その子の外接矩形を、内部に含まれるラベル数が単一になるまで細分割する操作を繰り返して行うが、この細分割処理において行う単一ラベルの判定を行う際のラベリング処理時間等を削減することができる。
【0046】
これは、前記単一ラベル判定手段14Aにより、ラベル内部に、他のラベルが明らかに無いと判明しているケースを外接矩形サイズから算出することで、内部のラベル数をラベリング等の処理をすることなく判別できるからである。従って、前記のように、処理量を少なくして処理の高速化を達成することができる。
【0047】
(b) :前記(2) では、前記単一ラベル判定手段14Aにより、単一ラベルでないと判定された場合、細分割手段15Aは、対象とする外接矩形に対し、再度ラベリング処理を行なってラベル画像を作成し、該ラベル画像の外接矩形を親として、その内部に含まれるラベルを基に、子の外接矩形に細分割し(外接矩形を算出し)、更に、その子の外接矩形を内部に含まれるラベル数が単一になるまで細分割する操作を繰り返し、ラベル数が単一になったときの各々の子の外接矩形の座標を求める処理を行う。
【0048】
この場合、単一ラベル判定手段17Aが、細分割処理の過程で算出した外接矩形に対し、その外接矩形の縦方向、又は横方向のサイズを算出し、前記いずれかのサイズが2画素以下であった場合に、そのラベル内部に他の重なりラベルが無い単一ラベルであると判定する。そして、前記判定結果が単一ラベルであれば、その外接矩形についての細分割処理を終了させ、単一ラベルでなければ、その外接矩形について更に細分割処理を行わせる。このようにすれば、繰り返し行う細分割処理の処理量が少なくなり、細分割処理の高速化が達成できる。
【0049】
(3) :連結領域抽出装置の制御部(例えば、CPU)が、前記記録媒体のプログラムを読み出して実行することにより、連結領域抽出処理における重なり判定で、重なり有りと判定された外接矩形に対し、その外接矩形の縦方向、又は横方向のサイズを算出し、前記いずれかのサイズが2画素以下であった場合に、そのラベル内部に他の重なりラベルが無い単一ラベルであると判定する手順と、前記判定結果が単一ラベルであれば、その外接矩形の座標データを出力手段へ送り、単一ラベルでなければ、その外接矩形の座標データを細分割手段15Aへ送る手順とを実行する。
【0050】
このように、重なり判定処理で重なり有りと判定された外接矩形について、細分割処理を行う前に、単一ラベル判定処理により単一ラベルか否かの判定を行ない、単一ラベルと判定された場合は、細分割処理を行うことなく、該当する外接矩形の座標データを出力手段16Aへ出力する。
【0051】
このため、余分な細分割処理を行う必要がなくなり、処理量を少なくして処理の高速化を達成できる。すなわち、従来は、重なり有りと判定された外接矩形に対し、再度ラベリング処理を行なってラベル画像を作成し、該ラベル画像の外接矩形を親として、その内部に含まれるラベルを基に、子の外接矩形に細分割し、更に、その子の外接矩形を、内部に含まれるラベル数が単一になるまで細分割する操作を繰り返して行うが、この細分割処理において行う単一ラベルの判定を行う際のラベリング処理時間を削減することができる。
【0052】
これは、前記単一ラベル判定処理により、ラベル内部に、他のラベルが明らかに無いと判明しているケースを外接矩形サイズから算出することで、内部のラベル数をラベリング等の処理をすることなく判別できるからである。従って、前記のように、処理量を少なくして処理の高速化を達成することができる。
【0053】
【発明の実施の形態】
以下、発明の実施の形態を図面に基づいて詳細に説明する。
【0054】
§1:連結領域抽出装置の説明
図2は連結領域抽出装置のブロック図である。以下、図2に基づいて、連結領域抽出装置を説明する。連結領域抽出装置は、入力された2値画像データから画素の連結成分(連結領域)を抽出し、その情報を一画面のラベル画像情報として出力する装置であり、出力されたラベル画像情報は、例えば、画像処理装置へ送り画像処理を行う。
【0055】
この連結領域抽出装置は、入力した2値画像データを一時格納する2値画像記憶部11(例えば、バッファメモリ)と、2値画像記憶部11に格納された2値画像データから、画素の繋がった成分である連結成分(或いは連結領域)を抽出し、その連結成分の外接矩形を算出して、各外接矩形にラベルを付してラベル画像とし、このラベル画像をワークメモリに格納する外接矩形算出部12と、前記算出された各外接矩形について他の外接矩形との重なりの有無を判定する重なり判定部13と、前記重なり判定部13の判定で、重なり有りと判定された場合、単一ラベルか否かを判定する単一ラベル判定部14と、前記単一ラベル判定部14で単一ラベルでないと判定された場合、更に細分割を行う細分割部15と、前記各部で処理された後のデータを出力する出力部16を設け、更に、前記細分割部15内に単一ラベル判定部17を設ける。
【0056】
この場合、前記細分割部15は、外接矩形算出部12により作成されたラベル画像の外接矩形を親として、その内部に含まれるラベルを基に、子の外接矩形に細分割し、更に子の外接矩形を内部に含まれるラベル数が各々の子の外接矩形の座標を求める処理を行うが、このような細分割処理を行う際、単一ラベル判定部14により、単一ラベルか否かの判定を行い、単一ラベルと判定した場合は、細分割処理を終了して出力部16へ出力する。
【0057】
なお、前記単一ラベル判定部14、17を除く他の構成、すなわち、2値画像記憶部11、外接矩形算出部12、重なり判定部13、細分割部15、出力部16の構成は、前記従来例(特開平8−55219号公報参照)と同じである。
【0058】
§2:連結領域抽出処理の説明
図3は連結領域抽出処理フローチャートである。以下、図2を参照しながら図3に基づいて、2値画像データの連結領域抽出処理を説明する。なお、S1〜S8は各処理ステップを示す。
【0059】
先ず、入力された2値画像データを2値画像記憶部11に記憶する(S1)。その後、外接矩形算出部12は、前記2値画像記憶部11に記憶された2値画像データを取り出し、画素が繋がった連結成分(連結領域)の外接矩形を算出する(S2)。
【0060】
この場合、前記2値画像データにラベリング処理(例えば、特願平3−206574号、特願平5−237552号の明細書及び図面参照)を施して、連結したパターン(連結成分)毎に、それらを区別するラベルが付いた、その連結したパターンの外接矩形を求めワークメモリに格納する。
【0061】
次に、重なり判定部13は、外接矩形算出部12が算出した外接矩形に対し、各ラベルの外接矩形がお互いに重なっているかどうかを判定する(S3)。その結果、重なりが有ると判定された場合には(S4)、単一ラベル判定部14により単一ラベルか否かの判定を行う(S5)。しかし、前記S4の処理で重なり無しと判定された場合には、判定対象の外接矩形を出力部16へ出力する。
【0062】
そして、前記S6の処理で単一ラベルか否かの判定を行ない、単一ラベルであると判定された場合には、その外接矩形のデータを出力装置16へ出力する。しかし、前記S5の単一ラベル判定処理で単一ラベルでないと判定された場合は、外接矩形の細分割処理(細分割処理の詳細は後述する)を行い(S7)、細分割後のデータを出力部16へ出力へ送る(S8)。以上のようにして、2値画像データの連結領域抽出処理を行う。
【0063】
§3:細分割処理の説明
図4は細分割処理フローチャートである。以下、図4に基づいて前記細分割処理を説明する。なお、S11〜S17は各処理ステップを示す。この処理は、前記図2に示した細分割部15が行う処理であり、単一ラベル判定部17による単一ラベル判定処理を含む処理である。
【0064】
前記単一ラベル判定部14により単一ラベルでないと判定された外接矩形データに対し、細分割部15が細分割処理を行うが、この処理では先ず、単一ラベル判定部17により単一ラベルか否かの判定を行う。すなわち、注目ラベル以外の他ラベル(雑音ラベル)が単一ラベルかどうかの判定処理を行う(S11)。
【0065】
その結果、単一ラベルであれば(S12)、細分割処理を終了するが、単一ラベルでなければ、細分割部15が再び、外接矩形の算出処理(再外接矩形算出処理)を行う(S13)。そして、前記算出した外接矩形は注目ラベルか否かの判定処理を行なう(S14)。その結果、前記算出した外接矩形が注目ラベルでなければ(S15)、細分割処理を終了するが、注目ラベルであれば、算出した外接矩形について再び単一ラベルか否かの判定処理を行う(S16)。
【0066】
その結果、単一ラベルであると判定した場合(S17)は、細分割処理を終了するが、単一ラベルでないと判定した場合は前記S11の処理から繰り返して行う。以上のようにして、注目ラベル以外の他外接矩形(雑音外接矩形)の内部に含まれるラベルが単一になるまで、細分割処理(S11〜S17)を繰り返して行う。
【0067】
§4:単一ラベル判定処理の説明
図5は単一ラベル判定処理フローチャートである。また、図6は単一ラベル判定処理説明図であり、A図は重なり外接矩形、B図はラベル内部に他の重なりラベルが存在しない図の例1、C図はラベル内部に他の重なりラベルが存在しない図の例2、D図は内部にラベルが存在する図の例1、E図は内部にラベルが存在する図の例2である。なお、図6の「0」、「1」は2値画像データの「白」、「黒」画素を示す。
【0068】
以下、図6を参照しながら図5のフローチャートに基づいて単一ラベル判定処理を説明する。この処理は、単一ラベル判定部14、17が行う処理であり、S21〜S27は各処理ステップを示す。また、重なり外接矩形のデータ等は、図示しないワークメモリに格納されているとする。
【0069】
例えば、図6のA図に示したように、重なり外接矩形の左上の座標点がP1、右下の座標点がP2とし、P1=(x1,y1)、P2=(x2,y2)であるとする。単一ラベル判定部14、17は、先ず、重なり外接矩形の左上の座標P1=(x1,y1)と、右下の座標P2=(x2,y2)をワークメモリから取得する(S21)。
【0070】
そして、重なり外接矩形の横幅(横方向の画素数)W=(x2−x1+1)と、高さ(縦方向の画素数)H=(y2−y1+1)を算出する(S22)。なお、前記W、Hの式において、+1があるのは、画素に幅があるためである。そして、最小単一ラベルのサイズS(予め設定した値S=2)を取得し(S23)、W≦Sの条件を満たしているかどうかを判定する(S24)。
【0071】
その結果、W≦Sの条件を満たしていれば、単一ラベルと判定し(S26)、処理を終了するが、W≦Sの条件を満たしていなければ、H≦S(S=2)の条件を満たしているか否かを判定する(S25)。その結果、H≦Sの条件を満たしていれば、単一ラベルと判定し(S26)、処理を終了するが、H≦Sの条件を満たしていなければ、従来の処理を行う(S27)。
【0072】
前記処理において、S=2(2画素)とし、図6のB図に示したように、W=2(横幅=2画素)であれば、W≦Sの条件を満たしており、ラベル内に他の重なりラベルが存在しない。また、図6のC図に示したように、W=2(横幅=2画素)でない場合でも、H≦Sの条件を満たしていれば、ラベル内に他の重なりラベルが存在しないと判定する。更に、図6のD図のように、W=3(横幅=3)の場合、或いは、E図のように、H=3(高さ=3)の場合、内部にラベルが存在すると判定する。
【0073】
すなわち、W=2以下、又はH=2以下なら、W又はHは2画素か1画素なので、このような幅の画素からなるラベルの内部に、他の重なりラベルが存在することはない。しかし、W=3以上、又はH=3以上なら、前記ラベルの内部に、他の重なりラベルが存在する可能性があるので、前記のように判定する。
【0074】
以上のように、単一ラベル判定部14、17では、判定対象の外接矩形の横方向のサイズ(横幅=W)、又は縦方向のサイズ(高さ=H)を算出し、前記いずれかのサイズが2画素以下(W≦2、又はH≦2)であった場合に、そのラベル内部に他の重なりラベルが無い単一ラベルであると判定する。
【0075】
このように、ラベル内部に、他のラベルが明らかに無いと判明しているケースを、外接矩形サイズ(W、H)から算出することで、従来のように、内部のラベル数を算出したり、ラベリング処理を行ったりすることなく、簡単、かつ短時間で単一ラベル判定処理を行うことができ、処理の高速化を達成できる。
【0076】
§5:連結領域抽出装置の具体的な装置例と記録媒体の説明
図7は具体的な装置例である。前記連結領域抽出装置は、パーソナルコンピュータ、ワークステーション等の任意のコンピュータにより実現することができる。この装置は、コンピュータ本体21と、該コンピュータ本体21に接続されたディスプレイ装置22、入力装置(キーボード/マウス等)23、リムーバブルディスクドライブ(「RDD」という)24、磁気ディスク装置(「MDD」という)25等で構成されている。
【0077】
そして、前記コンピュータ本体21には、内部の各種制御や処理を行うCPU26と、プログラムや各種データを格納しておくためのROM27と、メモリ28(ワークメモリ)と、インタフェース制御部(「I/F制御部」という)29と、通信制御部30等が設けてある。なお、前記RDD24には、フレキシブルディスクドライブや光ディスクドライブ等が含まれる。
【0078】
前記構成の装置において、例えば、前記ROM27、或いはMDD25の磁気ディスク(記録媒体)に、前記連結領域抽出処理を実現するためのプログラムを格納しておき、このプログラムをCPU26が読み出して実行することにより、前記連結領域抽出処理を実行する。
【0079】
しかし、本願発明は、このような例に限らず、例えば、MDD25の磁気ディスクに、次のようにしてプログラムを格納し、このプログラムをCPU26が実行することで前記連結領域抽出処理を行うことも可能である。
【0080】
▲1▼:他の装置で作成されたリムーバブルディスクに格納されているプログラム(他の装置で作成したプログラムデータ)を、RDD24により読み取り、MDD25の記録媒体に格納する。
【0081】
▲2▼:LAN等の通信回線を介して他の装置から伝送されたプログラム等のデータを、通信制御部30を介して受信し、そのデータをMDD25の記録媒体(磁気ディスク)に格納する。
【0082】
【発明の効果】
以上説明したように、本発明によれば次のような効果がある。
【0083】
(1) :連結領域抽出装置に単一ラベル判定手段を設け、単一ラベルと判定した外接矩形について、以降の処理を省略するので、連結領域抽出処理全体の処理量を少なくして、処理の高速化を達成できる。
【0084】
(2) :単一ラベル判定手段では、ラベル内部に、他のラベルが無いと判明しているケースを外接矩形サイズから算出することで、従来行っていたラベリング処理等を省略できる。その結果、連結領域抽出処理の処理量を少なくして、処理の高速化を達成できる。特に、かすれた画像は細かいラベルが多いため、前記効果が顕著に現れる。
【0085】
(3) :外接矩形算出手段により算出された各外接矩形について、重なり判定手段は他の外接矩形との重なりの有無を判定し、重なり無しであれば外接矩形の座標を出力手段へ送り、重なり有りであればその重なり有りと判定された外接矩形に対し、単一ラベル判定手段が単一ラベルか否かを判定する。
【0086】
この場合、単一ラベル判定手段は、外接矩形の縦方向、又は横方向のサイズを算出し、前記サイズが2画素以下であった場合に、そのラベル内部に他の重なりラベルが無い単一ラベルであると判定する。そして、単一ラベルであると判定した場合には、その外接矩形の座標データを前記出力手段へ送り、単一ラベルでないと判定した場合は、その外接矩形の座標データを細分割手段へ送る。
【0087】
このように、重なり判定手段で重なり有りと判定された外接矩形について、細分割手段により細分割処理を行う前に、単一ラベル判定処理により単一ラベルか否かの判定を行ない、単一ラベルと判定された場合は、細分割処理を行うことなく、該当する外接矩形の座標データを出力手段へ出力する。
【0088】
このため、単一ラベルと判定された外接矩形についての細分割処理を行う必要がなくなり、その分、処理量を少なくして処理の高速化を達成できる。すなわち、従来の細分割手段では、重なり有りと判定された外接矩形に対し、再度ラベリング処理を行なってラベル画像を作成し、該ラベル画像の外接矩形を親として、その内部に含まれるラベルを基に、子の外接矩形に細分割し、更に、その子の外接矩形を、内部に含まれるラベル数が単一になるまで細分割する操作を繰り返して行うが、単一ラベルと判定された外接矩形については、この細分割処理を削減することができる。
【0089】
また、ラベル内部に、他のラベルが無いと判明しているケースを外接矩形サイズから算出することで、従来行っていたラベリング処理等を省略できる。その結果、連結領域抽出処理の処理量を少なくして、処理の高速化を達成できる。特に、かすれた画像は細かいラベルが多いため、前記効果が顕著に現れる。従って、連結領域抽出処理の処理量を少なくして、処理の高速化を達成することができる。
【0090】
(4) :重なり判定手段により他の外接矩形との重なり有りと判定された外接矩形について単一ラベルか否かの判定を行い、単一ラベルでないと判定された外接矩形に対して細分割処理を行う。この細分割処理において、細分割手段は、該当する外接矩形に対し、再度ラベリング処理を行なってラベル画像を作成し、該ラベル画像の外接矩形を親として、その内部に含まれるラベルを基に、子の外接矩形に細分割し、更に、その子の外接矩形を内部に含まれるラベル数が単一になるまで細分割する操作を繰り返し、ラベル数が単一になったときの各々の子の外接矩形の座標を求める処理を行う。
【0091】
この場合、細分割手段内部の単一ラベル判定手段が、細分割処理の過程で算出した外接矩形に対し、その外接矩形の縦方向、又は横方向のサイズを算出し、前記いずれかのサイズが2画素以下であった場合に、そのラベル内部に他の重なりラベルが無い単一ラベルであると判定する。そして、前記判定結果が単一ラベルであれば、その外接矩形についての細分割処理を終了させる。
【0092】
このようにすれば、細分割処理を行う場合、単一ラベルと判定された外接矩形については、以降の処理を省略できる。従って、繰り返し行う細分割処理の処理量が少なくなり、細分割処理の高速化が達成できる。この場合、特に、ラベル内部に、他のラベルが無いと判明しているケースを外接矩形サイズから算出することで、ラベリング処理等を省略できる。
【0093】
その結果、特に、細分割処理の処理量を少なくして、処理の高速化を達成できる。特に、かすれた画像は細かいラベルが多いため、かすれた画像を扱う場合には、前記効果が顕著に現れる。
【0094】
(5) :連結領域抽出装置の制御部(例えば、CPU)が、前記記録媒体のプログラムを読み出して実行することにより、連結領域抽出処理における重なり判定で、重なり有りと判定された外接矩形に対し、その外接矩形の縦方向、又は横方向のサイズを算出し、前記いずれかのサイズが2画素以下であった場合に、そのラベル内部に他の重なりラベルが無い単一ラベルであると判定する手順と、前記判定結果が単一ラベルであれば、その外接矩形の座標データを出力手段へ送り、単一ラベルでなければ、その外接矩形の座標データを細分割手段へ送る手順とを実行する。
【0095】
このように、重なり判定処理で重なり有りと判定された外接矩形について、細分割処理を行う前に、単一ラベル判定処理により単一ラベルか否かの判定を行ない、単一ラベルと判定された場合は、細分割処理を行うことなく、該当する外接矩形の座標データを出力手段へ出力する。
【0096】
このため、余分な細分割処理を行う必要がなくなり、処理量を少なくして処理の高速化を達成できる。すなわち、従来は、重なり有りと判定された外接矩形に対し、再度ラベリング処理を行なってラベル画像を作成し、該ラベル画像の外接矩形を親として、その内部に含まれるラベルを基に、子の外接矩形に細分割し、更に、その子の外接矩形を、内部に含まれるラベル数が単一になるまで細分割する操作を繰り返して行うが、この細分割処理を削減することができる。
【0097】
また、ラベル内部に、他のラベルが無いと判明しているケースを外接矩形サイズから算出することで、従来行っていたラベリング処理等を省略できる。その結果、連結領域抽出処理の処理量を少なくして、処理の高速化を達成できる。特に、かすれた画像は細かいラベルが多いため、前記効果が顕著に現れる。従って、連結領域抽出処理の処理量を少なくして、処理の高速化を達成することができる。
【図面の簡単な説明】
【図1】本発明の原理説明図である。
【図2】本発明の実施の形態における連結領域抽出装置のブロック図である。
【図3】本発明の実施の形態における連結領域抽出処理フローチャートである。
【図4】本発明の実施の形態における細分割処理フローチャートである。
【図5】本発明の実施の形態における単一ラベル判定処理フローチャートである。
【図6】本発明の実施の形態における単一ラベル判定処理説明図である。
【図7】本発明の実施の形態における具体的な装置例である。
【図8】従来例の説明図(その1)である。
【図9】従来例の説明図(その2)である。
【図10】従来例の説明図(その3)である。
【符号の説明】
1 連結成分抽出部
2 連結成分細分割部
3 細分割領域判定部
4 細分割領域記憶部
11 2値画像記憶部
12 外接矩形算出部
13 重なり判定部
14 単一ラベル判定部
15 細分割部
16 出力部
17 単一ラベル判定部
21 コンピュータ本体
22 ディスプレイ装置
23 入力装置
24 リムーバブルディスクドライブ
25 磁気ディスク装置
26 CPU(中央処理装置)
27 ROM(リードオンリメモリ)
28 メモリ
29 インタフェース制御部(I/F制御部)
30 通信制御部
[0001]
BACKGROUND OF THE INVENTION
In recent years, demand for character recognition devices OCR (hereinafter simply referred to as “OCR”) is increasing as input peripheral devices for financial documents, business documents, and the like. The present invention is used for such OCR and the like, and relates to, for example, a connected region extraction apparatus and a recording medium that are effective when applied to character cutout processing in OCR.
[0002]
In the character cutout process in the OCR, in order to realize a high recognition rate of individual characters, “cutout process”, which is a stage before recognition, is important in terms of accuracy. Conventionally, characters within the specified range are specified for documents that have previously specified the character entry position such as bookkeeping (those that are written in the same color or density as the black borders and characters instead of dropout color). If written well, characters could be automatically recognized at a considerable rate, but beyond the specified range, touch the frame or ruled line indicating the specified range, or the frame or ruled line indicating the specified range. When the protrusions occur, the recognition rate is remarkably lowered.
[0003]
Therefore, there has been a demand for the development of a technique for accurately cutting only characters from characters touching ruled lines and frames. The invention of the present application is not limited to OCR, but in a broad sense as a straight line such as a printed character recognition device, cut out characters and symbols in drawing recognition, separation of ruled lines and objects, figures, and character contact portions in images. It is also possible to use the technique for extracting only the figure from the pattern in which the figures overlap.
[0004]
[Prior art]
A conventional example will be described below.
[0005]
§1: General description of the conventional example
Conventionally, there has been known a connected region extraction apparatus that extracts a connected region (connected component) in which pixels are connected to one from binary image data and creates label image information based on the connected region (for example, Japanese Patent Laid-Open No. Hei. No. 8-55219, JP-A-7-325921).
[0006]
In recent years, a labeling method for extracting a connected region where pixels are connected from binary image data has become important as means for analyzing an image and extracting characters, figures, and the like from the image. For example, in a handwritten character recognition device (OCR), a labeling technique is used for the preprocessing unit as means for cutting out individual characters from a plurality of characters. Furthermore, it has been widely realized in image processing application systems for the purpose of inspection and monitoring. The labeling technique is well known as described in, for example, the specification and drawings of Japanese Patent Application No. 3-206574 and Japanese Patent Application No. 5-237552, and the description thereof will be omitted. The outline of the invention described in JP-A-8-55219 will be described below as a conventional example.
[0007]
§2: Outline of connected area extraction device
The connected area extracting device calculates a circumscribed rectangle of a connected area (connected component) in which pixels are connected from input binary image data, labels each circumscribed rectangle with a label, and stores the circumscribed rectangle in a memory. When the circumscribing rectangle calculated by the circumscribing rectangle calculating unit determines whether or not there is an overlap with another circumscribing rectangle, and when the overlapping determining unit determines that there is an overlap, the circumscribing rectangle is again displayed. Labeling is performed to create the label image. The circumscribing rectangle of the label image is used as a parent. Based on the label contained in the label, it is subdivided into child circumscribing rectangles. The subdivision means for repeating the subdivision operation until the number of contained labels becomes single, and obtaining the coordinates of the circumscribed rectangle of each child when the number of labels becomes single, and the input Value image, configured to include no overlap and the determined circumscribed rectangle coordinates, and an output means for outputting data composed of a circumscribed rectangle of the parent and each child determined by subdivision means.
[0008]
The processing outline of the connected area extracting apparatus is as follows. The circumscribed rectangle calculating means calculates a circumscribed rectangle of the connected area from the input binary image data, and stores each circumscribed rectangle with a label. Next, the overlap determining unit determines whether each circumscribed rectangle calculated by the circumscribed rectangle calculating unit overlaps with other circumscribed rectangles. If it is determined that there is an overlap, the subdivision unit performs further labeling processing again. To perform re-division processing.
[0009]
In this case, the subdivision means uses the circumscribed rectangle of the label image that has been labeled again as a parent, and subdivides it into child circumscribed rectangles based on the labels contained therein (calculates the circumscribed rectangle again), and further The operation of subdividing the child's circumscribed rectangle is repeated until the number of labels contained therein becomes single, and the coordinates of the circumscribed rectangle of each child when the number of labels becomes single are obtained. The output means outputs data consisting of the input binary image data, the coordinates of the circumscribed rectangle determined as non-overlapping by the overlap determining means, and the circumscribed rectangle of the parent and each child obtained by the subdivision means To do.
[0010]
§3: Outline of connected area extraction processing
FIG. 8 is an explanatory diagram (part 1) of a conventional example. Hereinafter, based on the specific example of FIG. 8, the outline | summary of the connection area | region extraction process in the said connection area | region extraction apparatus is demonstrated.
[0011]
The connected component extraction unit 1 extracts a connected component (or connected region) that is a component in which pixels are connected from the input binary image data. At this time, a labeling process is performed on the extracted connected components. For example, in the illustrated example, there are a connected component of label 1 and a connected component of label 2. Next, the connected component subdivision unit 2, when another connected component is further included in the extracted connected component, converts the extracted connected component (2-1) into each connected component included therein. Subdivide into component (2-2, 2-3) regions.
[0012]
And the subdivision area | region determination part 3 determines which connected component each area | region subdivided based on the said label. In this example, the subdivision area (2-1) belongs to the connected component of label 2, (2-2) belongs to the connected component of label 1, and (2-3) belongs to the connected component of label 2. And so on.
[0013]
The subdivision area storage unit 4 expresses the extracted connected components by arithmetic expressions such as the sum and difference of subdivided areas (subdivision areas) and stores them in a storage unit (buffer memory or the like). For example, this data is stored in the storage unit in the following manner: label 2 region = + (2-1) region− (2-2) region + (2-3) region.
[0014]
As described above, unlike the method of storing the label of the entire screen, or the connected component label image that overlaps with other connected components, the connected components are expressed by the sum, difference, etc. of the subdivided areas. As a result, the number of stored label images can be reduced or eliminated.
[0015]
§4: Explanation of processing by flowchart
FIG. 9 is an explanatory diagram (part 2) of the conventional example. Detailed processing will be described below based on the flowchart of FIG. In addition, (1)-(8) of a figure shows each process.
[0016]
(1): First, the input binary image data is subjected to a labeling process (for example, refer to the specification and drawings of Japanese Patent Application No. 3-206574 and Japanese Patent Application No. 5-237552) and connected patterns ( For each connected component), a circumscribed rectangle of the connected pattern with a label for distinguishing them is calculated. In this case, the meaning of the circumscribed rectangle may include coordinates and labels on the screen as attributes.
[0017]
(2): Next, it is determined whether or not the circumscribed rectangles of each label overlap each other. That is, the overlapping of circumscribed rectangles is determined.
[0018]
(3): Based on the result of the overlap determination in (2), for the non-overlapping label (non-overlapping label), the correspondence between the non-overlapping label (number) and its circumscribed rectangle is stored in the storage unit. Remember.
[0019]
(4): For the overlapping labels, the circumscribed rectangle for each connected pattern is calculated again for the overlapping labels based on the result of the overlap determination in (2) Perform circumscribed rectangle calculation processing).
[0020]
(5): Next, since the circumscribed rectangle of the target label matches the image size for re- circumscribed rectangle calculation, the circumscribed rectangle of the label other than the overlapping target label (hereinafter, this circumscribed rectangle is referred to as “noise circumscribed rectangle”). "Rectangle" or "other circumscribed rectangle").
[0021]
(6): It is confirmed whether or not the plurality of connection patterns included in the noise circumscribed rectangle is one. Specifically, for each noise circumscribed rectangle, the circumscribed rectangle of the connected pattern is calculated again, and it is confirmed from the number of circumscribed rectangles whether or not it is a single label.
[0022]
(7): When a plurality of circumscribed rectangles are all single labels, the noise circumscribed rectangles are overlapped and stored in the storage unit as noise rectangles in the target label. Thus, when the label image is restored, an area obtained by removing the noise circumscribed rectangle from the circumscribed rectangle of the overlap target label becomes the overlap target label area.
[0023]
(8): If even one noise circumscribed rectangle is not a single label (that is, the same label as the target label), the label image in the overlap target label is stored in the storage unit. This label image is calculated by performing a labeling process on the in-rectangular image of the overlapping attention label. However, the label image may be stored at the same time when the circumscribed rectangle is calculated in (4).
[0024]
In this way, the connected pattern is output not only with the circumscribed rectangle but also with the label image. Based on the circumscribed rectangle and the label image output in this way, the image processing apparatus performs image analysis, document image processing, and the like.
[0025]
§5: Explanation of subdivision processing example
FIG. 10 is an explanatory diagram (part 3) of the conventional example. Hereinafter, an example of subdivision processing will be described with reference to FIG.
[0026]
In the above example, only when there is a single circumscribed rectangle other than the target label in the overlapping portion, the circumscribed rectangle of the target label is expressed by the circumscribed rectangle arithmetic expression, and there are a plurality of circumscribed rectangles other than the target label in the overlapping portion. In some cases, a label image was stored. However, in this example, in order to reduce the amount of data required for storing the label image, the subdivision is repeated until there is a single label included in the circumscribed rectangle (noise circumscribed rectangle) other than the target label.
[0027]
In this subdivision process, first, the process of subdividing the noise circumscribed rectangle is repeated until there is a single label in each circumscribed rectangle (noise circumscribed rectangle) present in the circumscribed rectangle of the target label. In this case, if the circumscribed rectangle of the target label is a parent (in this example, label 9), the circumscribed rectangle of the target label can be expressed hierarchically as child 1, child 2,.
[0028]
In this example, the circumscribed rectangle represented by the upper left coordinates (X19, Y19) and the lower right coordinates (X29, Y29) is the parent of the label 9, the upper left coordinates (X192, Y192), and the lower right coordinates The circumscribed rectangle represented by the coordinates (X292, Y292) is the child 1 of the label 1, and the circumscribed rectangle represented by the upper left coordinates (X193, Y193) and the lower right coordinates (X293, Y293) is the label. It is a child 2 of 1-1.
[0029]
In this way, the process of subdividing the noise circumscribed rectangle is repeated until there is a single label in each circumscribed rectangle existing in the circumscribed rectangle of the target label. Then, it is expressed by an arithmetic expression such as the sum and difference of each subdivided area (subdivided area) and stored in a storage unit (buffer memory or the like). For example, this data is stored in the storage unit in the following manner: label 9 area = + (9-1) area− (9-2) area + (9-3) area.
[0030]
[Problems to be solved by the invention]
The conventional apparatus as described above has the following problems.
[0031]
(1): In the conventional subdivision process, a label image is generated again by performing a labeling process on the circumscribed rectangle determined to be overlapped, and the label included in the circumscribed rectangle of the label image is used as a parent. Based on the above, the child's circumscribed rectangle is subdivided into sub-rectangular rectangles, and the child's circumscribed rectangle is further subdivided until the number of labels contained therein becomes single.
[0032]
For this reason, when there are small labels other than noise in the circumscribed rectangles that overlap, the number of partial labeling increases, and the time for the subdivision processing increases.
[0033]
(2): When dealing with a blurred image in the conventional connected region extraction process, since the blurred image has many fine labels, the labeling process and circumscribed rectangle calculation process are repeated many times in the subdivision process. Had to be done. For this reason, processing time was long.
[0034]
An object of the present invention is to solve such a conventional problem and to reduce the processing amount of the entire connected region extraction processing to achieve high-speed processing.
[0035]
[Means for Solving the Problems]
FIG. 1 is a diagram illustrating the principle of the present invention. In order to achieve the above object, the present invention is configured as follows.
[0036]
(1): A circumscribed rectangle calculating unit 12A that calculates a circumscribed rectangle of a connected region where pixels are connected from input binary image data, and stores each circumscribed rectangle with a label, and the circumscribed rectangle calculating unit 12A. For each circumscribed rectangle calculated, an overlap determination unit 13A that determines whether or not there is an overlap with other circumscribed rectangles, and a labeling process is performed again on the circumscribed rectangle that is determined to be overlapping by the determination of the overlap determination unit 13A. A label image is created, and the circumscribed rectangle of the label image is used as a parent, and is subdivided into child circumscribed rectangles based on the labels contained therein, and the child circumscribed rectangle is further subdivided into the number of labels contained therein. The subdivision means 15A for obtaining the coordinates of the circumscribed rectangle of each child when the number of labels becomes single, and the input binary image data; A connecting unit provided with output means 16A for outputting data consisting of the coordinates of circumscribed rectangles determined not to overlap by the determination of the overlap determining means, and the circumscribed rectangles of the parent and each child obtained by the subdivision means In the area extraction device, for the circumscribed rectangle determined to be overlapped by the determination of the overlap determining unit, the size of the circumscribed rectangle in the vertical direction or the horizontal direction is calculated, and one of the sizes is 2 pixels or less. If the determination result is a single label, coordinate data of the circumscribed rectangle is provided. If it is not a single label, it is provided with a function of sending the circumscribed rectangle coordinate data to the subdivision means 15A.
[0037]
(2): In the connected region extraction apparatus according to (1), the subdivision means 15A performs a vertical direction or a horizontal direction of the circumscribed rectangle with respect to the circumscribed rectangle calculated in the process of performing the subdivision processing of the circumscribed rectangle. A single label determining means 17A for determining that there is no other overlapping label inside the label when any of the sizes is 2 pixels or less, and If the determination result of the single label determination means 17A is a single label, the subdivision processing for the circumscribed rectangle is terminated, and if it is not a single label, the subdivision processing for the circumscribed rectangle is performed. ing.
[0038]
(3): A circumscribed rectangle calculating unit 12A that calculates a circumscribed rectangle of a connected region where pixels are connected from input binary image data, and stores each circumscribed rectangle with a label, and the circumscribed rectangle calculating unit 12A. For each circumscribed rectangle calculated, an overlap determination unit 13A that determines whether or not there is an overlap with other circumscribed rectangles, and a labeling process is performed again on the circumscribed rectangle that is determined to be overlapping by the determination of the overlap determination unit 13A. The label image is created, and the circumscribed rectangle of the label image is used as a parent. Based on the label contained in the label image, the child circumscribed rectangle is subdivided. Further, the number of labels contained in the child circumscribed rectangle is determined. The subdivision operation is repeated until the number of labels becomes single, and the subdivision means 15A for obtaining the coordinates of the circumscribed rectangle of each child when the number of labels becomes single, the input binary image data, A connecting unit provided with output means 16A for outputting data consisting of the coordinates of circumscribed rectangles determined not to overlap by the determination of the overlap determining means, and the circumscribed rectangles of the parent and each child obtained by the subdivision means When the size of the circumscribed rectangle is calculated in the vertical direction or the horizontal direction for the circumscribed rectangle determined to be overlapped by the overlap determination in the region extracting device, and any of the sizes is 2 pixels or less And a procedure for determining that the label is a single label having no other overlapping label, and if the determination result is a single label, the coordinate data of the circumscribed rectangle is sent to the output means. Otherwise, a computer-readable recording medium recording a program for realizing the procedure of sending the coordinate data of the circumscribed rectangle to the subdivision means.
[0039]
(Function)
The operation of the present invention based on the above configuration will be described with reference to FIG.
[0040]
(a): In the above (1), the circumscribed rectangle calculating means 12A calculates a circumscribed rectangle of a connected region (connected component of pixels) connected to pixels from the input binary image data, and labels each circumscribed rectangle. Added and stored (for example, stored in a work memory not shown). Next, the overlap determining unit 13A determines whether or not each circumscribed rectangle calculated by the circumscribed rectangle calculating unit 12A overlaps with other circumscribed rectangles.
[0041]
As a result, if there is no overlap, the coordinates of the circumscribed rectangle are sent to the output means 16A, and if there is an overlap, whether or not the single label determination means 14A is a single label for the circumscribed rectangle determined to have overlap. Determine whether. In this case, the single label determination unit 14A calculates the size of the circumscribed rectangle in the vertical direction or the horizontal direction. When the size is 2 pixels or less, the single label determination unit 14A has no single overlapping label inside the label. Judged as one label.
[0042]
If it is determined that the label is a single label, the coordinate data of the circumscribed rectangle is sent to the output means 16A. If it is determined that the label is not a single label, the coordinate data of the circumscribed rectangle is sent to the subdivision means 15A. send.
[0043]
Thereafter, the subdivision means 15A performs a labeling process again to create a label image, and subdivides the circumscribed rectangle of the label image into a parent circumscribing rectangle based on the label contained therein, Repeat the operation to subdivide the child's circumscribed rectangle until the number of labels contained in it is single, determine the coordinates of each child's circumscribed rectangle when the number of labels becomes single, and output the data Send to means.
[0044]
As described above, the circumscribed rectangle determined to be overlapped by the overlap determination unit 13A is subjected to the single label determination unit 14A to determine whether or not it is a single label before performing the subdivision processing by the subdivision unit 15A. If it is determined that the label is a single label, the coordinate data of the corresponding circumscribed rectangle is output to the output means 16A without performing subdivision processing.
[0045]
For this reason, it is not necessary to perform extra subdivision processing for the circumscribed rectangle determined to be a single label, and accordingly, the processing amount can be reduced and the processing speed can be increased. That is, the conventional subdivision means 15A performs a labeling process again on the circumscribed rectangle determined to be overlapped to create a label image, and uses the circumscribed rectangle of the label image as a parent, and labels contained therein Based on this, subdivision into the child's circumscribed rectangle is performed, and further, the subdivision of the child's circumscribed rectangle is repeated until the number of labels contained therein becomes single. It is possible to reduce labeling processing time and the like when performing label determination.
[0046]
This is because the single label determination means 14A calculates the number of labels inside by labeling the number of labels inside by calculating the circumscribing rectangle size when it is known that there are no other labels inside the label. This is because it can be determined without any problem. Therefore, as described above, the processing amount can be reduced and the processing speed can be increased.
[0047]
(b): In (2), when it is determined by the single label determination means 14A that the label is not a single label, the subdivision means 15A performs the labeling process again on the target circumscribed rectangle and performs labeling. An image is created, and the circumscribed rectangle of the label image is used as a parent, and is subdivided into child circumscribed rectangles based on the labels contained therein (the circumscribed rectangle is calculated). The subdivision operation is repeated until the number of contained labels becomes single, and the process of obtaining the coordinates of the circumscribed rectangle of each child when the number of labels becomes single is performed.
[0048]
In this case, the single label determining unit 17A calculates the size of the circumscribed rectangle in the vertical direction or the horizontal direction with respect to the circumscribed rectangle calculated in the process of the subdivision processing, and any one of the sizes is 2 pixels or less. If there is, it is determined that the label is a single label having no other overlapping label. If the determination result is a single label, the subdivision processing for the circumscribed rectangle is terminated, and if it is not a single label, the subdivision processing is further performed for the circumscribed rectangle. In this way, the processing amount of the repeated subdivision process is reduced, and the speed of the subdivision process can be increased.
[0049]
(3): The controller (for example, CPU) of the connected area extraction apparatus reads and executes the program of the recording medium, and thereby determines the overlap rectangle in the connected area extraction process that is determined to have overlap. The vertical or horizontal size of the circumscribed rectangle is calculated, and when one of the sizes is 2 pixels or less, it is determined that the label is a single label having no other overlapping label inside the label. If the determination result is a single label, the circumscribed rectangle coordinate data is sent to the output means, and if it is not a single label, the circumscribed rectangle coordinate data is sent to the subdivision means 15A. To do.
[0050]
As described above, the circumscribed rectangle determined to have overlap in the overlap determination process is determined to be a single label by performing a single label determination process before performing the subdivision process, and determined to be a single label. In this case, the coordinate data of the corresponding circumscribed rectangle is output to the output unit 16A without performing subdivision processing.
[0051]
For this reason, it is not necessary to perform extra subdivision processing, and the processing amount can be reduced and the processing speed can be increased. In other words, conventionally, a circumscribed rectangle determined to have overlap is subjected to a labeling process again to create a label image, and the circumscribed rectangle of the label image is used as a parent, and a child is created based on a label contained therein. Subdivision into circumscribed rectangles and further subdivision of the child's circumscribed rectangle until the number of labels contained therein becomes single is repeated, and single label determination is performed in this subdivision processing. Labeling processing time can be reduced.
[0052]
This is because the single label determination process calculates the number of labels inside by calculating the circumscribing rectangle size when it is known that there are no other labels inside the label. This is because it can be discriminated. Therefore, as described above, the processing amount can be reduced and the processing speed can be increased.
[0053]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described in detail below with reference to the drawings.
[0054]
§1: Description of connected region extraction device
FIG. 2 is a block diagram of the connected region extracting apparatus. Hereinafter, based on FIG. 2, a connection area | region extraction apparatus is demonstrated. The connected region extraction device is a device that extracts a connected component (connected region) of pixels from input binary image data and outputs the information as label image information of one screen. The output label image information is: For example, the image is sent to the image processing apparatus and image processing is performed.
[0055]
This connected area extracting device connects pixels from a binary image storage unit 11 (for example, a buffer memory) that temporarily stores input binary image data and the binary image data stored in the binary image storage unit 11. A connected component (or connected region), which is a connected component, is calculated, a circumscribed rectangle of the connected component is calculated, a label is attached to each circumscribed rectangle to form a label image, and this circumscribed rectangle is stored in the work memory When it is determined by the calculation unit 12, the overlap determination unit 13 that determines whether or not each of the calculated circumscribed rectangles overlaps with another circumscribed rectangle, and the overlap determination unit 13 determine that there is an overlap, A single label determination unit 14 that determines whether or not the label is determined, and a subdivision unit 15 that performs further subdivision when the single label determination unit 14 determines that the label is not a single label. rear An output unit 16 for outputting the data provided, further, provided with a single label determination unit 17 to the subdivision unit 15.
[0056]
In this case, the subdivision unit 15 uses the circumscribed rectangle of the label image created by the circumscribed rectangle calculation unit 12 as a parent, and subdivides it into child circumscribed rectangles based on the labels contained therein, and further subdivides the child A process for obtaining the coordinates of the circumscribed rectangle of each child whose number is contained in the circumscribed rectangle is performed. When performing such subdivision processing, the single label determination unit 14 determines whether or not the label is a single label. When the determination is made and it is determined that the label is a single label, the subdivision process is terminated and output to the output unit 16.
[0057]
The other configurations excluding the single label determination units 14 and 17, that is, the configurations of the binary image storage unit 11, circumscribed rectangle calculation unit 12, overlap determination unit 13, subdivision unit 15, and output unit 16 are described above. This is the same as the conventional example (see JP-A-8-55219).
[0058]
§2: Explanation of connected area extraction processing
FIG. 3 is a flowchart of connected area extraction processing. Hereinafter, based on FIG. 3 with reference to FIG. 2, the connected region extraction processing of binary image data will be described. In addition, S1-S8 shows each process step.
[0059]
First, the input binary image data is stored in the binary image storage unit 11 (S1). Thereafter, the circumscribed rectangle calculation unit 12 extracts the binary image data stored in the binary image storage unit 11, and calculates a circumscribed rectangle of a connected component (connected region) in which pixels are connected (S2).
[0060]
In this case, the binary image data is subjected to a labeling process (for example, refer to the specifications and drawings of Japanese Patent Application No. 3-206574 and Japanese Patent Application No. 5-237552), and for each connected pattern (connected component), A circumscribed rectangle of the connected pattern with a label for distinguishing them is obtained and stored in the work memory.
[0061]
Next, the overlap determining unit 13 determines whether or not the circumscribed rectangles of the labels overlap each other with respect to the circumscribed rectangle calculated by the circumscribed rectangle calculating unit 12 (S3). As a result, when it is determined that there is an overlap (S4), the single label determination unit 14 determines whether the label is a single label (S5). However, if it is determined that there is no overlap in the process of S4, the circumscribed rectangle to be determined is output to the output unit 16.
[0062]
Then, it is determined whether or not it is a single label in the process of S6. If it is determined that the label is a single label, the circumscribed rectangle data is output to the output device 16. However, if it is determined in the single label determination process of S5 that the label is not a single label, a circumscribed rectangle is subdivided (details of the subdivision process will be described later) (S7), and the data after subdivision is processed. The output is sent to the output unit 16 (S8). As described above, the connected region extraction process of the binary image data is performed.
[0063]
§3: Explanation of subdivision processing
FIG. 4 is a flowchart of subdivision processing. Hereinafter, the subdivision process will be described with reference to FIG. In addition, S11-S17 show each process step. This process is a process performed by the subdivision unit 15 shown in FIG. 2 and includes a single label determination process by the single label determination unit 17.
[0064]
The subdivision unit 15 performs subdivision processing on circumscribed rectangular data determined by the single label determination unit 14 as not being a single label. In this process, first, the single label determination unit 17 determines whether the single label is a single label. Determine whether or not. That is, it is determined whether or not a label other than the target label (noise label) is a single label (S11).
[0065]
As a result, if it is a single label (S12), the subdivision process is terminated, but if it is not a single label, the subdivision unit 15 performs the circumscribed rectangle calculation process (re circumscribed rectangle calculation process) again (re- circumscribed rectangle calculation process) ( S13). Then, a determination process is performed as to whether or not the calculated circumscribed rectangle is a target label (S14). As a result, if the calculated circumscribed rectangle is not the target label (S15), the subdivision process is terminated, but if it is the target label, the process determines whether the calculated circumscribed rectangle is a single label again ( S16).
[0066]
As a result, if it is determined that the label is a single label (S17), the subdivision process is terminated. If it is determined that the label is not a single label, the process is repeated from S11. As described above, the subdivision processing (S11 to S17) is repeatedly performed until the labels included inside the circumscribed rectangle (noise circumscribed rectangle) other than the target label become single.
[0067]
§4: Description of single label determination processing
FIG. 5 is a flowchart of the single label determination process. FIG. 6 is an explanatory diagram of single label determination processing. FIG. 6A is an overlapping circumscribed rectangle, FIG. 6B is an example 1 of a diagram in which no other overlapping label exists inside the label, and FIG. Figure 2 is an example 2 of a figure in which no label exists, Figure D is an example 1 of a figure in which a label exists, and Figure E is an example 2 of a figure in which a label exists. In FIG. 6, “0” and “1” indicate “white” and “black” pixels of the binary image data.
[0068]
Hereinafter, the single label determination process will be described with reference to FIG. This processing is performed by the single label determination units 14 and 17, and S21 to S27 indicate each processing step. Further, it is assumed that overlapping circumscribed rectangle data and the like are stored in a work memory (not shown).
[0069]
For example, as shown in FIG. 6A, the upper left coordinate point of the overlapping circumscribed rectangle is P1, the lower right coordinate point is P2, and P1 = (x1, y1) and P2 = (x2, y2). And The single label determination units 14 and 17 first obtain the upper left coordinates P1 = (x1, y1) and the lower right coordinates P2 = (x2, y2) of the overlapping circumscribed rectangle from the work memory (S21).
[0070]
Then, the horizontal width (number of pixels in the horizontal direction) W = (x2−x1 + 1) and the height (number of pixels in the vertical direction) H = (y2−y1 + 1) are calculated (S22). Note that the reason why +1 exists in the W and H formulas is that the pixels have a width. Then, the minimum single label size S (preset value S = 2) is acquired (S23), and it is determined whether or not the condition of W ≦ S is satisfied (S24).
[0071]
As a result, if the condition of W ≦ S is satisfied, it is determined as a single label (S26), and the process is terminated. If the condition of W ≦ S is not satisfied, H ≦ S (S = 2) is satisfied. It is determined whether or not the condition is satisfied (S25). As a result, if the condition of H ≦ S is satisfied, it is determined as a single label (S26), and the process is terminated. If the condition of H ≦ S is not satisfied, the conventional process is performed (S27).
[0072]
In the above process, S = 2 (2 pixels), and as shown in FIG. 6B, if W = 2 (horizontal width = 2 pixels), the condition of W ≦ S is satisfied and There are no other overlapping labels. Further, as shown in FIG. 6C, even if W = 2 (width = 2 pixels), if the condition of H ≦ S is satisfied, it is determined that no other overlapping label exists in the label. . Further, when W = 3 (width = 3) as shown in FIG. 6D, or when H = 3 (height = 3) as shown in E, it is determined that a label exists inside. .
[0073]
That is, if W = 2 or less, or H = 2 or less, W or H is 2 pixels or 1 pixel, and therefore, there is no other overlapping label inside the label composed of pixels having such a width. However, if W = 3 or more, or H = 3 or more, there is a possibility that another overlapping label exists inside the label, so the determination is made as described above.
[0074]
As described above, the single label determination units 14 and 17 calculate the horizontal size (horizontal width = W) or the vertical size (height = H) of the circumscribed rectangle to be determined, When the size is 2 pixels or less (W ≦ 2 or H ≦ 2), it is determined that the label is a single label with no other overlapping label inside.
[0075]
In this way, the number of labels inside can be calculated as in the past by calculating the case where it is known that there are no other labels clearly inside the label from the circumscribed rectangle size (W, H). The single label determination process can be performed easily and in a short time without performing the labeling process, and the processing speed can be increased.
[0076]
§5: Description of specific example of connected region extraction device and recording medium
FIG. 7 shows a specific example of the apparatus. The connected area extracting apparatus can be realized by an arbitrary computer such as a personal computer or a workstation. This apparatus includes a computer main body 21, a display device 22 connected to the computer main body 21, an input device (keyboard / mouse, etc.) 23, a removable disk drive (referred to as “RDD”) 24, and a magnetic disk device (referred to as “MDD”). ) 25 etc.
[0077]
The computer main body 21 includes a CPU 26 for performing various internal controls and processes, a ROM 27 for storing programs and various data, a memory 28 (work memory), and an interface control unit (“I / F”). 29) and a communication control unit 30 are provided. The RDD 24 includes a flexible disk drive, an optical disk drive, and the like.
[0078]
In the apparatus having the above configuration, for example, a program for realizing the connected area extraction processing is stored in the ROM 27 or the magnetic disk (recording medium) of the MDD 25, and this program is read and executed by the CPU 26. The connected region extraction process is executed.
[0079]
However, the present invention is not limited to such an example. For example, the program may be stored on the magnetic disk of the MDD 25 as follows, and the CPU 26 may execute the connected region extraction process by executing the program. Is possible.
[0080]
{Circle around (1)} A program (program data created by another device) stored in a removable disk created by another device is read by the RDD 24 and stored in a recording medium of the MDD 25.
[0081]
(2): Data such as a program transmitted from another device via a communication line such as a LAN is received via the communication control unit 30, and the data is stored in a recording medium (magnetic disk) of the MDD 25.
[0082]
【The invention's effect】
As described above, the present invention has the following effects.
[0083]
(1): Since the connected region extraction apparatus is provided with a single label determination means and the subsequent processing is omitted for the circumscribed rectangle determined to be a single label, the processing amount of the entire connected region extraction process is reduced, High speed can be achieved.
[0084]
(2): The single label determination means can calculate the case where it is known that there is no other label inside the label from the circumscribed rectangle size, thereby omitting the labeling process that has been performed conventionally. As a result, it is possible to reduce the processing amount of the connected region extraction processing and to increase the processing speed. In particular, since the blurred image has a lot of fine labels, the above-mentioned effect appears remarkably.
[0085]
(3): For each circumscribed rectangle calculated by the circumscribed rectangle calculating means, the overlap determining means determines whether or not there is an overlap with other circumscribed rectangles. If there is no overlap, the coordinates of the circumscribed rectangle are sent to the output means, and the overlap is determined. If there is, the single label determination means determines whether or not the circumscribed rectangle determined to have overlap is a single label.
[0086]
In this case, the single label determination means calculates the size of the circumscribed rectangle in the vertical or horizontal direction, and when the size is 2 pixels or less, the single label has no other overlapping label inside the label. It is determined that If it is determined that the label is a single label, the coordinate data of the circumscribed rectangle is sent to the output means. If it is determined that the label is not a single label, the coordinate data of the circumscribed rectangle is sent to the subdivision means.
[0087]
In this way, for the circumscribed rectangle determined to be overlapped by the overlap determination unit, before performing the subdivision process by the subdivision unit, it is determined whether or not it is a single label by the single label determination process. Is determined, the corresponding circumscribed rectangle coordinate data is output to the output means without performing subdivision processing.
[0088]
For this reason, it is not necessary to perform the subdivision processing for the circumscribed rectangle determined to be a single label, and accordingly, the processing amount can be reduced and the processing speed can be increased. That is, in the conventional subdivision means, a label image is created again by performing a labeling process on the circumscribed rectangle determined to be overlapped, and the label contained within the circumscribed rectangle is used as a parent. Then, subdividing the child's circumscribing rectangle and further subdividing the child's circumscribing rectangle until the number of labels contained in the child becomes single, but the circumscribing rectangle determined to be a single label This subdivision process can be reduced.
[0089]
In addition, by calculating the case where it is determined that there is no other label inside the label from the circumscribed rectangle size, the labeling process that has been performed conventionally can be omitted. As a result, it is possible to reduce the processing amount of the connected region extraction processing and to increase the processing speed. In particular, since the blurred image has a lot of fine labels, the above-mentioned effect appears remarkably. Therefore, it is possible to reduce the processing amount of the connected area extraction process and achieve a high-speed process.
[0090]
(4): The circumscribing rectangle determined to be overlapped with other circumscribed rectangles by the overlap determining means is determined as to whether it is a single label, and the circumscribing rectangle determined not to be a single label is subdivided. I do. In this subdivision processing, the subdivision means performs labeling processing again on the corresponding circumscribed rectangle, creates a label image, and uses the circumscribed rectangle of the label image as a parent, based on the label contained therein, Subdividing the child's circumscribed rectangle into sub-boundary rectangles and further subdividing the child's circumscribed rectangle until the number of labels contained in the child becomes single. Performs processing to obtain rectangular coordinates.
[0091]
In this case, the single label determination unit in the subdivision unit calculates the vertical or horizontal size of the circumscribed rectangle for the circumscribed rectangle calculated in the process of the subdivision process, and any one of the sizes is If it is 2 pixels or less, it is determined that the label is a single label with no other overlapping label inside. If the determination result is a single label, the subdivision process for the circumscribed rectangle is terminated.
[0092]
In this way, when the subdivision processing is performed, the subsequent processing can be omitted for the circumscribed rectangle determined to be a single label. Accordingly, the processing amount of the repeated subdivision process is reduced, and the speed of the subdivision process can be increased. In this case, in particular, the labeling process or the like can be omitted by calculating from the circumscribed rectangle size the case where it is determined that there is no other label inside the label.
[0093]
As a result, in particular, the processing amount can be increased by reducing the processing amount of the subdivision processing. In particular, since the blurred image has many fine labels, the above-described effect appears remarkably when the blurred image is handled.
[0094]
(5): The controller (for example, CPU) of the connected area extraction apparatus reads and executes the program of the recording medium, thereby determining the overlap rectangle in the connected area extraction process that is determined to have overlap. The vertical or horizontal size of the circumscribed rectangle is calculated, and when one of the sizes is 2 pixels or less, it is determined that the label is a single label having no other overlapping label inside the label. If the determination result is a single label, the circumscribed rectangle coordinate data is sent to the output means, and if it is not a single label, the circumscribed rectangle coordinate data is sent to the subdivision means. .
[0095]
As described above, the circumscribed rectangle determined to have overlap in the overlap determination process is determined to be a single label by performing a single label determination process before performing the subdivision process, and determined to be a single label. In this case, the coordinate data of the corresponding circumscribed rectangle is output to the output means without performing subdivision processing.
[0096]
For this reason, it is not necessary to perform extra subdivision processing, and the processing amount can be reduced and the processing speed can be increased. In other words, conventionally, a circumscribed rectangle determined to have overlap is subjected to a labeling process again to create a label image, and the circumscribed rectangle of the label image is used as a parent, and a child is created based on a label contained therein. Subdivision into circumscribed rectangles and further subdivision of the circumscribed rectangles of its children until the number of labels contained therein becomes single are repeated, but this subdivision processing can be reduced.
[0097]
In addition, by calculating the case where it is determined that there is no other label inside the label from the circumscribed rectangle size, the labeling process that has been conventionally performed can be omitted. As a result, it is possible to reduce the processing amount of the connected region extraction processing and to increase the processing speed. In particular, since the blurred image has a lot of fine labels, the above-mentioned effect appears remarkably. Therefore, it is possible to reduce the processing amount of the connected area extraction process and achieve a high-speed process.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating the principle of the present invention.
FIG. 2 is a block diagram of a connected region extraction apparatus in an embodiment of the present invention.
FIG. 3 is a flowchart of connected area extraction processing in the embodiment of the present invention.
FIG. 4 is a flowchart of subdivision processing in the embodiment of the present invention.
FIG. 5 is a flowchart of a single label determination process in the embodiment of the present invention.
FIG. 6 is an explanatory diagram of single label determination processing according to the embodiment of the present invention.
FIG. 7 is a specific apparatus example according to the embodiment of the present invention.
FIG. 8 is an explanatory diagram (part 1) of a conventional example.
FIG. 9 is an explanatory diagram (part 2) of a conventional example.
FIG. 10 is an explanatory diagram of a conventional example (part 3);
[Explanation of symbols]
1 connected component extraction unit
2 Connected component subdivision
3 Subdivision area determination unit
4 Subdivision area storage
11 Binary image storage unit
12 circumscribed rectangle calculator
13 Overlap determination unit
14 Single label judgment part
15 Subdivision section
16 Output section
17 Single label determination unit
21 Computer body
22 Display device
23 Input device
24 Removable disk drive
25 Magnetic disk unit
26 CPU (Central Processing Unit)
27 ROM (Read Only Memory)
28 memory
29 Interface control unit (I / F control unit)
30 Communication control unit

Claims (3)

入力された2値画像データから、画素の繋がった連結領域の外接矩形を算出し、各外接矩形にラベルを付して記憶する外接矩形算出手段と、
前記外接矩形算出手段により算出された各外接矩形について、他の外接矩形との重なりの有無を判定する重なり判定手段と、
前記重なり判定手段の判定で重なり有りと判定された外接矩形に対し、再度ラベリング処理を行なってラベル画像を作成し、該ラベル画像の外接矩形を親として、その内部に含まれるラベルを基に、子の外接矩形に細分割し、更に、その子の外接矩形を、内部に含まれるラベル数が単一になるまで細分割する操作を繰り返し、ラベル数が単一になったときの各々の子の外接矩形の座標を求める細分割手段と、
前記入力された2値画像データ、前記重なり判定手段の判定で重なり無しと判定された外接矩形の座標、及び、前記細分割手段によって求められた親及び各々の子の外接矩形とからなるデータを出力する出力手段を備えた連結領域抽出装置において、
前記重なり判定手段の判定で重なり有りと判定された外接矩形に対し、その外接矩形の縦方向、又は横方向のサイズを算出し、前記いずれかのサイズが2画素以下であった場合に、そのラベル内部に他の重なりラベルが無い単一ラベルであると判定する単一ラベル判定手段を備えると共に、
前記判定結果が単一ラベルであれば、その外接矩形の座標データを前記出力手段へ送り、単一ラベルでなければ、その外接矩形の座標データを前記細分割手段へ送る機能を備えている、
ことを特徴とする連結領域抽出装置。
Circumscribing rectangle calculation means for calculating a circumscribed rectangle of a connected area where pixels are connected from the input binary image data, and storing each circumscribed rectangle with a label;
For each circumscribed rectangle calculated by the circumscribed rectangle calculating means, an overlap determining means for determining whether or not there is an overlap with other circumscribed rectangles;
For the circumscribed rectangle determined to be overlapped by the determination of the overlap determining means, a label image is created again by creating a label image, based on the label contained inside the circumscribed rectangle of the label image as a parent, Subdivide the child's circumscribing rectangle into sub-divisions, and further subdivide the child's circumscribing rectangle until the number of labels contained in it is unity. Subdivision means for obtaining the coordinates of the circumscribed rectangle;
Data consisting of the input binary image data, the coordinates of the circumscribed rectangle determined to be non-overlapping by the determination of the overlap determining means, and the circumscribed rectangle of the parent and each child determined by the subdivision means In the connected region extraction apparatus having output means for outputting,
For the circumscribed rectangle determined to have overlap by the determination of the overlap determining means, the vertical or horizontal size of the circumscribed rectangle is calculated, and when any of the sizes is 2 pixels or less, A single label determination means for determining that there is no other overlapping label inside the label, and
If the determination result is a single label, the coordinate data of the circumscribed rectangle is sent to the output means, and if it is not a single label, the coordinate data of the circumscribed rectangle is sent to the subdivision means.
A connected region extracting apparatus.
前記細分割手段は、
前記外接矩形の細分割処理を行う過程で算出した外接矩形に対し、その外接矩形の縦方向、又は横方向のサイズを算出し、前記いずれかのサイズが2画素以下であった場合に、そのラベル内部に他の重なりラベルが無い単一ラベルであると判定する単一ラベル判定手段を備えると共に、
前記単一ラベル判定手段の判定結果が単一ラベルであれば、その外接矩形についての細分割処理を終了させ、単一ラベルでなければ、その外接矩形についての細分割処理を行わせる機能を備えている、
ことを特徴とする請求項1記載の連結領域抽出装置。
The subdivision means includes
For the circumscribed rectangle calculated in the process of performing the subdivision processing of the circumscribed rectangle, the size of the circumscribed rectangle is calculated in the vertical direction or the horizontal direction. A single label determination means for determining that there is no other overlapping label inside the label, and
If the determination result of the single label determination means is a single label, the subdivision processing for the circumscribed rectangle is terminated, and if it is not a single label, the subdivision processing for the circumscribed rectangle is performed. ing,
The connected area extracting apparatus according to claim 1, wherein:
入力された2値画像データから画素の繋がった連結領域の外接矩形を算出し、各外接矩形にラベルを付して記憶する外接矩形算出手段と、
前記外接矩形算出手段により算出された各外接矩形について、他の外接矩形との重なりの有無を判定する重なり判定手段と、
前記重なり判定手段の判定で重なり有りと判定された外接矩形に対し、再度ラベリング処理を行なってラベル画像を作成し、該ラベル画像の外接矩形を親として、その内部に含まれるラベルを基に、子の外接矩形に細分割し、更に、その子の外接矩形を内部に含まれるラベル数が単一になるまで細分割する操作を繰り返し、ラベル数が単一になったときの各々の子の外接矩形の座標を求める細分割手段と、
前記入力された2値画像データ、前記重なり判定手段の判定で重なり無しと判定された外接矩形の座標、及び、前記細分割手段によって求められた親及び各々の子の外接矩形とからなるデータを出力する出力手段を備えた連結領域抽出装置に、
前記重なり判定で、重なり有りと判定された外接矩形に対し、その外接矩形の縦方向、又は横方向のサイズを算出し、前記いずれかのサイズが2画素以下であった場合に、そのラベル内部に他の重なりラベルが無い単一ラベルであると判定する手順と、
前記判定結果が単一ラベルであれば、その外接矩形の座標データを前記出力手段へ送り、単一ラベルでなければ、その外接矩形の座標データを前記細分割手段へ送る手順と、
を実現させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体。
Circumscribed rectangle calculating means for calculating a circumscribed rectangle of a connected region where pixels are connected from input binary image data, and storing each circumscribed rectangle with a label;
For each circumscribed rectangle calculated by the circumscribed rectangle calculating means, an overlap determining means for determining whether or not there is an overlap with other circumscribed rectangles;
For the circumscribed rectangle determined to be overlapped by the determination of the overlap determining means, a labeling process is performed again to create a label image, with the circumscribed rectangle of the label image as a parent, based on the label contained therein, Subdividing the child's circumscribed rectangle into sub-boundaries and further subdividing the child's circumscribed rectangle until the number of labels contained in the child becomes single. Subdivision means for obtaining rectangular coordinates;
Data consisting of the input binary image data, the coordinates of the circumscribed rectangle determined to be non-overlapping by the determination of the overlap determining means, and the circumscribed rectangle of the parent and each child determined by the subdivision means In the connected region extraction apparatus provided with output means for outputting,
For the circumscribed rectangle determined to be overlapped by the overlap determination, the vertical or horizontal size of the circumscribed rectangle is calculated, and if any of the sizes is 2 pixels or less, the label inside A procedure for determining that a single label has no other overlapping label,
If the determination result is a single label, the coordinate data of the circumscribed rectangle is sent to the output means, and if it is not a single label, the coordinate data of the circumscribed rectangle is sent to the subdivision means;
The computer-readable recording medium which recorded the program for implement | achieving.
JP12095299A 1999-04-28 1999-04-28 Connected region extraction apparatus and recording medium Expired - Lifetime JP4322999B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP12095299A JP4322999B2 (en) 1999-04-28 1999-04-28 Connected region extraction apparatus and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP12095299A JP4322999B2 (en) 1999-04-28 1999-04-28 Connected region extraction apparatus and recording medium

Publications (2)

Publication Number Publication Date
JP2000311247A JP2000311247A (en) 2000-11-07
JP4322999B2 true JP4322999B2 (en) 2009-09-02

Family

ID=14799051

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12095299A Expired - Lifetime JP4322999B2 (en) 1999-04-28 1999-04-28 Connected region extraction apparatus and recording medium

Country Status (1)

Country Link
JP (1) JP4322999B2 (en)

Also Published As

Publication number Publication date
JP2000311247A (en) 2000-11-07

Similar Documents

Publication Publication Date Title
EP1017011A2 (en) Block selection of table features
JP4565396B2 (en) Image processing apparatus and image processing program
JP2000235619A (en) Surface image processor and its program storage medium
JP4049560B2 (en) Halftone dot removal method and system
JP4322999B2 (en) Connected region extraction apparatus and recording medium
JP2010102396A (en) Person detection device, person detection method, and program
JP3172498B2 (en) Image recognition feature value extraction method and apparatus, storage medium for storing image analysis program
JP2002342710A (en) Character segmenting device and character segmenting method used for the same device and its program
JPH11265422A (en) Method and device for recognizing mark and recording medium
JP4087911B2 (en) Ruled line creation device and ruled line creation method
JPH11143990A (en) Method and device for recognizing character and recording medium in which method for recognizing character is recorded
JPH117493A (en) Character recognition processor
JP4153850B2 (en) Image processing apparatus and image processing program
JP2006277509A (en) Dot texture superposition notation part shape restoration method and program therefor
JPH0560876B2 (en)
JPH0830725A (en) Device and method for processing image
JP3534997B2 (en) Ruled line extraction device and method
JP2962525B2 (en) Text block recognition method
JPH10162104A (en) Character recognition device
JPH0573718A (en) Area attribute identifying system
JPH0713996A (en) Character recognizing device
JP2002015323A (en) Document image layout distinguishing method and device thereof
JPH0728933A (en) Character recognition device
JP2010086409A (en) Information processor and information processing method
JPH02128292A (en) Optical character reader

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060324

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20090602

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090604

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120612

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120612

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130612

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140612

Year of fee payment: 5

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313117

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

EXPY Cancellation because of completion of term