JP2004334461A - Character recognition device and character recognition program - Google Patents
Character recognition device and character recognition program Download PDFInfo
- Publication number
- JP2004334461A JP2004334461A JP2003128637A JP2003128637A JP2004334461A JP 2004334461 A JP2004334461 A JP 2004334461A JP 2003128637 A JP2003128637 A JP 2003128637A JP 2003128637 A JP2003128637 A JP 2003128637A JP 2004334461 A JP2004334461 A JP 2004334461A
- Authority
- JP
- Japan
- Prior art keywords
- character
- area
- character string
- black
- division mode
- 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
Links
Images
Landscapes
- Character Input (AREA)
- Character Discrimination (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
この発明は、画像中の文字を認識する文字認識装置及び文字認識プログラムに係るものであり、特に画像中に異なる大きさの文字からなる文字列が存在する場合に、この画像から文字列領域を効率的に抽出する技術に関する。
【0002】
【従来の技術】
従来の画像中の文字を認識する文字認識装置は、文字パターンの大きさを推測して文字列の存在する領域(文字列領域)を切り出して、この文字列領域内に存在する画素パターンと文字パターンとを照合するものであった。このような文字認識装置では、切り出す文字列領域の大きさの基礎となる文字パターンの大きさの推測方法が重要となる。
【0003】
このような文字パターンの大きさを推測する方法としては、画像中の特定位置にある部分領域において、文字を構成する画素の分布状況を取得し、この分布状況から文字サイズを推測する技術がある(例えば特許文献1)。
【0004】
【特許文献1】
特開昭63−292381「文字行検出装置」(第1図、第3頁−第5頁)
【0005】
【発明が解決しようとする課題】
上記のとおり、従来の文字認識装置は入力画像の一部の領域から文字サイズと行間隔を推定している。したがって、このような領域から、基準となる文字の情報を得ても、この文字とは異なる大きさの文字が別の領域に存在している場合には、正しく認識することができないという課題があった。
【0006】
この発明は、このような課題を解決するためになされたものであり、大きさの異なる複数の文字列が存在する場合であっても、適切に文字列を検出し、認識を行う文字認識装置を提供することを目的とする。
【0007】
【課題を解決するための手段】
この発明に係る文字認識装置は、入力画像を所定の大きさの文字に適合する第1分割形態の領域に分割するとともに、前記大きさとは異なる大きさの文字に適合する第2分割形態の領域に分割し、さらに前記第1分割形態の各領域と前記第2分割形態の各領域から黒画素数が所定数以上存在する領域を黒区画として抽出する黒区画抽出手段と、
前記黒区画を併合してそれらの分割形態に適合する文字列領域を形成するとともに、前記文字列領域から文字領域を切り出す文字領域抽出手段と、
前記文字領域の文字パターンを認識する文字認識手段と、を備えたものである。
【0008】
【発明の実施の形態】
以下、この発明による実施の形態について説明する。
実施の形態1.
図1はこの発明の実施の形態1による文字認識装置の構成を示したブロック図である。図において、領域区画部1と領域区画部2はそれぞれ、図示せぬカメラなどの画像入力手段によって撮像された入力画像を複数の領域に分割するものである。領域区画部1が分割する領域の大きさと領域区画部2が分割する領域の大きさは異なっている。投影区画抽出部3は、入力画像中の領域の画素の値に基づいて、黒画素の存在する領域(黒区画)を抽出するようになっている。文字列領域抽出部4は、投影区画抽出部3によって抽出された黒区画を併合して、文字列が存在する可能性のある領域である文字列領域候補を形成し、さらに文字列領域候補の大きさから文字列領域か否かを決定する部位である。文字切り出し部5は、文字列領域抽出部4によって形成された文字列領域から各文字の領域を切り出すようになっている。そして、文字認識部6は、文字切り出し部5によって切り出された各文字の領域を文字認識する部位である。ここで、領域区画部1と領域区画部2、投影区画抽出部3は黒区画抽出手段を構成するものであり、文字列領域抽出部4と文字切り出し部5は文字領域抽出手段を構成するものである。また文字認識部6は、文字認識手段に対応する。
【0009】
次にこの文字認識装置の動作を説明する。図2はこの文字認識装置の動作を示すフローチャートである。本処理の前提として、図3に示すような入力画像7が撮像されているものとする。入力画像7は、白と黒の画素からなる2値画像であって、図に示すように、入力画像7には文字列ではない模様8と文字列9〜文字列11からなる3個の横書きの文字列が存在している。
【0010】
まず、領域区画部1と領域区画部2は入力画像7全体を部分領域に分割する(ステップS1)。領域区画部1は、入力画像7を互いに等しい面積を有する部分領域に分割する。入力画像7を領域区画部1によって分割した状態を、第1の分割形態と呼ぶこととする。また領域区画部2は、同じ入力画像7を第1の分割形態による部分領域とは異なる面積を有する部分領域であって、互いに等しい面積を有する部分領域に分割する。領域区画部2によるこのような分割状態を、第2の分割形態と呼ぶこととする。
【0011】
図4は領域区画部1による部分領域設定(第1の分割形態)の例を示す図であって、図5は領域区画部2による部分領域設定(第2の分割形態)の例を示す図である。第2の分割形態に比べて、第1の分割形態では幅狭の部分領域に分割されている。
【0012】
一般に、画像中の文字を認識するためには、画像を複数の部分領域に分割して、各部分領域毎に画素の分布を求めることが基本となる。精度のよい文字認識を行うには、この部分領域を適切に設定することが要求される。ところで、多くの場合画像中には、文字列以外の物体やその影が画像中に撮像されたり、文字列が回転する(画像の水平あるいは垂直座標軸に対して文字列が斜めに撮像される)ことによって、ノイズ(文字を構成しない画素)が混在する。そこでなるべく大きな部分領域を設定すれば、このようなノイズによる画素分布の影響を相対的に小さくすることができる。しかし画像中に小さな文字が存在する場合には、この小さな文字までもノイズとして排除されてしまうおそれがある。
【0013】
そこで、実施の形態1による文字認識装置では、小さな文字を認識することを目的とする領域分割も行うこととした。小さな文字用の領域分割によって、大きな文字用の領域分割ではノイズとして排除されてしまうような画素の分布に対しても文字認識が可能となるからである。
【0014】
図4に示した第1の分割形態は、比較的小さな文字を認識することを目的とする部分領域に分割した状態を指している。また図5に示した第2の分割形態は、第1の分割形態に対応する文字よりも大きな文字を認識することを目的とする部分領域に分割した状態を指している。
【0015】
さらに画像を分割する方向については、横書き文字列を認識する場合には、縦長の短冊状に入力画像を分割する方がよい。部分領域の幅単位でノイズを棄却するためである。一方、縦書き文字列を認識するには、横長の短冊状に入力画像を分割すればよいし、横書きか縦書きか想定できない場合には正方形に近い部分領域に分割する。図4及び図5は縦長の短冊状の部分領域に入力画像を分割したものである。
【0016】
また、第1及び第2の分割形態の部分領域は、説明を簡単にするために、想定される入力画像中の文字の大きさに基づいて定められるものとする。文字の大きさと大きさが極端に異なる部分領域に分割すると、正しくノイズの棄却が行えなかったり、文字の一部が欠けた状態で検出してしまったりするためである。この例とは異なり、入力画像中の文字の大きさを予測できない場合には、何段階かの文字の大きさに対応した分割形態とその分割形態に対応した領域区画部を準備しておけばよい。したがって当然に、3以上の分割形態に分割するようにしてもよい。
【0017】
次に、投影区画抽出部3は、第1の分割形態と第2の分割形態の双方に対して、入力画像を分割した方向の画素の列ごとに、投影をとって投影値を算出する(ステップS2)。投影値とは、ある領域の一定方向(水平方向、又は垂直方向)の画素の列について、その列上の画素値の総和をいう。この例では、入力画像を水平方向(部分領域が縦長の短冊状をなすように)分割したので、各部分領域を水平方向の画素の列ごとに、画素値の総和を算出する。
【0018】
続いて、ステップS2で算出された投影値に基づいて、黒区画を抽出する(ステップS3)。具体的には、各投影値と所定の閾値とを比較し、所定の閾値以上となる場合には1、所定の閾値未満となる場合には0に2値化する。ついで2値化された投影値として1が連続する領域を黒区画、0が連続する領域を白区画とする。その結果として、第1の分割形態から抽出された黒区画の例が図6である。幅狭な第1の分割形態の黒区画14では、大きな文字列9の領域は分断されている。また第2の分割形態から抽出された黒区画の例が図7である。幅広な第2の分割形態の黒区画15では、小さくかつ近接位置にある文字列10と11の領域が一つの黒区画になっている。また、図3の入力画像7の模様8の領域については、第1の分割形態の黒区画14では分かれているが、第2の分割形態の黒区画15では全体が一つの区画となり、その大きさ(高さ)は文字列9や10とほぼ同じになっている。
【0019】
次に文字列領域抽出部4は、投影区画抽出部3によって抽出された第1の分割形態と第2の分割形態の各黒区画から、文字列領域を構成する黒区画を抽出する(ステップS4)。すなわち、次のような処理を行う。まず第1の分割形態について、図示せぬ記憶装置に記憶されている文字の大きさ(第1の文字の大きさと呼ぶ)を取得する。ここでは、第1の文字の大きさとして、文字の標準高さを取得する。次に第1の分割形態の各黒区画の高さと第1の文字の大きさとして取得した文字の標準高さとを比較する。ここでは例えば許容最小倍率は90%、許容最大倍率は110%を許容範囲として設定しておき、黒区画の高さが文字の標準高さの90%以上でかつ110%以内の値となる場合に、その黒区画を文字列領域を構成する黒区画として採用する。また第2の分割形態についても同様に第2の文字の大きさを取得して比較する。第2の分割形態は第1の分割形態よりも大きいので、第2の文字の大きさも第1の文字の大きさよりも大きく設定される。
【0020】
この結果、図6及び図7の左下に存在した模様8に対応する黒区画については、選択されない。その理由は、第1の分割形態において、これらの黒区画は第1の文字の大きさの許容範囲を超えて小さいものであり、さらに、第2の分割形態において、これらの黒区画は第1の文字の大きさに近い高さを有しているが、第2の文字の大きさの許容範囲を超えていることを理由とする。このようにして、異なる大きさの文字が混在する入力画像であっても、文字を構成しない画素を原因とするノイズを除去し、誤検出を防止する。
【0021】
なお、上記の例では横書き文字列を検出するために、縦方向に分割した領域に存在する黒区画の高さと文字の標準高さとを比較した。これに対して縦書き文字列を認識する場合には横方向に領域分割するが、この場合には各領域に存在する黒区画の幅と文字の標準幅とを比較すればよい。縦書き文字列と横書き文字列が混在した入力画像を文字認識の対象とするために、正方形状に部分領域に分割した場合には、高さと幅の双方を比較すればよい。
【0022】
その結果、文字列領域抽出部4は、当該許容範囲に入っている黒区画を文字列領域候補とする(ステップS5)。その後、文字列領域抽出部4は、文字列領域候補を併合して文字列領域を形成する(ステップS6)。すなわち、隣接する部分領域に存在する文字列領域候補であって、相互の垂直座標の差が所定の閾値以下の文字列領域候補を一つの文字列領域とする。一方、隣接する部分領域に上端・下端が近接した文字列領域候補が存在しない場合、この文字列領域候補は文字列領域として形成されない。図10は、第1の分割形態の黒区画から形成された文字列領域の例であり、図3の文字列10〜11に対応した文字列領域21〜22が形成されている。また図11は、第2の分割形態の黒区画から形成された文字列領域の例であり、図3の文字列9に対応した文字列領域24が得られている。
【0023】
文字切り出し部5は、文字列領域抽出手段5の抽出した文字列領域それぞれに対して、文字切り出し対象領域を定め、従来と同様の手順で文字切り出しを行う(ステップS7)。文字切り出し対象領域は、当該領域からはみ出る文字パターンが発生しないよう、例えば文字列領域の上下左右を所定値だけ広げた範囲とする。図11の文字列領域24に対して設定した例が図12の文字切り出し対象領域25である。その後、文字認識部6が、従来と同様の手順で文字認識を行う(ステップS8)。
【0024】
なお、画像分布の状態から、大きな文字を処理対象とする第2の分割形態の文字列領域と、小さな文字を処理対象とする第1の分割形態の文字列領域が重なることも考えられる。例えば漢字「知」は偏「矢」と旁「口」から構成されているが、偏と旁それぞれのみで単独の漢字と扱うことも可能である。このような場合に第1の分割形態による処理結果からは「矢」と「口」が検出され、第2の分割形態による処理結果からは「知」が検出されることになるので、両者の処理結果は矛盾することになる。
【0025】
そこで、このような場合には、大きな文字を処理対象とする第2の分割形態の算出結果を優先することとする。これによって、複数の分割形態による処理結果は統合される。なお、このような統合処理は文字切り出し部5あるいは文字認識部6のいずれかで行うようにする。
【0026】
以上から明らかなように、実施の形態1の文字認識装置によれば、部分領域の大きさと対応付けて抽出すべき文字列の大きさを定め、この大きさと抽出した黒区画の大きさとを比較して文字列領域を抽出するようにし、さらに異なる大きさの部分領域に分割して、それぞれの大きさの部分領域ごとにこのような処理を行うこととしたので、異なる大きさの文字を含む入力画像に対しても、誤認識を防止して適切に文字認識を行うことができる。
【0027】
さらに、入力画面全体を部分領域に分割したので、文字列の表示位置やその大きさによらず、文字列を適切に検出して認識することができる。
【0028】
なお、以上の処理では、各分割形態の黒区画の大きさと文字の標準大きさとを比較し、適合する黒区画のみを選択した後に、選択された黒区画から文字列領域を形成することとした。しかしこの方法以外にも、まず隣接する黒区画を併合して文字列領域候補を形成した後に、この文字列領域候補が文字列領域であるかどうかを調べる方法も考えられる。この場合には、上述の説明のように文字列が横書きの場合には文字の標準高さを基準として文字列領域候補を選択する方法(文字列が縦書きの場合には文字の幅、縦書きと横書きが混在するには双方)の他に、次のような文字列領域候補選択方法を採ってもよい。
【0029】
すなわち、文字列領域候補の幅(文字列が横書きの場合)をこの分割形態に対応する文字の標準幅で除算し、この除算結果が整数値(離散値)に近い値になる場合に、この文字列領域候補を文字列領域であると判定するというものである。文字列が縦書きの場合には、文字の標準高さで除算するようにする。また混在する場合には、いずれか文字の標準高さか標準幅のいずれか一方を選択して除算する。さらに標準幅と標準高さとを乗算して得た標準面積を基準としてもよい。
【0030】
また、本実施の形態では黒い文字を検出・認識するため、入力画像の投影値から黒区画を求めたが、最初に入力画像を白黒反転させることで、白い文字の検出・認識も可能である。
【0031】
また、実施の形態1による文字認識装置が果たす文字認識機能をコンピュータに実行させるコンピュータプログラムとして実現することも当然に可能である。この場合には、領域区画部1、領域区画部2、投影区画抽出部3、文字列領域抽出部4、文字切り出し部5、文字認識部6のそれぞれの部位の機能に相当する機能を実行するコンピュータプログラムを順次実行するコンピュータプログラムとすればよい。
【0032】
実施の形態2.
なお、実施の形態1では、入力画像全体を複数通りの分割形態によって部分領域に分割した。これに対して、図2のフローチャートのステップS1において、一つの入力画像を複数の分割形態を組み合わせて分割するようにしてもよい。
【0033】
例えば、図13に示すように入力画像を撮像するカメラ26aが支柱26bの上端に設置されており、自動車などのナンバープレート27や28上に印字されたナンバーを読みとる場合、撮像された入力画像中の文字列は図14のようになる。図14において、入力画像29の上部にはナンバープレート28上の文字列30が相対的に小さく表示されている。また入力画像29の下部にはナンバープレート27上の文字列31が相対的に大きく表示されている。このように、ナンバープレート27と28上の文字の大きさはもともとほぼ同じ大きさであるが、カメラ26aから遠い位置にあるナンバープレート27上の文字列30は入力画像29の上部に小さく、かつ、カメラ26aから近い位置にあるナンバープレート28上の文字列31は入力画像29の下部に大きく表示されることになる。
【0034】
このような場合に、例えば入力画像29の上半分を第1の分割形態によって領域分割し、下半分を第2の分割形態によって領域分割するようにすれば、実施の形態1と同様に文字列を構成する文字の大きさに適した文字列領域の分割が行える。
【0035】
以上から明らかなように、実施の形態2による文字認識装置によれば、カメラの撮像位置と文字列が表示されている物体の位置との関係から、入力画像中の文字列の大きさが予め予測できる場合に、入力画像の分割形態を最適に組み合わせて検出・認識することができる。
【0036】
また実施の形態1のように入力画像全体を単一の分割形態による部分領域に分割する処理を複数回行う方法に比べて、同一の入力画像を複数の分割形態を組み合わせて部分的に分割することによって、大量の画素を処理する手間が省けるので、性能も向上し、さらに計算機資源の節約を図ることも可能となる。
【0037】
なお、カメラの位置と文字列を表示する物体の位置関係に応じて、入力画像の分割の仕方を変更してもよいことはいうまでもない。例えば、左側に設置されたカメラから右方向に設置されているナンバープレートを撮像するような場合、部分領域の大きな分割形態の対象範囲を入力画像の左側に、部分領域の小さな分割形態の対象範囲を入力画像の右側に設定すればよい。
【0038】
実施の形態3.
次に、この発明の実施の形態3による文字認識装置について説明する。実施の形態1による文字認識装置は入力画像を白と黒の画素からなる2値画像としたが、実施の形態3による文字認識装置は、多値画像あるいは多階調画像を入力画像とする点で異なる。
【0039】
図15は、実施の形態3による文字認識装置の構成を示すブロック図である。図において微分画像抽出部101は、多階層画像から微分画像を作成する部位である。その他、実施の形態1による文字認識装置と同一の符号を付した構成要素については、実施の形態1と同様であるので説明を省略する。
【0040】
次に実施の形態3による文字認識装置の動作について説明する。この文字認識装置の処理を示すフローチャートは実施の形態1と同じく図2を用いる。まず実施の形態1と同じように図示せぬ画像入力手段によって、多階層画像が撮像されて取り込まれる。例えば、この画像は1画素8ビットの濃淡画像であるものとする。図16はこのような入力画像の例を示す図であって、入力画像36の中には、白色の文字列37と黒色の文字列38が混在しており、さらに文字列38の両脇には柱39と柱40が表示されている。
【0041】
まず、実施の形態1と同様にステップS1において、領域区画部1および2が第1の分割形態及び第2の分割形態による領域に分割する(ステップS1)。続いて、入力画像36の投影値を算出する(ステップS2)。実施の形態1による文字認識装置とは異なり、この文字認識装置の入力画像は多階層画像である。そこで、このステップにおいては、まず微分画像抽出部101が微分画像を作成し、次にこの微分画像を2値化して投影値を算出する。画像の微分は、例えば総研出版発行「コンピュータ画像処理入門」pp.119〜122に記載の各種方法が使用できるが、ここでは、その中のSobelオペレータによる方法を用いることとする。また、微分値の2値化には、例えば固定の閾値を適用する方法を用いることができる。その結果、図17に示すように表示されている物体と文字の輪郭部分だけが残った画像が得られる。この微分2値画像から投影値を算出することで、黒文字だけでなく白色の文字列からも黒区画が抽出される。
【0042】
なお図17では、図を見やすくするために領域区画部1および2によって分割された分割の境界線を割愛している。またステップS1とステップS2の処理順序を逆にして、先に微分2値画像を求めてから領域分割を行うようにしてもよい。
【0043】
次に実施の形態1と同様の手順で、ステップS2で算出された投影値に基づいて、第1の分割形態と第2の分割形態のそれぞれについて黒区画を抽出する(ステップS3)。微分2値画像の場合、濃度の変化の少ない領域は黒画素の分布が小さいので、黒区画は濃度の変化の大きい文字や物体の輪郭部分に多く検出される。図18は、第1の分割形態から抽出された黒区画の例を示す図であり、幅狭な第1の分割形態の黒区画44では、大きな文字列37の領域は分断されている。また図19は、第1の分割形態から抽出された黒区画の例を示す図であり、幅広な第2の分割形態の黒区画45では、文字列38の領域が隣接した柱39と柱40の影響で極度に大きな黒区画となっている。
【0044】
次に、抽出された黒区画から文字列領域を構成しうる文字列領域候補を選択し(ステップS4とステップS5)、次に文字列領域候補を併合して文字列領域を形成する(ステップS6)。これらの処理は実施の形態1と同様であるので、説明を省略する。
【0045】
続いて文字列切り出し部5は、実施の形態1と同様に文字パターンの切り出しを行う(ステップS7)。但し、実施の形態3における入力画像は多階層画像なので、最初に各文字列領域に含まれる文字が黒文字か白文字かを判定する。そのために、文字列領域の位置を基準に判定対象領域を設定し、入力画像における判定対象領域を2値化して文字列方向への投影を行い、この投影値に基づいて判定を行う。
【0046】
なお「文字列方向」という語は、文字列を構成する文字の並んでいる方向(縦または垂直・横または水平など)を意味する語であるものとし、「文字列方向への投影を行う」とは、例えば、横書き文字列であれば、水平方向の各画素列について投影データを算出するものである。したがって、例えば画素数が20(垂直)×128(水平)の文字列領域に横書き文字が表示されている場合、同一の垂直座標を有する128個の画素からなる水平方向の画素列が20個存在することになる。このような場合、文字列方向への投影を行う、とは、20個の水平方向画素列のそれぞれについて投影データを算出することを意味する。
【0047】
また、判定領域とは文字列領域を含む領域であって、例えば、文字の端が確実に判定領域内に含まれるように、文字列領域を文字列方向と垂直な方向に所定量広げた範囲の領域である。図20は、このような判定領域を概念的に示すための図であって、白文字列37についての判定領域48と黒文字列38についての判定領域49を示している。
【0048】
以下に、判定領域48を例にとって、この領域に表示されている文字が黒文字であるか白文字であるかを判定する処理(黒文字・白文字判定)について説明する。図21は判定領域48について算出した投影値の分布を示すものである。図において、投影値分布50はこの領域全体の水平方向の投影値を示している。51は文字列領域37の中央位置であって、52と53はそれぞれ予め設定された投影値の下限値と上限値である。この下限値52・上限値53の値は、例えば、判定対象領域の文字列方向の長さに所定の比率を掛けた値とする。
【0049】
この場合において、まず文字列領域の中央位置51の投影値から開始して、次に上方向(縦書き文字列の場合は左方向)、および下方向(縦書き文字列の場合は右方向)に一画素分ずつ順次投影値を取得していき、そして各投影値が下限値を下回らないか、さらに上限値を上回らないかを調べる。この結果、初めて下限値を下回るか上限値を上回る画素の位置を文字列の端とみなす。さらに下限値を先に下回った場合には、この文字列を黒色の文字列とみなし、上限値を先に上回った場合には、この文字列を白色の文字列とみなす。
【0050】
図21の例でいえば、上下どちらの方向についても下限値52を下回る前に上限値53を上回ることになるので、この文字列が白色の文字列であると判断される。一方、図22に示した例では、投影値54を文字列領域の中央から参照して行くと、上限値56を上回る前に下限値55を下回り、黒色の文字列と判定される。
【0051】
その後、文字切り出し部5は、実施の形態1と同様の手順で文字切り出し対象領域を定めた後、当該領域の入力画像を2値化して文字切り出し用の2値画像を作成する。さらに黒文字・白文字判定の結果、判定結果が白文字であれば、当該2値画像を白黒反転させた画像を文字切り出しに用いる。以後の処理については、実施の形態1と同様であるので説明を省略する。
【0052】
以上から明らかなように、実施の形態3の文字認識装置によれば、多階層画像に対しても微分2値画像化したのちに、黒区画を抽出して文字列の大きさと比較し、文字列領域を選択することとしたので、白色・黒色の文字列が混在した画像からでも、処理量を大きく増やすことなく、個々の文字を正しく抽出して認識できる。
【0053】
なお上述の説明では、領域分割を行った後に、それぞれの分割形態ごとに微分2値化を行うこととしたが、微分2値化は黒区画を抽出するステップS3以前に行っておけばよく、例えば入力画像を微分2値化し、その微分2値化後の画像に対して領域分割を行うようにしてもよい。
【0054】
実施の形態4.
次に実施の形態4による文字認識装置について説明する。実施の形態4の文字認識装置は、第2の分割形態の部分領域を形成する方法に特徴を有するものである。また、実施の形態3の文字認識装置と比して、多階調画像を取扱う方法が異なり、さらに入力画像中には回転を生じた文字列を含むものとする。
【0055】
実施の形態4による文字認識装置の構成を示すブロック図として図15を用いる。但し実施の形態4の文字認識装置では、領域区画部2及び投影区画抽出部3、文字列領域抽出部4が実施の形態3と異なっている。領域区画部2は領域区画部1が分割した第1の分割形態による部分領域を併合することによって第2の分割形態による部分領域を形成するようになっている。投影区画抽出部3は、第1の分割形態の部分領域から抽出した黒区画を併合して第2の分割形態の部分領域の黒区画を形成するようになっている。文字列領域抽出部4は、文字列の回転によって生じた黒区画間のずれの影響を排除して文字列領域を形成するようになっている。他の構成要素については、実施の形態3と同様であるので説明を省略する。
【0056】
図23は実施の形態4の文字認識装置が文字認識を行う入力画像の例である。図の入力画像58において、59は黒地に白色で表示された文字列である。また62は文字又は文字列でない楕円状の図形であり、さらに文字列60および61は回転が生じている文字列である。
【0057】
次に実施の形態4による文字認識装置の動作を説明する。実施の形態4による文字認識装置における処理は実施の形態1乃至3と同様にフローチャート図2によって示される。まず領域区画部1は、入力画像58を第1の分割形態による部分領域に分割した後、領域区画部2は、これらの部分領域に基づいて第2の分割形態による部分領域を形成する(ステップS1)。すなわち、最初に領域区画部1は、入力画像58を小さい部分領域に分割する。領域区画部1が分割した部分領域は第1の分割形態としてメモリに記憶させておく。次に領域区画部2は、この小さな部分領域のうち、隣接する2個の部分領域同士を併合して大きな部分領域を形成する。実施の形態1及び3では、領域区画部1と2は独立して入力画像を部分領域に分割したが、実施の形態4では第1の分割形態を利用して第2の分割形態による部分領域を形成する点で異なるものである。
【0058】
なお、この説明では簡単のために、第1の分割形態による部分領域のうち、隣接する部分領域を2個ずつ併合して、第2の分割形態による部分領域を形成することとするが、第2の分割形態による部分領域を形成する方法はこの限りではない。例えば隣接する部分領域を3個ずつ併合する方法を採用してもよいし、また隣接する3個の部分領域を併合した後に、2等分するような方法で部分領域を形成してもよい。
【0059】
次に第1の分割形態による部分領域と第2の分割形態による部分領域から投影値を算出して、黒区画を抽出する(ステップS2及びステップS3)。実施の形態4における入力画像は多階調画像であるので、実施の形態3と同様に微分2値化を行ってから黒区画を抽出する。ただし実施の形態4は、次のような点で実施の形態3とは異なる。すなわち、第1の分割形態による部分領域に対して微分2値化を行い、さらに黒区画の抽出を行った後に、この黒区画を併合して第2の分割形態による黒区画を形成する点である。
【0060】
具体的には、次のような処理を行う。まず第1の分割形態に対して実施の形態3と同様に微分2値画像や投影値の算出、黒区画の抽出を行う。図24は、ここで得られた微分2値画像の例である。但し部分領域間の境界線の表示を省略している。さらに図25は、第1の分割形態に基づいて得られた黒区画の例である。
【0061】
さらに、すでに第2の分割形態の部分領域を形成するために併合された第1の分割形態の部分領域間で、黒区画が隣接している場合に、これらの黒区画の併合処理を行う。この併合処理は例えば次のいずれかの方法によって行われる。
【0062】
(1)隣接する第1の分割形態による黒区画を囲む最小の矩形を算出し、この矩形によって囲まれた黒区画の面積の和とこの矩形の面積との比をとって、この比が所定値以上となる場合に、この最小矩形全体を第2の分割形態による黒区画とする。
(2)隣接する第1の分割形態による黒区画の境界線の長さが所定値以上である場合に、これらの黒区画を囲む最小の矩形全体を第2の分割形態による黒区画とする。
【0063】
図26は、このような黒区画の併合処理を示す説明図である。図は、第1の分割形態による黒区画111と112が第2の分割形態による黒区画113に併合される様子を示すものである。また第1の分割形態による黒区画116は同じ部分領域に属する黒区画114と115の双方に隣接している。このような場合には、黒区画114、115、116のすべてを囲む最小の矩形が一つの黒区画117となる。
【0064】
一方、第1の分割形態による黒区画118と119も隣接しているが、このような場合には、上記(1)と(2)のいずれの方法によっても第2の分割形態による黒区画には形成されない。このように、文字列の回転を吸収するために、黒区画のずれを許容しようとすると文字列の回転によって生じた黒区画のずれではない黒区画のずれまで含んでしまうことがある。しかし、上記(1)と(2)の基準に基づいて隣接する黒区画を併合するようにすれば、そのようなケースを排除することが可能となる。
【0065】
このように第1の分割形態による黒区画を併合して第2の分割形態の黒区画を形成することによって、第2の分割形態に対して微分2値画像や投影値の算出、黒区画の抽出を行う処理を行わなくて済むので、処理を高速に行うことができるようになる。
【0066】
次に文字列領域抽出部4は、黒区画を併合して文字列領域を形成する(ステップS4)。実施の形態4では、文字の標準大きさによって黒区画を選択する代わりに、各黒区画の領域における入力画像の画素濃度に基づいて黒区画を選択することとする。例えば、第1の分割形態の黒区画については黒文字・白文字双方を許容し、第2の分割形態の部分領域に対しては白文字のみを許容するようにする。
【0067】
黒区画を選択する処理は次のように行う。すなわち、まず黒区画の領域における入力画像の最大画素値と最小画素値との平均値を2値化閾値として算出する。次に、2値化閾値より値の小さい画素の数と2値化閾値以上の値を持つ画素の数とを比較し、前者が大きければ(2値化閾値より黒い画素が多ければ)黒文字と判定し、逆に後者が大きければ白文字と判定する。黒文字・白文字の判定結果が、その黒区画の分割形態で定められた文字の色(黒色・白色)に一致すれば、この黒区画は選択される。一致しない場合は、その黒区画は棄却される。文字列領域の形成(ステップS5)は、選択された黒区画だけを併合することによって行われる。
【0068】
一般的な文字列の画像領域では、文字の画素よりも背景の画素の方が多いため、上記の方法によれば、2値化閾値を適正に設定することで黒文字・白文字が判定できる。実施の形態3で説明した方法では文字列方向の投影を用いるため、文字列の回転角度が非常に大きいと正しく判定できない場合もあるが、この方法では、濃淡分布を使用しているため、回転角度に制約を受けずに判定できる。
【0069】
ステップS5以降の処理については実施の形態3と同様であるので、説明を省略する。
【0070】
以上から明らかなように、実施の形態4の文字認識装置によれば、第1の分割形態に基づいて第2の分割形態を求めるので、演算量を大幅に削減できる。また上記(1)と(2)の基準により黒区画を併合するので、文字列の回転に強い文字認識が可能となる。
【0071】
【発明の効果】
この発明による文字認識装置は、入力画像を第1の分割形態の領域に分割するとともに、第1の分割形態の領域とは異なる大きさを有する第2の分割形態の領域にも分割し、さらに双方の分割形態の領域から抽出された黒区画から、それぞれの分割形態に適合する文字列領域を形成するようにしたので、大きさの異なる複数の文字列が存在する場合であっても、適切に文字列を検出し、認識を行うことができるという極めて優れた効果を有するものである。
【図面の簡単な説明】
【図1】この発明の実施の形態1の文字認識装置の構成を示すブロック図である。
【図2】この発明の実施の形態1の文字認識装置のフローチャートである。
【図3】この発明の実施の形態1の入力画像の例を示す図である。
【図4】この発明の実施の形態1の第1の分割形態を示す図である。
【図5】この発明の実施の形態1の第2の分割形態を示す図である。
【図6】この発明の実施の形態1の第1の分割形態から抽出された黒区画の例を示す図である。
【図7】この発明の実施の形態1の第2の分割形態から抽出された黒区画の例を示す図である。
【図8】この発明の実施の形態1の第1の分割形態から抽出された文字列領域を構成する黒区画の例を示す図である。
【図9】この発明の実施の形態1の第2の分割形態から抽出された文字列領域を構成する黒区画の例を示す図である。
【図10】この発明の実施の形態1の第1の分割形態から抽出された文字列領域候補の例を示す図である。
【図11】この発明の実施の形態1の第2の分割形態から抽出された文字列領域候補の例を示す図である。
【図12】この発明の実施の形態1の文字列切り出し領域の例を示す図である。
【図13】この発明の実施の形態2の入力画像を撮像するカメラとナンバープレートの位置関係を示す説明図である。
【図14】この発明の実施の形態2の入力画像の例を示す図である。
【図15】この発明の実施の形態3の文字認識装置の構成を示すブロック図である。
【図16】この発明の実施の形態3の入力画像の例を示す図である。
【図17】この発明の実施の形態3の微分2値画像の例を示す図である。
【図18】この発明の実施の形態3の第1の分割形態から抽出された黒区画の例を示す図である。
【図19】この発明の実施の形態3の第2の分割形態から抽出された黒区画の例を示す図である。
【図20】この発明の実施の形態3の判定領域の説明図である。
【図21】この発明の実施の形態3の白文字についての判定領域の投影値の分布を示す図である。
【図22】この発明の実施の形態3の黒文字についての判定領域の投影値の分布を示す図である。
【図23】この発明の実施の形態4の入力画像の例を示す図である。
【図24】この発明の実施の形態4の微分2値画像の例を示す図である。
【図25】この発明の実施の形態4の第1の分割形態から抽出された黒区画の例を示す図である。
【図26】この発明の実施の形態4の黒区画の併合処理を示す説明図である。
【符号の説明】
1、2 領域区画部
3 投影区画抽出部
4 文字列領域抽出部
5 文字切り出し部
6 文字認識部
101 微分画像抽出部[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a character recognizing device and a character recognizing program for recognizing characters in an image. In particular, when a character string composed of characters of different sizes exists in an image, a character string area is formed from the image. It relates to a technology for efficient extraction.
[0002]
[Prior art]
A conventional character recognition device that recognizes characters in an image estimates a character pattern size, cuts out an area (character string area) in which a character string exists, and extracts a pixel pattern and a character existing in the character string area. It was to match the pattern. In such a character recognition device, a method of estimating the size of a character pattern serving as a basis for the size of a character string region to be cut out is important.
[0003]
As a method of estimating the size of such a character pattern, there is a technique of acquiring a distribution state of pixels constituting a character in a partial region at a specific position in an image and estimating a character size from the distribution state. (For example, Patent Document 1).
[0004]
[Patent Document 1]
JP-A-63-292381, "Character line detection device" (FIG. 1, page 3-5)
[0005]
[Problems to be solved by the invention]
As described above, the conventional character recognition device estimates the character size and line spacing from a partial area of the input image. Therefore, even if information of a reference character is obtained from such an area, it cannot be correctly recognized if a character having a size different from that of the character exists in another area. there were.
[0006]
The present invention has been made to solve such a problem, and a character recognition device that appropriately detects and recognizes a character string even when a plurality of character strings having different sizes exist. The purpose is to provide.
[0007]
[Means for Solving the Problems]
A character recognition device according to the present invention divides an input image into regions in a first division mode suitable for characters of a predetermined size and a region in a second division mode suitable for characters having a size different from the size. Black section extracting means for further dividing, as a black section, a region having a predetermined number of black pixels or more from each region of the first division mode and each region of the second division mode,
A character area extracting unit that merges the black sections to form a character string area that conforms to those division forms, and cuts out a character area from the character string area.
And character recognition means for recognizing a character pattern in the character area.
[0008]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments according to the present invention will be described.
Embodiment 1 FIG.
FIG. 1 is a block diagram showing a configuration of a character recognition device according to Embodiment 1 of the present invention. In the figure, a region partitioning unit 1 and a
[0009]
Next, the operation of the character recognition device will be described. FIG. 2 is a flowchart showing the operation of the character recognition device. As a premise of this processing, it is assumed that an
[0010]
First, the region partitioning unit 1 and the
[0011]
FIG. 4 is a diagram showing an example of a partial area setting (first division mode) by the area division unit 1, and FIG. 5 is a diagram showing an example of a partial area setting (second division mode) by the
[0012]
Generally, in order to recognize a character in an image, it is basically necessary to divide an image into a plurality of partial areas and obtain a distribution of pixels for each partial area. In order to perform accurate character recognition, it is necessary to appropriately set the partial area. By the way, in many cases, an object other than a character string and its shadow are captured in the image, or the character string rotates (the character string is captured diagonally with respect to the horizontal or vertical coordinate axes of the image). As a result, noise (pixels that do not constitute a character) is mixed. Therefore, by setting a large partial area as much as possible, the influence of the pixel distribution due to such noise can be relatively reduced. However, when small characters are present in the image, even such small characters may be eliminated as noise.
[0013]
Therefore, the character recognition device according to the first embodiment also performs area division for the purpose of recognizing small characters. This is because the area division for small characters enables character recognition even for a pixel distribution that is excluded as noise in the area division for large characters.
[0014]
The first division mode shown in FIG. 4 indicates a state where a relatively small character is divided into partial regions for the purpose of recognition. In addition, the second division mode shown in FIG. 5 indicates a state where the image is divided into partial areas for the purpose of recognizing a character larger than the character corresponding to the first division mode.
[0015]
Regarding the direction in which the image is divided, when recognizing a horizontally written character string, it is better to divide the input image into vertically long strips. This is because noise is rejected in units of the width of the partial area. On the other hand, in order to recognize a vertically written character string, the input image may be divided into horizontally long strips. If it is not possible to determine whether the image is horizontally or vertically written, the input image is divided into a partial area close to a square. FIGS. 4 and 5 show the input image divided into vertically long strip-shaped partial areas.
[0016]
In addition, the partial areas of the first and second divided forms are determined based on the assumed size of characters in the input image for simplicity of description. This is because, if the image is divided into partial areas having extremely different character sizes and sizes, noise cannot be rejected correctly or a part of the character is detected as being missing. Unlike this example, if the size of the character in the input image cannot be predicted, it is necessary to prepare a division form corresponding to the character size in several stages and an area partition corresponding to the division form. Good. Therefore, naturally, the image may be divided into three or more division forms.
[0017]
Next, the projection
[0018]
Subsequently, a black section is extracted based on the projection value calculated in step S2 (step S3). Specifically, each projection value is compared with a predetermined threshold value, and is binarized to 1 when the projection value is equal to or more than the predetermined threshold value and to 0 when the projection value is less than the predetermined threshold value. Next, as a binarized projection value, an area where 1s are continuous is a black section, and an area where 0s are continuous is a white section. As a result, FIG. 6 shows an example of a black section extracted from the first division mode. In the narrow black section 14 of the first division mode, the area of the large character string 9 is divided. FIG. 7 shows an example of a black section extracted from the second division mode. In the wide
[0019]
Next, the character string area extracting unit 4 extracts a black section constituting the character string area from each of the black sections of the first division mode and the second division mode extracted by the projection section extraction unit 3 (step S4). ). That is, the following processing is performed. First, for the first division mode, the size of a character (referred to as the first character size) stored in a storage device (not shown) is obtained. Here, the standard height of the character is acquired as the size of the first character. Next, the height of each black section in the first division mode is compared with the standard height of the character acquired as the size of the first character. In this case, for example, the allowable minimum magnification is set to 90% and the allowable maximum magnification is set to 110% as an allowable range, and the height of the black section is 90% or more of the standard height of the character and within 110%. Then, the black section is adopted as a black section constituting the character string area. In the second division mode, the size of the second character is similarly obtained and compared. Since the second division mode is larger than the first division mode, the size of the second character is also set to be larger than the size of the first character.
[0020]
As a result, the black section corresponding to the pattern 8 existing at the lower left of FIGS. 6 and 7 is not selected. The reason is that in the first division mode, these black sections are smaller than the allowable range of the size of the first character, and in the second division mode, these black sections are the first section. , But is outside the allowable range for the size of the second character. In this way, even in the case of an input image in which characters of different sizes are mixed, noise caused by pixels that do not constitute characters is removed, and erroneous detection is prevented.
[0021]
In the above example, in order to detect a horizontally written character string, the height of the black section existing in the vertically divided area was compared with the standard height of the character. On the other hand, when recognizing a vertically written character string, the area is divided in the horizontal direction. In this case, the width of the black section existing in each area may be compared with the standard width of the character. When an input image in which a vertical writing character string and a horizontal writing character string are mixed is divided into partial areas in a square shape in order to be subjected to character recognition, both the height and the width may be compared.
[0022]
As a result, the character string area extraction unit 4 sets black sections falling within the permissible range as character string area candidates (step S5). After that, the character string area extracting unit 4 combines the character string area candidates to form a character string area (step S6). That is, character string region candidates existing in adjacent partial regions and having a difference in vertical coordinate between each other less than or equal to a predetermined threshold are regarded as one character string region. On the other hand, when there is no character string area candidate whose upper end and lower end are close to an adjacent partial area, the character string area candidate is not formed as a character string area. FIG. 10 is an example of a character string area formed from black sections in the first division mode. Character string areas 21 to 22 corresponding to the character strings 10 to 11 in FIG. 3 are formed. FIG. 11 is an example of a character string area formed from black sections in the second division mode, and a
[0023]
The character cutout unit 5 determines a character cutout target area for each of the character string areas extracted by the character string area extraction unit 5, and performs character cutout in the same procedure as in the related art (step S7). The character cutout target area is, for example, a range in which the upper, lower, left, and right sides of the character string area are extended by a predetermined value so that a character pattern protruding from the area does not occur. An example set for the
[0024]
In addition, from the state of the image distribution, it is conceivable that the character string region of the second division mode for processing large characters and the character string region of the first division mode for processing small characters overlap. For example, the kanji character "chi" is composed of a partial "arrow" and a side "mouth", but it is also possible to treat only the partial and the side as a single kanji. In such a case, “arrow” and “mouth” are detected from the processing result of the first division mode, and “knowledge” is detected from the processing result of the second division mode. The processing results will be inconsistent.
[0025]
Therefore, in such a case, the calculation result of the second division mode for processing a large character is given priority. As a result, the processing results of the plurality of division modes are integrated. Note that such integration processing is performed by either the character cutout unit 5 or the
[0026]
As is clear from the above, according to the character recognition device of the first embodiment, the size of the character string to be extracted is determined in association with the size of the partial area, and this size is compared with the size of the extracted black section. Then, the character string area is extracted and further divided into partial areas of different sizes, and such processing is performed for each partial area of each size, so that characters of different sizes are included. Even for an input image, erroneous recognition can be prevented and proper character recognition can be performed.
[0027]
Further, since the entire input screen is divided into partial areas, the character string can be appropriately detected and recognized regardless of the display position and size of the character string.
[0028]
In the above processing, the size of the black section of each divided form is compared with the standard size of the character, and only the suitable black section is selected, and then the character string area is formed from the selected black section. . However, besides this method, a method is also conceivable in which first, adjacent black sections are merged to form a character string area candidate, and then whether or not the character string area candidate is a character string area. In this case, as described above, when the character string is written horizontally, a method of selecting a character string area candidate based on the standard height of the character (when the character string is written vertically, the width of the character, In addition to the two methods for mixing writing and horizontal writing, the following character string region candidate selection method may be adopted.
[0029]
That is, when the width of the character string area candidate (when the character string is written horizontally) is divided by the standard width of the character corresponding to this division mode, and the result of the division becomes a value close to an integer value (discrete value), The character string area candidate is determined to be a character string area. If the string is vertical, divide by the standard height of the character. If the characters are mixed, one of the standard height and the standard width of one of the characters is selected and divided. Further, a standard area obtained by multiplying the standard width by the standard height may be used as a reference.
[0030]
In addition, in the present embodiment, in order to detect and recognize black characters, a black section is obtained from the projection value of the input image. However, white characters can be detected and recognized by first inverting the black and white of the input image. .
[0031]
Further, it is naturally possible to realize as a computer program that causes a computer to execute the character recognition function performed by the character recognition device according to the first embodiment. In this case, the functions corresponding to the functions of the respective sections of the area section 1, the
[0032]
In the first embodiment, the entire input image is divided into partial regions by a plurality of division modes. On the other hand, in step S1 of the flowchart in FIG. 2, one input image may be divided by combining a plurality of division forms.
[0033]
For example, as shown in FIG. 13, a
[0034]
In such a case, if, for example, the upper half of the
[0035]
As is clear from the above, according to the character recognition device according to the second embodiment, the size of the character string in the input image is determined in advance from the relationship between the imaging position of the camera and the position of the object on which the character string is displayed. When prediction is possible, detection and recognition can be performed by optimally combining the division forms of the input image.
[0036]
Also, the same input image is partially divided by combining a plurality of division modes, as compared with the method of performing the process of dividing the entire input image into partial regions in a single division mode multiple times as in the first embodiment. As a result, it is not necessary to process a large number of pixels, so that the performance is improved and the computer resources can be saved.
[0037]
Needless to say, the method of dividing the input image may be changed according to the positional relationship between the camera position and the object displaying the character string. For example, when capturing a license plate installed in the right direction from a camera installed on the left side, a target area of a large divided form of the partial area is set on the left side of the input image, May be set to the right of the input image.
[0038]
Next, a character recognition device according to a third embodiment of the present invention will be described. Although the character recognition device according to the first embodiment uses an input image as a binary image composed of white and black pixels, the character recognition device according to the third embodiment uses a multivalued image or a multi-tone image as an input image. Different.
[0039]
FIG. 15 is a block diagram illustrating a configuration of a character recognition device according to the third embodiment. In the figure, a differential
[0040]
Next, the operation of the character recognition device according to the third embodiment will be described. FIG. 2 is used for the flowchart showing the processing of this character recognition device as in the first embodiment. First, as in the first embodiment, a multi-level image is captured and captured by an image input unit (not shown). For example, it is assumed that this image is a grayscale image of 8 bits per pixel. FIG. 16 is a diagram showing an example of such an input image. In the
[0041]
First, as in the first embodiment, in step S1, the
[0042]
Note that, in FIG. 17, the boundaries of the divisions divided by the
[0043]
Next, in the same procedure as in the first embodiment, a black section is extracted for each of the first and second division modes based on the projection values calculated in step S2 (step S3). In the case of a differential binary image, since the distribution of black pixels is small in an area with a small change in density, many black sections are detected in a contour portion of a character or an object with a large change in density. FIG. 18 is a diagram illustrating an example of a black section extracted from the first division mode. In the black section 44 of the narrow first division mode, the area of the large character string 37 is divided. FIG. 19 is a diagram showing an example of a black section extracted from the first division mode. In the wide
[0044]
Next, character string area candidates that can constitute a character string area are selected from the extracted black sections (steps S4 and S5), and then the character string area candidates are merged to form a character string area (step S6). ). These processes are the same as those in the first embodiment, and a description thereof will not be repeated.
[0045]
Subsequently, the character string cutout unit 5 cuts out a character pattern as in the first embodiment (step S7). However, since the input image in the third embodiment is a multi-layer image, it is first determined whether the characters included in each character string area are black characters or white characters. For this purpose, a determination target region is set based on the position of the character string region, the determination target region in the input image is binarized and projected in the character string direction, and a determination is made based on the projection value.
[0046]
Note that the term “character string direction” means a direction in which characters constituting a character string are arranged (vertical or vertical / horizontal or horizontal), and “projects in the character string direction”. For example, in the case of a horizontally written character string, projection data is calculated for each pixel row in the horizontal direction. Therefore, for example, when a horizontally written character is displayed in a character string area having 20 (vertical) × 128 (horizontal) pixels, there are 20 horizontal pixel rows of 128 pixels having the same vertical coordinates. Will do. In such a case, performing projection in the character string direction means calculating projection data for each of the 20 horizontal pixel rows.
[0047]
The determination area is an area including a character string area. For example, a range in which the character string area is extended by a predetermined amount in a direction perpendicular to the character string direction so that the end of the character is included in the determination area. Area. FIG. 20 is a diagram conceptually showing such a determination area, and shows a
[0048]
The process of determining whether a character displayed in this region is a black character or a white character (black character / white character determination) will be described below taking the
[0049]
In this case, starting from the projection value at the center position 51 of the character string area, then upward (to the left in the case of a vertically written character string) and downward (to the right in the case of a vertically written character string) Then, the projection values are sequentially acquired one pixel at a time, and it is checked whether each projection value does not fall below the lower limit value or further exceeds the upper limit value. As a result, for the first time, the position of a pixel below the lower limit or above the upper limit is regarded as the end of the character string. When the value falls below the lower limit first, this character string is regarded as a black character string, and when the value exceeds the upper limit first, this character string is regarded as a white character string.
[0050]
In the example of FIG. 21, the character string exceeds the upper limit value 53 before falling below the
[0051]
After that, the character cutout unit 5 determines a character cutout target area in the same procedure as in the first embodiment, and then binarizes the input image of the area to create a binary image for character cutout. Further, as a result of the black character / white character determination, if the determination result is a white character, an image obtained by inverting the binary image in black and white is used for character extraction. Subsequent processing is the same as in the first embodiment, and a description thereof will not be repeated.
[0052]
As is apparent from the above description, according to the character recognition device of the third embodiment, a multi-layer image is converted into a differential binary image, and then a black section is extracted and compared with the size of the character string. Since the row region is selected, individual characters can be correctly extracted and recognized even from an image in which white and black character strings are mixed without greatly increasing the processing amount.
[0053]
In the above description, after performing the area division, the differential binarization is performed for each of the division forms. However, the differential binarization may be performed before step S3 for extracting the black section. For example, the input image may be binarized differently, and region division may be performed on the image after the binarization.
[0054]
Embodiment 4 FIG.
Next, a character recognition device according to a fourth embodiment will be described. The character recognition device according to the fourth embodiment is characterized by a method of forming a partial area in the second division mode. Also, the method of handling multi-tone images is different from that of the character recognition device according to the third embodiment, and the input image contains a rotated character string.
[0055]
FIG. 15 is used as a block diagram showing the configuration of the character recognition device according to the fourth embodiment. However, in the character recognition device according to the fourth embodiment, the
[0056]
FIG. 23 is an example of an input image on which the character recognition device of the fourth embodiment performs character recognition. In the
[0057]
Next, the operation of the character recognition device according to the fourth embodiment will be described. The processing in the character recognition device according to the fourth embodiment is shown by the flowchart in FIG. 2 as in the first to third embodiments. First, the area division unit 1 divides the
[0058]
In this description, for the sake of simplicity, of the partial regions according to the first division mode, adjacent partial regions are merged two by two to form a partial region according to the second division mode. The method of forming the partial area by the two division forms is not limited to this. For example, a method of merging three adjacent partial regions may be adopted, or a method of merging three adjacent partial regions and then forming a partial region by a method of dividing into two equal parts.
[0059]
Next, a projection value is calculated from the partial area according to the first division mode and the partial area according to the second division mode, and a black section is extracted (steps S2 and S3). Since the input image in the fourth embodiment is a multi-tone image, the differential binarization is performed as in the third embodiment, and then the black section is extracted. However, the fourth embodiment differs from the third embodiment in the following points. That is, after performing differential binarization on the partial area according to the first division mode and further extracting a black section, the black sections are merged to form a black section according to the second division mode. is there.
[0060]
Specifically, the following processing is performed. First, as in the third embodiment, calculation of a differential binary image and a projection value and extraction of a black section are performed for the first division mode. FIG. 24 is an example of the differential binary image obtained here. However, the display of the boundary line between the partial areas is omitted. FIG. 25 is an example of a black section obtained based on the first division mode.
[0061]
Further, if black sections are adjacent to each other in the first divided form that has been merged to form the partial areas in the second divided form, the black sections are merged. This merging process is performed, for example, by any of the following methods.
[0062]
(1) Calculate the minimum rectangle surrounding the black section in the adjacent first division mode, take the ratio of the sum of the areas of the black sections surrounded by this rectangle to the area of this rectangle, and set this ratio to a predetermined value. If the value is equal to or greater than the value, the entirety of the minimum rectangle is set as a black section in the second division mode.
(2) When the length of the boundary line between adjacent black sections in the first division mode is equal to or greater than a predetermined value, the entirety of the smallest rectangle surrounding these black sections is defined as the black section in the second division mode.
[0063]
FIG. 26 is an explanatory diagram showing such a black section merging process. The figure shows how the
[0064]
On the other hand, the
[0065]
Thus, by combining the black sections of the first division mode to form the black sections of the second division mode, the differential binary image and the projection value are calculated with respect to the second division mode, and the black section is calculated. Since it is not necessary to perform the process of performing the extraction, the process can be performed at high speed.
[0066]
Next, the character string area extracting unit 4 forms a character string area by merging the black sections (step S4). In the fourth embodiment, instead of selecting a black section based on the standard size of a character, a black section is selected based on the pixel density of an input image in each black section area. For example, both black characters and white characters are allowed for the black section in the first division mode, and only white characters are allowed for the partial area in the second division mode.
[0067]
The process of selecting a black section is performed as follows. That is, first, the average value of the maximum pixel value and the minimum pixel value of the input image in the black section area is calculated as the binarization threshold. Next, the number of pixels having a value smaller than the binarization threshold value is compared with the number of pixels having a value equal to or greater than the binarization threshold value. If the latter is large, it is determined to be a white character. If the determination result of the black character / white character matches the character color (black / white) defined in the division mode of the black partition, the black partition is selected. If they do not match, the black section is rejected. The formation of the character string area (step S5) is performed by merging only the selected black sections.
[0068]
In a general character string image area, since there are more background pixels than character pixels, according to the above-described method, black and white characters can be determined by appropriately setting the binarization threshold. In the method described in the third embodiment, since the projection in the character string direction is used, it may not be possible to correctly determine that the rotation angle of the character string is very large. However, in this method, since the grayscale distribution is used, the rotation is not performed. It can be determined without any restrictions on the angle.
[0069]
The processing after step S5 is the same as in the third embodiment, and a description thereof will not be repeated.
[0070]
As is clear from the above, according to the character recognition device of the fourth embodiment, since the second division mode is obtained based on the first division mode, the amount of calculation can be significantly reduced. In addition, since the black sections are merged based on the above criteria (1) and (2), character recognition that is strong against rotation of a character string can be performed.
[0071]
【The invention's effect】
A character recognition device according to the present invention divides an input image into regions in a first divisional form, and also divides the input image into regions in a second divisional form having a size different from the region in the first divisional form. Since a character string area suitable for each of the divided forms is formed from the black sections extracted from the areas of both divided forms, even if a plurality of character strings of different sizes exist, the This has an extremely excellent effect that a character string can be detected and recognized.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a character recognition device according to Embodiment 1 of the present invention.
FIG. 2 is a flowchart of the character recognition device according to the first embodiment of the present invention.
FIG. 3 is a diagram illustrating an example of an input image according to the first embodiment of the present invention;
FIG. 4 is a diagram showing a first division mode according to the first embodiment of the present invention.
FIG. 5 is a diagram showing a second division mode according to the first embodiment of the present invention.
FIG. 6 is a diagram showing an example of a black section extracted from the first division mode according to the first embodiment of the present invention.
FIG. 7 is a diagram illustrating an example of a black section extracted from the second division mode according to the first embodiment of the present invention.
FIG. 8 is a diagram showing an example of a black section constituting a character string area extracted from the first division mode according to the first embodiment of the present invention.
FIG. 9 is a diagram showing an example of a black section constituting a character string area extracted from the second division mode according to the first embodiment of the present invention.
FIG. 10 is a diagram showing an example of a character string region candidate extracted from the first division mode according to the first embodiment of the present invention.
FIG. 11 is a diagram showing an example of a character string region candidate extracted from the second division mode according to the first embodiment of the present invention.
FIG. 12 is a diagram showing an example of a character string cutout area according to the first embodiment of the present invention.
FIG. 13 is an explanatory diagram illustrating a positional relationship between a camera that captures an input image and a license plate according to the second embodiment of the present invention.
FIG. 14 is a diagram illustrating an example of an input image according to the second embodiment of the present invention;
FIG. 15 is a block diagram showing a configuration of a character recognition device according to
FIG. 16 is a diagram showing an example of an input image according to the third embodiment of the present invention.
FIG. 17 is a diagram showing an example of a differential binary image according to the third embodiment of the present invention.
FIG. 18 is a diagram illustrating an example of a black section extracted from the first division mode according to the third embodiment of the present invention.
FIG. 19 is a diagram showing an example of a black section extracted from the second division mode according to the third embodiment of the present invention.
FIG. 20 is an explanatory diagram of a determination area according to the third embodiment of the present invention.
FIG. 21 is a diagram showing a distribution of projection values of a determination area for white characters according to
FIG. 22 is a diagram showing a distribution of projection values of a determination area for black characters according to
FIG. 23 is a diagram illustrating an example of an input image according to Embodiment 4 of the present invention;
FIG. 24 is a diagram showing an example of a differential binary image according to the fourth embodiment of the present invention.
FIG. 25 is a diagram illustrating an example of a black section extracted from the first division mode according to the fourth embodiment of the present invention.
FIG. 26 is an explanatory diagram showing a black partition merging process according to the fourth embodiment of the present invention;
[Explanation of symbols]
1, 2 area division
3 Projection section extraction unit
4 Character string area extraction unit
5 Character cutout
6 Character recognition unit
101 Differential image extraction unit
Claims (16)
前記黒区画を併合してそれらの分割形態に適合する文字列領域を形成するとともに、前記文字列領域から文字領域を切り出す文字領域抽出手段と、
前記文字領域の文字パターンを認識する文字認識手段と、を備えたことを特徴とする文字認識装置。The input image is divided into regions in a first division mode suitable for characters of a predetermined size, and further divided into regions in a second division mode suitable for characters having a size different from the size. Black section extraction means for extracting, as a black section, a region having a predetermined number of black pixels or more from each region of the form and each region of the second division form;
A character area extracting unit that merges the black sections to form a character string area that conforms to those division forms, and cuts out a character area from the character string area.
A character recognition unit that recognizes a character pattern in the character area.
前記黒区画を併合してそれらの分割形態に適合する文字列領域を形成するとともに、前記文字列領域から文字領域を切り出す文字領域抽出手順と、
前記文字領域の文字パターンを認識する文字認識手順と、を逐次コンピュータに実行させることを特徴とする文字認識プログラム。The input image is divided into regions in a first division mode suitable for characters of a predetermined size, and further divided into regions in a second division mode suitable for characters having a size different from the size. A black section extraction procedure for extracting, as a black section, an area having a predetermined number of black pixels or more from each area of the form and each area of the second division form;
A character area extraction procedure for merging the black sections to form a character string area conforming to the division mode, and for extracting a character area from the character string area,
And a character recognition procedure for recognizing a character pattern in the character area.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2003128637A JP4244692B2 (en) | 2003-05-07 | 2003-05-07 | Character recognition device and character recognition program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2003128637A JP4244692B2 (en) | 2003-05-07 | 2003-05-07 | Character recognition device and character recognition program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2004334461A true JP2004334461A (en) | 2004-11-25 |
| JP4244692B2 JP4244692B2 (en) | 2009-03-25 |
Family
ID=33504696
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2003128637A Expired - Lifetime JP4244692B2 (en) | 2003-05-07 | 2003-05-07 | Character recognition device and character recognition program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4244692B2 (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2008299673A (en) * | 2007-05-31 | 2008-12-11 | Sharp Corp | Image processing apparatus, image processing program, computer-readable recording medium storing the image processing program, and image processing method |
| US8081188B2 (en) | 2006-12-25 | 2011-12-20 | Ricoh Company, Limited | Image delivering apparatus and image delivery method |
| US8437553B2 (en) | 2007-09-20 | 2013-05-07 | Canon Kabushiki Kaisha | Image detection device and image detection method |
| JP2019049943A (en) * | 2017-09-12 | 2019-03-28 | 凸版印刷株式会社 | IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, AND PROGRAM |
| CN115410191A (en) * | 2022-11-03 | 2022-11-29 | 平安银行股份有限公司 | Text image recognition method, device, equipment and storage medium |
-
2003
- 2003-05-07 JP JP2003128637A patent/JP4244692B2/en not_active Expired - Lifetime
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8081188B2 (en) | 2006-12-25 | 2011-12-20 | Ricoh Company, Limited | Image delivering apparatus and image delivery method |
| JP2008299673A (en) * | 2007-05-31 | 2008-12-11 | Sharp Corp | Image processing apparatus, image processing program, computer-readable recording medium storing the image processing program, and image processing method |
| US8437553B2 (en) | 2007-09-20 | 2013-05-07 | Canon Kabushiki Kaisha | Image detection device and image detection method |
| JP2019049943A (en) * | 2017-09-12 | 2019-03-28 | 凸版印刷株式会社 | IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, AND PROGRAM |
| JP7006059B2 (en) | 2017-09-12 | 2022-01-24 | 凸版印刷株式会社 | Image processing equipment, image processing methods, and programs |
| CN115410191A (en) * | 2022-11-03 | 2022-11-29 | 平安银行股份有限公司 | Text image recognition method, device, equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| JP4244692B2 (en) | 2009-03-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10896349B2 (en) | Text detection method and apparatus, and storage medium | |
| CN101453575B (en) | A method for extracting video subtitle information | |
| CN110598566A (en) | Image processing method, device, terminal and computer readable storage medium | |
| CN103761527A (en) | Device and method for detecting the presence of a logo in a picture | |
| JP2008148298A (en) | Method for identifying different content areas in an image, apparatus for identifying different content areas in an image, and computer-readable medium embodying a computer program for identifying different content areas in an image | |
| CN109753953A (en) | Method, device, electronic device and storage medium for locating text in image | |
| JP2002133426A (en) | Ruled line extraction device for extracting ruled lines from multi-valued images | |
| JP2004126648A (en) | Image processing method, image processing apparatus, and image processing program | |
| CN111461126B (en) | Method, device, electronic device and storage medium for identifying spaces in text lines | |
| CN112800824A (en) | Processing method, device and equipment for scanning file and storage medium | |
| CN103268472B (en) | Lip detection method based on double-colored color space | |
| JP5523537B2 (en) | Document image line dividing method and line dividing system | |
| JP5847062B2 (en) | Image processing device | |
| JP4392907B2 (en) | Character extraction method | |
| CN112749599B (en) | Image enhancement method, device and server | |
| CN111709419A (en) | Method, system and equipment for positioning banknote serial number and readable storage medium | |
| Gui et al. | A fast caption detection method for low quality video images | |
| CN107016389B (en) | Method and device for locating license plate | |
| JP2004334461A (en) | Character recognition device and character recognition program | |
| CN114648751A (en) | Method, device, terminal and storage medium for processing video subtitles | |
| JP2016053763A (en) | Image processing apparatus, image processing method, and program | |
| JP5010627B2 (en) | Character recognition device and character recognition method | |
| JP6643301B2 (en) | Defect inspection device and defect inspection method | |
| CN106407969A (en) | Robust complex background video text positioning and extracting method | |
| JP2004086436A (en) | Image processing apparatus, image processing method, program, and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060120 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20080821 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080826 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20081022 |
|
| 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: 20081216 |
|
| 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: 20081229 |
|
| R151 | Written notification of patent or utility model registration |
Ref document number: 4244692 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120116 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130116 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130116 Year of fee payment: 4 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| EXPY | Cancellation because of completion of term |