JP4013060B2 - Image correction method and image correction apparatus - Google Patents

Image correction method and image correction apparatus Download PDF

Info

Publication number
JP4013060B2
JP4013060B2 JP2003012282A JP2003012282A JP4013060B2 JP 4013060 B2 JP4013060 B2 JP 4013060B2 JP 2003012282 A JP2003012282 A JP 2003012282A JP 2003012282 A JP2003012282 A JP 2003012282A JP 4013060 B2 JP4013060 B2 JP 4013060B2
Authority
JP
Japan
Prior art keywords
point
information
image
ideal
distortion
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
Application number
JP2003012282A
Other languages
Japanese (ja)
Other versions
JP2004228759A (en
Inventor
昌並 沖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2003012282A priority Critical patent/JP4013060B2/en
Publication of JP2004228759A publication Critical patent/JP2004228759A/en
Application granted granted Critical
Publication of JP4013060B2 publication Critical patent/JP4013060B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Facsimile Image Signal Circuits (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、紙面に罫線や文字が記入された帳票の画像データを読み取る画像補正装置及び画像補正方法に関し、特に、折れ曲がった帳票や反った帳票を読み取ったときに生じる歪みを含む画像を補正する画像補正装置及び画像補正方法に関する。
【0002】
【従来の技術】
近年、卓上に置かれた帳票を該帳票から離れた位置に該帳票に対向するように設置された非接触型スキャナにより画像データを撮影し、文字認識やデータとして保存することが多く行われるようになったが、帳票自体が変形(折れ曲り、反りなど)している場合には、帳票をできるだけ平面から浮かないようにするために読み取り時に手で押さえたりすると、撮影領域に指が入る可能性があるため、帳票を平面から浮かないようにすることができず、読み取られた画像に複雑な歪みが生じるという問題がある。
【0003】
上記のように折れ曲がった帳票や反った帳票など空間的に曲がった文書を非接触型スキャナによって読み取ったときに生ずる画像の歪みを補正する従来の技術としては、例えば、読み取ったブック原稿(製本された原稿)のエッジ位置と原稿面の高さを検出してブック原稿の形状を推定し、推定した形状面に基づいて画像を変倍して歪みを補正する技術が開示されている(例えば、特許文献1参照。)。また、焦点位置などの読み取り条件を変更して2枚の画像を読み取ることで、それら画像間から作成される分散画像より変位を解析し、その情報を使ってカメラから帳票までの距離を算出することにより、帳票の3次元形状を復元し、さらにこれを2次元平面に展開して歪みを補正する技術が開示されている(例えば、特許文献2参照。)。
【0004】
また、ある領域に含まれる全ての格子点情報を用いて格子点情報の実格子点が理想格子点に変換されるような変換行列Hのパラメータm1〜m8の算出方法が開示されている(例えば、非特許文献1参照。)。
【0005】
【特許文献1】
特開平6−164852号公報
【特許文献2】
特開2000−115510号公報
【非特許文献1】
長尾著、「画像認識論」、近代科学社、p.24−27
【0006】
【発明が解決しようとする課題】
しかし、上記特許文献1の技術内容によれば、原稿面の高さを測定する手段を必要とするため(3次元形状を復元)、専用の装置によらないと画像の歪み補正が行えないといった問題がある。また、処理対象が製本された原稿であり、それに特化した技術であるため、1枚〜数枚重ねの文書への適用は難しい。
【0007】
また上記特許文献2の技術内容によれば、焦点位置などの読み取り条件を変更して2枚以上の画像を読み取り、それら画像間から作成される分散画像より画像間の偏差の大きい部分を特徴点(この特徴点を帳票折れや帳票浮きなどによる端部)として抽出し、この特徴点における距離を算出することにより3次元形状の復元を行っている。しかし、帳票折れや帳票浮きなどによる変形が被写界深度内に収まるような場合は複数の画像の焦点が合ってしまい、画像間の偏差が小さくなるなり、帳票折れや帳票浮きなどによる端部が特徴点として抽出されない場合があるため正確な3次元形状の復元が行えず、画像の歪み補正ができないという問題がある。
【0008】
本発明の目的は、1枚〜数枚重ねの帳票などの文書に対して3次元形状を復元すること無しに、撮影された帳票イメージの形状から空間的に曲がった文書を撮影したときに生ずる画像の歪みを正確に補正し、文字認識において切り出し位置のずれが生じない良好な画像を得ることのできる画像補正装置及び画像補正方法を提供することにある。
【0009】
【課題を解決するための手段】
本発明の画像補正装置は、卓上に置かれて折れ曲がったり反ったりしている空間的な曲がりを有する帳票を帳票から離れた位置に帳票に対向するように設置された非接触型スキャナで読み取った画像に含まれる歪みを補正する画像補正装置であって、処理対象の帳票を帳票イメージとして入力するための帳票イメージ入力部と、入力された帳票イメージを保持する画像保存メモリと、帳票の寸法をあらかじめ保持した帳票情報保存メモリと、帳票上の正確な罫線(理想罫線)座標をあらかじめ保持した理想罫線保存メモリと、画像保存メモリ内の帳票イメージから帳票の4隅の点であるコーナー点(実コーナー点)座標を検出するとともに、帳票情報保存メモリ内の前記帳票の寸法からもコーナー点(理想コーナー点)座標を算出するコーナー点情報生成部と、帳票イメージから実コーナー点座標を手掛りとして複数のエッジ点(実エッジ点)座標を検出するとともに、実エッジ点に対応するエッジ点(理想エッジ点)座標を理想コーナー点座標から算出しエッジ点情報を生成するエッジ点情報生成部と、帳票イメージから罫線(実罫線)座標を検出するとともに、罫線を理想罫線保存メモリに保持された罫線(理想罫線)座標と対応付ける罫線情報生成部と、実コーナー点と実エッジ点と実罫線とを用いて算出される格子点(実格子点)座標と理想コーナー点と理想エッジ点と理想罫線とを用いて算出される格子点(理想格子点)座標が対となった格子点情報を生成する格子点情報生成部と、エッジ点情報を用いて歪みの状態を判定する歪みパターン判定部と、格子点情報と歪みの状態の判定の結果とを用いて変換行列を生成し、画像に含まれる歪みを補正するイメージ補正部とを備えている。
【0010】
従って、本発明の画像補正装置により歪みのない補正画像を生成する。これにより、文字読み取り装置において、撮影された画像が帳票浮きや帳票折れのために歪みが生じ読み取りが難しかった場合でも読み取りが可能になる。
【0011】
また、歪みパターン判定部は、画像保存メモリに格納されている帳票イメージとエッジ点情報生成部によって生成されたエッジ点情報とを用いて曲率を算出し、歪みパターン情報を生成し、歪みパターン情報は、「帳票歪み無し」と、「帳票浮きによる歪み有り」と、「帳票折れによる歪み有り」との3つのパターンを表すフラグと曲率が最大となるエッジ点情報とから構成され、歪みパターン情報は、イメージ補正部に出力され、イメージ補正部は、歪みパターン判定部の出力を受けて、歪み補正を行うか否かを決定してもよい。
【0012】
従って、歪みの有無を検証し、補正する必要があるときのみ画像補正を行うため、運用時の処理時間の軽減が可能となる。
【0013】
また、イメージ補正部は、格子点情報を複数の領域に分割し、歪みパターン情報のフラグが「帳票折れによる歪み有り」の場合、歪みパターン情報に登録されているエッジ点情報に対応する格子点情報が、領域と領域との境界となる格子点情報(境界格子点情報)になるように変更し、変更方法は、境界格子点情報にしたい格子点情報と今ある境界格子点情報の位置をそれぞれ比較し、最も近い今ある境界格子点情報を算出することにより変更してもよい。
【0014】
従って、格子点情報の領域分割において境界位置を変更することにより、歪みが大きい場合でも精度良い補正が可能となる。
【0015】
本発明の画像補正方法は、卓上に置かれて折れ曲がったり反ったりしている空間的な曲がりを有する帳票を帳票から離れた位置に帳票に対向するように設置された非接触型スキャナで読み取った画像に含まれる歪みを補正する画像補正方法であって、帳票イメージ入力部により、処理対象の帳票を帳票イメージとして入力し、入力された帳票イメージを画像保存メモリに保持し、帳票の寸法を帳票情報保存メモリにあらかじめ保持し、帳票上の正確な罫線(理想罫線)座標を理想罫線保存メモリにあらかじめ保持し、コーナー点情報生成部により、画像保存メモリ内の帳票イメージから帳票の4隅の点であるコーナー点(実コーナー点)座標を検出するとともに、帳票情報保存メモリ内の帳票の寸法からもコーナー点(理想コーナー点)座標を算出し、エッジ点情報生成部により、帳票イメージから実コーナー点座標を手掛りとして複数のエッジ点(実エッジ点)座標を検出するとともに、実エッジ点に対応するエッジ点(理想エッジ点)座標を理想コーナー点座標から算出しエッジ点情報を生成し、罫線情報生成部により、帳票イメージから罫線(実罫線)座標を検出するとともに、罫線を理想罫線保存メモリに保持された罫線(理想罫線)座標と対応付け、格子点情報生成部により、実コーナー点と実エッジ点と実罫線とを用いて算出される格子点(実格子点)座標と理想コーナー点と理想エッジ点と理想罫線とを用いて算出される格子点(理想格子点)座標が対となった格子点情報を生成し、歪みパターン判定部により、エッジ点情報を用いて歪みの状態を判定し、イメージ補正部により、格子点情報と歪みの状態の判定の結果とを用いて変換行列を生成し、画像に含まれる歪みを補正する。
【0016】
また、歪みパターン判定部は、画像保存メモリに格納されている帳票イメージとエッジ点情報生成部によって生成されたエッジ点情報とを用いて曲率を算出し、歪みパターン情報を生成し、歪みパターン情報は、「帳票歪み無し」と、「帳票浮きによる歪み有り」と、「帳票折れによる歪み有り」との3つのパターンを表すフラグと曲率が最大となるエッジ点情報とから構成され、歪みパターン情報は、イメージ補正部に出力され、イメージ補正部は、歪みパターン判定部の出力を受けて、歪み補正を行うか否かを決定してもよい。
【0017】
また、イメージ補正部は、格子点情報を複数の領域に分割し、歪みパターン情報のフラグが「帳票折れによる歪み有り」の場合、歪みパターン情報に登録されているエッジ点情報に対応する格子点情報が、領域と領域との境界となる格子点情報(境界格子点情報)になるように変更し、変更方法は、境界格子点情報にしたい格子点情報と今ある境界格子点情報の位置をそれぞれ比較し、最も近い今ある境界格子点情報を算出することにより変更してもよい。
【0018】
【発明の実施の形態】
(発明の第1の実施の形態)
次に、本発明の第1の実施の形態について図1を参照して説明する。本実施の形態は、非接触型スキャナ等の帳票イメージ入力部101と、帳票イメージ入力部101で得られた帳票を受け取って格納する画像保存メモリ107と、あらかじめ帳票登録時に測定していた帳票の幅と高さ(帳票情報)が格納されている帳票情報保存メモリ108と、あらかじめ帳票登録時に測定していた罫線(理想罫線)の始点・終点座標が格納されている理想罫線保存メモリ109と、画像保存メモリ107に格納されている帳票イメージ内から帳票の左上、右上、左下、右下の4つのコーナー点(実コーナー点)座標を抽出し、それぞれの実コーナー点に対応する本来存在すべき理想的なコーナー点(理想コーナー点)座標を帳票情報保存メモリ108に格納されている帳票情報から算出し、実コーナー点と理想コーナー点が対となったコーナー点情報を生成するコーナー点情報生成部102と、画像保存メモリ107に格納されている帳票イメージ内から前記実コーナー点を手掛りとして複数のエッジ点(実エッジ点)座標を抽出し、それぞれの実エッジ点に対応する本来存在すべき理想的なエッジ点(理想エッジ点)座標を前記理想コーナー点から算出し、実エッジ点と理想エッジ点が対となったエッジ点情報を生成するエッジ点情報生成部103と、理想罫線保存メモリ109に格納されている理想罫線の始点・終点座標を用いて画像保存メモリ107に格納されている帳票イメージ内から罫線(実罫線)の始点・終点を抽出し、実罫線と理想罫線が対となった罫線情報を生成する罫線情報生成部104と、前記実コーナー点と前記実エッジ点と前記実罫線を用いて格子点(実格子点)座標を算出し、ぞれぞれの実格子点に対応する本来存在すべき理想的な格子点(理想格子点)座標を前記理想コーナー点と前記理想エッジ点と前記理想罫線を用いて算出し、実格子点と理想格子点が対となった格子点情報を生成する格子点情報生成部105と、前記格子点情報を用いて部分的に変換行列を算出し、その変換行列を用いて画像の歪みを補正するイメージ補正部106から構成される。
【0019】
以下に図1における各構成要素の機能について図1と図11を用いて詳細に説明する。
【0020】
帳票イメージ入力部101は、処理対象となる帳票の画像を該帳票から離れた位置に該帳票に対向するように設置された非接触型スキャナを用いて帳票イメージが入力される。入力された帳票イメージは画像保存メモリ107に出力(格納)される。なお、撮影条件として帳票は黒色の台の上に置き、帳票イメージの背景が紙面中の背景輝度より低くなるようにする。
【0021】
画像保存メモリ107は、帳票イメージ入力部101で入力された帳票イメージが格納される。帳票イメージの形式は、256階調の多値イメージであり、紙面の白地部分(輝度が高い部分)の値は大きいとものする。帳票イメージはコーナー点情報生成部102,エッジ点情報生成部103,罫線抽出部104,イメージ補正部106へ各々入力される。
【0022】
帳票情報保存メモリ108には、あらかじめ帳票登録時に測定しておいた帳票の正確な幅と高さ情報(帳票情報)が格納されている。この帳票情報はコーナー点情報生成部102において帳票イメージから抽出される歪みを含んだコーナー点(実コーナー点)座標に対応する本来存在すべき歪みの無い場合の理想的なコーナー点(理想コーナー点)座標を生成するために用いられる。
【0023】
理想罫線保存メモリ109には、あらかじめ帳票登録時に測定しておいた歪みの無い状態の帳票の正確な罫線(理想罫線)の始点座標と終点座標が図11の1103に示す書式で格納されている。この理想罫線は罫線情報生成部103で用いられる。
【0024】
コーナー点情報生成部102は、画像保存メモリ107に格納されている帳票イメージと帳票情報保存メモリ108に格納されている帳票情報を用いて前記コーナー点情報を生成する。なお、コーナー点情報は図11の1101の書式で生成される。生成されたコーナー点情報はエッジ点情報生成部103と格子点情報生成部105に出力される。
【0025】
エッジ点情報生成部103は、画像保存メモリ107に格納されている帳票イメージとコーナー点情報生成部102で生成されたコーナー点情報を用いて前記エッジ点情報を生成する。なお、エッジ点情報は図11の1102の書式で生成される。生成されたエッジ点情報は格子点情報生成部105に出力される。
【0026】
罫線情報生成部104は、画像保存メモリ107に格納されている帳票イメージと理想罫線保存メモリ109に格納されている理想罫線を用いて前記罫線情報を生成する。なお、罫線情報は図11の1103の書式で生成される。生成された罫線情報は格子点情報生成部105に出力される。
【0027】
格子点情報生成部105は、コーナー点情報生成部102で生成されたコーナー点情報とエッジ点情報生成部103で生成されたエッジ点情報と罫線情報生成部104で生成された罫線情報を用いて前記格子点情報を生成する。なお、格子点情報は図11の1104の書式で生成される。生成された格子点情報はイメージ補正部106に出力される。
【0028】
イメージ補正部106は、画像保存メモリ107に格納されている帳票イメージと格子点情報生成部105で生成された格子点情報を用いて歪みを補正した画像を出力する。
【0029】
次に、本発明の画像補正装置の動作について図1〜図12、図15〜図17を用いて順を追って説明する。
【0030】
まず、帳票イメージ入力部101では、帳票イメージを入力する(ステップ201)。次に、コーナー点情報生成部102では、画像保存メモリ107に格納されている帳票イメージ内から抽出される左上、右上、左下、右下の実コーナー点(図3の301a〜304a)と帳票情報保存メモリ108に格納されている帳票情報から算出されるそれぞれの実コーナー点に対応した理想コーナー点(図3の301b〜304b)が対となった4つのコーナー点情報を生成する。以下にコーナー点情報生成部102の動作を図4と図5のフローチャートを用いて詳細に説明する。
【0031】
まず、帳票イメージからの左上実コーナー点の抽出を行う(ステップ501)。抽出方法は、図4の(a)に示す番号の順に探索を行う。探索の結果、最初に濃度T(約50)より大きい濃度値を持つ画素が図4の番号39〜43のようにL(約5)以上連続して検出された場合、番号39の座標を(x39,y39)とし、番号43の座標を(x43,y43)とすると、左上実コーナー点は(x43、y39)となる(図4の番号13)。なお、読み取る帳票の傾きは0°〜10°程度とする。以降同様の抽出方法を適用し、図4の(b)に示す番号の順に探索して右上実コーナー点を抽出(ステップ502),図4の(c)に示す番号の順に探索して左下実コーナー点を抽出(ステップ503)、図4の(d)に示す番号の順に探索して右下実コーナー点を抽出(ステップ504)する。
【0032】
次に、抽出された実コーナー点のそれぞれに対応する理想コーナー点を帳票情報保存メモリ108の帳票情報を用いて生成する。帳票情報の帳票幅をW,帳票高さをHとすると理想コーナー点(x,y)は、左上理想コーナー点(0,0)、右上理想コーナー点(W,0)、左下理想コーナー点(0,H)、右下理想コーナー点(W,H)となる。そして、これらに平行移動成分として301aの座標を付加する。すなわち、左上実コーナ点と左上理想コーナー点を同じ値にする。
【0033】
次に、エッジ点情報生成部103では、画像保存メモリ107に格納されている帳票イメージ内から前記実コーナー点を用いて抽出される実エッジ点(図3の305a〜316a)と前記理想コーナー点座標から算出されるそれぞれの実エッジ点に対応した理想エッジ点(図3の305b〜316b)が対となったエッジ点情報を生成する。以下にエッジ点情報生成部の動作を図3、図7と図6のフローチャートを用いて詳細に説明する。
【0034】
まず、帳票イメージから左上実コーナー点と右上実コーナー点を用いて、上端実エッジ点(図3の305a〜307a)の抽出を行う(ステップ601)。抽出方法は、まず図7のように左上実コーナー点と右上実コーナー点を結ぶ線分をN(A4帳票の場合で約128)個に等分割する。図7では説明の簡略化のためN=4として等分割している。そして、図7の点701〜703のそれぞれの位置を中心として画像上を下から上にスキャンして濃度T(約50)以下の画素を探索(Y方向に探索)することにより上端実エッジ点を検出する。次に、帳票イメージから左下実コーナー点と右下実コーナー点を用いて、下端実エッジ点(図3の314a〜316a)の抽出を行う(ステップ602)。抽出方法は上端実エッジ点の抽出(ステップ601)と同様である。次に、帳票イメージから左上実コーナー点と左下実コーナー点を用いて、左端実エッジ点(図3の308a〜310a)の抽出を行う(ステップ603)。抽出方法は、まず図8のように左上実コーナー点と左下実コーナー点を結ぶ線分をM(A4帳票の場合で約128)個に等分割する。図8では説明の簡略化のためM=4として等分割している。そして、図8の点801〜803のそれぞれの位置を中心として画像上を左から右にスキャンして濃度T(約50)以下の画素を探索(X方向に探索)することにより左端実エッジ点を検出する。次に、帳票イメージから右上実コーナー点と右下実コーナー点を用いて、右端実エッジ点(図3の311a〜313a)の抽出を行う(ステップ604)。抽出方法は左端実エッジ抽出(ステップ603)と同様である。
【0035】
次に、抽出されたそれぞれの実エッジ点に対応する理想エッジ点を理想コーナー点を用いて生成する(ステップ605)。上端理想エッジ点(図3の305b〜307b)は左上理想コーナー点と右上理想コーナー点を結ぶ線分をN個に等分割する点を求めることにより生成される。下端理想エッジ点(図3の314b〜316b)は左下理想コーナー点と右下理想コーナー点を結ぶ線分をN個に等分割する点を求めることにより生成される。左端理想エッジ点(図3の308b〜310b)は左上理想コーナー点と左下理想コーナー点を結ぶ線分をM個に等分割する点を求めることにより生成される。右端理想エッジ点(図3の311b〜313b)は右上理想コーナー点と右下理想コーナー点を結ぶ線分をM個に等分割する点を求めることにより生成される。これによりエッジ点情報生成部103では“2(M-1)+2(N-1)”個のエッジ点情報が生成される。
【0036】
次に、罫線情報生成部104では、前記帳票イメージ内から抽出される実罫線(図3のH1a〜H3a,V1a〜V3a)とあらかじめ理想罫線保存メモリ109に格納されているそれぞれの実罫線に対応した理想罫線(図3のH1b〜H3b,V1b〜V3b)が対となった罫線情報を生成する。以下に罫線情報生成部の動作を図15と図9のフローチャートを用いて詳細に説明する。まず、理想罫線保存メモリ109に格納されている理想罫線位置を用いて前記帳票イメージ内から実罫線が存在する矩形領域(罫線存在領域)を推定する(ステップ901)。次に罫線存在領域に対して二値化処理を行い、図15(a)の1501に示す二値画像を生成する(ステップ902)。次に図15(a)のように生成された二値画像から実罫線の方向に対して垂直方向に探索し、図15(b)の黒ランの長さ(黒ラン長)に関するヒストグラムを生成する。そして、図15(b)の1502に示すこのヒストグラムの最頻値を標準罫線幅とする(ステップ903)。 次に、罫線存在領域内の黒画素部分のうち標準罫線幅に等しい黒ラン長の黒画素部分をHough空間に投票する(ステップ904)。ここで使用するHough空間は直線の式
【0037】
【数1】

Figure 0004013060
【0038】
から変換される(ρ,θ)平面である。次にHough空間内の最大投票数の位置(ρmax,θmax)を求める(ステップ905)。そして、(ρmax,θmax)と数式1を用いて実罫線の始点と終点を求める(ステップ906)。横方向の実罫線(横実罫線)の場合は、求める実罫線の始点を(sx1,sy1)、終点を(ex1,ey1)とし、対応する横方向の理想罫線(横理想罫線)の始点を(sx2,sy2)、終点を(ex2,ey2)とすると、数式2より求める。すなわち、実罫線の始点・終点のX座標は理想罫線の始点・終点のX座標を同じにし、実罫線の始点・終点のY座標のみ求める。
【0039】
【数2】
Figure 0004013060
【0040】
縦方向の実罫線(縦実罫線)の場合は、求める実罫線の始点を(sx3,sy3)、終点を(ex3,ey3)とし、対応する縦方向の理想罫線(縦理想罫線)の始点を(sx4,sy4)、終点を(ex4,ey4)とすると、数式3より求める。すなわち、実罫線の始点・終点のY座標は理想罫線の始点・終点のY座標を同じにし、実罫線の始点・終点のX座標のみ求める。
【0041】
【数3】
Figure 0004013060
【0042】
これにより、実罫線の始点と終点が抽出され、実罫線と理想罫線が対となった罫線情報が生成される。
【0043】
次に、格子点生成部105では、前記実コーナー点と前記実エッジ点と前記実罫線を用いて算出される実格子点(図3の317a〜341a)と前記理想コーナー点と前記理想エッジ点と前記理想罫線を用いて算出されるそれぞれの実格子点に対応した理想格子点(図3の317b〜341b)が対となった格子点情報を生成する。以下に格子点情報生成部の動作を図10のフローチャートを用いて詳細に説明する。まず、コーナー点情報とエッジ点情報を用いて格子点情報を生成する(ステップ1001)。
【0044】
格子点情報は図11の1104に示す(M+1)×(N+1)の行列の形式で生成される。ここで、格子点情報の表記を簡略化するためにs行t列の格子点情報を [s,t]と表記する。ここで、0<s<Mであり、0<t<Nである。[s,t]には実格子点の座標(X,Y)と理想格子点の座標(X,Y)が格納される。
【0045】
最初にコーナー点情報とエッジ点情報が行列に格納される。格納方法は、実コーナー点の場合は実コーナー点の座標(X,Y)が実格子点の座標(X,Y)に、理想コーナー点の座標(X,Y)が理想格子点の座標(X,Y)にそれぞれ格納される。すなわち、左上コーナー点情報が[0,0]に、右上コーナー点情報が[0,N]に、左下コーナー点情報が[M,0]に、右下コーナー点情報が[M,N]に格納される。また、エッジ点情報の場合は実エッジ点の座標(X,Y)が実格子点の座標(X,Y)に、理想エッジ点の座標(X,Y)が理想格子点の座標(X,Y)にそれぞれ格納される。すなわち、上端エッジ情報が[0,1]〜[0,N-1]に、下端エッジ情報が[M,1]〜[M,N-1]に、左端エッジ情報が[1,0]〜[M-1,0]に、右端エッジ情報が[1,N]〜[M-1,N]に図11の1102の番号順に格納される。
【0046】
次に上記以外の格子点情報を生成する。 [s,0]の実格子点のX,Y座標をそれぞれx1,y1とし、 [s,N]の実格子点のX,Y座標をそれぞれx2,y2とすると、 [s,t]の実格子点のX座標は数式4より求める。
【0047】
【数4】
Figure 0004013060
【0048】
また、 [0,t]の実格子点のX,Y座標をそれぞれx3,y3とし、 [M,t]の実格子点のX,Y座標をそれぞれx4,y4とすると、 [s,t]の実格子点のY座標は数式5より求める。
【0049】
【数5】
Figure 0004013060
【0050】
理想格子点についても実格子点と同様の方法で求めることができる。これにより、全ての格子点情報が生成される。
【0051】
次に、以上のように生成された格子点情報を前記罫線情報を用いて精度を向上させる方法について説明する。最初に罫線情報の実罫線を用いて格子点情報の実格子点の位置を調整する。まず、横実罫線による実格子点の位置を調整する。i番目の横実罫線hiの中点を求め、その中点と最も近い [Si,Ti]を実格子点を用いて求める(ステップ1002)。次に、 [Si-1,Ti]の実格子点と [Si+1,Ti]の実格子点を結ぶ線分と横実罫線hiとの交点dを求める(ステップ1003)。次に [Si,Ti]の実格子点と交点dとのY方向の変化量を求める(ステップ1004)。そして、求めたY方向の変化量をSi行全ての実格子点のY座標に加算する(ステップ1005)。全ての横実罫線が終了していなければステップ1002からi+1番目の横実罫線に対して同様の処理を行う(ステップ1006)。全ての横実罫線が終了すると、ステップ1002で求めたSi行とSi+1行の間に位置する実格子点のY座標について位置を調整する(ステップ1007)。調整方法は、[Si,t](0≦t≦N)の実格子点のX,Y座標をそれぞれx1,y1とし、 [Si+1,t]の実格子点のX,Y座標をそれぞれx2,y2すると、 [s,t]の実格子点のY座標は数式6より求める。
【0052】
【数6】
Figure 0004013060
【0053】
横実罫線による実格子点の位置調整が終了すると、次に縦実罫線による実格子点の位置を調整する。j番目の縦実罫線vjの中点を求め、その中点と最も近い[Sj,Tj]を実格子点を用いて求める(ステップ1008)。次に、 [Sj,Tj-1]の実格子点と[Sj,Tj+1]の実格子点を結ぶ線分と縦実罫線viとの交点dを求める(ステップ1009)。次に[Sj,Tj]の実格子点と交点dとのX方向の変化量を求める(ステップ1010)。そして、求めたX方向の変化量をTj列全ての実格子点のX座標に加算する(ステップ1011)。全ての縦実罫線が終了していなければステップ1008からj+1番目の縦実罫線に対して同様の処理を行う(ステップ1012)。全ての縦実罫線が終了すると、ステップ1008で求めたTj列とTj+1列の間に位置する実格子点のX座標について位置を調整する(ステップ1013)。調整方法は、[s,Ti ](0≦s≦M)の実格子点のX,Y座標をそれぞれx3,y3とし、 [s,Ti+1]の実格子点のX,Y座標をそれぞれx4,y4すると、 [s,t]の実格子点のX座標は数式7より求める。
【0054】
【数7】
Figure 0004013060
【0055】
これにより、罫線情報の実罫線を用いて格子点情報の実格子点の位置が調整される。次に罫線情報の理想罫線を用いて格子点情報の理想格子点の位置を調整する。調整方法は、上記の実格子点の調整方法と同様の処理を行うことにより調整することができる。
【0056】
以上の処理を実行して格子点情報の実格子点と理想格子点の位置を調整することにより、精度を向上させた格子点情報が生成される。
【0057】
次に、イメージ補正部106では、格子点情報生成部105で生成された格子点情報を用いて画像の補正を行う(ステップ206)。以下にイメージ補正部の動作を図12のフローチャートを用いて詳細に説明する。
【0058】
まず、格子点情報を複数の領域に分割する(ステップ1201)。分割方法は図16に示すように行列の形式で生成された格子点情報について行をK1(約16)個に分割し、列をK2(約16)個に分割する。すなわち、K1×K2個の領域に分割する。なお、領域内に含まれる格子点情報の個数は後述する変換行列を算出するために8個以上の格子点情報が含まれる必要があるが、各領域の格子点情報の個数が一定である必要はない。また、領域と領域との境界となる格子点情報(境界格子点情報)は、両方の領域に含まれるようにする。次に、ある領域に含まれる全ての格子点情報を用いて格子点情報の実格子点が理想格子点に変換されるような数式8に示す変換行列Hを算出する(ステップ1202)。
【0059】
【数8】
Figure 0004013060
【0060】
以下に8個のパラメータm1〜m8の算出方法を示す。実格子点の座標を(xi,yi)、理想格子点の座標を(ui,vi)とし、その関係を数式9の線形の式で与えられるとする。ここで数式9のRは格子点情報の個数であり、(M+1)×(N+1)個である。
【0061】
【数9】
Figure 0004013060
【0062】
全ての格子点情報を数式9に代入すると数式10となる。
【0063】
【数10】
Figure 0004013060
【0064】
数式10のそれぞれについて最小2乗法を用いて求めることによりm1〜m8を算出できる(非特許文献1より)。そして、得られた変換行列を用いて数式11により部分画像の補正(変換)を行う(ステップ1203)。ここで、(x’,y’)は歪みを含んだ(補正前)座標系の点であり、(x,y)が歪みの無い(補正後)座標系の点である。
【0065】
【数11】
Figure 0004013060
【0066】
なお、境界格子点情報の理想格子点の座標に位置する画素については関係するそれぞれの領域の変換行列から求まる濃度値の平均とする。全ての領域が完了していない場合、ステップ1202から他の領域に対して同様の処理を行い、全ての領域が完了した場合は処理を終了する。これにより、帳票イメージの歪みが補正される。
【0067】
(発明の第2の実施の形態)
図13は本発明の第2の実施の形態における画像補正装置の構成を示すブロック図である。図14はこの画像補正装置における動作を示すフローチャートである。上記第1の実施の形態との装置構成における相違点は、図13において、歪みパターン判定部110が追加されている点である。また、イメージ補正部106が歪みパターン判定部110の出力を受けて、歪み補正を行うか否かを決定する点である。
【0068】
歪みパターン判定部110は画像保存メモリ107に格納されている帳票イメージとエッジ点情報生成部103によって生成されたエッジ点情報を用いて曲率を算出し、歪みパターン情報を生成する。歪みパターン情報は、「帳票歪み無し」,「帳票浮きによる歪み有り」,「帳票折れによる歪み有り」,の3つのパターンを表すフラグと曲率が最大となるエッジ点情報から構成されている。なお、歪みパターン情報は、イメージ補正部106に出力される。
【0069】
次に、本発明の第2の実施の形態の動作を説明する。動作はステップ201〜205まで第1の実施の形態と同じである。以下では動作の相違点についてのみ説明する。図14において、ステップ207とステップ208が新たに追加されたステップであり、ステップ206aが上記ステップ206に歪みパターン情報を利用するように変更したステップである。
【0070】
ステップ207では、まずエッジ点情報生成部103によって生成されたエッジ点情報を用いて曲率を算出する。曲率Cの算出方法は、曲率を求めようとする実エッジ点の左右(上下)にそれぞれk(約5)個のエッジ点を取り、数式12より求める。
【0071】
【数12】
Figure 0004013060
【0072】
これを全ての実エッジ点に対して行い、それらの曲率の最大値を算出する。なお、左右(上下)にk個のエッジ点が取れないエッジ点についてはC=0とする。曲率の最大値がT1(約2.0)より小さければ歪みパターンフラグを1(帳票歪み無し)にする。曲率の最大値がT1より大きくT2(約10.0)より小さければ歪みパターンフラグを2(帳票浮きによる歪み)とする。曲率の最大値がT2より大きければフラグ3(帳票折れによる歪み)とする。また、曲率の最大値となったエッジ点情報も歪みパターン情報に登録する。以上の処理は歪みパターン判定部110で実行される。
【0073】
ステップ208では、歪みパターン情報のフラグが1であれば、補正処理を行わずに帳票イメージをそのまま出力する。歪みパターン情報のフラグが1以外の場合はステップ204以降の処理を実行する。
【0074】
ステップ206aでは、上記ステップ206に歪みパターン情報を利用するように図12のステップ1201に示す格子点情報の領域分割の方法を変更する。まず、ステップ1201の通りに格子点情報を分割する。次に、歪みパターン情報のフラグが3(帳票折れによる歪み有り)の場合、歪みパターン情報に登録されているエッジ点情報に対応する格子点情報が図16の1601であるとき、図17に示すように1601の格子点情報が領域と領域との境界となる格子点情報(境界格子点情報)になるように変更する。変更方法は、境界格子点情報にしたい格子点情報と今ある境界格子点情報の位置をそれぞれ比較し、最も近い今ある境界格子点情報を算出することにより変更する。以上の処理はイメージ補正部106で行われる。
【0075】
以上に述べたように、第1の実施の形態では歪みが無く、補正する必要がなくても画像補正を行っていたが、第2の実施の形態では歪みの有無を検証し、補正する必要があるときのみ画像補正を行うため、運用時の処理時間の軽減が可能となる。また、格子点情報の領域分割において境界位置を変更することにより、歪みが大きい場合でも第1の実施の形態に比べて精度良い補正が可能となる。
【0076】
【発明の効果】
以上説明したように、本発明には以下の効果がある。
【0077】
第1の効果は、文字読み取り装置において、撮影された画像が帳票浮きや帳票折れのために歪みが生じている場合でも読み取り可能な画像を提供できる点である。その理由は、図1に示すように非線形の歪みに対して精度良く補正を行う手段を有しているためである。
【0078】
第2の効果は、文字読み取り装置において、撮影された画像がずれたり、傾いたり、伸縮などの歪みが生じる場合でも読み取り可能な画像を提供できる点である。その理由は、図1に示すように線形の歪みに対しても精度良く補正を行う手段を有しているためである。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態による画像補正装置のブロック図である。
【図2】本発明の第1の実施の形態の処理手順を示すフローチャートである。
【図3】コーナー点情報とエッジ点情報を例示する図である。
【図4】コーナー点を抽出するときの探索方法を示す図である。
【図5】コーナー点情報生成部の処理手順を示すフローチャートである。
【図6】エッジ点情報生成部の処理手順を示すフローチャートである。
【図7】エッジ点情報生成部で水平方向のエッジ点の抽出方法を例示した図である。
【図8】エッジ点情報生成部で垂直方向のエッジ点の抽出方法を例示した図である。
【図9】罫線情報生成部の処理手順を示すフローチャートである。
【図10】格子点情報生成部の処理手順を示すフローチャートである。
【図11】コーナー点情報、エッジ点情報、罫線情報、格子点情報の書式を例示した図である。
【図12】イメージ補正部の処理手順を示すフローチャートである。
【図13】本発明の第2の実施の形態による画像補正装置のブロック図である。
【図14】本発明の第2の実施の形態の処理手順を示すフローチャートである。
【図15】罫線情報生成部での実罫線の抽出方法を例示した図である。
【図16】イメージ補正部での領域分割の方法を例示した図である。
【図17】イメージ補正部での歪みパターン情報を用いた領域分割の方法を例示した図である。
【符号の説明】
101 帳票イメージ入力部
102 コーナー点情報生成部
103 エッジ点情報生成部
104 罫線情報生成部
105 格子点情報生成部
106 イメージ補正部
107 画像保存メモリ
108 帳票情報保存メモリ
109 理想罫線保存メモリ
110 歪みパターン判定部
301a〜304a 実コーナー点
301b〜304b 理想コーナー点
305a〜316a 実エッジ点
305b〜316b 理想エッジ点
317a〜340a 実格子点
317b〜340b 理想格子点
701〜703、801〜803 点
1101 コーナー点情報の書式
1102 エッジ点情報の書式
1103 罫線情報の書式
1104 格子点情報の書式
1501 二値画像
1502 ヒストグラムの最頻値
1601 格子点情報(境界格子点情報)
H1a〜H3a 実罫線
H1b〜H3b 理想罫線
V1a〜V3a 実罫線
V1b〜V3b 理想罫線[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image correction apparatus and an image correction method for reading image data of a form in which ruled lines and characters are written on a paper surface, and in particular, corrects an image including distortion generated when a bent form or a warped form is read. The present invention relates to an image correction apparatus and an image correction method.
[0002]
[Prior art]
In recent years, image data is often photographed and stored as a character recognition or data by a non-contact type scanner installed on a table so as to face the form at a position away from the form. However, if the form itself is deformed (bent, warp, etc.), you can put your finger into the shooting area by holding it down while reading to prevent the form from floating from the plane as much as possible. Therefore, there is a problem that the form cannot be prevented from being lifted off the plane and complicated distortion occurs in the read image.
[0003]
As a conventional technique for correcting image distortion generated when a spatially bent document such as a bent form or a warped form is read by a non-contact type scanner as described above, for example, a read book original (bound book) A technique for estimating the shape of a book document by detecting the edge position of the original document and the height of the document surface, and correcting distortion by scaling the image based on the estimated shape surface (for example, (See Patent Document 1). In addition, by changing the reading conditions such as the focus position and reading two images, the displacement is analyzed from the dispersed image created between the images, and the distance from the camera to the form is calculated using that information. Thus, a technique is disclosed in which a three-dimensional shape of a form is restored, and further, this is developed on a two-dimensional plane to correct distortion (see, for example, Patent Document 2).
[0004]
In addition, the parameter m of the transformation matrix H that converts the actual lattice points of the lattice point information into ideal lattice points using all the lattice point information included in a certain region.1~ M8(For example, refer nonpatent literature 1).
[0005]
[Patent Document 1]
JP-A-6-164852
[Patent Document 2]
JP 2000-115510 A
[Non-Patent Document 1]
Nagao, “Image Recognition”, Modern Science, p. 24-27
[0006]
[Problems to be solved by the invention]
However, according to the technical content of the above-mentioned patent document 1, since a means for measuring the height of the document surface is required (restoring the three-dimensional shape), the distortion of the image cannot be corrected unless a dedicated device is used. There's a problem. In addition, since a document to be processed is a bound manuscript and is a technique specialized for it, it is difficult to apply it to a document of one to several sheets.
[0007]
Further, according to the technical content of Patent Document 2, the reading condition such as the focal position is changed, two or more images are read, and a portion having a larger deviation between images than a dispersed image created between the images is a feature point. (This feature point is extracted as the end of a form break or form lift), and the distance at the feature point is calculated to restore the three-dimensional shape. However, when deformation due to form breakage or form floating falls within the depth of field, multiple images will be in focus, and the deviation between the images will be reduced, resulting in end parts due to form breakage or form float. May not be extracted as a feature point in some cases, so that an accurate three-dimensional shape cannot be restored and image distortion cannot be corrected.
[0008]
An object of the present invention occurs when a document that is spatially bent from the shape of a photographed form image is photographed without restoring the three-dimensional shape of a document such as one to several sheets. An object of the present invention is to provide an image correction apparatus and an image correction method capable of accurately correcting distortion of an image and obtaining a good image in which a shift of a cutout position does not occur in character recognition.
[0009]
[Means for Solving the Problems]
  The image correction apparatus of the present invention reads a form having a spatial bend that is placed on a table and is bent or warped by a non-contact type scanner disposed so as to face the form at a position away from the form. An image correction apparatus that corrects distortion included in an image, a form image input unit for inputting a form to be processed as a form image, an image storage memory for holding the input form image, and a size of the form Form information storage memory held in advance, ideal ruled line storage memory holding the exact ruled line (ideal ruled line) coordinates in advance, and corner points (actual points of the four corners of the form from the form image in the image storage memory) Corner that detects corner point coordinates and calculates corner point (ideal corner point) coordinates from the dimensions of the form in the form information storage memory Multiple edge point (actual edge point) coordinates are detected from the point information generator and form image using the actual corner point coordinates as clues, and the edge point (ideal edge point) coordinates corresponding to the actual edge points are detected as ideal corner point coordinates. Edge point information generation unit that calculates edge point information calculated from, and ruled line information that detects the ruled line (actual ruled line) coordinates from the form image and associates the ruled line with the ruled line (ideal ruled line) coordinates held in the ideal ruled line storage memory Lattice points (real grid points) calculated using the generation unit, real corner points, real edge points, and real ruled lines, grid points calculated using ideal corner points, ideal edge points, and ideal ruled lines ( (Ideal grid point) A grid point information generation unit that generates grid point information with a pair of coordinates, a strain pattern determination unit that determines the state of distortion using edge point information, and grid point information and distortion Generating a transformation matrix using the results of the determination of the state, and a image correcting unit for correcting the distortion contained in the image.
[0010]
Therefore, a corrected image without distortion is generated by the image correction apparatus of the present invention. As a result, in the character reading device, even when the photographed image is distorted due to form floating or form breakage, it is possible to read the image.
[0011]
  The distortion pattern determination unit calculates a curvature using the form image stored in the image storage memory and the edge point information generated by the edge point information generation unit, generates distortion pattern information, and generates distortion pattern information. Is composed of a flag indicating three patterns of “no distortion due to form slip”, “with distortion due to form floating”, and “with distortion due to form break” and edge point information with the maximum curvature, and distortion pattern information May be output to the image correction unit, and the image correction unit may receive the output of the distortion pattern determination unit and determine whether to perform distortion correction.
[0012]
  Accordingly, since the image correction is performed only when it is necessary to verify the presence / absence of distortion and correct it, the processing time during operation can be reduced.
[0013]
  In addition, the image correction unit divides the lattice point information into a plurality of regions, and when the distortion pattern information flag is “distortion due to form breakage”, the lattice point corresponding to the edge point information registered in the distortion pattern information The information is changed so that it becomes grid point information (boundary grid point information) that becomes the boundary between areas, and the change method is to change the position of the grid point information to be made into the boundary grid point information and the existing boundary grid point information. Each may be changed by comparing and calculating the nearest existing boundary grid point information.
[0014]
  Therefore, by changing the boundary position in the area division of the grid point information, it is possible to correct with high accuracy even when the distortion is large.
[0015]
  In the image correction method of the present invention, a form having a spatial curve that is placed on a table and is bent or warped is read by a non-contact type scanner disposed so as to face the form at a position away from the form. An image correction method for correcting distortion included in an image. A form image input unit inputs a form to be processed as a form image, holds the input form image in an image storage memory, and determines the dimensions of the form. Pre-stored in the information storage memory, the exact ruled line (ideal ruled line) coordinates on the form are stored in advance in the ideal ruled line storage memory, and the corner point information generator generates four corner points from the form image in the image storage memory. In addition to detecting the corner point (actual corner point) coordinates, the corner point (ideal corner point) coordinates are also determined from the dimensions of the form in the form information storage memory. The edge point information generation unit calculates a plurality of edge point (real edge point) coordinates from the form image using the actual corner point coordinates as clues, and calculates edge point (ideal edge point) coordinates corresponding to the real edge points. Edge point information is generated by calculating from the ideal corner point coordinates, and the ruled line information generation unit detects the ruled line (actual ruled line) coordinates from the form image, and the ruled line (ideal ruled line) coordinates held in the ideal ruled line storage memory Using the grid point (real grid point) coordinates, the ideal corner point, the ideal edge point, and the ideal ruled line calculated by the grid point information generation unit using the real corner point, the real edge point, and the real ruled line The grid point information is generated by pairing the calculated grid point (ideal grid point) coordinates, and the distortion pattern determination unit uses the edge point information to determine the state of the distortion. Tadashibu allows to generate a transformation matrix using the results of the determination of the state of the grid point information and distortion, corrects distortion included in an image.
[0016]
  The distortion pattern determination unit calculates a curvature using the form image stored in the image storage memory and the edge point information generated by the edge point information generation unit, generates distortion pattern information, and generates distortion pattern information. Is composed of a flag indicating three patterns of “no distortion due to form slip”, “with distortion due to form floating”, and “with distortion due to form break” and edge point information with the maximum curvature, and distortion pattern information May be output to the image correction unit, and the image correction unit may receive the output of the distortion pattern determination unit and determine whether to perform distortion correction.
[0017]
  In addition, the image correction unit divides the lattice point information into a plurality of regions, and when the distortion pattern information flag is “distortion due to form breakage”, the lattice point corresponding to the edge point information registered in the distortion pattern information The information is changed so that it becomes grid point information (boundary grid point information) that becomes the boundary between areas, and the change method is to change the position of the grid point information to be made into the boundary grid point information and the existing boundary grid point information. Each may be changed by comparing and calculating the nearest existing boundary grid point information.
[0018]
DETAILED DESCRIPTION OF THE INVENTION
(First Embodiment of the Invention)
Next, a first embodiment of the present invention will be described with reference to FIG. In the present embodiment, a form image input unit 101 such as a non-contact scanner, an image storage memory 107 that receives and stores a form obtained by the form image input unit 101, and a form that has been measured at the time of form registration in advance. A form information storage memory 108 in which the width and height (form information) are stored; an ideal ruled line storage memory 109 in which the start and end coordinates of the ruled line (ideal ruled line) measured at the time of registering the form are stored; Four corner point (actual corner point) coordinates of the upper left, upper right, lower left, and lower right corners of the form are extracted from the form image stored in the image storage memory 107 and should originally exist corresponding to each real corner point. The ideal corner point (ideal corner point) coordinates are calculated from the form information stored in the form information storage memory 108, and the actual corner point and the ideal corner point are calculated. A corner point information generation unit 102 that generates paired corner point information and a plurality of edge point (actual edge point) coordinates extracted from the form image stored in the image storage memory 107 using the actual corner point as a clue. Then, the ideal edge point (ideal edge point) coordinates that should exist originally corresponding to each real edge point are calculated from the ideal corner point, and the edge point information in which the real edge point and the ideal edge point are paired is calculated. The start point of the ruled line (actual ruled line) from the form image stored in the image storage memory 107 using the edge point information generating unit 103 to be generated and the start / end point coordinates of the ideal ruled line stored in the ideal ruled line storage memory 109 A ruled line information generation unit 104 that extracts end points and generates ruled line information in which a real ruled line and an ideal ruled line are paired, the actual corner point, the actual edge point, and the actual ruled line The grid point (real grid point) coordinates are calculated using the ideal grid point (ideal grid point) coordinates that should exist originally corresponding to each real grid point, and the ideal corner point and the ideal edge point. And the ideal ruled line, and a lattice point information generation unit 105 that generates lattice point information in which a real lattice point and an ideal lattice point are paired, and a conversion matrix is partially calculated using the lattice point information. The image correction unit 106 corrects image distortion using the transformation matrix.
[0019]
The function of each component in FIG. 1 will be described in detail below with reference to FIGS.
[0020]
The form image input unit 101 inputs a form image of a form image to be processed by using a non-contact type scanner installed so as to face the form at a position away from the form. The input form image is output (stored) in the image storage memory 107. As a photographing condition, the form is placed on a black table so that the background of the form image is lower than the background brightness in the paper.
[0021]
The image storage memory 107 stores the form image input by the form image input unit 101. The form image format is a 256-level multi-value image, and the value of the white background portion (the portion with high luminance) of the paper surface is large. The form image is input to the corner point information generation unit 102, the edge point information generation unit 103, the ruled line extraction unit 104, and the image correction unit 106, respectively.
[0022]
The form information storage memory 108 stores accurate width and height information (form information) of the form that has been measured in advance when the form is registered. This form information is an ideal corner point (ideal corner point) corresponding to the corner point (actual corner point) coordinates including the distortion extracted from the form image in the corner point information generation unit 102 when there is no distortion that should exist originally. ) Used to generate coordinates.
[0023]
The ideal ruled line storage memory 109 stores the start point coordinates and end point coordinates of the accurate ruled line (ideal ruled line) of the form without distortion, which was measured in advance when the form was registered, in the format shown in 1103 of FIG. . This ideal ruled line is used by the ruled line information generation unit 103.
[0024]
The corner point information generation unit 102 generates the corner point information using the form image stored in the image storage memory 107 and the form information stored in the form information storage memory 108. The corner point information is generated in the format 1101 in FIG. The generated corner point information is output to the edge point information generation unit 103 and the lattice point information generation unit 105.
[0025]
The edge point information generation unit 103 generates the edge point information using the form image stored in the image storage memory 107 and the corner point information generated by the corner point information generation unit 102. The edge point information is generated in the format 1102 in FIG. The generated edge point information is output to the lattice point information generation unit 105.
[0026]
The ruled line information generation unit 104 generates the ruled line information using the form image stored in the image storage memory 107 and the ideal ruled line stored in the ideal ruled line storage memory 109. The ruled line information is generated in the format 1103 in FIG. The generated ruled line information is output to the grid point information generating unit 105.
[0027]
The grid point information generation unit 105 uses the corner point information generated by the corner point information generation unit 102, the edge point information generated by the edge point information generation unit 103, and the ruled line information generated by the ruled line information generation unit 104. The lattice point information is generated. The lattice point information is generated in the format 1104 in FIG. The generated grid point information is output to the image correction unit 106.
[0028]
The image correction unit 106 outputs an image in which distortion is corrected using the form image stored in the image storage memory 107 and the grid point information generated by the grid point information generation unit 105.
[0029]
Next, the operation of the image correction apparatus according to the present invention will be described in order with reference to FIGS. 1 to 12 and FIGS. 15 to 17.
[0030]
First, the form image input unit 101 inputs a form image (step 201). Next, in the corner point information generation unit 102, the upper left, upper right, lower left, and lower right real corner points (301a to 304a in FIG. 3) extracted from the form image stored in the image storage memory 107 and the form information. Four corner point information in which ideal corner points (301b to 304b in FIG. 3) corresponding to each actual corner point calculated from the form information stored in the storage memory 108 are paired is generated. Hereinafter, the operation of the corner point information generation unit 102 will be described in detail with reference to the flowcharts of FIGS. 4 and 5.
[0031]
First, the upper left real corner point is extracted from the form image (step 501). In the extraction method, the search is performed in the order of the numbers shown in FIG. As a result of the search, when pixels having a density value larger than the density T (about 50) are first detected continuously as L (about 5) or more as indicated by numbers 39 to 43 in FIG. x39, Y39) And the coordinates of number 43 are (x43, Y43), The upper left corner point is (x43, Y39(No. 13 in FIG. 4). Note that the inclination of the form to be read is about 0 ° to 10 °. Thereafter, the same extraction method is applied, and the upper right real corner point is extracted by searching in the order of the numbers shown in FIG. 4B (step 502), and the search is performed in the order of the numbers shown in FIG. A corner point is extracted (step 503), and a search is performed in the order of the numbers shown in FIG. 4D to extract a lower right real corner point (step 504).
[0032]
Next, ideal corner points corresponding to the extracted real corner points are generated using the form information in the form information storage memory 108. If the form width of the form information is W and the form height is H, the ideal corner points (x, y) are the upper left ideal corner point (0, 0), the upper right ideal corner point (W, 0), and the lower left ideal corner point ( 0, H), lower right ideal corner point (W, H). Then, the coordinates of 301a are added to these as a translation component. That is, the upper left actual corner point and the upper left ideal corner point are set to the same value.
[0033]
Next, the edge point information generation unit 103 extracts the actual edge points (305a to 316a in FIG. 3) extracted from the form image stored in the image storage memory 107 using the actual corner points and the ideal corner points. Edge point information in which ideal edge points (305b to 316b in FIG. 3) corresponding to the respective real edge points calculated from the coordinates are paired is generated. Hereinafter, the operation of the edge point information generation unit will be described in detail with reference to the flowcharts of FIGS. 3, 7, and 6.
[0034]
First, the upper real edge points (305a to 307a in FIG. 3) are extracted from the form image using the upper left real corner point and the upper right real corner point (step 601). In the extraction method, first, as shown in FIG. 7, the line segment connecting the upper left real corner point and the upper right real corner point is equally divided into N (about 128 in the case of A4 form). In FIG. 7, for the sake of simplification of explanation, N = 4 is equally divided. Then, the upper edge real edge point is obtained by scanning (searching in the Y direction) a pixel having a density T (about 50) or less by scanning the image from the bottom to the top with the positions of the points 701 to 703 in FIG. 7 as the center. Is detected. Next, lower end real edge points (314a to 316a in FIG. 3) are extracted from the form image using the lower left real corner point and the lower right real corner point (step 602). The extraction method is the same as the extraction of the upper edge real edge point (step 601). Next, the left edge real edge points (308a to 310a in FIG. 3) are extracted from the form image using the upper left real corner point and the lower left real corner point (step 603). In the extraction method, first, as shown in FIG. 8, the line segment connecting the upper left real corner point and the lower left real corner point is equally divided into M (about 128 in the case of A4 form). In FIG. 8, for the sake of simplification of explanation, M = 4 is equally divided. Then, the left edge real edge point is obtained by scanning (searching in the X direction) a pixel having a density of T (about 50) or less by scanning the image from left to right with the positions of the points 801 to 803 in FIG. 8 as the center. Is detected. Next, the right edge real edge points (311a to 313a in FIG. 3) are extracted from the form image using the upper right real corner point and the lower right real corner point (step 604). The extraction method is the same as the left-end real edge extraction (step 603).
[0035]
Next, an ideal edge point corresponding to each extracted actual edge point is generated using the ideal corner point (step 605). The upper-end ideal edge points (305b to 307b in FIG. 3) are generated by obtaining points that equally divide the line segment connecting the upper left ideal corner point and the upper right ideal corner point into N pieces. The lower end ideal edge points (314b to 316b in FIG. 3) are generated by obtaining a point that equally divides the line segment connecting the lower left ideal corner point and the lower right ideal corner point into N pieces. The leftmost ideal edge points (308b to 310b in FIG. 3) are generated by obtaining points that equally divide the line segment connecting the upper left ideal corner point and the lower left ideal corner point into M pieces. The right end ideal edge point (311b to 313b in FIG. 3) is generated by obtaining a point that equally divides the line segment connecting the upper right ideal corner point and the lower right ideal corner point into M pieces. As a result, the edge point information generation unit 103 generates “2 (M−1) +2 (N−1)” pieces of edge point information.
[0036]
Next, the ruled line information generation unit 104 corresponds to the actual ruled lines (H1a to H3a and V1a to V3a in FIG. 3) extracted from the form image and the respective actual ruled lines stored in the ideal ruled line storage memory 109 in advance. Ruled line information in which the ideal ruled lines (H1b to H3b and V1b to V3b in FIG. 3) are paired is generated. Hereinafter, the operation of the ruled line information generation unit will be described in detail with reference to the flowcharts of FIGS. First, a rectangular area (ruled line existence area) where an actual ruled line exists is estimated from the form image using the ideal ruled line position stored in the ideal ruled line storage memory 109 (step 901). Next, binarization processing is performed on the ruled line existence region, and a binary image indicated by 1501 in FIG. 15A is generated (step 902). Next, the binary image generated as shown in FIG. 15A is searched in a direction perpendicular to the direction of the actual ruled line, and a histogram relating to the length of black run (black run length) shown in FIG. 15B is generated. To do. Then, the mode value of this histogram shown at 1502 in FIG. 15B is set as the standard ruled line width (step 903). Next, of the black pixel portions in the ruled line existence region, the black pixel portion having the black run length equal to the standard ruled line width is voted for the Hough space (step 904). The Hough space used here is a straight line formula
[0037]
[Expression 1]
Figure 0004013060
[0038]
(Ρ, θ) plane transformed from. Next, the position of the maximum number of votes in the Hough space (ρmax, Θmax) Is obtained (step 905). And (ρmax, Θmax) And Equation 1 are used to determine the start and end points of the actual ruled line (step 906). In the case of a horizontal solid ruled line (horizontal solid ruled line), the start point of the actual ruled line to be calculated is (sx1, sy1), End point (ex1, ey1) And the starting point of the corresponding horizontal ideal ruled line (horizontal ideal ruled line) is (sx2, sy2), End point (ex2, ey2) Is obtained from Equation 2. In other words, the X coordinate of the start point / end point of the actual ruled line is made the same as the X coordinate of the start point / end point of the ideal ruled line, and only the Y coordinate of the start point / end point of the real ruled line is obtained.
[0039]
[Expression 2]
Figure 0004013060
[0040]
In the case of a vertical solid ruled line (vertical solid ruled line), the start point of the actual ruled line to be calculated is (sxThree, syThree), End point (exThree, eyThree) And the starting point of the corresponding vertical ideal ruled line (vertical ideal ruled line) (sxFour, syFour), End point (exFour, eyFour) Is obtained from Equation 3. That is, the Y coordinates of the start and end points of the actual ruled line are made the same as the Y coordinates of the start and end points of the ideal ruled line, and only the X coordinates of the start and end points of the actual ruled line are obtained.
[0041]
[Equation 3]
Figure 0004013060
[0042]
Thereby, the start point and end point of the real ruled line are extracted, and ruled line information in which the real ruled line and the ideal ruled line are paired is generated.
[0043]
Next, in the grid point generation unit 105, the real grid points (317a to 341a in FIG. 3) calculated using the real corner points, the real edge points, and the real ruled lines, the ideal corner points, and the ideal edge points. And lattice point information in which ideal lattice points (317b to 341b in FIG. 3) corresponding to the respective actual lattice points calculated using the ideal ruled line are paired. The operation of the grid point information generation unit will be described in detail below with reference to the flowchart of FIG. First, grid point information is generated using corner point information and edge point information (step 1001).
[0044]
The lattice point information is generated in the form of a matrix of (M + 1) × (N + 1) indicated by 1104 in FIG. Here, in order to simplify the notation of lattice point information, the lattice point information of s rows and t columns is denoted as [s, t]. Here, 0 <s <M and 0 <t <N. [s, t] stores the coordinates (X, Y) of the real lattice points and the coordinates (X, Y) of the ideal lattice points.
[0045]
First, corner point information and edge point information are stored in a matrix. In the case of an actual corner point, the coordinates of the actual corner point (X, Y) are the coordinates of the actual grid point (X, Y), and the coordinates of the ideal corner point (X, Y) are the coordinates of the ideal grid point ( X, Y) respectively. That is, the upper left corner point information is [0, 0], the upper right corner point information is [0, N], the lower left corner point information is [M, 0], and the lower right corner point information is [M, N]. Stored. In the case of edge point information, the coordinates of the actual edge point (X, Y) are the coordinates of the actual grid point (X, Y), and the coordinates of the ideal edge point (X, Y) are the coordinates of the ideal grid point (X, Y). Y) respectively. That is, the upper edge information is [0, 1] to [0, N-1], the lower edge information is [M, 1] to [M, N-1], and the left edge information is [1, 0] to The right edge information is stored in [M-1, 0] in the order of numbers 1102 in FIG. 11 in [1, N] to [M-1, N].
[0046]
Next, grid point information other than the above is generated. x and Y coordinates of the real grid points of [s, 0] are x1, Y1And the X and Y coordinates of the real grid point of [s, N] are x2, Y2Then, the X coordinate of the real lattice point of [s, t] is obtained from Equation 4.
[0047]
[Expression 4]
Figure 0004013060
[0048]
Also, the X and Y coordinates of the real grid point of [0, t]Three, YThreeAnd the X and Y coordinates of the real grid points of [M, t] are xFour, YFourThen, the Y coordinate of the real lattice point of [s, t] is obtained from Equation 5.
[0049]
[Equation 5]
Figure 0004013060
[0050]
The ideal lattice point can also be obtained by the same method as the actual lattice point. Thereby, all grid point information is generated.
[0051]
Next, a method for improving the accuracy of the grid point information generated as described above using the ruled line information will be described. First, the position of the actual grid point of the grid point information is adjusted using the actual ruled line of the ruled line information. First, the position of the actual grid point by the horizontal solid ruled line is adjusted. i-th horizontal ruled line hiFind the midpoint of and [Si, Ti] Is obtained using real grid points (step 1002). Then click [Si-1, Ti] Real grid points and [Si+1, Ti] And the horizontal solid ruled line hiIs obtained (step 1003). Then click [Si, Ti], The amount of change in the Y direction between the actual grid point and the intersection d is obtained (step 1004). Then, the calculated amount of change in the Y direction is SiIt adds to the Y coordinate of the real grid point of all the lines (step 1005). If all the horizontal solid ruled lines have not been completed, the same processing is performed on the i + 1th horizontal solid ruled line from step 1002 (step 1006). When all the horizontal solid ruled lines are completed, S obtained in step 1002iLine and Si + 1The position is adjusted with respect to the Y coordinate of the real lattice point located between the rows (step 1007). The adjustment method is [Si, T] (0≤t≤N) x and Y coordinates of the real grid points1, Y1And [Si + 1, T], the x and y coordinates of the real grid points are x2, Y2Then, the Y coordinate of the real grid point of [s, t] is obtained from Equation 6.
[0052]
[Formula 6]
Figure 0004013060
[0053]
When the position adjustment of the actual grid point by the horizontal solid ruled line is completed, the position of the actual grid point by the vertical real ruled line is then adjusted. jth vertical solid ruled line vjFind the midpoint of and [Sj, Tj] Is obtained using real grid points (step 1008). Then click [Sj, Tj-1] and [Sj, Tj+1] line segment connecting vertical grid points and vertical solid ruled line viIs obtained (step 1009). Next, select [Sj, Tj] In the X direction between the real grid point and the intersection d (step 1010). The calculated change in the X direction is TjIt adds to the X coordinate of the real grid point of all the lines (step 1011). If all the vertical solid ruled lines have not been completed, the same processing is performed on the j + 1-th vertical solid ruled line from step 1008 (step 1012). When all vertical solid ruled lines have been completed, T calculated in step 1008jColumn and Tj + 1The position is adjusted with respect to the X coordinate of the real lattice point located between the columns (step 1013). The adjustment method is [s, Ti ] (0 ≦ s ≦ M) x and Y coordinates of the real grid pointsThree, YThreeAnd [s, Ti + 1X and Y coordinates of the real grid pointsFour, YFourThen, the X coordinate of the real lattice point of [s, t] is obtained from Equation 7.
[0054]
[Expression 7]
Figure 0004013060
[0055]
Thereby, the position of the real grid point of the grid point information is adjusted using the real ruled line of the ruled line information. Next, the position of the ideal grid point of the grid point information is adjusted using the ideal ruled line of the ruled line information. The adjustment method can be adjusted by performing the same process as the adjustment method for the actual grid point.
[0056]
By executing the above processing and adjusting the positions of the real grid points and the ideal grid points of the grid point information, grid point information with improved accuracy is generated.
[0057]
Next, the image correction unit 106 corrects the image using the lattice point information generated by the lattice point information generation unit 105 (step 206). Hereinafter, the operation of the image correction unit will be described in detail with reference to the flowchart of FIG.
[0058]
First, the lattice point information is divided into a plurality of regions (step 1201). In the dividing method, as shown in FIG. 16, the rows of grid point information generated in the form of a matrix are divided into K.1Divide into (about 16) pieces and column K2Divide into (about 16) pieces. That is, K1× K2Divide into areas. Note that the number of grid point information included in a region needs to include eight or more pieces of grid point information in order to calculate a transformation matrix described later, but the number of grid point information in each region needs to be constant. There is no. Also, lattice point information (boundary lattice point information) that is a boundary between regions is included in both regions. Next, a conversion matrix H shown in Formula 8 is calculated such that real grid points of the grid point information are converted into ideal grid points using all grid point information included in a certain region (step 1202).
[0059]
[Equation 8]
Figure 0004013060
[0060]
Below are 8 parameters m1~ M8The calculation method of is shown. Set the coordinates of the real grid point to (xi, yi), The coordinates of the ideal grid point (ui, vi) And the relationship is given by the linear expression of Expression 9. Here, R in Expression 9 is the number of grid point information, which is (M + 1) × (N + 1).
[0061]
[Equation 9]
Figure 0004013060
[0062]
When all the lattice point information is substituted into Equation 9, Equation 10 is obtained.
[0063]
[Expression 10]
Figure 0004013060
[0064]
By calculating each of Equation 10 using the least squares method, m1~ M8Can be calculated (from Non-Patent Document 1). Then, the partial image is corrected (converted) by Equation 11 using the obtained conversion matrix (step 1203). Here, (x ′, y ′) is a point in the coordinate system including distortion (before correction), and (x, y) is a point in the coordinate system without distortion (after correction).
[0065]
## EQU11 ##
Figure 0004013060
[0066]
It should be noted that the pixels located at the coordinates of the ideal grid point of the boundary grid point information are the average of the density values obtained from the transformation matrix of each related area. If all the regions are not completed, the same processing is performed on the other regions from step 1202, and if all the regions are completed, the processing is terminated. Thereby, the distortion of the form image is corrected.
[0067]
(Second Embodiment of the Invention)
FIG. 13 is a block diagram showing a configuration of an image correction apparatus according to the second embodiment of the present invention. FIG. 14 is a flowchart showing the operation of the image correction apparatus. The difference in the apparatus configuration from the first embodiment is that a distortion pattern determination unit 110 is added in FIG. The image correction unit 106 receives the output of the distortion pattern determination unit 110 and determines whether or not to perform distortion correction.
[0068]
The distortion pattern determination unit 110 calculates a curvature using the form image stored in the image storage memory 107 and the edge point information generated by the edge point information generation unit 103, and generates distortion pattern information. The distortion pattern information is composed of flags representing three patterns of “no form distortion”, “there is distortion due to form floating”, and “there is distortion due to form breakage”, and edge point information that maximizes the curvature. The distortion pattern information is output to the image correction unit 106.
[0069]
Next, the operation of the second exemplary embodiment of the present invention will be described. The operation is the same as that in the first embodiment from step 201 to step 205. Only the difference in operation will be described below. In FIG. 14, step 207 and step 208 are newly added steps, and step 206a is a step in which step 206a is changed to use distortion pattern information.
[0070]
In step 207, first, the curvature is calculated using the edge point information generated by the edge point information generation unit 103. The calculation method of the curvature C is obtained from Equation 12 by taking k (about 5) edge points on the left and right (up and down) of the actual edge point for which the curvature is to be obtained.
[0071]
[Expression 12]
Figure 0004013060
[0072]
This is performed for all actual edge points, and the maximum value of the curvatures is calculated. Note that C = 0 is set for edge points where k edge points cannot be taken on the left and right (up and down). If the maximum value of curvature is smaller than T1 (about 2.0), the distortion pattern flag is set to 1 (no form distortion). If the maximum value of the curvature is larger than T1 and smaller than T2 (about 10.0), the distortion pattern flag is set to 2 (distortion due to form floating). If the maximum value of curvature is greater than T2, flag 3 (distortion due to form breakage) is set. Further, the edge point information having the maximum curvature value is also registered in the distortion pattern information. The above processing is executed by the distortion pattern determination unit 110.
[0073]
In step 208, if the distortion pattern information flag is 1, the form image is output as it is without performing correction processing. When the distortion pattern information flag is other than 1, the processing after step 204 is executed.
[0074]
In step 206a, the method of dividing the region of the lattice point information shown in step 1201 of FIG. 12 is changed so that the distortion pattern information is used in step 206. First, the grid point information is divided as in step 1201. Next, when the distortion pattern information flag is 3 (there is distortion due to form breakage), when the lattice point information corresponding to the edge point information registered in the distortion pattern information is 1601 in FIG. As described above, the grid point information 1601 is changed to grid point information (boundary grid point information) that is a boundary between regions. In the changing method, the grid point information desired to be the boundary grid point information is compared with the position of the existing boundary grid point information, and the nearest boundary grid point information is calculated. The above processing is performed by the image correction unit 106.
[0075]
As described above, in the first embodiment, there is no distortion, and image correction is performed even when correction is not necessary. In the second embodiment, the presence or absence of distortion must be verified and corrected. Since image correction is performed only when there is an image, the processing time during operation can be reduced. Further, by changing the boundary position in the area division of the grid point information, it is possible to perform correction with higher accuracy than in the first embodiment even when the distortion is large.
[0076]
【The invention's effect】
As described above, the present invention has the following effects.
[0077]
The first effect is that, in the character reading device, it is possible to provide a readable image even when the photographed image is distorted due to form floating or form breakage. The reason is that, as shown in FIG. 1, there is means for accurately correcting non-linear distortion.
[0078]
The second effect is that a character reading device can provide an image that can be read even when the captured image is displaced, tilted, or distorted such as expansion and contraction. This is because, as shown in FIG. 1, it has means for accurately correcting linear distortion.
[Brief description of the drawings]
FIG. 1 is a block diagram of an image correction apparatus according to a first embodiment of the present invention.
FIG. 2 is a flowchart illustrating a processing procedure according to the first embodiment of this invention.
FIG. 3 is a diagram illustrating corner point information and edge point information.
FIG. 4 is a diagram illustrating a search method when extracting corner points.
FIG. 5 is a flowchart illustrating a processing procedure of a corner point information generation unit.
FIG. 6 is a flowchart illustrating a processing procedure of an edge point information generation unit.
FIG. 7 is a diagram illustrating a method of extracting edge points in the horizontal direction by an edge point information generation unit.
FIG. 8 is a diagram illustrating a method for extracting edge points in the vertical direction by an edge point information generation unit;
FIG. 9 is a flowchart illustrating a processing procedure of a ruled line information generation unit.
FIG. 10 is a flowchart illustrating a processing procedure of a lattice point information generation unit.
FIG. 11 is a diagram illustrating a format of corner point information, edge point information, ruled line information, and grid point information.
FIG. 12 is a flowchart illustrating a processing procedure of an image correction unit.
FIG. 13 is a block diagram of an image correction apparatus according to a second embodiment of the present invention.
FIG. 14 is a flowchart illustrating a processing procedure according to the second embodiment of the present invention.
FIG. 15 is a diagram illustrating a method for extracting an actual ruled line in a ruled line information generation unit.
FIG. 16 is a diagram exemplifying a region dividing method in an image correcting unit.
FIG. 17 is a diagram exemplifying a region dividing method using distortion pattern information in an image correction unit.
[Explanation of symbols]
101 Form image input part
102 Corner point information generator
103 Edge point information generation unit
104 Ruled line information generation unit
105 Lattice point information generator
106 Image correction unit
107 Image storage memory
108 Form information storage memory
109 Ideal ruled line storage memory
110 Distortion pattern determination unit
301a-304a Actual corner point
301b-304b Ideal corner point
305a-316a Real edge point
305b-316b Ideal edge point
317a-340a Real grid points
317b-340b Ideal lattice points
701-703, 801-803 points
1101 Corner point information format
1102 Format of edge point information
1103 Ruled line information format
1104 Format of grid point information
1501 Binary image
1502 Mode of histogram
1601 Grid point information (boundary grid point information)
H1a-H3a real ruled lines
H1b-H3b ideal ruled line
V1a-V3a real ruled lines
V1b to V3b Ideal ruled line

Claims (6)

卓上に置かれて折れ曲がったり反ったりしている空間的な曲がりを有する帳票を該帳票から離れた位置に該帳票に対向するように設置された非接触型スキャナで読み取った画像に含まれる歪みを補正する画像補正装置であって、
処理対象の帳票を帳票イメージとして入力するための帳票イメージ入力部と、
入力された帳票イメージを保持する画像保存メモリと、
前記帳票の寸法をあらかじめ保持した帳票情報保存メモリと、
前記帳票上の正確な罫線(理想罫線)座標をあらかじめ保持した理想罫線保存メモリと、
前記画像保存メモリ内の帳票イメージから帳票の4隅の点であるコーナー点(実コーナー点)座標を検出するとともに、前記帳票情報保存メモリ内の前記帳票の寸法からもコーナー点(理想コーナー点)座標を算出するコーナー点情報生成部と、
前記帳票イメージから前記実コーナー点座標を手掛りとして複数のエッジ点(実エッジ点)座標を検出するとともに、該実エッジ点に対応するエッジ点(理想エッジ点)座標を前記理想コーナー点座標から算出しエッジ点情報を生成するエッジ点情報生成部と、
前記帳票イメージから罫線(実罫線)座標を検出するとともに、該罫線を前記理想罫線保存メモリに保持された罫線(理想罫線)座標と対応付ける罫線情報生成部と、
前記実コーナー点と前記実エッジ点と前記実罫線とを用いて算出される格子点(実格子点)座標と前記理想コーナー点と前記理想エッジ点と前記理想罫線とを用いて算出される格子点(理想格子点)座標が対となった格子点情報を生成する格子点情報生成部と、
前記エッジ点情報を用いて歪みの状態を判定する歪みパターン判定部と、
前記格子点情報と前記歪みの状態の判定の結果とを用いて変換行列を生成し、画像に含まれる歪みを補正するイメージ補正部とを備えている画像補正装置。
Distortion included in an image read by a non-contact scanner placed on a table with a spatial bend that is bent or warped by a non-contact scanner placed opposite the form at a position away from the form An image correction device for correcting,
A form image input unit for inputting a form to be processed as a form image;
An image storage memory to hold the entered form image;
A form information storage memory that holds the dimensions of the form in advance;
An ideal ruled line storage memory that holds in advance the exact ruled line (ideal ruled line) coordinates on the form;
The corner point (actual corner point) coordinates which are the four corner points of the form are detected from the form image in the image storage memory, and the corner point (ideal corner point) is also determined from the dimensions of the form in the form information storage memory. A corner point information generator for calculating coordinates;
A plurality of edge point (actual edge point) coordinates are detected from the form image using the actual corner point coordinates as a clue, and edge point (ideal edge point) coordinates corresponding to the actual edge point are calculated from the ideal corner point coordinates. Edge point information generating unit for generating edge point information;
A ruled line information generating unit that detects ruled line (real ruled line) coordinates from the form image, and associates the ruled lines with the ruled line (ideal ruled line) coordinates held in the ideal ruled line storage memory;
Grid calculated using the actual corner point, the actual edge point, and the actual ruled line, the grid point (real grid point) coordinates, the ideal corner point, the ideal edge point, and the ideal ruled line A grid point information generation unit that generates grid point information in which point (ideal grid point) coordinates are paired;
A distortion pattern determination unit that determines the state of distortion using the edge point information;
An image correction apparatus comprising: an image correction unit that generates a transformation matrix using the lattice point information and the determination result of the distortion state, and corrects distortion included in the image.
前記歪みパターン判定部は、前記画像保存メモリに格納されている帳票イメージと前記エッジ点情報生成部によって生成されたエッジ点情報とを用いて曲率を算出し、歪みパターン情報を生成し、該歪みパターン情報は、「帳票歪み無し」と、「帳票浮きによる歪み有り」と、「帳票折れによる歪み有り」との3つのパターンを表すフラグと曲率が最大となるエッジ点情報とから構成され、前記歪みパターン情報は、前記イメージ補正部に出力され、
該イメージ補正部は、前記歪みパターン判定部の出力を受けて、歪み補正を行うか否かを決定する、請求項に記載の画像補正装置。
The distortion pattern determination unit calculates a curvature using the form image stored in the image storage memory and the edge point information generated by the edge point information generation unit, generates distortion pattern information, and generates the distortion pattern information. The pattern information is composed of a flag representing three patterns of “no form distortion”, “with distortion due to form floating”, and “with distortion due to form break” and edge point information with the maximum curvature, The distortion pattern information is output to the image correction unit,
The image correction device according to claim 1 , wherein the image correction unit receives the output of the distortion pattern determination unit and determines whether or not to perform distortion correction.
前記イメージ補正部は、前記格子点情報を複数の領域に分割し、
前記歪みパターン情報のフラグが「帳票折れによる歪み有り」の場合、前記歪みパターン情報に登録されているエッジ点情報に対応する格子点情報が、領域と領域との境界となる格子点情報(境界格子点情報)になるように変更し、該変更方法は、境界格子点情報にしたい格子点情報と今ある境界格子点情報の位置をそれぞれ比較し、最も近い今ある境界格子点情報を算出することにより変更する、請求項に記載の画像補正装置。
The image correction unit divides the lattice point information into a plurality of regions,
When the distortion pattern information flag is “distortion due to form break”, the lattice point information corresponding to the edge point information registered in the distortion pattern information is the lattice point information (boundary between the regions). Grid point information), and the change method compares the grid point information desired to be the boundary grid point information with the position of the existing boundary grid point information, and calculates the nearest existing boundary grid point information. The image correction device according to claim 2 , wherein the image correction device is changed accordingly.
卓上に置かれて折れ曲がったり反ったりしている空間的な曲がりを有する帳票を該帳票から離れた位置に該帳票に対向するように設置された非接触型スキャナで読み取った画像に含まれる歪みを補正する画像補正方法であって、
帳票イメージ入力部により、処理対象の帳票を帳票イメージとして入力し、
入力された帳票イメージを画像保存メモリに保持し、
前記帳票の寸法を帳票情報保存メモリにあらかじめ保持し、
前記帳票上の正確な罫線(理想罫線)座標を理想罫線保存メモリにあらかじめ保持し、
コーナー点情報生成部により、前記画像保存メモリ内の帳票イメージから帳票の4隅の点であるコーナー点(実コーナー点)座標を検出するとともに、前記帳票情報保存メモリ内の前記帳票の寸法からもコーナー点(理想コーナー点)座標を算出し、
エッジ点情報生成部により、前記帳票イメージから前記実コーナー点座標を手掛りとして複数のエッジ点(実エッジ点)座標を検出するとともに、該実エッジ点に対応するエッジ点(理想エッジ点)座標を前記理想コーナー点座標から算出しエッジ点情報を生成し、
罫線情報生成部により、前記帳票イメージから罫線(実罫線)座標を検出するとともに、該罫線を前記理想罫線保存メモリに保持された罫線(理想罫線)座標と対応付け、
格子点情報生成部により、前記実コーナー点と前記実エッジ点と前記実罫線とを用いて算出される格子点(実格子点)座標と前記理想コーナー点と前記理想エッジ点と前記理想罫線とを用いて算出される格子点(理想格子点)座標が対となった格子点情報を生成し、
歪みパターン判定部により、前記エッジ点情報を用いて歪みの状態を判定し、
イメージ補正部により、前記格子点情報と前記歪みの状態の判定の結果とを用いて変換行列を生成し、画像に含まれる歪みを補正する、画像補正方法。
Distortion included in an image read by a non-contact scanner placed on a table and having a spatial bend that is bent or warped, placed away from the form and facing the form An image correction method for correcting,
Use the form image input unit to enter the form to be processed as a form image,
Hold the entered form image in the image storage memory,
The dimensions of the form are stored in advance in the form information storage memory,
Precise ruled line (ideal ruled line) coordinates on the form are stored in the ideal ruled line storage memory in advance,
The corner point information generation unit detects corner point (actual corner point) coordinates that are the four corner points of the form from the form image in the image storage memory, and also from the dimensions of the form in the form information storage memory. Calculate the corner point (ideal corner point) coordinates,
The edge point information generation unit detects a plurality of edge point (actual edge point) coordinates from the form image using the actual corner point coordinates as clues, and obtains edge point (ideal edge point) coordinates corresponding to the actual edge point. Calculate from the ideal corner point coordinates to generate edge point information,
The ruled line information generation unit detects ruled line (actual ruled line) coordinates from the form image and associates the ruled lines with ruled line (ideal ruled line) coordinates held in the ideal ruled line storage memory.
Grid point (real grid point) coordinates calculated using the real corner point, the real edge point, and the real ruled line, the ideal corner point, the ideal edge point, and the ideal ruled line by the grid point information generation unit Generate lattice point information that is a pair of lattice point (ideal lattice point) coordinates calculated using
The distortion pattern determination unit determines the state of distortion using the edge point information,
An image correction method, wherein an image correction unit generates a transformation matrix using the lattice point information and the determination result of the distortion state, and corrects distortion included in the image.
前記歪みパターン判定部は、前記画像保存メモリに格納されている帳票イメージと前記エッジ点情報生成部によって生成されたエッジ点情報とを用いて曲率を算出し、歪みパターン情報を生成し、該歪みパターン情報は、「帳票歪み無し」と、「帳票浮きによる歪み有り」と、「帳票折れによる歪み有り」との3つのパターンを表すフラグと曲率が最大となるエッジ点情報とから構成され、前記歪みパターン情報は、前記イメージ補正部に出力され、
該イメージ補正部は、前記歪みパターン判定部の出力を受けて、歪み補正を行うか否かを決定する、請求項に記載の画像補正方法。
The distortion pattern determination unit calculates a curvature using the form image stored in the image storage memory and the edge point information generated by the edge point information generation unit, generates distortion pattern information, and generates the distortion pattern information. The pattern information is composed of a flag representing three patterns of “no form distortion”, “with distortion due to form floating”, and “with distortion due to form break” and edge point information with the maximum curvature, The distortion pattern information is output to the image correction unit,
The image correction method according to claim 4 , wherein the image correction unit receives the output of the distortion pattern determination unit and determines whether or not to perform distortion correction.
前記イメージ補正部は、前記格子点情報を複数の領域に分割し、
前記歪みパターン情報のフラグが「帳票折れによる歪み有り」の場合、前記歪みパターン情報に登録されているエッジ点情報に対応する格子点情報が、領域と領域との境界となる格子点情報(境界格子点情報)になるように変更し、該変更方法は、境界格子点情報にしたい格子点情報と今ある境界格子点情報の位置をそれぞれ比較し、最も近い今ある境界格子点情報を算出することにより変更する、請求項に記載の画像補正方法。
The image correction unit divides the lattice point information into a plurality of regions,
When the distortion pattern information flag is “distortion due to form break”, the lattice point information corresponding to the edge point information registered in the distortion pattern information is the lattice point information (boundary between the regions). Grid point information), and the change method compares the grid point information desired to be the boundary grid point information with the position of the existing boundary grid point information, and calculates the nearest existing boundary grid point information. The image correction method according to claim 5 , wherein the image correction method is changed accordingly.
JP2003012282A 2003-01-21 2003-01-21 Image correction method and image correction apparatus Expired - Fee Related JP4013060B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003012282A JP4013060B2 (en) 2003-01-21 2003-01-21 Image correction method and image correction apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003012282A JP4013060B2 (en) 2003-01-21 2003-01-21 Image correction method and image correction apparatus

Publications (2)

Publication Number Publication Date
JP2004228759A JP2004228759A (en) 2004-08-12
JP4013060B2 true JP4013060B2 (en) 2007-11-28

Family

ID=32900942

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003012282A Expired - Fee Related JP4013060B2 (en) 2003-01-21 2003-01-21 Image correction method and image correction apparatus

Country Status (1)

Country Link
JP (1) JP4013060B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101377910B1 (en) 2011-06-15 2014-03-24 후지쯔 가부시끼가이샤 Image processing method and image processing apparatus

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3857709B2 (en) * 2005-01-07 2006-12-13 株式会社東芝 Image information acquisition apparatus, image information acquisition method and program
CN101458814B (en) * 2007-12-13 2012-02-01 东软集团股份有限公司 Method and apparatus for separating objects interesting region from image
JP5153593B2 (en) 2008-12-02 2013-02-27 株式会社Pfu Image processing apparatus and image processing method
JP6010870B2 (en) 2013-12-24 2016-10-19 カシオ計算機株式会社 Image correction apparatus, image correction method, and program
JP6225096B2 (en) * 2014-10-30 2017-11-01 富士通フロンテック株式会社 Form reading program, form reading method, and information processing apparatus
CN107944438B (en) * 2017-12-08 2020-09-25 维沃移动通信有限公司 Document image correction method and mobile terminal
JP7076216B2 (en) * 2018-01-30 2022-05-27 トッパン・フォームズ株式会社 Imaging control device, imaging control method, and program
CN111860489A (en) * 2019-12-09 2020-10-30 北京嘀嘀无限科技发展有限公司 Certificate image correction method, device, equipment and storage medium
CN112633275B (en) * 2020-12-22 2023-07-18 航天信息股份有限公司 Multi-bill mixed shooting image correction method and system based on deep learning
CN113076607B (en) * 2021-03-30 2024-05-03 上海华力微电子有限公司 Prediction method of chemical mechanical polishing process model
CN114013334B (en) * 2021-11-09 2023-09-15 成都工贸职业技术学院 New energy automobile battery state detection processing apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101377910B1 (en) 2011-06-15 2014-03-24 후지쯔 가부시끼가이샤 Image processing method and image processing apparatus
US9077926B2 (en) 2011-06-15 2015-07-07 Fujitsu Limited Image processing method and image processing apparatus

Also Published As

Publication number Publication date
JP2004228759A (en) 2004-08-12

Similar Documents

Publication Publication Date Title
US9805281B2 (en) Model-based dewarping method and apparatus
JP5934762B2 (en) Document modification detection method by character comparison using character shape characteristics, computer program, recording medium, and information processing apparatus
JP5082637B2 (en) Image processing program, image processing method, and image processing apparatus
JP5387193B2 (en) Image processing system, image processing apparatus, and program
JP3278471B2 (en) Area division method
JP2012243307A (en) Method for detecting strain in input image, device for detecting strain in input image and computer readable medium
JP4013060B2 (en) Image correction method and image correction apparatus
CN109948135B (en) Method and equipment for normalizing image based on form characteristics
US7079265B2 (en) Distortion correction device for correcting imaged object to produce plane image without distortion
CN111353961A (en) Document curved surface correction method and device
CN115619656A (en) Digital file deviation rectifying method and system
CN108197624A (en) The recognition methods of certificate image rectification and device, computer storage media
JP4208520B2 (en) Image processing apparatus, image processing method, program, and storage medium
JPH10285379A (en) Original angle correction method and original angle correction system
JP5844698B2 (en) Character recognition device
JP5563390B2 (en) Image processing apparatus, control method therefor, and program
JP2002077578A (en) Apparatus and method for correcting distortion as well as distortion correction program recording computer readable recording medium
CN115578729B (en) AI intelligent process arrangement method for digital staff
JP3709991B2 (en) Score recognition device
JPH11288453A (en) Method and system for detecting skew angle and black boundary line of original image in scan environment for reproduction
JP4974794B2 (en) Document recognition apparatus, document recognition method, and computer program
JP2008258980A (en) Image information processor, and image inclination angle calculation method
CN117292389A (en) Decimal point digital recognition system and method applied to scanning recognition and electronic equipment
JP3915974B2 (en) Image processing apparatus, image processing method, program, and recording medium
JPH11250179A (en) Character reocognition device and its method

Legal Events

Date Code Title Description
RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20050106

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20050106

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051115

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20060130

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070517

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070523

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070717

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: 20070815

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070828

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

Free format text: PAYMENT UNTIL: 20100921

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees