JP3882427B2 - Image processing apparatus and image processing method - Google Patents
Image processing apparatus and image processing method Download PDFInfo
- Publication number
- JP3882427B2 JP3882427B2 JP30182199A JP30182199A JP3882427B2 JP 3882427 B2 JP3882427 B2 JP 3882427B2 JP 30182199 A JP30182199 A JP 30182199A JP 30182199 A JP30182199 A JP 30182199A JP 3882427 B2 JP3882427 B2 JP 3882427B2
- Authority
- JP
- Japan
- Prior art keywords
- color
- line segment
- extraction
- image
- extracted
- 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
Images
Landscapes
- Facsimile Image Signal Circuits (AREA)
- Color Image Communication Systems (AREA)
- Image Analysis (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、文字要素を含んだカラー文書画像データ中から、文字要素、さらに詳しくは文字要素を構成する線分データを抽出する画像処理装置および画像処理方法に関するものである。
【0002】
【従来の技術】
従来、文書画像データ中からの線分抽出を行う画像処理装置としては、以下に述べるような方法を用いたものが広く知られている。例えば、文書画像データ全面の濃度情報に基づいて二値化処理のための単一のしきい値を決定し、その単一のしきい値を用いて高濃度画素(文字要素)と低濃度画素(非文字要素、背景要素等)を分離することで、線分抽出を行うものがある。また、文書画像データを局所ブロックに分割し各ブロック毎の濃度情報に基づいて二値画像を生成する方法を用いたものや、文書画像データを文字要素の存在する領域と写真等の絵柄が存在する領域とに分割した後に文字要素の存在する領域に対して二値化処理のためのしきい値を設定して二値画像を生成する方法を用いたもの等もある。さらに、カラー文書画像データに対しては、赤(R),緑(G),青(B)の原色成分から明るさを表す明度信号を生成し、それに対して上記の各処理と同様な方法で対応するものも存在する。
【0003】
【発明が解決しようとする課題】
しかしながら、近年ではコンピュータや画像入出力機器およびそれらに用いられる文書処理ソフトウェア等の文書作成環境の変化・進歩に伴って、処理の対象となる文書画像が従来に比べて非常に多様化・複雑化しているため、上述した従来の画像処理装置および画像処置方法では対応することができずに、結果として線分抽出を的確に行えないおそれがある。
【0004】
例えば、図17は、昨今の文書作成環境にて作成される文書画像の一例を示したものである。
従来の画像処理装置および画像処置方法では、図中▲1▼に示すような白背景上の黒文字を構成する線分を主たる抽出対象としている。そのため、図中▲2▼に示すような白背景上の色文字を構成する線分や、図中▲3▼に示すような背景色を有する文字を構成する線分については、白背景上の黒文字の場合と同等の精度で抽出することが困難である。これに対しては、しきい値等のパラメータ設定を変更して、色文字を構成する線分等であっても文字要素と非文字要素との判定時に抽出すべき線分と判定され易くするといった対策も考えられるが、かかる場合には文字ではない要素も誤って文字として抽出してしまう可能性が高くなる。例えば、図中▲4▼に示すような絵柄要素を有する文書については、絵柄要素中のエッジ成分に起因して、その絵柄について文字を構成する線分と判定してしまう誤検出が多く発生する可能性がある。また、この他にも、図中▲5▼に示すような文字背景が一様でない領域や、▲6▼のように色背景上に色文字が存在する領域、あるいは▲7▼のように文字と背景の明暗が反転しているような領域では、さらに線分抽出が困難になってくる。
【0005】
そこで、本発明は、上述したような多様化・複雑化した文書画像データであってもこれに対応することができ、その文書画像データから文字要素を構成する線分データの抽出を的確に行うことのできる画像処理装置および画像処置方法を提供することを目的とする。
【0006】
【課題を解決するための手段】
本発明は、上記目的を達成するために案出された画像処理装置で、画像データを取得する取得手段と、前記取得手段が取得した画像データにおける色成分の出現頻度を基に該画像データに含まれる所定個の色成分を抽出する色抽出手段と、前記色抽出手段が抽出した所定個の色成分に関する色情報を保持記憶する記憶手段と、前記取得手段が取得した画像データと前記記憶手段が保持記憶している色情報との間における色空間上の距離を検出する検出手段と、前記検出手段による検出結果を基に前記記憶手段が保持記憶している色情報により特定される色成分についてのみ前記取得手段が取得した画像データからの線分抽出を行う線分抽出手段とを備えることを特徴とするものである。
【0007】
また、本発明は、上記目的を達成するために案出された画像処理方法で、画像データ中から文字要素を構成する線分データを抽出するための画像処理方法であって、線分データを抽出すべき画像データにおける色成分の出現頻度を基に該画像データに含まれる所定個の色成分を抽出し、抽出した所定個の色成分に関する色情報を保持記憶しておき、線分データを抽出すべき画像データを取得すると該画像データと前記色情報との間における色空間上の距離を検出し、検出した色空間上の距離に基づいて前記色情報により特定される色成分に係る線分データのみを取得した画像データ中から抽出することを特徴とする。
【0008】
既述のように多様化かつ複雑化してきた文書画像ではあるが、数十〜数百万もの色を使用するのは文書中の背景画像や装飾等の絵柄要素であって、文書中の主たる情報である文字や罫線等の線分に使用される色は一般に3〜4色程度である。また、線分に使用される色自体も「黒」、「赤」、「白(反転)」、「濃紺」といったように概ね定まっているのが実情である。
このことから、上記構成の画像処理装置および上記手順による画像処理方法では、色成分の出現頻度を基に抽出した所定個の色成分に関する色情報を保持記憶しておき、線分データを抽出すべき画像データを取得すると、保持記憶している色情報により特定される色成分に係る線分データのみを、取得した画像データから抽出するようになっている。そのため、文書画像中の文字要素に使用される色情報を保持記憶しておけば、その文書画像中に多くの色成分が含まれていても、文字要素に使用される色成分に係る線分データのみを抽出することができる。
【0009】
【発明の実施の形態】
以下、図面に基づき本発明に係る画像処理装置および画像処理方法について説明する。
【0010】
〔第1の実施の形態〕
図1は、本発明の第1の実施の形態における画像処理装置の概略構成を示すブロック図である。
図例のように、本実施形態における画像処理装置は、画像入力部11と、色情報記憶部12と、操作部13と、画像処理部14と、文字画像蓄積部15と、これらの各部を互いに結ぶバス16と、を備えている。
【0011】
画像入力部11は、画像処理装置の外部より、複数の画素データからなる画像データを取得するものである。具体的には、例えばフラットベッドスキャナのように、原稿画像を光学的に読み取って、その原稿画像からR,G,Bの各原色成分で表現されるデジタルカラー画像データを取得するものである。ただし、画像入力部11は、例えば画像処理装置に接続するネットワーク等を通じて外部から画像データを取得するものであってもよい。
なお、画像入力部11が取得する画像データは、R,G,Bそれぞれ8ビット/画素の階調数で、400画素/インチの解像度を有しているものとする。
【0012】
色情報記憶部12は、所定の色成分に関する色情報、さらに詳しくは文字抽出の対象色となる色成分に関する色情報を保持記憶するものである。この色情報記憶部12は、RAM(Random Access Memory) 等の半導体メモリによって構成しても、あるいはHDD(Hard Disk Drive)等の補助記憶装置によって構成してもよい。
【0013】
操作部13は、画像処理装置全体の動作を制御するための操作が行われるもので、画像処理装置のユーザ等が操作するタッチパネルやスイッチ等からなるものである。この操作部13で行われる操作としては、色情報記憶部12に保持記憶させる色情報の設定および入力がある。
【0014】
画像処理部14は、画像入力部11が取得したデジタルカラー画像データに対して、文字要素の抽出処理を行うものである。そのために、画像処理部14は、線分画素抽出部14aと、不要画素除去部14bと、画像合成部14cと、ワークメモリ14dと、から構成されている。
【0015】
線分画素抽出部14aは、画像入力部11が取得したデジタルカラー画像データ中から、所定の色成分に係る線分データ、詳しくは所定の色成分を有した線分画像を構成する画素データを抽出するものである。所定の色成分には、色情報記憶部12に保持記憶されている色情報によって特定されるものが該当する。なお、色情報記憶部12内に複数の色成分に関する色情報が保持記憶されていれば、線分画素抽出部14aは、各色成分毎に線分データの抽出を行うようになっている。
【0016】
不要画素除去部14bは、線分画素抽出部14aで抽出された線分データの中から、文字要素を構成しないと判断されるデータ、例えば誤って抽出されるエッジ画素データやノイズデータなどを除去するものである。なお、不要画素除去部14bも、線分画素抽出部14aと同様に、各色成分毎に不要データの除去を行うようになっている。
【0017】
画像合成部14cは、線分画素抽出部14aによる各色成分毎の線分データの抽出結果および不要画素除去部14bによる各色成分毎の不要データの除去結果を合成して、画像処理部14からの最終的な出力形態となる画像データ、すなわち画像入力部11で取得した中に含まれる文字要素に相当する画像データを生成するものである。
【0018】
ワークメモリ14dは、これら線分画素抽出部14a、不要画素除去部14bおよび画像合成部14cが処理動作を行う際のワークメモリまたはバッファメモリとして用いられるものである。
なお、ワークメモリ14dはRAM等の半導体メモリによって構成されるものであるが、線分画素抽出部14a、不要画素除去部14bおよび画像合成部14cは、所定プログラムを実行するマイクロコンピュータ等によりソフトウエア的に構成しても、あるいは所定機能を有した電子回路等によりハードウエア的に構成してもよい。
【0019】
また、文字画像蓄積部15は、画像処理部14での処理結果である文字要素に相当する画像データを記憶蓄積するものである。そのために、文字画像蓄積部15は、RAM等の半導体メモリまたはHDD等の補助記憶装置によって構成されている。
【0020】
ここで、以上のように構成された画像処理装置における処理動作の概要について説明する。図2は、本実施形態の画像処理装置での処理動作例、すなわち本実施形態の画像処理装置によって行われる画像処理方法の概要を示すフローチャートである。
【0021】
図例のように、本実施形態の画像処理装置では、線分抽出処理に際し、先ずはじめに、抽出対象となる色成分の設定を行う(ステップ101、以下ステップをSと略す)。このとき、抽出対象色は、色情報記憶部12に予め保持記憶されているものであってもよいし、操作部13から新たに指定入力したものであってもよい。図中では、N個の抽出対象色が既に指定され色情報記憶部12内に保持記憶されている場合を例に挙げている。
【0022】
抽出対象色が設定されると、次いで、画像入力部11は、原稿画像に対する読み取りを行って、その原稿画像からR,G,Bの各原色成分で表現されるデジタルカラー画像データを取得する(S102)。ここで取得したカラー画像データは、画像処理部14内のワークメモリ14dに一旦保持される。
【0023】
そして、画像処理部14は、1〜N番目の抽出対象色のうち、先ず1番目の抽出対象色について線分抽出処理を開始する(S103)。すなわち、画像処理部14では、ワークメモリ14d内のカラー画像データを読み出して、これを線分画素抽出部14aに入力する。また、このとき、線分画素抽出部14aには、1番目の抽出対象色に係る色情報が色情報記憶部12からロードされる(S104)。これらにより、線分画素抽出部14aは、入力されたカラー画像データ中から1番目の抽出対象色の色成分を有する線分データを抽出し(S105)、その線分データを不要画素除去部14bへ出力する。
【0024】
不要画素除去部14bでは、線分画素抽出部14aにて抽出された線分データを受け取って、その線分データの中から誤って抽出されたノイズ成分や非文字成分等についての画素データを除去する処理を行う(S106)。そして、その処理後の画像データをワークメモリ14dへ出力して、ワークメモリ14d内に一旦保持記憶させる(S107)。
【0025】
このようにして1番目の抽出対象色についての線分抽出処理が終了すると、次いで、画像処理部14は、2番目以降の抽出対象色に対して(S108)、N番目の抽出対象色の線分抽出処理が終了するまで(S109)、同様の線分抽出処理を繰り返す(S105〜S109)。これにより、ワークメモリ14d内には、N個の抽出対象色全てについての抽出処理結果が保持記憶されることになる。
【0026】
全ての抽出対象色に関する抽出処理が完了すると(S109)、画像処理部14では、画像合成部14cがワークメモリ14d内の全色分の抽出処理結果を取り出してこれらを合成する処理を行う(S110)。この処理によって得られる合成画像データ、すなわち画像処理部14による抽出処理結果は、文字画像蓄積部15に記憶蓄積された後、図示しない文字認識装置等へ送出され、その文字認識装置等での文字認識処理に供されることになる。
【0027】
次に、上述した処理動作のうち、線分画素抽出部14aが行う特定色(1〜N番目の抽出対象色)についての線分抽出処理(図2におけるS105)について詳しく説明する。
図3は、線分画素抽出部14aが行う処理動作の概要を示すフローチャートである。なお、図中において、「R,G,B」は画像入力部11で取得したデジタルカラー画像データの注目画素データ値を、「Ri,Gi,Bi」は色情報記憶部12からロードされる抽出対象色の色情報値を、「OUT」は線分画素抽出部14aによる抽出結果である2値化された画素データを表している。
【0028】
図例のように、線分画素抽出部14aは、線分抽出処理を行うのにあたって、先ず、注目画素データ値R,G,Bと抽出対象色の色情報値Ri,Gi,Biとの差分信号「ΔR,ΔG,ΔB」を生成する(S201)。差分信号ΔR,ΔG,ΔBの生成は、以下の(1)〜(3)式を用いて行う。
【0029】
【数1】
【0030】
【数2】
【0031】
【数3】
【0032】
差分信号ΔR,ΔG,ΔBを生成すると、続いて、線分画素抽出部14aは、これらの差分信号ΔR,ΔG,ΔBを用いて色検出信号「D」を生成する(S202)。色検出信号Dの生成は、以下の(4)式を用いて行う。
【0033】
【数4】
【0034】
ここで算出される色検出信号Dは、注目画素データ値R,G,Bと抽出対象色の色情報値Ri,Gi,Biとの間におけるRGB色空間上の距離を表すものである。すなわち、色検出信号Dは、RGB色空間における各画素の有する色と抽出対象色との距離を示す信号に相当し、その値が大きくなるほど抽出対象色に近い色であることを表している。
【0035】
なお、ここでは、注目画素データ値R,G,Bと抽出対象色の色情報値Ri,Gi,Biとの間のユークリッド距離、すなわち差分信号ΔR,ΔG,ΔBの二乗和の平方根を色検出信号Dとして定義しているが、例えば差分信号ΔR,ΔG,ΔBの平均値など、2点間の隔たりの尺度となる演算でこれを代替することも可能であることはいうまでもない。
【0036】
色検出信号Dを求めると、次いで、線分画素抽出部14aは、求めた色検出信号Dを基に線分抽出を行う。線分抽出は、周知の手法を用いて行えばよい。例えば、注目画素周辺で階調レベルの変化が急峻であり、かつ、注目画素の階調レベルが十分に高い場合に、その注目画素を線分要素とある判断することが考えられる。
【0037】
具体的には、線分画素抽出部14aは、先ず、求めた色検出信号Dを用いて、色検出信号Dのエッジ特徴量「De」およびレベル特徴量「Dl」を算出する(S203,S204)。エッジ特徴量Deおよびレベル特徴量Dlは、それぞれ以下の(5)式および(6)式のように定義される。
【0038】
【数5】
【0039】
【数6】
【0040】
ここで、エッジ特徴量Deは、図4の注目画素近傍における画素配置の説明図に示すように、注目画素を「Dj,k」とすると、注目画素周辺の5×5(主走査×副走査)画素の平均値と注目画素周辺の3×3(主走査×副走査)画素の平均との差分の絶対値に相当する。また、レベル特徴量Dlは、注目画素周辺の3×3(主走査×副走査)画素の平均値に相当する。
なお、(5)式および(6)式中における「M」および「N」は、調整用のオフセットパラメータであり、画像処理装置の特性に応じて予め実験的に定められている定数である。
【0041】
エッジ特徴量Deおよびレベル特徴量Dlを求めると、次いで、線分画素抽出部14aは、これらエッジ特徴量Deおよびレベル特徴量Dlを、それぞれ予め設定されているしきい値THe,THlと比較する。そして、エッジ特徴量Deがしきい値THe以上であり、かつ、レベル特徴量Dlしきい値THl以上であるか否かを判定する(S205)。
【0042】
この判定の結果、De≧THeかつDl≧THlであれば、線分画素抽出部14aは、注目画素Dj,k周辺で階調レベルの変化が急峻であり、かつ、注目画素の階調レベルが十分に高いので、注目画素Dj,kが線分を構成する画素であると判断する。そして、注目画素データ値R,G,Bに対する出力画素データ値OUTをONとする(S206)。その一方で、De≧THeかつDl≧THlでない場合には、線分画素抽出部14aは、出力画素データ値OUTをOFFとする(S207)。
【0043】
このように、線分画素抽出部14aでは、画像入力部11が取得したデジタルカラー画像データを構成する各画素データに対して、抽出対象色の色情報値Ri,Gi,Biとの間の距離を表す色検出信号Dを基に二値化を行う。これにより、線分画素抽出部14aからは、抽出対象色の線分要素に該当する画素データ、すなわち抽出対象色の色成分に係る線分データが抽出され、不要画素除去部14bに対して出力されることになる。
【0044】
なお、ここでは、線分画素抽出部14aが比較的簡便な手法によって線分抽出を行う場合を例に挙げたが、本発明は特にこれに限定されるものではない。例えば、本願出願人が既にした特許出願(特願平11−166676号)で提案しているように、所定の図形形状要素に相当する線分基本要素によりデジタルカラー画像データを走査することで、当該線分基本要素に対応する幅の線分を構成する画素データを抽出すれば、より高精度な線分抽出を行うことが可能となる。
【0045】
次に、本実施形態の画像処理装置による処理動作のうち、不要画素除去部14bが行う不要画素データの除去処理(図2におけるS106)について詳しく説明する。
図5および図6は、不要画素除去部14bが行う処理動作の概要を示す説明図である。なお、図5中の矩形内は、線分画素抽出部14aから出力される二値化後の出力画素データOUTをイメージ化した状態を表している。
【0046】
不要画素除去部14bが行う処理動作は、周知の文書構造認識/像域分離手法に基づくものである。先ず、不要画素除去部14bは、図5(a)に示すように、二値化画像イメージに対し垂直方向および水平方向についての投影分布を作成し、頻度「0」の分布が最も長いポイントで領域を2分割する。さらに、不要画素除去部14bは、図5(b),(c)に示すように、分割した2つの領域のそれぞれに対しても同様の領域分割処理を行う。そして、この処理を各領域が文書を構成する最小単位となるまで繰り返す。
【0047】
その後、不要画素除去部14bは、図6(a)に示すように、分割した各領域内で画素データ値がONである部分について、その外接矩形を生成する。外接矩形を生成すると、不要画素除去部14bは、各外接矩形について特徴量を算出し、その特徴量を基に、各外接矩形が文字要素に相当するものであるか、或いは網点領域や罫線など文字要素以外の文書構成要素や誤って抽出されたノイズ成分に相当するものであるかを判断する。ここで、特徴量としては、外接矩形の面積、縦横比、外接矩形内におけるデータ値がONである部分の面積比、ON/OFF反転回数等を用いることが考えられる。例えば、外接矩形の面積を用いた場合には、文字要素の大きさを表すポイント数を基準に、大きすぎるものや小さすぎるものを文字要素でないと判断する。これらの特徴量を用いた判断の結果、文字画素ではないと判断された外接矩形に属する画素データについては、不要画素除去部14bが図6(b)に示すようにその値をONからOFFに変換する。
【0048】
そして、不要画素除去部14bは、全ての外接矩形に対して処理を終了すると、その処理結果をワークメモリ14d内に保持記憶させる。このような不要画素データの除去処理を、不要画素除去部14bがN個の抽出対象色すべてに対して実行することにより、ワークメモリ14d内には、N個の各抽出対象色について、当該抽出対象色に係る線分データのうち、文字要素を構成する線分データのみが保持記憶されることになる。
【0049】
次に、本実施形態の画像処理装置による処理動作のうち、画像合成部14cが行うN色分の抽出処理結果の合成処理(図2におけるS110)について詳しく説明する。
図7は、画像合成部14cが行う処理動作の概要を示す説明図である。なお、図中では、簡単のため、N=3で、「黒」、「白」、「赤」の3色が抽出対象色として設定されている場合の例を示す。
【0050】
抽出対象色が「黒」、「白」、「赤」の3色である場合、線分画素抽出部14aによる線分抽出処理および不要画素除去部14bによる不要画素データの除去処理が完了すると、ワークメモリ14d内には、図7中に▲1▼で示すような黒色成分に係る二値化線分データと、同じく▲2▼で示すような白色成分に係る二値化線分データと、同じく▲3▼で示すような赤色成分に係る二値化線分データとが、それぞれ個別に蓄積される。ここで、画像合成部14cは、各色成分に係る二値化線分データ▲1▼,▲2▼,▲3▼をワークメモリ14d内から取り出し、これらに対する合成処理を行い、その合成処理結果を文字画像蓄積部15に出力してそこに保存させる。
【0051】
合成処理は、例えば、画像合成部14cが各色成分に係る二値化線分データ▲1▼,▲2▼,▲3▼の論理和を取ることによって行い、これにより最終的な画像処理部14による抽出処理結果、すなわち抽出対象色の文字要素を構成する二値画像データを得る(図7(a)参照)。
【0052】
ただし、合成処理は、以下のように行ってもよい。
例えば、図7(b)に示すように、各色成分に係る二値化線分データ▲1▼,▲2▼,▲3▼に、それぞれの色情報▲4▼を付加した状態で、これらを合成することが考えられる。このときの色情報▲4▼としては、例えば色情報記憶部12に設定されている色No. 等が適当である。このような合成処理を行えば、最終的な画像処理部14による抽出処理結果として、各文字要素の色情報が付加された多層二値画像データを得ることが可能である。
さらには、例えば図7(c)に示すように、二値画像データのヘッダ情報として、色情報▲4▼を付加した2ビットのカラーマップを生成することも考えられる。このとき、色情報の上位1ビットは該当する画素データを表し、下位24ビットはその色成分を表すものとする。このような合成処理を行えば、最終的な画像処理部14による抽出処理結果として、各文字要素の色情報が付加された多値パレット画像データを得ることが可能である。
【0053】
このように、色情報を付加した合成処理を行った場合には、その後に行う後処理に対して大きな付加価値を与えることができる。例えば、文字画像蓄積部15に蓄積される文字画像データについて、後処理として文字認識処理を行う場合に、「黒い文字」や「赤い文字」といった原稿画像上で当該文字が有していた属性を利用することが可能となる。そのため、特にHTML(Hyper Text Markup Language)形式等へのデータ変換を行う場合などには、非常に有効なものとなる。
【0054】
以上のような処理を行った場合の従来技術に対する優位点を図8〜図11を用いて説明する。図8〜図11は、いずれも、従来技術の項で説明した図17と同様に、文書画像の構成要素を示した説明図である。
【0055】
例えば、図8(a)に示すのような一様でない背景を有する文字については、適切に抽出対象色を設定して線分抽出処理を行うことによって、図8(b)に示す二値画像を表す線分データと、図8(c)に示す二値画像を表す線分データとに、分離して抽出することが可能となる。また、これらの線分データに対して不要画素データの除去処理を行うことによって、最終的には図8(b)に示すような文字画像のみを表す線分データを抽出することが可能となる。
【0056】
図9は、反転文字の抽出の様子を示している。通常の明度成分に基づく線分抽出処理を行う場合には、図9(a)のような周辺画素よりも高い明度値(周辺よりも明るい画素データ値)を持つ文字要素を、それ以外の色の文字と同一の処理論理で抽出することが困難である。しかしながら、本実施形態の画像処理装置および画像処理方法によれば、予め設定された抽出対象色からのユークリッド距離(隔たり)に着目して線分データの抽出処理を行うので、図9(b)および(c)に示したように反転した文字列でも良好に抽出することができる。また、図8に示した例と同様に、図9(c)の枠線も文字以外の要素として除去されるため、最終的には図9(b)に示すような文字画像のみを表す線分データを抽出することが可能となる。
【0057】
図10は、背景を有する文字の抽出の様子を示している。図10(a)に示すように背景色を有する領域に文字が存在する場合については、その背景色が抽出対象色でなければ抽出されることがないので、図10(b)に示すように文字画像のみを表す線分データの抽出が可能となる。
【0058】
図11は、図8と場合と同様に、一様でない背景を有する文字の抽出の様子を示している。図11(a)に示すように、背景がグラデーションで表現されるような場合には、明度の差異だけで文字抽出を行うのが非常に困難であるが、本実施形態の画像処理装置および画像処理方法では、抽出すべき文字の色に着目しているため、図11(b)に示すような良好な文字抽出が可能となる。また、図11(c)に示すように、抽出される文字以外の成分に関しては、不要画素データの除去処理を行うことによって消去することが可能である。
【0059】
以上に説明したように、本実施形態の画像処理装置および画像処理方法は、請求項1または6に記載の発明の如く、抽出すべき文字の色に着目し、抽出対象色に係る線分データのみを抽出するようになっている。したがって、文字要素を抽出すべき文書画像中に多くの色成分が含まれていても、従来よりも良好かつ的確に、文字要素を構成する線分データの抽出を行うことができる。
【0060】
また、本実施形態の画像処理装置および画像処理方法は、請求項2または7に記載の発明の如く、抽出した線分データの中から文字要素を構成しないと判断されるデータを除去するようになっている。したがって、文字要素を抽出すべき文書画像が多様化・複雑化しても、これに対応しつつ、従来よりも良好かつ的確に、文字要素を構成する線分データの抽出を行うことができる。
【0061】
さらに、本実施形態の画像処理装置および画像処理方法は、請求項3または8に記載の発明の如く、複数の抽出対象色にも対応し得るようになっている。したがって、文書画像の多様化・複雑化への対応が容易となる。しかも、複数の抽出対象色について順次線分抽出処理を行うことによって、それぞれの色に対する抽出範囲を従来の場合よりもより狭く設定できるので、例えば網点を表す画素データやエッジ部のデータなどの誤抽出を大きく軽減することができるようになる。
【0062】
〔第2の実施の形態〕
次に、本発明の第2の実施の形態について説明する。ただし、ここでは、上述した第1の実施の形態との相違点についてのみ説明するものとする。
【0063】
本実施形態は、上述した第1の実施の形態の場合と、線分画素抽出部14aによる線分抽出処理のみが異なる。詳しくは、第1の実施の形態では、RGB色空間における注目画素データ値R,G,Bと抽出対象色の色情報値Ri,Gi,Biとの間の三次元的距離を、抽出対象色と注目画素色との隔たりを表す尺度としたのに対し、本実施形態では、注目画素データ値R,G,Bとと抽出対象色それぞれの原色成分との間の一次元的距離を色検出用信号とし、これを用いて各原色成分毎の抽出結果の論理積を取ることで、抽出対象となる色線分を有した線分データの抽出を行う点で異なる。
【0064】
以下、図12を用いて、本実施形態における線分抽出処理を詳しく説明する。図12は、線分画素抽出部14aが行う処理動作の他の例を示すフローチャートである。なお、第1の実施の形態の場合(図3参照)と同様に、図12中において、「R,G,B」は画像入力部11で取得したデジタルカラー画像データの注目画素データ値を、「Ri,Gi,Bi」は色情報記憶部12からロードされる抽出対象色の色情報値を、「OUT」は線分画素抽出部14aによる抽出結果である2値化された画素データを表している。
【0065】
図例のように、本実施形態の場合、線分画素抽出部14aは、線分抽出処理を行うのにあたって、先ず、注目画素データの赤成分値Rと抽出対象色の赤成分値Riとの差分信号「ΔR」を生成する(S301)。差分信号ΔRの生成は、第1の実施の形態の場合と同様に(1)式を用いて行う。
【0066】
ここで、差分信号ΔRは、注目画素データの赤成分値Rと抽出対象色の赤成分値Riとの間におけるR軸上の距離を表すものであり、値が大きくなるほど注目画素の赤成分が抽出対象色の赤成分に近い色であることを表している。
【0067】
差分信号ΔRを生成すると、続いて、線分画素抽出部14aは、その差分信号ΔRを基に線分抽出を行う。線分抽出は、周知の手法を用いて行えばよい。例えば、第1の実施の形態で説明した場合と同様に、注目画素周辺で階調レベルの変化が急峻であり、かつ、注目画素の階調レベルが十分に高い場合に、その注目画素を線分要素とある判断することが考えられる。
具体的には、線分画素抽出部14aは、先ず、生成した差分信号ΔRを用いて、そのエッジ特徴量「Re」およびレベル特徴量「Rl」を算出する(S302,S303)。エッジ特徴量Reおよびレベル特徴量Rlは、それぞれ以下の(7)式および(8)式のように定義される。
【0068】
【数7】
【0069】
【数8】
【0070】
ここで、エッジ特徴量Reは、注目画素を「Rj,k」とすると、注目画素周辺の5×5(主走査×副走査)画素の平均値と注目画素周辺の3×3(主走査×副走査)画素の平均との差分の絶対値に相当する。また、レベル特徴量Rlは、注目画素周辺の3×3(主走査×副走査)画素の平均値に相当する(いずれも図4参照)。
なお、(7)式および(8)式中における「Mr」および「Nr」は、調整用のオフセットパラメータであり、画像処理装置の特性に応じて予め実験的に定められている定数である。
【0071】
こうしてエッジ特徴量Reおよびレベル特徴量Rlを求めると、、次いで、線分画素抽出部14aは、これらエッジ特徴量Reおよびレベル特徴量Rlを、それぞれ予め設定されているしきい値THe,THlと比較する。そして、エッジ特徴量Reがしきい値THe以上であり、かつ、レベル特徴量Rlしきい値THl以上であるか否かを判定する(S304)。
【0072】
この判定の結果、Re≧THeかつRl≧THlであれば、線分画素抽出部14aは、注目画素Rj,k周辺で階調レベルの変化が急峻であり、かつ、注目画素の階調レベルが十分に高いので、注目画素Rj,kが線分を構成する画素であると判断する。そして、判定結果信号「Ro」をONとする(S305)。その一方で、Re≧THeかつRl≧THlでない場合には、線分画素抽出部14aは、判定結果信号RoをOFFとする(S306)。
【0073】
以上のような処理を、線分画素抽出部14aは、注目画素データの赤成分値Rについてのみならず、注目画素データの緑成分値Gおよび青成分値Bに対しても全く同様に実施し、それぞれの判定結果信号GoおよびBoを得る(S307〜S318)。
【0074】
こうして判定結果信号Ro,Go,Boを得ると、線分画素抽出部14aは、それぞれの判定結果信号Ro,Go,Boを参照して、これら全ての信号がONであるか否かを判断し(S319)、全てがONであれば出力画素データ値OUTをONとし(S320)、そうでなければ出力画素データ値OUTをOFFとする(S321)。
【0075】
このように、線分画素抽出部14aでは、各原色成分毎に抽出対象色との隔たりを表す尺度を算出し、その判定結果に基づいて最終的な抽出結果を得ることも可能である。このような処理の長所としては、多次元での距離計算が必要な構成に比べ演算量が少なくて済むこと、画像入力部11が画素順次ではなく面順次の形式で画像データを取得した場合にも対応できること、などが挙げられる。
【0076】
なお、上述した第1および第2の実施の形態では、いずれの場合も、請求項4または9に記載の発明の如く、RGB色空間上のユークリッド距離または各原色成分毎の隔たりの距離の検出結果を基に注目画素データを二値化することによって線分抽出を行う場合を例に挙げて説明した。これは、二値化処理を利用すれば、比較的簡単な処理にて良好かつ的確な線分抽出を実現することができるからである。ただし、線分画素抽出部14aは、これに限定されるものではなく、他の手法を用いて線分抽出を行うものであってもよい。
【0077】
〔第3の実施の形態〕
次に、本発明の第3の実施の形態について説明する。ただし、ここでも、上述した第1の実施の形態との相違点についてのみ説明するものとする。
【0078】
本実施形態は、上述した第1の実施の形態の場合と異なり、抽出対象色を操作部13から指定入力するのではなく、画像入力部11が取得したデジタルカラー画像データを参照して自動的に設定する機能を有する点に特徴がある。
図13は、本実施形態における画像処理装置の概略構成を示すブロック図である。なお、図中において、上述した第1の実施の形態と同一の構成要素については、同一の符号を与えてその説明を省略するものとする。
【0079】
図例のように、本実施形態における画像処理装置は、第1の実施の形態における場合に加えて、画像処理部14が使用色検出部14eを有している。
使用色検出部14eは、画像入力部11が取得したデジタルカラー画像データ中から、その中で使用されている文字色や線分色を抽出し、その抽出した色成分に関する色情報を色情報記憶部12に保持記憶させるものである。なお、使用色検出部14eは、所定プログラムを実行するマイクロコンピュータ等によりソフトウエア的に構成しても、あるいは所定機能を有した電子回路等によりハードウエア的に構成してもよい。
【0080】
次に、以上のように構成された画像処理装置における処理動作の概要について説明する。図14は、本実施形態の画像処理装置での処理動作例、すなわち本実施形態の画像処理装置によって行われる画像処理方法の概要を示すフローチャートである。
【0081】
図例のように、本実施形態の画像処理装置では、線分抽出処理に際し、先ずはじめに、抽出対象色の数の設定を行う(S401)。ここでいう数は、後述するように画像入力部11で取得した画像データから検出した色の数のみであっても良いし、例えば「黒」,「赤」等といった色情報記憶部12内に予め保持記憶されている色に検出色を加えた数であっても良い。図中では、色情報記憶部12に予め記憶されているN個の抽出対象色に、画像入力部11で取得した画像データから検出したn個の色を加えた、合わせてN+n個を抽出対象色とする場合を例に挙げている。
【0082】
抽出対象色の数が設定されると、次いで、画像入力部11は、原稿画像に対する読み取りを行って、その原稿画像からR,G,Bの各原色成分で表現されるデジタルカラー画像データを取得する(S402)。ここで取得したカラー画像データは、画像処理部14内のワークメモリ14dに一旦保持される。
【0083】
そして、ワークメモリ14dがカラー画像データを保持すると、画像処理部14の使用色検出部14eは、ワークメモリ14d内のカラー画像データを参照して、そのカラー画像データ中に使用されている色成分を、n個だけ検出する処理を行う(S403)。
【0084】
ここで、使用色検出部14eによるn個分の色検出処理について詳しく説明する。 図15は、使用色検出部14eが行う処理動作の概要を示すフローチャートである。
【0085】
図例のように、使用色検出部14eによる色検出処理は、画像入力部11が取得したカラー画像データ中の色をサンプリング(画像内色サンプリング)するステップ(S500)と、そのサンプリング結果に基づいてn個の色成分を抽出(色抽出)するステップ(S600)と、から構成されている。
【0086】
画像内色サンプリングは、取得したカラー画像データ中のエッジ成分を検出し、そのR,G,B信号の出現頻度を計測することにより行う。このときに検出すべき色成分は、文字要素や線分要素に用いられているものである。そのため、使用色検出部14eは、エッジ部分に用いられる色成分のみをサンプリングし、例えば均一背景やグラデーション域などの色情報のサンプリングは行わない。
【0087】
具体的には、先ず、使用色検出部14eは、エッジ成分の検出のため、エッジ検出用の特徴量「Rdt」,「Gdt」,「Bdt」を算出する(S501,S502,S503)。検出用特徴量Rdt,Gdt,Bdtは、それぞれ以下の(9)〜(11)式のように定義される。
【0088】
【数9】
【0089】
【数10】
【0090】
【数11】
【0091】
ここで、検出用特徴量Rdtは、図16の注目画素近傍における画素配置の説明図に示すように、注目画素を「Rj,k」とすると、注目画素周辺の7×7(主走査×副走査)画素の平均値と注目画素周辺の3×3(主走査×副走査)画素の平均との差分の絶対値に相当する。検出用特徴量Gdt,Bdtについても同様である。また、ここで、(9)〜(11)式中における「Mdt」は、調整用のオフセットパラメータであり、画像処理装置の特性に応じて予め実験的に定められている定数である。
【0092】
検出用特徴量Rdt,Gdt,Bdtを求めると、次いで、使用色検出部14eは、これら検出用特徴量Rdt,Gdt,Bdtを、それぞれ予め設定されているしきい値THdtと比較する。この比較の結果、「Rdt≧THdt」と「Gdt≧THdt」と「Bdt≧THdt」とのいずれかが満たされる場合、すなわちR,G,Bいずれかの原色成分にエッジが存在する場合に、使用色検出部14eは、注目画素がエッジ部分に相当すると判断する(S504)。この判断の結果、注目画素がエッジ部分である場合に、使用色検出部14eは、その注目画素データのR,G,Bの各信号値を検出し、その一方で注目画素がエッジ部分でなければ何の処理も行わない。そして、使用色検出部14eは、以上のような処理を、取得したカラー画像データ中の全画素に対して行い、そのカラー画像データが有する色成分のサンプリング、すなわち出現頻度の計測を完了する(S505,S506)。
【0093】
このようにして画像内色サンプリングを行うと、その後、使用色検出部14eは、そのサンプリング結果によって得られた出現頻度データから、抽出対象となるn個の色成分について色抽出を行う。色抽出処理は、単純に出現頻度の高いn個の色成分を選択することで行われる。
【0094】
具体的には、先ず、使用色検出部14eは、画像データ取得のバラツキや各種ノイズ等を考慮して、画素あたり8ビットの中の上位4ビットを用いて3次元ヒストグラムを生成する(S601)。これにより、三次元の色空間は、4096個の空間に分割されたことになる。次いで、使用色検出部14eは、4096個の局所領域の中で大きな頻度を有するもの上位n個分を代表色領域として選択する(S602)。その後、使用色検出部14eは、画像内色サンプリングで生成された出現頻度データを参照して、選択されたn個の代表色領域(局所領域)内の平均値を算出する(S603)。
【0095】
そして、その算出結果から、使用色検出部14eは、n個の抽出対象色を得る。
ただし、色成分の頻度分布から代表色を選定するアルゴリズムは、この他にも各種提案されている。例えば、三次元色空間を分散の大きな軸から順次分割してn個の領域を生成する手法であるとか、n個の塊を形成するまで領域の統合を繰り返していく手法等、が広く知られている。したがって、使用色検出部14eは、他の手法を用いてn個の抽出対象色を得るようにしてもよい。
【0096】
このような処理によって画像入力部11が取得したカラー画像データ中のn個の使用色成分を検出すると、使用色検出部14eでは、図14に示すように、その検出した色成分に関する情報を色情報記憶部12内に保持記憶させる(S404)。その後は、第1の実施の形態で説明したように、色情報記憶部12内の色情報を基に特定色線分データの抽出を行い(S405〜S407)、不要画素データの除去を経て(S408)、N+n個の抽出対象色に関する抽出処理を文字画像蓄積部15に記憶蓄積する(S409〜S412)。
【0097】
以上に説明したように、本実施形態の画像処理装置および画像処理方法は、請求項5または10に記載の発明の如く、処理対象となる文書画像中の文字や線分に使用されている色を検出し、その検出結果に基づいて特定色の文字画像を抽出するようになっている。したがって、文字要素を抽出すべき文書画像中に多くの色成分が含まれていても、ユーザ等による煩雑な操作を必要とすることなく、抽出対象色に係る線分データのみを従来よりも良好かつ的確に抽出することができるので、その操作性が大きく向上し、ユーザ等にとっては非常に便利なものとなる。
【0098】
【発明の効果】
上述したように、本発明の画像処理装置および画像処理方法では、抽出すべき文字の色に着目し、抽出対象色に係る線分データのみを、取得した画像データから抽出するようになっている。そのため、例えば複雑で多様な構成を持つ文書画像のように、多くの色成分を含むものであっても、従来よりも良好かつ的確に、文字要素に使用される色成分に係る線分データの抽出を行うことができる。
【図面の簡単な説明】
【図1】 本発明の第1の実施の形態における画像処理装置の概略構成を示すブロック図である。
【図2】 第1の実施の形態における画像処理方法の概要を示すフローチャートである。
【図3】 第1の実施の形態における線分画素抽出部が行う処理動作の概要を示すフローチャートである。
【図4】 線分抽出処理を行う際の注目画素近傍における画素配置の一例を示す説明図である。
【図5】 第1の実施の形態における不要画素除去部が行う処理動作の概要を示す説明図(その1)であり、(a)〜(c)はそれぞれ領域分割処理の様子を示す図である。
【図6】 第1の実施の形態における不要画素除去部が行う処理動作の概要を示す説明図(その2)であり、(a)は不要画素除去前の状態を示す図、(b)は不要画素除去後の状態を示す図である。
【図7】 第1の実施の形態における画像合成部が行う処理動作の概要を示す説明図である。
【図8】 線分抽出処理結果の具体例を示す説明図(その1)であり、(a)は処理される原画像を示す図、(b)は抽出される文字画像を示す図、(c)は除去される線分画像を示す図である。
【図9】 線分抽出処理結果の具体例を示す説明図(その2)であり、(a)は処理される原画像を示す図、(b)は抽出される文字画像を示す図、(c)は除去される線分画像を示す図である。
【図10】 線分抽出処理結果の具体例を示す説明図(その3)であり、(a)は処理される原画像を示す図、(b)は抽出される文字画像を示す図である。
【図11】 線分抽出処理結果の具体例を示す説明図(その4)であり、(a)は処理される原画像を示す図、(b)は抽出される文字画像を示す図、(c)は除去される線分画像を示す図である。
【図12】 第2の実施の形態における線分画素抽出部が行う処理動作の概要を示すフローチャートである。
【図13】 第3の実施の形態における画像処理装置の概略構成を示すブロック図である。
【図14】 第3の実施の形態における画像処理方法の概要を示すフローチャートである。
【図15】 第3の実施の形態における使用色検出部が行う処理動作の概要を示すフローチャートである。
【図16】 使用色検出処理を行う際の注目画素近傍における画素配置の一例を示す説明図である。
【図17】 線分抽出処理の対象となる原画像の一例を示す説明図である。
【符号の説明】
11…画像入力部、12…色情報記憶部、14…画像処理部、14a…線分画素抽出部、14b…不要画素除去部、14c…画像合成部、14e…使用色検出部[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing apparatus and an image processing method for extracting character elements, more specifically line segment data constituting the character elements, from color document image data including the character elements.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, as image processing apparatuses that extract line segments from document image data, those using a method described below are widely known. For example, a single threshold value for binarization processing is determined based on density information on the entire surface of document image data, and a high density pixel (character element) and a low density pixel are used using the single threshold value. Some perform line segment extraction by separating (non-character elements, background elements, etc.). Also, there are methods that use a method that generates binary images based on density information for each block by dividing the document image data into local blocks, and document image data that includes areas with character elements and pictures such as photographs. There is also a method using a method of generating a binary image by setting a threshold value for binarization processing for an area where character elements exist after being divided into areas to be processed. Further, for color document image data, a brightness signal representing brightness is generated from the primary color components of red (R), green (G), and blue (B), and the same method as in each of the above processes is generated. There is also a corresponding one.
[0003]
[Problems to be solved by the invention]
However, in recent years, document images to be processed have become extremely diversified and complicated as compared with the past due to changes and advances in the document creation environment such as computers, image input / output devices, and document processing software used in them. Therefore, the conventional image processing apparatus and the image processing method described above cannot cope with it, and as a result, line segment extraction may not be performed accurately.
[0004]
For example, FIG. 17 shows an example of a document image created in a recent document creation environment.
In the conventional image processing apparatus and image processing method, line segments constituting black characters on a white background as indicated by (1) in the figure are mainly extracted. For this reason, the line segment constituting the color character on the white background as shown in (2) in the figure and the line segment constituting the character having the background color as shown in (3) in the figure are on the white background. It is difficult to extract with the same accuracy as that of black characters. In response to this, parameter settings such as a threshold value are changed to make it easy to determine a line segment to be extracted when determining a character element and a non-character element even if the line segment is a color character. However, in such a case, there is a high possibility that an element that is not a character is erroneously extracted as a character. For example, in the case of a document having a picture element as shown in (4) in the figure, many false detections occur due to the edge component in the picture element and the picture is determined to be a line segment constituting a character. there is a possibility. In addition to this, a region where the character background is not uniform as shown in (5) in the figure, a region where color characters exist on the color background as shown in (6), or a character as shown in (7) In a region where the lightness of the background is reversed, line segment extraction becomes more difficult.
[0005]
Therefore, the present invention can cope with diversified and complicated document image data as described above, and accurately extracts line segment data constituting character elements from the document image data. An object of the present invention is to provide an image processing apparatus and an image treatment method that can be used.
[0006]
[Means for Solving the Problems]
The present invention provides an acquisition means for acquiring image data in an image processing apparatus devised to achieve the above object, Color extracting means for extracting a predetermined number of color components included in the image data based on the appearance frequency of the color component in the image data acquired by the acquiring means, and the predetermined number of colors extracted by the color extracting means Storage means for holding and storing color information relating to a color component; detection means for detecting a distance on a color space between the image data acquired by the acquisition means and the color information held and stored by the storage means; Line segment extraction means for extracting line segments from image data acquired by the acquisition means only for color components specified by the color information held and stored by the storage means based on the detection results of the detection means. It is characterized by.
[0007]
The present invention is an image processing method devised to achieve the above object, and is an image processing method for extracting line segment data constituting a character element from image data, A predetermined number of color components included in the image data are extracted based on the appearance frequency of the color components in the image data from which the line segment data is to be extracted. Color information relating to color components is stored and stored, and when image data from which line segment data is to be extracted is acquired, a distance in the color space between the image data and the color information is detected, and the detected color space Only line segment data related to the color component specified by the color information based on the distance is extracted from the acquired image data.
[0008]
Although it is a document image that has been diversified and complicated as described above, dozens to millions of colors use pattern elements such as background images and decorations in the document. In general, colors used for line segments such as information characters and ruled lines are about 3 to 4 colors. In fact, the colors used for the line segments are generally determined as “black”, “red”, “white (inverted)”, “dark blue”, and the like.
Therefore, in the image processing apparatus having the above configuration and the image processing method according to the above procedure, Pre-determined items extracted based on the appearance frequency of color components If the image data for which line segment data is to be extracted is obtained by storing and storing color information related to the color components, only the line segment data relating to the color component specified by the stored color information is obtained. Extracted from data. Therefore, if the color information used for the character elements in the document image is stored and stored, even if the document image includes many color components, the line segments related to the color components used for the character elements Only data can be extracted.
[0009]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an image processing apparatus and an image processing method according to the present invention will be described with reference to the drawings.
[0010]
[First Embodiment]
FIG. 1 is a block diagram showing a schematic configuration of an image processing apparatus according to the first embodiment of the present invention.
As shown in the figure, the image processing apparatus according to this embodiment includes an
[0011]
The
It is assumed that the image data acquired by the
[0012]
The color
[0013]
The
[0014]
The image processing unit 14 performs character element extraction processing on the digital color image data acquired by the
[0015]
The line segment
[0016]
The unnecessary
[0017]
The
[0018]
The
The
[0019]
The character
[0020]
Here, an outline of the processing operation in the image processing apparatus configured as described above will be described. FIG. 2 is a flowchart showing an outline of an image processing method performed by the image processing apparatus of this embodiment, that is, an example of processing operation in the image processing apparatus of this embodiment.
[0021]
As shown in the figure, in the image processing apparatus according to the present embodiment, in the line segment extraction process, first, a color component to be extracted is set (
[0022]
When the extraction target color is set, the
[0023]
Then, the image processing unit 14 starts a line segment extraction process for the first extraction target color among the first to Nth extraction target colors (S103). That is, the image processing unit 14 reads the color image data in the
[0024]
The unnecessary
[0025]
When the line segment extraction process for the first extraction target color is completed in this way, the image processing unit 14 then performs the Nth extraction target color line for the second and subsequent extraction target colors (S108). Until the segment extraction process is completed (S109), the same segment extraction process is repeated (S105 to S109). As a result, the extraction results for all the N extraction target colors are held and stored in the
[0026]
When the extraction process for all the extraction target colors is completed (S109), in the image processing unit 14, the
[0027]
Next, among the processing operations described above, the line segment extraction process (S105 in FIG. 2) for the specific color (1st to Nth extraction target colors) performed by the line segment
FIG. 3 is a flowchart showing an outline of the processing operation performed by the line segment
[0028]
As shown in the figure, in performing the line segment extraction process, the line segment
[0029]
[Expression 1]
[0030]
[Expression 2]
[0031]
[Equation 3]
[0032]
When the difference signals ΔR, ΔG, ΔB are generated, the line segment
[0033]
[Expression 4]
[0034]
The color detection signal D calculated here represents the distance in the RGB color space between the target pixel data value R, G, B and the color information value Ri, Gi, Bi of the color to be extracted. That is, the color detection signal D corresponds to a signal indicating the distance between the color of each pixel in the RGB color space and the extraction target color, and represents a color closer to the extraction target color as the value increases.
[0035]
Here, the color detection is performed for the Euclidean distance between the target pixel data values R, G, B and the color information values Ri, Gi, Bi of the extraction target color, that is, the square root of the square sum of the difference signals ΔR, ΔG, ΔB. Although it is defined as the signal D, it is needless to say that this can be replaced by an operation that is a measure of the distance between the two points, for example, the average value of the difference signals ΔR, ΔG, ΔB.
[0036]
When the color detection signal D is obtained, the line segment
[0037]
Specifically, the line segment
[0038]
[Equation 5]
[0039]
[Formula 6]
[0040]
Here, as shown in the explanatory diagram of the pixel arrangement in the vicinity of the target pixel in FIG. 4, when the target pixel is “Dj, k”, the edge feature amount De is 5 × 5 (main scan × sub scan) around the target pixel. This corresponds to the absolute value of the difference between the average value of the pixels and the average of 3 × 3 (main scanning × sub-scanning) pixels around the target pixel. The level feature amount Dl corresponds to an average value of 3 × 3 (main scanning × sub-scanning) pixels around the target pixel.
Note that “M” and “N” in the equations (5) and (6) are offset parameters for adjustment, and are constants experimentally determined in advance according to the characteristics of the image processing apparatus.
[0041]
When the edge feature amount De and the level feature amount Dl are obtained, the line segment
[0042]
As a result of this determination, if De ≧ THe and Dl ≧ TH1, the line segment
[0043]
As described above, in the line segment
[0044]
In addition, although the case where the line segment
[0045]
Next, of the processing operations performed by the image processing apparatus according to the present embodiment, the unnecessary pixel data removal process (S106 in FIG. 2) performed by the unnecessary
5 and 6 are explanatory diagrams showing an outline of the processing operation performed by the unnecessary
[0046]
The processing operation performed by the unnecessary
[0047]
Thereafter, as shown in FIG. 6A, the unnecessary
[0048]
Then, when the unnecessary
[0049]
Next, among the processing operations performed by the image processing apparatus according to the present embodiment, the composition processing (S110 in FIG. 2) of N color extraction processing results performed by the
FIG. 7 is an explanatory diagram showing an outline of the processing operation performed by the
[0050]
When the extraction target colors are “black”, “white”, and “red”, when the line segment extraction process by the line segment
[0051]
For example, the composition processing is performed by the
[0052]
However, the synthesis process may be performed as follows.
For example, as shown in FIG. 7B, the binarized line segment data (1), (2), (3) relating to each color component is added with the respective color information (4). It is possible to synthesize. As the color information (4) at this time, for example, a color number set in the color
Further, for example, as shown in FIG. 7C, it is conceivable to generate a 2-bit color map to which color information (4) is added as header information of binary image data. At this time, the upper 1 bit of the color information represents the corresponding pixel data, and the lower 24 bits represent the color component. By performing such a synthesis process, it is possible to obtain multi-value palette image data to which color information of each character element is added as a final extraction process result by the image processing unit 14.
[0053]
As described above, when the synthesis process with the color information added is performed, a great added value can be given to the post-processing performed thereafter. For example, when character recognition processing is performed as post-processing for character image data stored in the character
[0054]
Advantages of the conventional technique when the above processing is performed will be described with reference to FIGS. 8 to 11 are explanatory diagrams showing the components of the document image, as in FIG. 17 described in the section of the prior art.
[0055]
For example, for a character having a non-uniform background as shown in FIG. 8A, a binary image shown in FIG. 8B is obtained by appropriately setting an extraction target color and performing line segment extraction processing. Can be separated and extracted into line segment data representing the binary image shown in FIG. 8C. Further, by performing unnecessary pixel data removal processing on these line segment data, it is finally possible to extract line segment data representing only a character image as shown in FIG. .
[0056]
FIG. 9 shows how the inverted characters are extracted. When line segment extraction processing based on a normal lightness component is performed, a character element having a lightness value (pixel data value brighter than the surroundings) than the surrounding pixels as shown in FIG. It is difficult to extract with the same processing logic as that character. However, according to the image processing apparatus and the image processing method of the present embodiment, line segment data extraction processing is performed by paying attention to the Euclidean distance (distance) from a preset extraction target color. And, as shown in (c), even a reversed character string can be extracted well. Similarly to the example shown in FIG. 8, since the frame line in FIG. 9C is also removed as an element other than characters, a line that represents only the character image as shown in FIG. Minute data can be extracted.
[0057]
FIG. 10 shows how characters having a background are extracted. As shown in FIG. 10B, when a character exists in an area having a background color as shown in FIG. 10A, the background color is not extracted unless it is an extraction target color. Line segment data representing only a character image can be extracted.
[0058]
FIG. 11 shows the extraction of characters having a non-uniform background, as in FIG. As shown in FIG. 11A, when the background is expressed by gradation, it is very difficult to extract characters only by the difference in brightness. Since the processing method focuses on the color of the character to be extracted, good character extraction as shown in FIG. 11B is possible. Further, as shown in FIG. 11C, components other than the extracted character can be erased by performing unnecessary pixel data removal processing.
[0059]
As described above, the image processing apparatus and the image processing method according to the present embodiment pay attention to the color of the character to be extracted as in the first or sixth aspect of the invention, and the line segment data related to the extraction target color. Only to extract. Therefore, even if a document image from which a character element is to be extracted contains many color components, it is possible to extract line segment data constituting the character element better and more accurately than in the past.
[0060]
Further, the image processing apparatus and the image processing method according to the present embodiment removes data determined not to constitute a character element from the extracted line segment data, as in the invention described in
[0061]
Furthermore, the image processing apparatus and the image processing method according to the present embodiment can cope with a plurality of extraction target colors as in the invention described in
[0062]
[Second Embodiment]
Next, a second embodiment of the present invention will be described. However, only differences from the first embodiment described above will be described here.
[0063]
This embodiment is different from the above-described first embodiment only in the line segment extraction processing by the line segment
[0064]
Hereinafter, the line segment extraction process in the present embodiment will be described in detail with reference to FIG. FIG. 12 is a flowchart illustrating another example of the processing operation performed by the line segment
[0065]
As shown in the figure, in the case of the present embodiment, the line segment
[0066]
Here, the difference signal ΔR represents the distance on the R-axis between the red component value R of the target pixel data and the red component value Ri of the color to be extracted, and the red component of the target pixel increases as the value increases. It represents that the color is close to the red component of the extraction target color.
[0067]
When the difference signal ΔR is generated, the line segment
Specifically, the line segment
[0068]
[Expression 7]
[0069]
[Equation 8]
[0070]
Here, the edge feature amount Re is an average value of 5 × 5 (main scanning × sub-scanning) pixels around the pixel of interest and 3 × 3 (main scanning × X) around the pixel of interest when the pixel of interest is “Rj, k”. This corresponds to the absolute value of the difference from the average of the sub-scanning pixels. The level feature amount Rl corresponds to the average value of 3 × 3 (main scanning × sub-scanning) pixels around the target pixel (see FIG. 4 for both).
In the equations (7) and (8), “Mr” and “Nr” are offset parameters for adjustment, and are constants experimentally determined in advance according to the characteristics of the image processing apparatus.
[0071]
When the edge feature amount Re and the level feature amount Rl are obtained in this way, the line segment
[0072]
If Re ≧ THe and Rl ≧ THl as a result of this determination, the line segment
[0073]
The line segment
[0074]
When the determination result signals Ro, Go, and Bo are thus obtained, the line segment
[0075]
In this way, the line segment
[0076]
In any of the first and second embodiments described above, the detection of the Euclidean distance in the RGB color space or the separation distance for each primary color component as in the invention described in
[0077]
[Third Embodiment]
Next, a third embodiment of the present invention will be described. Here, however, only differences from the first embodiment described above will be described.
[0078]
Unlike the first embodiment described above, the present embodiment does not specify and input an extraction target color from the
FIG. 13 is a block diagram illustrating a schematic configuration of the image processing apparatus according to the present embodiment. In the figure, the same components as those in the first embodiment described above are given the same reference numerals and the description thereof is omitted.
[0079]
As illustrated, in the image processing apparatus according to the present embodiment, in addition to the case of the first embodiment, the image processing unit 14 includes a use
The used
[0080]
Next, an outline of processing operations in the image processing apparatus configured as described above will be described. FIG. 14 is a flowchart illustrating an example of a processing operation in the image processing apparatus of the present embodiment, that is, an outline of an image processing method performed by the image processing apparatus of the present embodiment.
[0081]
As shown in the figure, in the image processing apparatus of the present embodiment, in the line segment extraction process, first, the number of extraction target colors is set (S401). The number here may be only the number of colors detected from the image data acquired by the
[0082]
When the number of extraction target colors is set, the
[0083]
When the
[0084]
Here, n color detection processes by the used
[0085]
As shown in the figure, the color detection processing by the used
[0086]
In-image color sampling is performed by detecting edge components in the acquired color image data and measuring the appearance frequency of the R, G, B signals. The color components to be detected at this time are those used for character elements and line segment elements. Therefore, the used
[0087]
Specifically, first, the used
[0088]
[Equation 9]
[0089]
[Expression 10]
[0090]
[Expression 11]
[0091]
Here, as shown in the explanatory diagram of the pixel arrangement in the vicinity of the target pixel in FIG. 16, when the target pixel is “Rj, k”, the detection feature amount Rdt is 7 × 7 (main scanning × sub scan) around the target pixel. This corresponds to the absolute value of the difference between the average value of the scanning) pixel and the average of 3 × 3 (main scanning × sub-scanning) pixels around the target pixel. The same applies to the detection feature amounts Gdt and Bdt. Here, “Mdt” in equations (9) to (11) is an offset parameter for adjustment, and is a constant experimentally determined in advance according to the characteristics of the image processing apparatus.
[0092]
When the detection feature amounts Rdt, Gdt, and Bdt are obtained, the use
[0093]
When the in-image color sampling is performed in this manner, the used
[0094]
Specifically, first, the used
[0095]
Then, from the calculation result, the use
However, various other algorithms for selecting a representative color from the frequency distribution of color components have been proposed. For example, a method of generating n regions by sequentially dividing a three-dimensional color space from a large axis of dispersion or a method of repeating region integration until n clusters are formed is widely known. ing. Therefore, the used
[0096]
When n use color components are detected in the color image data acquired by the
[0097]
As described above, the image processing apparatus and the image processing method according to the present embodiment use the colors used for characters and line segments in the document image to be processed as in the invention described in
[0098]
【The invention's effect】
As described above, in the image processing apparatus and the image processing method of the present invention, focusing on the color of the character to be extracted, only the line segment data related to the extraction target color is extracted from the acquired image data. . For this reason, even if the document image includes a large number of color components, such as a document image having a complicated and diverse configuration, the line segment data relating to the color components used for the character elements is better and more accurate than the conventional one. Extraction can be performed.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a schematic configuration of an image processing apparatus according to a first embodiment of the present invention.
FIG. 2 is a flowchart showing an overview of an image processing method according to the first embodiment.
FIG. 3 is a flowchart showing an outline of a processing operation performed by a line segment pixel extraction unit in the first embodiment.
FIG. 4 is an explanatory diagram illustrating an example of a pixel arrangement in the vicinity of a target pixel when performing line segment extraction processing;
FIGS. 5A and 5B are explanatory diagrams (part 1) illustrating an outline of a processing operation performed by an unnecessary pixel removing unit according to the first embodiment, and FIGS. is there.
FIGS. 6A and 6B are explanatory diagrams (part 2) illustrating an outline of a processing operation performed by an unnecessary pixel removing unit according to the first embodiment, where FIG. 6A is a diagram illustrating a state before unnecessary pixel removal, and FIG. It is a figure which shows the state after unnecessary pixel removal.
FIG. 7 is an explanatory diagram illustrating an overview of processing operations performed by an image composition unit according to the first embodiment;
FIGS. 8A and 8B are explanatory diagrams (part 1) illustrating a specific example of the result of line segment extraction processing, where FIG. 8A is a diagram illustrating an original image to be processed, and FIG. 8B is a diagram illustrating a character image to be extracted; c) is a diagram showing a line segment image to be removed.
FIG. 9 is an explanatory diagram (part 2) showing a specific example of the result of line segment extraction processing, where (a) is a diagram showing an original image to be processed, (b) is a diagram showing a character image to be extracted, c) is a diagram showing a line segment image to be removed.
FIG. 10 is an explanatory diagram (part 3) illustrating a specific example of a line segment extraction processing result, where (a) is a diagram illustrating an original image to be processed, and (b) is a diagram illustrating a character image to be extracted; .
FIG. 11 is an explanatory diagram (part 4) of a specific example of a line segment extraction process result; (a) is a diagram illustrating an original image to be processed; (b) is a diagram illustrating a character image to be extracted; c) is a diagram showing a line segment image to be removed.
FIG. 12 is a flowchart illustrating an outline of a processing operation performed by a line segment pixel extraction unit according to the second embodiment.
FIG. 13 is a block diagram illustrating a schematic configuration of an image processing apparatus according to a third embodiment.
FIG. 14 is a flowchart illustrating an overview of an image processing method according to a third embodiment.
FIG. 15 is a flowchart illustrating an outline of a processing operation performed by a used color detection unit according to the third embodiment.
FIG. 16 is an explanatory diagram illustrating an example of a pixel arrangement in the vicinity of a target pixel when performing a use color detection process;
FIG. 17 is an explanatory diagram illustrating an example of an original image that is a target of line segment extraction processing;
[Explanation of symbols]
DESCRIPTION OF
Claims (8)
前記取得手段が取得した画像データにおける色成分の出現頻度を基に該画像データに含まれる所定個の色成分を抽出する色抽出手段と、
前記色抽出手段が抽出した所定個の色成分に関する色情報を保持記憶する記憶手段と、
前記取得手段が取得した画像データと前記記憶手段が保持記憶している色情報との間における色空間上の距離を検出する検出手段と、
前記検出手段による検出結果を基に前記記憶手段が保持記憶している色情報により特定される色成分についてのみ前記取得手段が取得した画像データからの線分抽出を行う線分抽出手段と
を備えることを特徴とする画像処理装置。Acquisition means for acquiring image data;
Color extracting means for extracting a predetermined number of color components included in the image data based on the appearance frequency of the color components in the image data acquired by the acquiring means;
Storage means for holding and storing color information relating to a predetermined number of color components extracted by the color extraction means ;
Detection means for detecting a distance on a color space between the image data acquired by the acquisition means and the color information held and stored by the storage means;
Line segment extraction means for extracting line segments from the image data acquired by the acquisition means only for the color components specified by the color information held and stored by the storage means based on the detection result by the detection means. An image processing apparatus.
線分データを抽出すべき画像データにおける色成分の出現頻度を基に該画像データに含まれる所定個の色成分を抽出し、
抽出した所定個の色成分に関する色情報を保持記憶しておき、
線分データを抽出すべき画像データを取得すると該画像データと前記色情報との間における色空間上の距離を検出し、
検出した色空間上の距離に基づいて前記色情報により特定される色成分に係る線分データのみを取得した画像データ中から抽出する
ことを特徴とする画像処理方法。An image processing method for extracting line segment data constituting a character element from image data,
Extracting a predetermined number of color components included in the image data based on the appearance frequency of the color components in the image data from which line segment data is to be extracted,
Stores and stores color information related to the predetermined number of extracted color components,
When acquiring image data from which line segment data is to be extracted, a distance on the color space between the image data and the color information is detected,
An image processing method, wherein only line segment data related to a color component specified by the color information is extracted from acquired image data based on a detected distance in a color space.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP30182199A JP3882427B2 (en) | 1999-10-25 | 1999-10-25 | Image processing apparatus and image processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP30182199A JP3882427B2 (en) | 1999-10-25 | 1999-10-25 | Image processing apparatus and image processing method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2001127998A JP2001127998A (en) | 2001-05-11 |
JP3882427B2 true JP3882427B2 (en) | 2007-02-14 |
Family
ID=17901580
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP30182199A Expired - Fee Related JP3882427B2 (en) | 1999-10-25 | 1999-10-25 | Image processing apparatus and image processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3882427B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4441300B2 (en) | 2004-03-25 | 2010-03-31 | 株式会社リコー | Image processing apparatus, image processing method, image processing program, and recording medium storing the program |
JP6543025B2 (en) * | 2014-09-12 | 2019-07-10 | キヤノン株式会社 | Image processing apparatus and image processing method |
-
1999
- 1999-10-25 JP JP30182199A patent/JP3882427B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2001127998A (en) | 2001-05-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6139396B2 (en) | Method and program for compressing binary image representing document | |
JP4732250B2 (en) | Information processing apparatus, control method, and computer program | |
JP2002135592A (en) | Image processing apparatus and recording medium | |
JPH07192086A (en) | Picture inclination detection method | |
CN100477722C (en) | Image processing apparatus, image forming apparatus, image reading process apparatus and image processing method | |
JP2003152995A (en) | Image processing device | |
JP2001203876A (en) | Document decorating device and image processor | |
JP5042917B2 (en) | Image processing apparatus and program | |
WO2019181072A1 (en) | Image processing method, computer program, and recording medium | |
JP3882427B2 (en) | Image processing apparatus and image processing method | |
JP3718967B2 (en) | Image feature amount extraction apparatus and method, and recording medium on which image feature amount extraction program is recorded | |
JP4441300B2 (en) | Image processing apparatus, image processing method, image processing program, and recording medium storing the program | |
JP3772262B2 (en) | How to identify the type of an image | |
JP4387907B2 (en) | Image processing method and apparatus | |
US20110187721A1 (en) | Line drawing processing apparatus, storage medium storing a computer-readable program, and line drawing processing method | |
JP6643301B2 (en) | Defect inspection device and defect inspection method | |
US8260057B2 (en) | Image processing apparatus that obtains a ruled line from a multi-value image | |
JPH064669A (en) | Pattern matching device for gradation picture | |
JPH06223177A (en) | Improvement of image processing | |
JP4501822B2 (en) | Image processing device | |
JPS6359272A (en) | Picture processor | |
JP2896919B2 (en) | Image processing device | |
JP2005159971A (en) | Apparatus and method for processing image | |
JPH0490082A (en) | Device for detecting character direction in document | |
JP2001053977A (en) | Color picture contour line extracting device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20060414 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20060418 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20060619 |
|
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: 20061024 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20061106 |
|
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: 20101124 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111124 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111124 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121124 Year of fee payment: 6 |
|
LAPS | Cancellation because of no payment of annual fees |