JP3721034B2 - Character reading device, reading method, and reading program recording medium - Google Patents
Character reading device, reading method, and reading program recording medium Download PDFInfo
- Publication number
- JP3721034B2 JP3721034B2 JP36360399A JP36360399A JP3721034B2 JP 3721034 B2 JP3721034 B2 JP 3721034B2 JP 36360399 A JP36360399 A JP 36360399A JP 36360399 A JP36360399 A JP 36360399A JP 3721034 B2 JP3721034 B2 JP 3721034B2
- Authority
- JP
- Japan
- Prior art keywords
- threshold value
- character
- pixel
- connected black
- image
- 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 - Fee Related
Links
- 238000000034 method Methods 0.000 title claims description 49
- 239000006185 dispersion Substances 0.000 claims description 3
- 238000000605 extraction Methods 0.000 description 8
- 238000007781 pre-processing Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 238000011156 evaluation Methods 0.000 description 6
- 238000004458 analytical method Methods 0.000 description 3
- 238000011109 contamination Methods 0.000 description 3
- 239000000284 extract Substances 0.000 description 3
- 238000007796 conventional method Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 239000000470 constituent Substances 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
Images
Landscapes
- Character Input (AREA)
- Facsimile Image Signal Circuits (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は文字読取り装置、文字読取り方法及び文字読取りプログラムを記録した記録媒体に関し、特に鉛筆で記入した文字を消しゴムで消した際に生じる消し残し等の汚れを除去するノイズ除去処理を具備する文字読取り装置、文字読取り方法及び文字読取りプログラムを記録した記録媒体に関する。
【0002】
【従来の技術】
文字読取り装置においては、帳票上の読取り対象となる文字の多値画像を、何らかの方法で定めた二値化しきい値で二値化し、その二値化画像に対して文字認識処理を行うのが一般的である。しかし、文字の周辺に汚れ等がある場合、多値画像を二値化する際にそれらが文字とともに二値画像上にノイズとして現れる事がある。このような二値画像に対するノイズ除去処理としては、所定の大きさ以下の孤立した連結黒画素を検出し、それをノイズとして除去するという処理が一般的である。この処理により、文字周辺の微小なノイズは除去することが可能である。しかしながら、この処理では、鉛筆で記入した文字を消しゴムで消したとき等に生じる消し残し等の比較的大きな汚れを除去することが出来なかった。
【0003】
そこで、上記のような比較的大きな汚れを除去する従来の技術として、特開平6−274693号公報や特開平5−6461号公報に開示されている。
【0004】
特開平6−274693号公報では、文字画像上の文字の存在位置に線状の領域を設定し、この領域内に存在する連結黒画素を種情報として、その線状の領域を走査して種情報と接続している黒画素を抽出するという操作を行っている。すなわち、文字を構成する黒画素の連結性に着目して、孤立した比較的大きな連結黒画素を汚れ等のノイズと判断し、これを除去している。
【0005】
特開平5−6461号公報では、文字画像を2分の1に圧縮した圧縮画像から最大画素ブロックを文字として抽出し、この最大画素ブロックを再び元の画像サイズに拡大したのちに、これと元の文字画像とのアンドを取ることにより、比較的大きな連結黒画素をノイズとして除去している。
【0006】
【発明が解決しようとする課題】
しかし、特開平6−274693号公報では、文字が1つの連結黒画素で表されるという前提のもとに文字かノイズかの判断を行っているため、特に手書きで記入された文字を読取る場合等、複数個のそれぞれ分離したストロークで表現される文字が容易に起こり得るため適用が難しい。
【0007】
また、特開平5−6461号公報では、最大画素ブロックという矩形領域の内か外かで文字とノイズの判別を行っているため、1文字が複数の分離したストロークで表現される場合や文字のすぐ近くに汚れが存在している場合に文字ストロークと汚れを正しく判別することが難しいという問題がある。
【0008】
そのため、上記のような従来の技術では、消しゴムによる消し残し等の汚れがうまく除去できないため、そのようなノイズが文字の誤読あるいは不読の原因となっていた。
【0009】
本発明は上述した従来技術の欠点を解決するためになされたものであり、その目的は鉛筆で記入する際に文字を消しゴムで消したときに生じる消し残し等の汚れをノイズとして除去することにより、汚れ等があっても正確に文字の読取りを行うことができる文字読取り装置、文字読取り方法及び文字読取りプログラムを記録した記録媒体を提供することである。
【0010】
【課題を解決するための手段】
本発明による文字読取り装置は、帳票に記載された手書き文字を読取る文字読取り装置であって、前記帳票に対して画像読取りを行った多値画像上の文字についてその濃度の区分である濃度区分を前記多値画像上の画素値の分散と所定のしきい値とを比較して判定する文字濃度判定部と、前記多値画像内の読取り対象である文字とその文字以外の汚れとを判別するための汚れ判別しきい値を算出する汚れ判別しきい値算出部と、前記多値画像を二値化した二値画像上の連結黒画素が汚れか文字ストロークかを判別する汚れ判別部とを含み、前記汚れ判別部は、前記連結黒画素のサイズが第1のしきい値より大で、前記第1のしきい値より大きい値の第2のしきい値以下であり、かつ前記多値画像上の画素値の分散が前記所定のしきい値より大である場合、前記汚れ判別しきい値を用いて前記連結黒画素が汚れか文字ストロークかを判別することを特徴とする。また、前記汚れ判別部は、前記連結黒画素のサイズが前記第1のしきい値以下である場合には前記連結黒画素を汚れと判別し、前記連結黒画素のサイズが前記第2のしきい値より大である場合または前記第2のしきい値以下であるが前記多値画像上の画素値の分散が前記所定のしきい値より小である場合には前記連結黒画素を文字ストロークと判別することを特徴とし、また、前記汚れ判別部は、前記多値画像の画素値に基づいて前記連結黒画素を汚れとして判別することを特徴とする。
【0011】
本発明による文字読取り方法は、帳票に記載された手書き文字を読取る文字読取り方法であって、前記帳票に対して画像読取りを行った多値画像上の文字についてその濃度の区分である濃度区分を前記多値画像上の画素値の分散と所定のしきい値とを比較して判定する文字濃度判定ステップと、前記多値画像内の読取り対象である文字とその文字以外の汚れとを判別するための汚れ判別しきい値を算出する汚れ判別しきい値算出ステップと、前記多値画像を二値化した二値画像上の連結黒画素が汚れか文字ストロークかを判別する汚れ判別ステップとを含み、前記汚れ判別ステップにおいては、前記連結黒画素のサイズが第1のしきい値より大で、前記第1のしきい値より大きい値の第2のしきい値以下であり、かつ前記多値画像上の画素値の分散が前記所定のしきい値より大である場合、前記汚れ判別しきい値を用いて前記連結黒画素が汚れか文字ストロークかを判別することを特徴とする。また、前記汚れ判別部ステップにおいては、前記連結黒画素のサイズが前記第1のしきい値以下である場合には前記連結黒画素を汚れと判別し、前記連結黒画素のサイズが前記第2のしきい値より大である場合または前記第2のしきい値以下であるが前記多値画像上の画素値の分散が前記所定のしきい値より小である場合には前記連結黒画素を文字ストロークと判別することを特徴とし、また、前記汚れ判別ステップにおいては、前記多値画像の画素値に基づいて前記連結黒画素を汚れとして判別することを特徴とする。
【0012】
本発明による記録媒体は、コンピュータによって、帳票に記載された手書き文字を読取るための文字読取りプログラムを記録した記録媒体であって、該プログラムは、コンピュータに、前記帳票に対して画像読取りを行った多値画像上の文字についてその濃度の区分である濃度区分を前記多値画像上の画素値の分散と所定のしきい値とを比較して判定する文字濃度判定ステップと、前記多値画像内の読取り対象である文字とその文字以外の汚れとを判別するための汚れ判別しきい値を算出する汚れ判別しきい値算出ステップと、前記多値画像を二値化した二値画像上の連結黒画素が汚れか文字ストロークかを判別する汚れ判別ステップとを含み、前記汚れ判別ステップにおいては、前記連結黒画素のサイズが第1のしきい値より大で、前記第1のしきい値より大きい値の第2のしきい値以下であり、かつ前記多値画像上の画素値の分散が前記所定のしきい値より大である場合、前記汚れ判別しきい値を用いて前記連結黒画素が汚れか文字ストロークかを判別することを特徴とする。また、前記汚れ判別部ステップにおいては、前記連結黒画素のサイズが前記第1のしきい値以下である場合には前記連結黒画素を汚れと判別し、前記連結黒画素のサイズが前記第2のしきい値より大である場合または前記第2のしきい値以下であるが前記多値画像上の画素値の分散が前記所定のしきい値より小である場合には前記連結黒画素を文字ストロークと判別することを特徴とし、また、前記汚れ判別ステップにおいては、前記多値画像の画素値に基づいて前記連結黒画素を汚れとして判別することを特徴とする。
【0013】
【発明の実施の形態】
次に、本発明の実施の形態について図面を参照して詳細に説明する。図1を参照すると、本発明の実施の形態は、帳票上の読取り対象の文字イメージを多値画像として取込むスキャナ等の画像入力装置1と、情報を記憶する記憶装置2と、プログラム制御により動作するデータ処理装置3と、ディスプレイ装置等の出力装置4から構成されている。
【0014】
記憶装置2は、画像記憶部21と文字認識辞書部22を含む。画像記憶部21は、画像入力装置にて取り込んだ文字の多値画像を記憶する。文字認識辞書部22は、文字認識処理に使用する辞書を記憶する。
【0015】
データ処理装置3は、文字認識のための前処理を行う前処理部31と、この前処理部31により生成された二値画像から文字認識のための特徴を抽出する特徴抽出部32と、この特徴抽出部32により抽出された特徴と文字認識辞書部22に格納された文字特徴とを比較することにより文字認識を行う文字認識部33とを含んで構成されている。
【0016】
前処理部31は、二値化部311とノイズ除去部312とを含んで構成されている。二値化部311は、濃度ヒストグラム生成部3111と、二値化しきい値算出部3112と文字濃度判定部3113と汚れ判別しきい値算出部3114と二値画像生成部3115とを含んで構成されている。
【0017】
濃度ヒストグラム生成部3111は、画像記憶部21に記憶された多値画像の各画素値毎の画素数をカウントした濃度ヒストグラムを生成する。二値化しきい値算出部3112は、この濃度ヒストグラムを基に多値画像を二値化するための二値化しきい値を算出する。文字濃度判定部3113は、この濃度ヒストグラムを基に多値画像上の文字の濃さ区分を判定する。汚れ判別しきい値算出部3114は、上記濃度ヒストグラムを基に汚れと文字とを判別するための汚れ判別しきい値を算出する。二値画像生成部3115は、上記二値化しきい値により上記多値画像を二値化した二値画像を生成する。
【0018】
ノイズ除去部312は、汚れ判別部3121と連結黒画素除去部3122とを含んで構成されている。汚れ判別部3121は、二値画像上の連結黒画素が汚れか文字ストロークかを判定する。連結黒画素除去部3122は、汚れ判別部3121で汚れと判定された連結黒画素または所定の大きさ以下の連結黒画素を上記二値画像上から除去する。
【0019】
次に、図1の他、図2〜図4、図6及び図7のフローチャート更には図5を参照して本実施の形態の全体の動作について詳細に説明する。
【0020】
図2を参照し、まず、画像入力装置1により帳票上の読取り対象となる文字イメージが多値画像IMGとして取り込まれ、画像記憶部21に格納される(ステップS1)。多値画像IMGは、画素値が大きいほど、その画素の明るさが明るいものとする。
【0021】
次に、二値化部311は、多値画像IMGを二値化した二値画像IMBを生成する(ステップS2)。この場合、図3に示されているように、まず、濃度ヒストグラム生成部3111は、この多値画像IMGに対して、画素値毎の画素数をカウントした濃度ヒストグラムを生成する(図3のステップS20)。
【0022】
次に、二値化しきい値算出部3112は、上記濃度ヒストグラムを基に上記多値画像IMGを二値化するためのしきい値BTHを算出する(ステップS21)。二値化しきい値BTHは、1980年、電子通信学会論文誌Vol.J63−D、No.4、pp.349−356で大津の提案した判別分析法により求める。この大津の提案した方法は、例えば文字と背景という2つのカテゴリを含む画像において、それぞれのカテゴリ内の分散を最小にし、かつカテゴリ間の分散を最大にするようにしきい値を選定する方法である。
【0023】
多値画像IMGの二値化は次のようにして行う。多値画像IMGのある画素の画素値が二値化しきい値BTHより小さければ、その画素に対応する二値画像IMB上の画素の画素値を‘1’すなわち‘黒’とし、多値画像IMGのある画素の画素値が二値化しきい値BTH以上であれば、その画素に対応する二値画像IMB上の画素の画素値を‘0’すなわち‘白’とする。
【0024】
次に、文字濃度判定部3113は、多値画像IMG上の文字の濃度区分を判定する(ステップS22)。文字の濃度区分としては、‘空白’、‘薄い’、‘濃い’の3つの区分があるものとする。
【0025】
文字濃度判定部3113は、図4に示されているように、まず、多値画像IMG上の画素値の分散Vrを求める(図4のステップS220)。次に、分散Vrと予め定められたしきい値BR_THとを比較する(ステップS221)。ステップS221の分散Vrとしきい値BR_THとを比較した結果、Vr<BR_THが成り立つ場合は、その文字濃度区分を‘空白’と判定する(ステップS223)。
【0026】
ステップS221において分散Vrとしきい値BR_THとを比較した結果、Vr<BR_THが成り立たない場合は、分散Vrと予め定められたしきい値KOSA_THとを比較する(ステップS222)。ステップS222において分散Vrとしきい値KOSA_THとを比較した結果、Vr<KOSA_THが成り立つ場合は、文字濃度区分を‘薄い’と判定する(ステップS224)。ステップS222において分散Vrとしきい値KOSA_THとを比較した結果、Vr<KOSA_THが成り立たない場合は、文字濃度区分を‘濃い’と判定する(ステップS225)。そして、文字濃度判定部3113はこのフローチャートの処理、すなわち図3のステップS22を終了する。
【0027】
次に、二値化部311は、変数KOSAを‘0’で初期化する(図3のステップS23)。変数KOSAは、KOSA=0ならば、上記文字濃度区分が‘空白’もしくは‘薄い’であり、KOSA=1ならば上記文字濃度区分が‘濃い’であることを示すための変数である。
【0028】
次に、文字濃度判定部3113により判定された文字濃度区分を参照し、濃度区分が‘空白’かどうか調べる(ステップS24)。濃度区分が‘空白’であれば、二値画像生成部3115は、上記多値画像IMGを二値化した画像として、画素値が全て‘0’、すなわち全て白画素の二値画像IMBを生成する(ステップS29)。ステップS24において文字濃度区分が‘空白’でなければ、次に、文字濃度区分が‘薄い’かどうか調べる(ステップS25)。ステップS25において文字濃度区分が‘薄い’であれば、二値画像生成部3115は、上記多値画像IMGを上記二値化しきい値BTHで二値化した二値画像IMBを生成する(ステップS28)。ステップS25において文字濃度区分が‘薄い’でない場合、すなわち文字濃度区分が‘濃い’である場合は、汚れ判別しきい値算出部3114は、二値画像IMB上の連結黒画素が汚れか文字ストロークかを判別するための汚れ判別しきい値DTHを算出する(ステップS26)。
【0029】
汚れ判別しきい値算出部3114は、図5のように、上記濃度ヒストグラム上の上記二値化しきい値BTH未満の画素値に対して上述した判別分析法を適用し、上記二値化しきい値BTH未満の画素を濃い画素(画素値小)と薄い画素(画素値大)とに分離するしきい値を見つけ、これを汚れ判別しきい値DTHとする(ステップS26)。次に、変数KOSAに‘1’を代入する(ステップS27)。二値画像生成部3115は、上記多値画像IMGを上記二値化しきい値BTHで二値化した二値画像IMBを生成する(ステップS28)。そして、二値化部311は、このフローチャートの処理、すなわち図2のステップS2を終了する。
【0030】
次に、ノイズ除去部312は、上記二値画像IMBに対してノイズ除去を行う(図2のステップS3)。ノイズ除去部312はまず、上記二値画像IMBに対して画像内に存在する全ての連結黒画素を検出する(図6のステップS30)。連結黒画素を見つけるための処理は、例えば公知の技術であるラベリング処理によって実現できる。次に、検出した連結黒画素の内の1つを選択し、これを連結黒画素BLKとする(ステップS31)。
【0031】
次に、上記連結黒画素BLKの高さH及び幅Wと予め定められたしきい値SIZE_Sとを比較する(ステップS32)。しきい値SIZE_Sは、連結黒画素BLKを微小ノイズと見なすかどうかをその連結黒画素BLKの幅W及び高さHから判定するためのしきい値である。幅W及び高さHが共にしきい値SIZE_S以下であれば、連結黒画素除去部3122はその連結黒画素BLKを微小ノイズとして除去し(ステップS36)、ステップS30にて検出した連結黒画素を全て選択し終わったかどうか判定する(ステップS37)。未選択の連結黒画素が存在すると判定された場合は、ステップS31に戻り、未選択の連結黒画素を1つ選択したのち、ステップS32以降を実行する。
【0032】
ステップS32で、連結黒画素BLKの幅W及び高さHのいずれかがしきい値SIZE_Sよりも大きければ、次に幅W及び高さHと予め定められたしきい値SIZE_Mとを比較し、さらに変数KOSAの値が‘1’かどうか調べる(ステップS33)。しきい値SIZE_Mは、ある連結黒画素に対して汚れと見なすかどうかをその連結黒画素BLKの幅W及び高さHから判断するためのしきい値である。
【0033】
なお、上記しきい値SIZE_Sはしきい値SIZE_Mよりも小さい値を設定するものとする。連結黒画素BLKの幅W及び高さHのいずれかがしきい値SIZE_Mよりも大きいか、もしくは変数KOSAの値が‘0’である場合は、ステップS37に進み、ステップS30にて検出した連結黒画素を全て選択し終わったかどうか判定する。一方、ステップS33で連結黒画素BLKの幅W及び高さHが共にしきい値SIZE_M以下であり、かつ変数KOSAの値が‘1’である場合、汚れ判別部3121はその連結黒画素BLKが汚れかどうかの判定を行う(ステップS34)。
【0034】
この場合、汚れ判別部3121は、図7に示されているように、変数BK_CNTとTK_CNTにそれぞれ0を代入する(図7のステップS340)。変数BK_CNTはその連結黒画素BLKを構成する黒画素の数を格納する変数である。また、変数TK_CNTはその連結黒画素BLKを構成する黒画素のうち、多値画像IMG上で汚れ判別しきい値DTH未満の画素値を持つ画素の個数を格納する変数である。
【0035】
次に、その連結黒画素BLKを構成する黒画素の1つを選択する(ステップS341)。次に、ステップS341で選択した黒画素に対応する多値画像IMG上の画素の画素値BK_Gを求める。すなわち、選択した黒画素に対して、二値化を行う前の多値の画素値を求める(ステップS342)。次に、上記画素値BK_Gと上記汚れ判別しきい値DTHとを比較する(ステップS343)。ステップS343における比較の結果、BK_G<DTHが成り立つ場合は、変数TK_CNTの値を1増加させる(ステップS344)。ステップS343における比較の結果、BK_G<DTHが成り立たない場合は、ステップS345に進む。次に、変数BK_CNTの値を1増加させる(ステップS345)。
【0036】
次に、ステップS341においてその連結黒画素BLKの構成黒画素が全て選択済みがどうか判定する(ステップS346)。ステップS346における判定の結果、未選択の黒画素があると判定された場合は、ステップS341に戻り、未選択の黒画素を1つ選択したのち、ステップS342以降を実行する。ステップS346における判定の結果、未選択の黒画素がないと判定された場合は、式(1)により汚れ評価値TK_RTOの値を計算する(ステップS347)。
【0037】
TK_RTO=TK_CNT/BK_CNT(1) 次に、汚れ評価値TK_RTOと予め設定された汚れ評価しきい値DTK_THとを比較し、TK_RTO<DTK_THが成り立つかどうか判定する(ステップS348)。ステップS348で汚れ評価値TK_RTOと予め設定された汚れ評価しきい値DTK_THとを比較した結果、TK_RTO<DTK_THが成り立つ場合は、その連結黒画素BLKを‘汚れ’であると判定する(ステップS349)。ステップS348での評価の結果、TK_RTO<DTK_THが成り立たない場合は、その連結黒画素BLKを‘文字ストローク’であると判定する(ステップS34a)。そして、汚れ判別部3121はこのフローチャートの処理、すなわち図6中のステップS34を終了する。
【0038】
次に、ノイズ除去部312は、ステップS34における汚れ判別部3121の判定結果が‘汚れ’であるかどうか調べる(図6のステップS35)。ステップS35において、汚れ判別部3121の判定結果が‘汚れ’であった場合は、連結黒画素除去部3122はその連結黒画素BLKを上記二値画像IMB上から除去する(ステップS36)。
【0039】
次に、ステップS37に進み、ステップS31で上記二値画像IMB上の連結黒画素を全て選択済みかどうか判定する。ステップS35において、汚れ判別部3121の判定結果が‘汚れ’でなかった場合は、ステップS37に進み、ステップS31で上記二値画像IMB上の連結黒画素を全て選択済みかどうか判定する。ステップS37において、上記二値画像IMB上の連結黒画素を全て選択済みであると判定された場合は、ノイズ除去部312はこのフローチャートの処理、すなわち図2のステップS3を終了する。未選択の連結黒画素が存在すると判定された場合は、ステップS31に戻り、未選択の連結黒画素を1つ選択したのち、ステップS32以降を実行する。
【0040】
次に、特徴抽出部32は、前処理部31により生成されたその二値画像IMBから文字認識に必要な特徴を抽出する(図2のステップS4)。次に、文字認識部33は、上記特徴抽出部32により抽出された特徴と文字認識辞書部22に記憶された文字特徴とを比較し、文字認識処理を行う(ステップS5)。そして、出力装置4は、文字認識部33による文字認識結果を上記多値画像IMGの読取り結果として出力する(ステップS6)。なお、特徴抽出部32及び文字認識部33は公知の技術を適用して実現できる。
【0041】
以上説明した文字読取り装置では、図2〜図7に示されている文字読取り方法が実現されている。すなわち、帳票に記載された手書き文字を読取る方法であり、帳票に対して画像読取りを行った多値画像上の文字についてその濃度の区分である濃度区分を判定し、多値画像内の読取り対象である文字とその文字以外の汚れとを判別するための汚れ判別しきい値を算出し、多値画像を二値化した二値画像上の連結黒画素が汚れか文字ストロークかを判別する文字読取り方法が実現されていることになる。そして、上記の汚れは、消しゴムで消した際に生じる消し残し等の汚れであり、多値画像の画素値に基づいて連結黒画素を汚れとして判別するのである。
【0042】
以上のように、本実施の形態による文字読取り装置では、画像入力装置1から取り込まれ画像記憶部21に記憶された多値画像を二値化した二値画像において、消しゴムで文字を消したときに生じる消し残し等の汚れが比較的大きな連結黒画素を形成している場合、汚れ判別部3121により、上記多値画像の画素値を基にその連結黒画素を汚れとして判別することができる。そして、そのような汚れを二値画像上から除去することにより、誤って汚れを文字の一部と見なして文字認識処理を行うことを避けることができる。したがって、消し残し等の汚れに頑健な高精度の文字読取りを実現できるのである。
【0043】
【実施例】
次に、具体的な実施例を用いて本実施の形態の動作を詳細に説明する。ここでは、図8に示されているような、数字の「5」の読取りを行う場合について説明する。図8を参照すると、帳票等に記載されている読取り対象は、数字の「5」を構成する文字成分100と文字成分101と、例えば消しゴムで一度記入した文字を消した際に残ってしまった汚れである汚れ成分102と同じく汚れ成分103から構成されている。図8に示す数字の「5」のイメージを画像入力装置1により取込み、多値画像IMGとして画像記憶部21に格納する(図2のステップS1)。
【0044】
次に、二値化部311はこの多値画像IMGを二値化した二値画像IMBを生成する処理を行う(ステップS2)。濃度ヒストグラム生成部3111は、上記多値画像IMGの濃度ヒストグラムを生成する(図3のステップS20)。次に、二値化しきい値算出部3112は、上記濃度ヒストグラムを基に多値画像IMGを二値化するための二値化しきい値BTHを算出する(ステップS21)。その結果、BTH=12であったとする。
【0045】
次に、文字濃度判定部3113は、多値画像IMG上の文字の濃度区分を判定する(ステップS22)。文字濃度判定部3113は、まず、多値画像IMG上の全ての画素の画素値の分散Vrを求める(図4のステップS220)。このとき、分散Vr=2.4であったとする。次に、Vr<BR_THが成り立つかどうか調べる(ステップS221)。BR_THは多値画像IMGが‘空白’かどうかを分散Vrに基づいて判定するために予め設定されたしきい値であり、ここではBR_TH=0.2に設定されているものする。
【0046】
したがって、Vr<BR_THが成り立たないため、ステップS222に進む。次に、Vr<KOSA_THが成り立つかどうか判定する(ステップS222)。KOSA_THは多値画像IMG上の文字の濃度区分が‘濃い’か‘薄い’かを分散Vrに基づいて判定する予め設定されたしきい値であり、ここではKOSA_TH=1.0と設定されているものとする。したがって、Vr<KOSA_THが成り立たないため、多値画像IMGに写っている文字の濃度区分は‘濃い’であると判定する。
【0047】
次に、二値化部311は、変数KOSAを0で初期化する(図3のステップS23)。次に、文字濃度判定部3113の判定した文字濃度区分が‘空白’かどうか判定する(ステップS24)。ここでは、文字濃度区分は‘濃い’であるため、ステップS25に進み、上記文字濃度区分が‘薄い’かどうか判定する。文字濃度区分は‘濃い’なので、汚れ判別しきい値算出部3114は、上記濃度ヒストグラムを基に、汚れ判別しきい値の算出を行う(ステップS26)。
【0048】
すなわち、BTH=12であるため、図5に示した濃度ヒストグラムの画素値が0から11までの部分に対して上述した判別分析法を適用し、汚れ判別しきい値DTHを求める。ここでは、DTH=10が得られたとする。次に、二値化部311は、変数KOSAに1を代入する(ステップS27)。そして、二値画像生成部3115は、多値画像IMGを二値化しきい値BTHで二値化し、図9の二値画像IMBを生成する(ステップS28)。もし、ステップS24の文字濃度区分が‘空白’かどうかの判定で‘空白’であると判定された場合は、多値画像IMGの二値画像として、全ての画素が白画素の二値画像IMBを生成する。
【0049】
次に、ノイズ除去部312は、上記二値画像IMBに対して連結黒画素を検出する(図6のステップS30)。その結果、図9に示されている4つの連結黒画素110〜113が検出される。これら4つの連結黒画素の内、まず連結黒画素110を選択する(ステップS31)。このとき、連結黒画素110の大きさは、幅W=20ピクセル、高さH=35ピクセルであったとする。
【0050】
次に、この幅Wと高さHが共に予め設定されたしきい値SIZE_S以下であるかどうか判定する(ステップS32)。ここでは、しきい値SIZE_S=5に設定されているものとする。この場合、幅Wと高さHは共にSIZE_Sよりも大きいため、次に、幅W及び高さHが予め設定されたしきい値SIZE_M以下であり、かつ変数KOSA=1であるかどうか判定する(ステップS33)。ここでは、しきい値SIZE_M=10に設定されているものとする。
【0051】
この場合、幅W及び高さHは共にしきい値SIZE_Mよりも大きいため、ステップS37に進み、連結黒画素が全て選択済みかどうか判定する。しかし、まだ連結黒画素111〜113が選択されていないので、ステップS31に戻り、連結黒画素111を選択する。連結黒画素の大きさは、幅W=10、高さH=4であったとする。すると、ステップS32での大きさ判定では、幅W及び高さHが共にしきい値SIZE_S以下という条件を満たさないため、ステップS33に進む。ステップS33での大きさ判定では、幅Wと高さHが共にSIZE_M以下という条件を満たすため、汚れ判別部3121は、連結黒画素111が汚れかどうかの判定を行う(ステップS34)。
【0052】
次に、汚れ判別部3121は、変数BK_CNTと変数TK_CNTを共に0で初期化する(図7のステップS340)。次に、連結黒画素111を構成する黒画素の内の1つを選択する(ステップS341)。次に、図10に示されているように、選択した黒画素に対応する画素の画素値BK_Gを、画像記憶部21に記憶された多値画像IMGを参照することにより求める(ステップS342)。なお、図10には、二値画像IMB上の連結黒画像BLKと、多値画像IMGとが示されている。
【0053】
この選択した黒画素に対応する画素の画素値BK_Gを求める場合、図9に示されている連結黒画素111に対応する図8の文字成分101を参照する。ここでは、BK_G=4であったとする。次に、このBK_Gと汚れ判別しきい値算出部3114により算出された汚れ判別しきい値DTHとを比較し、BK_G<DTHが成り立つかどうか判定する(ステップS343)。汚れ判別しきい値DTHは上述した通りDTH=10が得られていると仮定しているので、BK_G<DTHが成り立つ。従って、変数TK_CNTの値を1増加させる(ステップS344)。そして、変数BK_CNTの値を1増加させる(ステップS345)。
【0054】
次に、全ての黒画素を選択済みかどうか調べる(ステップS346)。ここでは、まだ未選択の黒画素があるとして、ステップS341に戻り、未選択の黒画素を1つ選択する。そして、この黒画素に対応する多値画像IMG上の画素の画素値をBK_Gを求める(ステップS342)。ここでは、この画素値BK_G=12であったとする。次に、画素値BK_Gと汚れ判別しきい値DTHとを比較し、BK_G<DTHが成り立つかどうか判定する(ステップS343)。しかし、BK_G<DTHが成り立たないので、ステップS344をとばしてステップS345に進み変数BK_CNTの値を1増加させる。
【0055】
そして、ステップS346で、全ての黒画素を選択済みかどうか判定する。このようにして、ステップS341で連結黒画素111を構成する全ての黒画素を選択するまでステップS341からステップS346間での処理を繰り返す。全ての黒画素を選択し終わった時点で、ステップS347に進み、TK_RTOの値を計算する。ここで、TK_CNT=20、BK_CNT=25であったとすると、TK_RTO=0.8となる。次に、このTK_RTOと予め設定されたしきい値DTK_THとを比較する。ここでは、DTK_TH=0.1に設定してあるものとする。すると、ステップS348でTK_RTOとDTK_THとを比較した結果、TK_RTO<DTK_THが成り立たないため、連結黒画素111を‘文字ストローク’であると判定する(ステップS34a)。
【0056】
そして、図6のステップS35に進み、汚れ判別部3121の判別結果が‘汚れ’かどうか判定する。この場合、汚れ判別部3121は、連結黒画素111は‘文字ストローク’であると判定しているので、ステップS37に進む。ステップS37で連結黒画素を全て選択したかどうか判定する。この場合、連結黒画素112と連結黒画素113が未選択であるので、ステップS31に戻り、連結黒画素112を選択する。
【0057】
連結黒画素112の大きさは、幅W=5,高さH=8であったとする。すると、ステップS32における判定では、幅W及び高さHが共にSIZE_S以下という条件を満たさないため、ステップS33に進む。ステップS33における判定では、幅W及び高さHが共にSIZE_M以下であり、かつ変数KOSA=1を満たすので、汚れ判別部3121は、連結黒画素112が汚れかどうかの判定を行う(ステップS34)。
【0058】
次に、汚れ判別部3121は、上記連結黒画素111に対して行った場合と同様に、図7のステップS340からステップS346までの処理を連結黒画素112に対して行う。その結果、TK_CNT=2、BK_CNT=32が得られたとすると、TK_RTO=0.0625となる。次に、このTK_RTOと上記しきい値DTK_THとを比較する(ステップS348)。ここでは、DTK_TH=0.1に設定してあるので、ステップS348でTK_RTO<DTK_THが成り立つため、連結黒画素112を‘汚れ’であると判定する(ステップS349)。そして、図6のステップS35に進み、汚れ判別部3121の判別結果が‘汚れ’かどうか判定する。この場合、汚れ判別部3121は、連結黒画素112を‘汚れ’であると判定しているので、連結黒画素除去部3122は連結黒画素112を二値画像IMB上から除去する(ステップS36)。
【0059】
次に、ステップS37で連結黒画素を全て選択したかどうか判定する。連結黒画素が113が未選択であるので、ステップS31に戻り、連結黒画素113を選択する。連結黒画素113の大きさは、幅W=3、高さH=4であるとする。すると、ステップS32の判定で、幅Wと高さHが共にSIZE_S以下であるので、連結黒画素除去部3122は連結黒画素113を二値画像IMB上から除去する(ステップS36)。次に、ステップS37で、連結黒画素を全て選択済みかどうか判定する。このとき、二値画像IMB上の連結黒画素110から113は全て選択済みであるので、ノイズ除去部312はその処理(図2のステップS3)を終了する。
【0060】
次に、特徴抽出部32は、前処理部31から図11に示すノイズ除去後の二値画像IMBを受け取り、文字認識部33で文字認識処理を行う際に用いる特徴を抽出する(図2のステップS4)。
【0061】
次に、文字認識部33は、特徴抽出部32にて抽出された特徴と文字認識辞書部22に格納された文字特徴とを比較し、文字認識処理を行う(ステップS5)。そして、文字認識処理の結果得られた、多値画像IMGの属すべきカテゴリ名を、文字読取り結果として出力装置4に出力する。
【0062】
なお、以上説明した実施の形態では、プログラム制御により動作するデータ処理装置3が、メモリに記憶されたプログラムを実行することによって、前処理部31から文字認識部33までの機能が実現されていた。これに対し、図12に示すように、データ処理装置3が実行するプログラムを記録した記録媒体5を備え、この記録媒体5からプログラムをデータ処理装置3のメモリに読込ませ、データ処理装置3の動作を制御するようにしても良い。
【0063】
つまり、上述した図2〜図4、図6及び図7の処理を実現するためのプログラムを記録した記録媒体を用意し、これを用いて図12の各部を制御すれば、上述と同様の文字読取り動作を行うことができることは明白である。この記録媒体5には、半導体メモリ、磁気ディスク装置の他、種々の記録媒体を用いることができる。
【0064】
また、同記録媒体に記録されているプログラムによってコンピュータを制御すれば、上述と同様に文字読取り動作を行うことができることは明白である。この記録媒体には、半導体メモリ、磁気ディスク装置の他、種々の記録媒体を用いることができる。
【0065】
【発明の効果】
以上説明したように本発明は、二値画像上のある程度大きな連結黒画素に対して汚れか文字ストロークかを、二値化する前の多値画像上の濃度情報を参照することによって判別するようにしたので、文字ストロークを誤って除去することなく、汚れのみを除去することができ、消しゴムで一度記入した文字を消したときなどに生じる消し残し等の汚れに強い安定した文字読取り装置を実現できるという効果がある。
【図面の簡単な説明】
【図1】本発明による文字読取り装置の実施の形態の構成を示すブロック図である。
【図2】図1中の各部の動作を示すフローチャートである。
【図3】図1中の二値化部311の動作を示すフローチャートである。
【図4】図1中の文字濃度判定部3113の動作を示すフローチャートである。
【図5】図1中の濃度ヒストグラム生成部3111で生成される濃度ヒストグラムの例を示す図である。
【図6】図1中のノイズ除去部312の動作を示すフローチャートである。
【図7】図1中の汚れ判別部3121の動作を示すフローチャートである。
【図8】多値画像IMGの例を示す図である。
【図9】多値画像IMGを二値化した二値画像IMBの例を示す図である。
【図10】二値画像IMB上の連結黒画素BLK上の画素から、その画素に対応する多値画像IMG上の画素の画素値BK_Gを参照する処理を示す図である。
【図11】図1中のノイズ除去部312によるノイズ除去後の二値画像IMBの例を示す図である。
【図12】本発明による文字読取り装置の他の実施の形態を示すブロック図である。
【符号の説明】
1 画像入力装置
2 記憶装置
21 画像記憶部
22 文字認識辞書部
3 データ処理装置
31 前処理部
311 二値化部
3111 濃度ヒストグラム生成部
3112 二値化しきい値算出部
3113 文字濃度判定部
3114 汚れ判別しきい値算出部
3115 二値画像生成部
312 ノイズ除去部
3121 汚れ判別部
3122 連結黒画素除去部
32 特徴抽出部
33 文字認識部
4 出力装置
5 記録媒体
100,101 文字成分
102,103 汚れ成分
110,111,112,113 連結黒画素[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a character reading device, a character reading method, and a recording medium on which a character reading program is recorded, and in particular, a character having a noise removing process for removing dirt such as unerased characters generated when a character written with a pencil is erased with an eraser. The present invention relates to a reading device, a character reading method, and a recording medium on which a character reading program is recorded.
[0002]
[Prior art]
In a character reader, a multi-valued image of characters to be read on a form is binarized with a binarization threshold value determined by some method, and character recognition processing is performed on the binarized image. It is common. However, when there are dirt around the character, when binarizing the multi-valued image, they may appear as noise on the binary image together with the character. As a noise removal process for such a binary image, a process of detecting an isolated connected black pixel having a predetermined size or less and removing it as noise is common. By this process, minute noise around the character can be removed. However, this process cannot remove relatively large stains such as unerased parts that occur when characters written with a pencil are erased with an eraser.
[0003]
Therefore, as conventional techniques for removing the relatively large dirt as described above, JP-A-6-274663 and JP-A-5-6461 are disclosed.
[0004]
In Japanese Patent Laid-Open No. Hei 6-274669, a linear region is set at the position of a character on a character image, and the linear region is scanned by using the connected black pixel existing in this region as seed information. An operation of extracting black pixels connected to information is performed. That is, paying attention to the connectivity of black pixels constituting a character, an isolated relatively large connected black pixel is determined as noise such as dirt, and is removed.
[0005]
In Japanese Patent Application Laid-Open No. 5-6461, a maximum pixel block is extracted as a character from a compressed image obtained by compressing a character image by a half, and the maximum pixel block is enlarged again to the original image size. By taking an AND with the character image, relatively large connected black pixels are removed as noise.
[0006]
[Problems to be solved by the invention]
However, in Japanese Patent Laid-Open No. Hei 6-274669, a determination is made as to whether a character is a noise or a noise on the assumption that the character is represented by one connected black pixel. It is difficult to apply because a plurality of characters represented by separate strokes can easily occur.
[0007]
Further, in Japanese Patent Laid-Open No. 5-6461, character and noise are discriminated within or outside a rectangular area called the maximum pixel block, so that one character is represented by a plurality of separated strokes or character There is a problem that it is difficult to correctly distinguish a character stroke and dirt when dirt is present in the immediate vicinity.
[0008]
For this reason, in the conventional technique as described above, dirt such as unerased by an eraser cannot be removed well, and such noise causes misreading or unreading of characters.
[0009]
The present invention has been made to solve the above-mentioned drawbacks of the prior art, and its purpose is to remove, as noise, dirt such as unerased material that occurs when characters are erased with an eraser when writing with a pencil. Another object of the present invention is to provide a character reading device, a character reading method, and a recording medium on which a character reading program is recorded, which can accurately read characters even if they are dirty.
[0010]
[Means for Solving the Problems]
A character reading device according to the present invention is a character reading device that reads handwritten characters described in a form, and a density classification that is a density classification of characters on a multi-valued image obtained by performing image reading on the form.Comparing the variance of pixel values on the multi-valued image with a predetermined threshold valueA character density determination unit for determining; a stain determination threshold value calculation unit for calculating a stain determination threshold value for determining a character to be read in the multi-valued image and a stain other than the character; And a stain discriminator for discriminating whether the connected black pixels on the binary image obtained by binarizing the value image are dirty or a character stroke.The stain determination unit is configured such that the size of the connected black pixel is larger than a first threshold value and smaller than or equal to a second threshold value that is larger than the first threshold value, and the multivalued value. When the variance of the pixel values on the image is larger than the predetermined threshold value, it is determined whether the connected black pixel is dirty or a character stroke using the stain determination threshold value.It is characterized by that. Also,The stain determination unit determines that the connected black pixel is dirty when the size of the connected black pixel is equal to or smaller than the first threshold value, and the size of the connected black pixel is the second threshold value. If it is greater than or less than the second threshold but the variance of the pixel values on the multi-valued image is smaller than the predetermined threshold, the connected black pixel is determined as a character stroke. It is also characterized byThe stain determination unit determines the connected black pixels as stains based on pixel values of the multi-valued image.
[0011]
A character reading method according to the present invention is a character reading method for reading a handwritten character written on a form, and a density classification that is a density classification of characters on a multi-valued image obtained by performing image reading on the form.Comparing the variance of pixel values on the multi-valued image with a predetermined threshold valueA character density determination step for determining; a stain determination threshold value calculating step for calculating a stain determination threshold value for determining a character to be read in the multi-valued image and a stain other than the character; A stain discrimination step for discriminating whether the connected black pixels on the binary image obtained by binarizing the value image are a stain or a character stroke.Therefore, in the stain determination step, the size of the connected black pixels is larger than the first threshold value and smaller than or equal to the second threshold value greater than the first threshold value, and If the variance of the pixel values on the value image is larger than the predetermined threshold value, it is determined whether the connected black pixel is dirty or a character stroke using the stain determination threshold value.It is characterized by that. Also,In the stain determination unit step, when the size of the connected black pixel is equal to or smaller than the first threshold value, the connected black pixel is determined as dirty, and the size of the connected black pixel is the second threshold value. If it is greater than the threshold value or less than the second threshold value but the variance of pixel values on the multi-valued image is smaller than the predetermined threshold value, the connected black pixels are treated as character strokes. And is characterized byIn the stain determination step, the connected black pixels are determined as stains based on the pixel values of the multi-valued image.
[0012]
A recording medium according to the present invention is a recording medium in which a character reading program for reading a handwritten character written in a form is recorded by a computer, and the program reads an image of the form on the computer. For the characters on the multi-valued image, set the density classification that is the density classification.Comparing the variance of pixel values on the multi-valued image with a predetermined threshold valueA character density determination step for determining; a stain determination threshold value calculating step for calculating a stain determination threshold value for determining a character to be read in the multi-valued image and a stain other than the character; A stain discrimination step for discriminating whether the connected black pixels on the binary image obtained by binarizing the value image are a stain or a character stroke.Therefore, in the stain determination step, the size of the connected black pixels is larger than the first threshold value and smaller than or equal to the second threshold value greater than the first threshold value, and If the variance of the pixel values on the value image is larger than the predetermined threshold value, it is determined whether the connected black pixel is dirty or a character stroke using the stain determination threshold value.It is characterized by that. Also,In the stain determination unit step, when the size of the connected black pixel is equal to or smaller than the first threshold value, the connected black pixel is determined as dirty, and the size of the connected black pixel is the second threshold value. If it is greater than the threshold value or less than the second threshold value but the variance of pixel values on the multi-valued image is smaller than the predetermined threshold value, the connected black pixels are treated as character strokes. And is characterized byIn the stain determination step, the connected black pixels are determined as stains based on the pixel values of the multi-valued image.
[0013]
DETAILED DESCRIPTION OF THE INVENTION
Next, embodiments of the present invention will be described in detail with reference to the drawings. Referring to FIG. 1, an embodiment of the present invention is an
[0014]
The
[0015]
The
[0016]
The preprocessing
[0017]
The density
[0018]
The
[0019]
Next, the overall operation of the present embodiment will be described in detail with reference to the flowcharts of FIGS. 2 to 4, 6 and 7 and FIG. 5 in addition to FIG. 1.
[0020]
Referring to FIG. 2, first, a character image to be read on a form is captured as a multi-valued image IMG by the
[0021]
Next, the
[0022]
Next, the binarization threshold
[0023]
The binarization of the multi-valued image IMG is performed as follows. If the pixel value of a pixel in the multi-valued image IMG is smaller than the binarization threshold BTH, the pixel value of the pixel on the binary image IMB corresponding to that pixel is set to “1”, that is, “black”, and the multi-valued image IMG If the pixel value of a certain pixel is equal to or greater than the binarization threshold BTH, the pixel value of the pixel on the binary image IMB corresponding to that pixel is set to “0”, that is, “white”.
[0024]
Next, the character
[0025]
As shown in FIG. 4, the character
[0026]
As a result of comparing the variance Vr with the threshold value BR_TH in step S221, if Vr <BR_TH does not hold, the variance Vr is compared with a predetermined threshold value KOSA_TH (step S222). As a result of comparing the variance Vr and the threshold value KOSA_TH in step S222, if Vr <KOSA_TH holds, the character density classification is determined to be “light” (step S224). As a result of comparing the variance Vr with the threshold value KOSA_TH in step S222, if Vr <KOSA_TH does not hold, the character density classification is determined to be 'deep' (step S225). Then, the character
[0027]
Next, the
[0028]
Next, the character density classification determined by the character
[0029]
As shown in FIG. 5, the stain determination threshold
[0030]
Next, the
[0031]
Next, the height H and width W of the connected black pixel BLK are compared with a predetermined threshold SIZE_S (step S32). The threshold SIZE_S is a threshold value for determining whether or not the connected black pixel BLK is regarded as minute noise from the width W and the height H of the connected black pixel BLK. If the width W and the height H are both equal to or smaller than the threshold SIZE_S, the connected black
[0032]
In step S32, if any of the width W and height H of the connected black pixel BLK is larger than the threshold value SIZE_S, then the width W and height H are compared with a predetermined threshold value SIZE_M. Further, it is checked whether or not the value of the variable KOSA is “1” (step S33). The threshold value SIZE_M is a threshold value for determining whether or not a certain connected black pixel is regarded as dirty from the width W and height H of the connected black pixel BLK.
[0033]
The threshold value SIZE_S is set to a value smaller than the threshold value SIZE_M. If either of the width W and the height H of the connected black pixel BLK is larger than the threshold value SIZE_M or the value of the variable KOSA is “0”, the process proceeds to step S37 and the connected detected in step S30. It is determined whether all black pixels have been selected. On the other hand, when the width W and the height H of the connected black pixel BLK are both equal to or smaller than the threshold SIZE_M and the value of the variable KOSA is “1” in step S33, the
[0034]
In this case, as shown in FIG. 7, the
[0035]
Next, one of the black pixels constituting the connected black pixel BLK is selected (step S341). Next, the pixel value BK_G of the pixel on the multi-valued image IMG corresponding to the black pixel selected in step S341 is obtained. That is, a multi-value pixel value before binarization is obtained for the selected black pixel (step S342). Next, the pixel value BK_G is compared with the dirt determination threshold value DTH (step S343). If BK_G <DTH holds as a result of the comparison in step S343, the value of variable TK_CNT is increased by 1 (step S344). As a result of the comparison in step S343, if BK_G <DTH does not hold, the process proceeds to step S345. Next, the value of the variable BK_CNT is incremented by 1 (step S345).
[0036]
Next, in step S341, it is determined whether all the constituent black pixels of the connected black pixel BLK have been selected (step S346). As a result of the determination in step S346, when it is determined that there is an unselected black pixel, the process returns to step S341, and after selecting one unselected black pixel, step S342 and subsequent steps are executed. As a result of the determination in step S346, when it is determined that there is no unselected black pixel, the value of the dirt evaluation value TK_RTO is calculated by equation (1) (step S347).
[0037]
TK_RTO = TK_CNT / BK_CNT (1) Next, the dirt evaluation value TK_RTO is compared with a preset dirt evaluation threshold value DTK_TH to determine whether or not TK_RTO <DTK_TH is satisfied (step S348). As a result of comparing the dirt evaluation value TK_RTO with the preset dirt evaluation threshold value DTK_TH in step S348, if TK_RTO <DTK_TH is satisfied, it is determined that the connected black pixel BLK is “dirt” (step S349). . If TK_RTO <DTK_TH does not hold as a result of the evaluation in step S348, it is determined that the connected black pixel BLK is a “character stroke” (step S34a). The
[0038]
Next, the
[0039]
In step S37, it is determined in step S31 whether or not all the connected black pixels on the binary image IMB have been selected. In step S35, if the determination result of the
[0040]
Next, the
[0041]
In the character reading apparatus described above, the character reading method shown in FIGS. 2 to 7 is realized. In other words, it is a method of reading handwritten characters described in a form, and determines a density classification that is a density classification of characters on a multi-valued image obtained by reading an image on a form, and is to be read in a multi-valued image. A character that determines whether a connected black pixel on a binary image obtained by binarizing a multi-valued image is a stain or a character stroke by calculating a stain detection threshold value for distinguishing between a character that is and a stain other than that character A reading method is realized. The above-mentioned stains are stains such as unerased portions that are generated when erased with an eraser, and the connected black pixels are determined as stains based on the pixel values of the multi-valued image.
[0042]
As described above, in the character reading device according to the present embodiment, when a character is erased with an eraser in a binary image obtained by binarizing a multi-valued image captured from the
[0043]
【Example】
Next, the operation of this embodiment will be described in detail using specific examples. Here, a case where the number “5” as shown in FIG. 8 is read will be described. Referring to FIG. 8, the reading target described in the form or the like remains when the
[0044]
Next, the
[0045]
Next, the character
[0046]
Therefore, since Vr <BR_TH does not hold, the process proceeds to step S222. Next, it is determined whether Vr <KOSA_TH is satisfied (step S222). KOSA_TH is a preset threshold value for determining whether the character density classification on the multi-valued image IMG is 'high' or 'light' based on the variance Vr. Here, KOSA_TH = 1.0 is set. It shall be. Therefore, since Vr <KOSA_TH does not hold, it is determined that the density classification of the characters shown in the multi-valued image IMG is “dark”.
[0047]
Next, the
[0048]
That is, since BTH = 12, the above-described discriminant analysis method is applied to the portion where the pixel values of the density histogram shown in FIG. Here, it is assumed that DTH = 10 is obtained. Next, the
[0049]
Next, the
[0050]
Next, it is determined whether or not both the width W and the height H are equal to or smaller than a preset threshold SIZE_S (step S32). Here, it is assumed that the threshold value SIZE_S = 5. In this case, since both the width W and the height H are larger than SIZE_S, it is next determined whether the width W and the height H are equal to or smaller than a preset threshold SIZE_M and the variable KOSA = 1. (Step S33). Here, it is assumed that the threshold SIZE_M = 10.
[0051]
In this case, since both the width W and the height H are larger than the threshold value SIZE_M, the process proceeds to step S37, and it is determined whether all connected black pixels have been selected. However, since the connected
[0052]
Next, the
[0053]
When obtaining the pixel value BK_G of the pixel corresponding to the selected black pixel, the
[0054]
Next, it is checked whether or not all black pixels have been selected (step S346). Here, assuming that there is still an unselected black pixel, the process returns to step S341, and one unselected black pixel is selected. Then, BK_G is obtained for the pixel value of the pixel on the multi-valued image IMG corresponding to the black pixel (step S342). Here, it is assumed that the pixel value BK_G = 12. Next, the pixel value BK_G is compared with the dirt determination threshold value DTH to determine whether BK_G <DTH is satisfied (step S343). However, since BK_G <DTH does not hold, step S344 is skipped and the process proceeds to step S345 where the value of variable BK_CNT is incremented by one.
[0055]
In step S346, it is determined whether all black pixels have been selected. In this manner, the process from step S341 to step S346 is repeated until all the black pixels constituting the connected
[0056]
AndFIG.In step S35, it is determined whether the determination result of the
[0057]
The size of the connected
[0058]
Next, the
[0059]
Next, in step S37, it is determined whether all connected black pixels have been selected. Since the connected
[0060]
Next, the
[0061]
Next, the
[0062]
In the embodiment described above, the functions from the preprocessing
[0063]
In other words, if a recording medium on which a program for realizing the processes of FIGS. 2 to 4, 6, and 7 described above is prepared and each part of FIG. Obviously, a read operation can be performed. As the
[0064]
If the computer is controlled by a program recorded on the same recording medium, it is obvious that the character reading operation can be performed as described above. As this recording medium, various recording media can be used in addition to a semiconductor memory and a magnetic disk device.
[0065]
【The invention's effect】
As described above, according to the present invention, it is determined by referring to the density information on the multi-valued image before binarization, whether it is dirty or a character stroke for a somewhat large connected black pixel on the binary image. As a result, it is possible to remove only the dirt without accidentally removing the character stroke, and to realize a stable character reader that is resistant to dirt such as unerased characters that occur when the characters once entered with the eraser are erased. There is an effect that can be done.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of an embodiment of a character reader according to the present invention.
FIG. 2 is a flowchart showing the operation of each unit in FIG.
FIG. 3 is a flowchart showing an operation of a
4 is a flowchart showing an operation of a character
FIG. 5 is a diagram illustrating an example of a density histogram generated by a density
6 is a flowchart showing the operation of the
7 is a flowchart showing an operation of a
FIG. 8 is a diagram illustrating an example of a multi-valued image IMG.
FIG. 9 is a diagram illustrating an example of a binary image IMB obtained by binarizing the multi-value image IMG.
FIG. 10 is a diagram illustrating a process of referring to a pixel value BK_G of a pixel on a multi-valued image IMG corresponding to the pixel from a connected black pixel BLK on the binary image IMB.
11 is a diagram illustrating an example of a binary image IMB after noise removal by a
FIG. 12 is a block diagram showing another embodiment of the character reading device according to the present invention.
[Explanation of symbols]
1 Image input device
2 storage devices
21 Image storage unit
22 Character recognition dictionary
3 Data processingapparatus
31 Pre-processing section
311 Binarization part
3111 Density histogram generator
3112 Binary threshold calculation unit
3113 Character density determination unit
3114 Dirt determination threshold value calculation unit
3115 Binary image generation unit
312 Noise removal unit
3121 Dirt determination unit
3122 Connected black pixel removal unit
32 Feature extraction unit
33 Character recognition part
4 Output device
5 recording media
100, 101 character component
102,103 Dirt component
110, 111, 112, 113 connected black pixels
Claims (9)
前記汚れ判別部は、前記連結黒画素のサイズが第1のしきい値より大で、前記第1のしきい値より大きい値の第2のしきい値以下であり、かつ前記多値画像上の画素値の分散が前記所定のしきい値より大である場合、前記汚れ判別しきい値を用いて前記連結黒画素が汚れか文字ストロークかを判別することを特徴とする文字読取り装置。A character reading device for reading a handwritten character described in a form, wherein a pixel value on the multi-valued image is a density class that is a density class for characters on the multi-valued image obtained by performing image reading on the form. A character density determination unit for comparing the dispersion of the image and a predetermined threshold value, and a stain determination threshold value for determining a character to be read in the multi-valued image and a stain other than the character. a dirt determination threshold value calculation unit that calculates, connected black pixels in the binary image obtained by binarizing the multivalued image and the stain determination unit for determining whether or dirty character strokes seen including,
The stain determination unit is configured such that the size of the connected black pixels is larger than a first threshold value and smaller than or equal to a second threshold value greater than the first threshold value, and on the multi-valued image. When the variance of the pixel values is larger than the predetermined threshold value , the character reading device determines whether the connected black pixel is dirty or a character stroke using the stain determination threshold value .
前記汚れ判別ステップにおいては、前記連結黒画素のサイズが第1のしきい値より大で、前記第1のしきい値より大きい値の第2のしきい値以下であり、かつ前記多値画像上の画素値の分散が前記所定のしきい値より大である場合、前記汚れ判別しきい値を用いて前記連結黒画素が汚れか文字ストロークかを判別することを特徴とする文字読取り方法。A character reading method for reading a handwritten character described in a form, wherein a density classification that is a density classification of a character on a multi-value image obtained by performing image reading on the form is a pixel value on the multi-value image. A character density determining step for comparing the variance of the image and a predetermined threshold value, and a stain determination threshold value for determining a character to be read in the multi-valued image and a stain other than the character. a dirt determination threshold value calculation step of calculating, see contains a stain determination step of connecting the black pixels on the binary image by binarizing the multi-valued image to determine whether dirt or character stroke,
In the stain determination step, the size of the connected black pixels is larger than a first threshold value and smaller than or equal to a second threshold value greater than the first threshold value, and the multi-value image A character reading method , wherein when the variance of the upper pixel value is larger than the predetermined threshold value, it is determined whether the connected black pixel is dirty or a character stroke by using the stain determination threshold value .
前記汚れ判別ステップにおいては、前記連結黒画素のサイズが第1のしきい値より大で、前記第1のしきい値より大きい値の第2のしきい値以下であり、かつ前記多値画像上の画素値の分散が前記所定のしきい値より大である場合、前記汚れ判別しきい値を用いて前記連結黒画素が汚れか文字ストロークかを判別することを特徴とする記録媒体。A recording medium which records a character reading program for reading a handwritten character written on a form by a computer, the program being used for characters on a multi-valued image obtained by performing image reading on the form on the computer. A character density determination step for determining a density classification, which is a density classification, by comparing a dispersion of pixel values on the multi-valued image and a predetermined threshold; and a character to be read in the multi-valued image; A stain determination threshold value calculating step for calculating a stain determination threshold value for determining a stain other than the character, and whether the connected black pixel on the binary image obtained by binarizing the multi-valued image is a stain or a character stroke only contains a stain determination step to determine whether,
In the stain determination step, the size of the connected black pixels is larger than a first threshold value and smaller than or equal to a second threshold value greater than the first threshold value, and the multi-value image When the variance of the upper pixel value is larger than the predetermined threshold value , the recording medium is characterized by determining whether the connected black pixel is dirty or a character stroke using the stain determination threshold value .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP36360399A JP3721034B2 (en) | 1999-12-22 | 1999-12-22 | Character reading device, reading method, and reading program recording medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP36360399A JP3721034B2 (en) | 1999-12-22 | 1999-12-22 | Character reading device, reading method, and reading program recording medium |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2001175809A JP2001175809A (en) | 2001-06-29 |
JP3721034B2 true JP3721034B2 (en) | 2005-11-30 |
Family
ID=18479724
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP36360399A Expired - Fee Related JP3721034B2 (en) | 1999-12-22 | 1999-12-22 | Character reading device, reading method, and reading program recording medium |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3721034B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4112968B2 (en) * | 2002-12-26 | 2008-07-02 | 富士通株式会社 | Video text processing device |
-
1999
- 1999-12-22 JP JP36360399A patent/JP3721034B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2001175809A (en) | 2001-06-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3904840B2 (en) | Ruled line extraction device for extracting ruled lines from multi-valued images | |
US5784500A (en) | Image binarization apparatus and method of it | |
US9158986B2 (en) | Character segmentation device and character segmentation method | |
KR100920764B1 (en) | Apparatus and process for two-stage decoding of high-density optical symbols | |
CA2789813A1 (en) | Document page segmentation in optical character recognition | |
IL151545A (en) | Method for image binarization | |
JP2002298085A (en) | Character recognition device, character recognition method, and record medium | |
US7720281B2 (en) | Visual characteristics-based news anchorperson segment detection method | |
CN113688838B (en) | Red handwriting extraction method and system, readable storage medium and computer equipment | |
JP2000184202A (en) | Image processing system for removing pattern arranged in vertical direction on image generated by scanning | |
Rebelo et al. | Staff line detection and removal in the grayscale domain | |
US9076225B2 (en) | Image processing device, an image processing method and a program to be used to implement the image processing | |
JP2001043313A (en) | Character segmenting method | |
JP3721034B2 (en) | Character reading device, reading method, and reading program recording medium | |
JPH11213090A (en) | Character / graphic / background area identification method and apparatus and recording medium recording the method | |
JP2005184787A (en) | Image processing method and image processing apparatus | |
JP2871590B2 (en) | Image extraction method | |
JP2001291056A (en) | Document image recognition device and recording medium | |
JP3095437B2 (en) | Character line detection cutout device and character reading device | |
JP3871876B2 (en) | Binarization apparatus, binarization method, and computer-readable recording medium recording a program for causing computer to execute the method | |
O'Gorman | Experimental comparisons of binarization and multi-thresholding methods on document images | |
JP2894111B2 (en) | Comprehensive judgment method of recognition result in optical type character recognition device | |
O'Gorman | Basic techniques and symbol-level recognition—An overview | |
Radha et al. | Threshold based segmentation using median filter for sign language recognition system | |
JP2000331118A (en) | Image processing device and recording medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20041224 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20050405 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20050606 |
|
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: 20050823 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20050909 |
|
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: 20080916 Year of fee payment: 3 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080916 Year of fee payment: 3 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |