JP4693289B2 - Image compression apparatus, image compression method, program code, and storage medium - Google Patents
Image compression apparatus, image compression method, program code, and storage medium Download PDFInfo
- Publication number
- JP4693289B2 JP4693289B2 JP2001202450A JP2001202450A JP4693289B2 JP 4693289 B2 JP4693289 B2 JP 4693289B2 JP 2001202450 A JP2001202450 A JP 2001202450A JP 2001202450 A JP2001202450 A JP 2001202450A JP 4693289 B2 JP4693289 B2 JP 4693289B2
- Authority
- JP
- Japan
- Prior art keywords
- image
- text
- color
- text area
- area
- 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)
- Compression Of Band Width Or Redundancy In Fax (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Image Analysis (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、カラー文書画像を圧縮する画像圧縮装置及び画像圧縮方法並びにプログラムコード、記憶媒体に関するものである。
【0002】
【従来の技術】
近年、スキャナの普及により文書の電子化が進んでいる。電子化された文書をフルカラーで所有すると300dpiでA4サイズの場合、約24Mバイトになり、保有するにもメモリを逼迫するし、メール添付などで他人に送信できるサイズではない。フルカラー画像圧縮にはJPEGが知られている。JPEGは写真などの自然画像を圧縮するには非常に効果も高く、画質も良いが、文字部などの高周波部分をJPEG圧縮するとモスキートノイズと呼ばれる画像劣化が発生し、圧縮率も悪い。そこで原画像に対して領域分割を行い、文字領域を抜いた下地部分のJPEG圧縮画像と、色情報付き文字領域部分のMMR圧縮画像を作成する。
【0003】
しかし、上記方法では例えば、黒文字の文章中の赤で示した強調文字の情報が欠落してしまう等、2色以上を用いた文字部を含む画像を上記圧縮方法で圧縮し、この圧縮した画像を伸長した場合、伸長後の画像に含まれる文字部は1色とされてしまう。
【0004】
それに対しカラー文書画像を画質劣化少なく高圧縮する方式として、以下の方法があった。まず、カラー文書画像に対して2値化処理を行い、2値画像を得る。そして2値画像から文字領域を検出する。具体的には、2値画像中の黒画素の輪郭線追跡を行い、すべての黒領域に対してラベル付けする。そしてラベル付けされた黒領域を検索し、黒領域中の文字らしい領域を判定する。そして2値画像の黒の領域に該当する原画像中の領域を黒の領域の周囲の色で塗りつぶし、画像Aを作成する。そして画像Aを縮小した画像BをJPEG圧縮する。そして、2値画像の黒の領域に該当する原画像(カラー文書画像)の領域の色を算出し、複数のパレットを作成する。またパレットに従って原画像に対して減色処理を行い、減色画像を生成する。減色画像が1ビットであるときには、減色画像をMMR圧縮する。減色画像が2ビット以上であるときには、減色画像を可逆圧縮する。
【発明が解決しようとする課題】
しかしながら従来の方式では画像中に多くのテキスト部が存在した場合にテキスト領域の部分的圧縮サイズは小さいがその部分画像の位置座標や色情報(パレット)等のヘッダ情報がそれぞれに付随して加わるため、結果的に圧縮サイズが大きくなるという欠点があった。例えば全面に表が配置された画像の場合には表の各セルがテキスト領域として処理されるため圧縮後のファイルサイズが大きくなってしまう。
【0005】
本発明は以上の問題に鑑みてなされたものであり、テキスト領域を含むカラー文書画像を圧縮する事で得られる圧縮データのサイズを抑えることを目的とする。
【0006】
【課題を解決するための手段】
本発明の目的を達成するために、例えば本発明の画像圧縮装置は以下の構成を備える。
【0007】
即ち、カラー文書画像を圧縮する画像圧縮装置であって、
前記カラー文書画像に含まれるテキスト領域の色を抽出する抽出手段と、
前記テキスト領域において、予め設定された色範囲内の色を有するテキスト領域を包含する包含画像を生成する生成手段と、
前記包含画像及び/又は前記テキスト領域に対して圧縮を行う圧縮手段と
を備え、
前記生成手段は、予め設定された色範囲内の色を有するテキスト領域のうち、注目テキスト領域に結合するテキスト領域を決定する決定手段を備え、
前記注目テキスト領域と、前記決定手段が決定したテキスト領域とを包含する包含画像と、当該包含画像に関する情報を生成し、
前記決定手段は、
前記注目テキスト領域、もしくは前記注目テキスト領域を含む包含画像を圧縮した際に推定される圧縮サイズと、前記テキスト領域を圧縮した際に推定される圧縮サイズとの合計により得られる第1の圧縮サイズと、
前記注目テキスト領域、もしくは前記注目テキスト領域を含む包含画像と前記テキスト領域とを包含する包含画像を圧縮した際に推定される第2の圧縮サイズとを求め、
前記第2の圧縮サイズが前記第1の圧縮サイズよりも小さい場合、前記テキスト領域を前記注目テキスト領域に結合する
ことを特徴とする。
【0011】
【発明の実施の形態】
以下添付図面を参照して、本発明を好適な実施形態に従って詳細に説明する。
【0012】
[第1の実施形態]
図1に本実施形態における画像圧縮装置の基本構成を示す。101はCPUで、RAM102やROM103に格納されたプログラムやデータを用いて本装置全体の制御を行うと共に、後述の画像圧縮処理を行う。102はRAMで、外部記憶装置104や記憶媒体ドライブ109からロードされたプログラムやデータ、画像入力装置108から入力された画像データなどを一時的に記憶するエリアを備えると共に、CPU101が各種の処理を実行する際に用いるワークエリアも備える。103はROMで、本装置全体の制御プログラムやブートプログラム、本装置の設定データ等を格納する。104はハードディスクなどの外部記憶装置で、記憶媒体ドライブ109からロードされたプログラムやデータなどを保存することができる。また、ワークエリアのサイズがRAM102のサイズを越えた場合、越えた分のエリアをファイルとして提供することもできる。105,106は夫々キーボード、マウスで、ポインティングデバイスとして機能し、各種の指示を本装置に入力することができる。
【0013】
107は表示装置で、CRTや液晶画面などにより構成されており、画像情報や文字情報を表示することができる。108は画像入力装置で、スキャナやディジタルカメラなどにより構成されており、画像をデータとして入力することができる。尚、画像入力装置108は本装置と接続するためのインターフェースを含む。109は記憶媒体ドライブで、CD−ROMドライブ、DVD−ROMドライブ、フロッピーディスク(FD)ドライブ等により構成されており、CD−ROMやDVD−ROMやFD等の記憶媒体からプログラムやデータなどを読み込むことができる。110は上述の各部を繋ぐバスである。
【0014】
図2に本実施形態における画像圧縮装置の機能構成を示す。201はカラーの文書画像で、画像201に含まれる文字部(テキスト部)には、複数の色が用いられている。202は2値化部で、カラー文書画像201を2値化処理し、2値画像を生成する。203は領域解析部で、2値画像におけるテキスト領域を特定し、2値画像におけるテキスト領域の位置やサイズなどの情報(テキスト情報)を生成する。テキスト領域の特定方法として、例えば、2値画像中の黒画素の輪郭線追跡を行い、すべての黒領域に対してラベル付けし、ラベル付けされた黒領域を検索し、黒領域中の文字らしい領域(すなわち、テキスト領域と思われる領域)を特定する方法が挙げられるが、これに限定されるものではない。
【0015】
204はテキスト部色抽出部で、各テキスト領域毎に、用いられている色を抽出する。205は画像結合部で、同色が用いられていると判断されたテキスト領域を包含する領域の画像(以下、包含画像)を生成する。206は2値画像圧縮部で、画像結合部205で生成された包含画像、及び/又はテキスト領域に対して圧縮を施す。207は文字部塗りつぶし部で、カラー文書画像201において、領域解析部203で解析されたテキスト領域を所定の色で塗りつぶした画像(以下、下地画像)を生成する。この所定の色は予め決められた色でも良いし、テキスト領域の周辺の画素の平均値でも良い。208は下地画像圧縮部で、文字部塗りつぶし部207で生成された下地画像を圧縮する。
【0016】
尚、図2に示した機能構成に従ったプログラムコードを記憶媒体に格納し、この記憶媒体を記憶媒体ドライブ109を介して図1に示した画像圧縮装置に(記憶媒体ドライブ108を介して)読み込ませてもよい。この場合、読み込んだプログラムをCPU101が実行することで、図1に示した構成を備える画像圧縮装置は図2に示した機能構成を有する装置として動作する。
【0017】
図2の機能構成図を用いて本実施形態におけるカラー文書画像の圧縮方法について説明する。
【0018】
まず、外部記憶装置104もしくは、画像入力装置108もしくは、記憶媒体ドライブ109のいずれかから、カラー文書画像201をRAM102に読み込む。本実施形態ではこのカラー文書画像201として図3Aに示す画像を用いる。
【0019】
次に、RAM102に読み込まれたカラー文書画像201に基づいて、2値化部202は2値画像を生成する。2値画像を生成する方法は特に限定されるものではないが、本実施形態では以下の方法を用いる。まず、カラー文書画像201における輝度データのヒストグラムを取り、2値化閾値Tを算出する。この算出方法はここでは特には限定しないが、例えばヒストグラムの中間値となる輝度値をこの閾値Tとしてもよい。そして2値化閾値Tを用いてカラー文書画像201を2値化し、2値画像を作成する。生成された2値画像はRAM102内において、カラー文書画像201が記憶されているエリアとは別のエリアに記憶される。
【0020】
次に、領域解析部203は上述の2値画像を参照して上述の方法で、テキスト領域を特定する。その際に上述のテキスト情報を生成する。領域解析部203によって領域解析される対象を図3Aに示した画像とした場合、その結果を図3Bに示す。同図ではテキスト領域としてTEXT1〜TEXT5が特定されており、夫々の領域に対してテキスト情報が生成される。このテキスト情報はテキスト部色抽出部204と、文字部塗りつぶし部207に出力される。
【0021】
テキスト部色抽出部204は、テキスト情報を参照してカラー文書画像201におけるテキスト領域を特定し、特定したテキスト領域における色、つまり、テキスト領域内の文字の色を抽出する。図3Bにおいて、本実施形態ではTEXT1とTEXT3の領域は赤の文字、TEXT2とTEXT4の領域は黒の文字、TEXT5は青の文字とする。テキスト部色抽出部204により抽出された各テキスト領域の色はパレット情報として生成される。
【0022】
画像結合部205は、テキスト部色抽出部204により抽出された各テキスト領域TEXT1〜TEXT5における色を前述のパレット情報を参照して、同じ色を用いているテキスト領域を結合する。この場合、TEXT1とTEXT3は同じ色を用いた文字を含んでいるので、これらの領域を包含する領域の画像(包含画像)を生成する。ここで、TEXT1とTEXT3とを包含する領域の画像(包含画像)を生成することを、「TEXT1とTEXT3とを結合する」と呼ぶことにする。この包含画像を図3Cにおいて、TEXT1’で示す。尚、この包含画像内の画素は、文字の部分以外は単色の画素値を有する。TEXT2とTEXT4についても同様である。なお、TEXT2とTEXT4とを包含する包含画像は図3Cにおいて、TEXT2’で示す。また、包含画像TEXT1’、TEXT2’の詳細を夫々図3Dに示す。また、画像結合部205は各包含画像の(2値画像もしくはカラー文書画像201における)位置、サイズを含む包含画像情報を生成する。
【0023】
また、画像結合部205において同じ色を用いているテキスト領域を特定する方法について説明する。テキスト領域内におけるテキストの色がRGB各8ビットであった場合、RGB各2ビット、もしくは3ビットといったように、予め決められた色範囲に減色する。そして各テキスト領域をこのように減色しておいて、同一色になるかどうかを判断する。どの程度まで減色するかは圧縮した画像にどの程度階調性を持たせたいかによって決まる。例えば人の目の青色に対する感度が低いことを利用してRGBを夫々2ビット、2ビット、1ビットとしてもよいし、RGBを夫々3ビット、3ビット、2ビットとしてもよい。
【0024】
また、より正確に同色の判定を行いたい場合はRGB形式ではなく、より色差を比較しやすいLAB形式やYCrCb形式に変換して、2ビットや3ビットに丸めて用いると良い。説明するとRGB形式では黒色を灰及び暗い青色とそれぞれ比較した場合には距離的に暗い青色が近くなるが、LABやYCrCb形式では輝度成分と色成分が分かれているため黒色と暗い青色の分離が可能となる。
【0025】
またスキャンされた文字の色と多少異なるが、黒文字などの輝度の低い色の場合は同色のテキスト領域内の最も輝度の低い色を採用し、逆に白文字などの輝度の高い色の場合は同色のテキスト領域内の最も輝度の高い色を採用すると入力画像の再現性は多少低くなるが見た目が良くなる。
【0026】
2値画像圧縮部206は、各包含画像及び/又はテキスト領域を圧縮するが、複数色を有するテキスト領域も存在する可能性がある。よってテキスト領域に対して圧縮を行う場合、このテキスト領域が1つの色を有するか複数の色を有するかに応じて圧縮方法を変更する。これはテキスト領域のパレット情報を参照することで決定する。このパレット情報を参照した結果、注目テキスト領域が1つの色のみを有している場合、この注目テキスト領域に対してMMR圧縮を行い、注目テキスト領域が複数の色を有する場合、この注目テキスト領域に対して可逆圧縮を行う。また、圧縮結果には上述のパレット情報とテキスト情報をヘッダとして添付する。
【0027】
一方、包含画像を圧縮する際には、MMR圧縮を用いる。またこの圧縮結果には、この包含画像のパレット情報と包含画像情報をヘッダとして添付する。尚、パレット情報は各テキスト領域毎に存在するが、包含画像内のテキスト領域は全て同じパレット情報を有する。よって、包含画像のパレット情報として、包含画像内のテキスト領域のいずれか1つのパレット情報を用いればよい。
【0028】
このようにすることで、各テキスト領域を圧縮すると5つのヘッダ(TEXT1〜TEXT5に対するヘッダ)が作成されるのに対して、本実施形態では3つのヘッダ(TEXT1’、TEXT2’、TEXT5に対するヘッダ)が作成されることになる。その結果、ヘッダの数を減らすことができ、結果として圧縮後のデータのサイズが減ることになる。
【0029】
一方、文字部塗りつぶし部207は、テキスト情報を用いてカラー文書画像201におけるテキスト領域を特定して、特定したテキスト領域を所定の色で塗りつぶした画像(下地画像)を生成する。この下地画像を図3Eに示す。この所定の色は予め決められた色でも良いし、カラー文書画像201におけるテキスト領域の周辺の画素の平均値でも良い。
【0030】
そして下地画像圧縮部208は、文字部塗りつぶし部207で生成された画像(下地画像)に対してJPEG圧縮を行う。
【0031】
以上の説明の通り、本実施形態の画像圧縮装置及び画像圧縮方法によって、テキスト領域を多く含むカラー文書画像を圧縮する場合でも、同じ色を有するテキスト領域を包含する画像を生成し、この画像を圧縮するので、圧縮後の画像に添付されるヘッダの数を減らすことができる。又、同時に、圧縮後のデータのサイズを減らすことができる。
【0032】
[第2の実施形態]
第1の実施形態では、同一色を有するテキスト領域は同じ包含画像に含まれ、MMR圧縮される。しかし同一色を有してはいるが、離れた小さなテキスト領域をこの包含画像に含ませる場合に、逆に圧縮後のサイズが大きくなる場合がある。本実施形態ではこのような場合の画像圧縮方法について、以下説明する。
【0033】
本実施形態における画像圧縮装置の機能構成は、図2に示した機能構成図において画像結合部205における処理が第1の実施形態とは異なる。よって、本実施形態における画像結合部205の処理を図4を用いて説明する。
【0034】
図4は本実施形態の画像結合部205における具体的な処理のフローチャートである。
【0035】
まず、画像結合部205で、同一色であると判定されたテキスト領域群の中から基準となる一つのテキスト領域(以下、基準テキスト領域)を選択する(ステップS401)。もしテキスト領域がなければ、もしくは全テキスト領域に対して後述の処理を終えたのであれば(ステップS402)、本処理を終了する。一方、未処理のテキスト領域が有れば、処理をステップS403に進める。
【0036】
基準テキスト領域の近傍のテキスト領域であって、同一色のテキスト領域を検索し(ステップS403)、この条件に合致する適する領域が有れば、処理をステップS404に進め、この条件に合致するテキスト領域であって、基準テキスト領域に最も近いテキスト領域(以下、近傍テキスト領域)を選択する(ステップS404)。一方、上述の条件に合致したテキスト領域が存在しなければ、処理をステップS409に進め、後述のステップS408で基準テキスト領域と結合したと見なされたテキスト領域を包含する包含画像を作成する(ステップS409)。
【0037】
次に、基準テキスト領域と近傍テキスト領域とを包含する包含画像矩形を決定する(ステップS405)。そして、基準テキスト領域、近傍テキスト領域の夫々を圧縮した場合に、夫々の圧縮データの合計サイズと、包含画像を圧縮した場合の圧縮サイズを推定する(ステップS406)。ここで実際に圧縮を施して正確なサイズを出す方法もあるが、以下の方法で簡易的に算出すれば圧縮サイズの精度は落ちるが処理時間を軽減できる。予め測定していたテキスト領域の圧縮率Aを用いて、2つの領域(基準テキスト領域と近傍テキスト領域)を夫々圧縮した場合に、その合計サイズは、以下の式で推定することができる。
【0038】
圧縮サイズ1=(基準テキスト領域の面積+近傍テキスト領域の面積)×A+2×ヘッダサイズ
一方、包含画像を圧縮する場合、包含画像に含まれる2つの領域、基準テキスト領域と近傍テキスト領域には必ず隙間部分が生じる。この部分は単一の画素値を表すデータで埋められており、テキスト領域を圧縮した場合に比べではるかに高圧縮率で圧縮できる。この圧縮率をBとすると
圧縮サイズ2=(テキスト領域の面積)×A+(隙間部分の面積)×B+ヘッダサイズ
となる。
【0039】
そして、上述の推定結果を用いて圧縮サイズ1と圧縮サイズ2の比較を行い、圧縮サイズ2の方が小さい、つまり、包含画像を圧縮した方が、各領域を別々に圧縮するよりも、発生する圧縮データのサイズが小さくなる場合(ステップS407)、処理をステップS408に進め、結合リストに基準テキスト領域と近傍テキスト領域とを同じ包含画像に含める(結合する)ことを示すデータを追加する(ステップS408)。
【0040】
図5に結合リストの例を示す。同図では、基準テキスト領域をTEXT2とした場合の結合リストの構成例を示したものであり、TEXT2と、各テキスト領域TEXT1〜TEXT5との対応が示されている。同図において、0は結合していないことを示す符号で、1は結合していることを示している符号、999が無効(自身とは結合できない)を示す符号である。結合リストには最初全て結合していないことを示す符号(同図では0)がセットされており、ステップS408における処理を実行したときのみ、結合していることを示す符号(同図では1)に変更される。
【0041】
一方、圧縮サイズ2の方が大きい、つまり、包含画像を圧縮した方が、各領域を別々に圧縮するよりも、発生する圧縮データのサイズが大きくなる場合(ステップS407)、処理をステップS403に戻し、次の近傍テキスト領域を検索する。
【0042】
以上の処理が一巡し、基準テキスト領域と近傍テキスト領域が結合された場合、再び行われるステップS403以降の処理では、一度選択されたテキスト領域以外であって、基準テキスト領域と同一色であって、基準テキスト領域に最も近いテキスト領域を新たな近傍テキスト領域とする(ステップS403,ステップS404)。そして、基準テキスト領域と前回の近傍テキスト領域、そして今回の近傍テキスト領域とを含む包含画像(第2の包含画像)矩形を決定し(ステップS405)、第2の包含画像と今回の近傍テキスト領域について、上述の式を用いて圧縮サイズ1,圧縮サイズ2を推定する(ステップS406)。具体的には以下のような式になる。
【0043】
圧縮サイズ1=(第2の包含画像の面積+近傍テキスト領域の面積)×A+2×ヘッダサイズ
圧縮サイズ2=(テキスト領域の面積)×A+(隙間部分の面積)×B+ヘッダサイズ
そして上述のステップS407以降の処理を行う。このようにすることで、最も多くのテキスト領域を含み、且つ圧縮後のサイズが最も小さい包含画像の作成を行うことができる。
【0044】
[他の実施形態]
また、本発明は上記実施形態を実現する為の装置及び方法のみに限定されるものではなく、上記システム又は装置内のコンピュータ(CPUあるいはMPU)に、上記実施形態を実現する為のソフトウェアのプログラムコードを供給し、このプログラムコードに従って上記システムあるいは装置のコンピュータが上記各種デバイスを動作させることにより上記実施形態を実現する場合も本発明の範疇に含まれる。
【0045】
またこの場合、ソフトウェアのプログラムコード自体が上記実施形態の機能を実現することになり、そのプログラムコード自体、及びそのプログラムコードをコンピュータに供給する為の手段、具体的には上記プログラムコードを格納した記憶媒体は本発明の範疇に含まれる。
【0046】
この様なプログラムコードを格納する記憶媒体としては、例えばフロッピーディスク、ハードディスク、光ディスク、光磁気ディスク、CD−ROM、磁気テープ、不揮発性のメモリカード、ROM等を用いることができる。
【0047】
また、上記コンピュータが、供給されたプログラムコードのみに従って各種デバイスを制御することにより、上記実施形態の機能が実現される場合だけではなく、上記プログラムコードがコンピュータ上で稼働しているOS(オペレーティングシステム)、あるいは他のアプリケーションソフト等と共同して上記実施形態が実現される場合にもかかるプログラムコードは本発明の範疇に含まれる。
【0048】
更に、この供給されたプログラムコードが、コンピュータの機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに格納された後、そのプログラムコードの指示に基づいてその機能拡張ボードや機能格納ユニットに備わるCPU等が実際の処理の一部又は全部を行い、その処理によって上記実施形態が実現される場合も本発明の範疇に含まれる。
【0049】
【発明の効果】
以上の説明により、本発明によって、所定の色範囲内で同じ色を有するテキスト領域を包含する包含画像、及びこの包含画像のヘッダを生成することで、テキスト領域毎に設けられたヘッダの数を包含画像のヘッダの数に減らすことができる。その結果、テキスト領域を含むカラー文書画像を圧縮する事で得られる圧縮データのサイズを抑えることができる。
【図面の簡単な説明】
【図1】本発明の第1の実施形態における画像圧縮装置の基本構成を示す図である。
【図2】本発明の第1の実施形態における画像圧縮装置の機能構成を示す図である。
【図3A】カラー文書画像201を示す図である。
【図3B】領域解析部203により特定したカラー文書画像201のテキスト領域を示す図である。
【図3C】包含画像を示す図である。
【図3D】TEXT1’、TEXT2’の詳細を示す図である。
【図3E】下地画像を示す図である。
【図4】本発明の第2の実施形態の画像結合部205における具体的な処理のフローチャートである。
【図5】結合リストの例を示す図である。[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image compression apparatus, an image compression method, a program code, and a storage medium for compressing a color document image.
[0002]
[Prior art]
In recent years, the digitization of documents has progressed with the spread of scanners. If an electronic document is owned in full color, it will be about 24 Mbytes in 300 dpi and A4 size, and it will not be a size that can be sent to others by attaching a mail, etc. JPEG is known for full-color image compression. JPEG is very effective for compressing natural images such as photographs and has good image quality. However, when JPEG compression is performed on a high-frequency portion such as a character portion, image degradation called mosquito noise occurs, and the compression rate is also poor. Therefore, the original image is divided into regions to create a JPEG compressed image of the background portion from which the character region is removed and an MMR compressed image of the character region portion with color information.
[0003]
However, in the above method, for example, an image including a character part using two or more colors is compressed by the above compression method, such as information on highlighted characters indicated by red in a black character sentence is lost, and the compressed image Is expanded, the character portion included in the expanded image is set to one color.
[0004]
On the other hand, as a method for highly compressing a color document image with little deterioration in image quality, there has been the following method. First, a binarization process is performed on a color document image to obtain a binary image. A character area is detected from the binary image. Specifically, the black pixel contour line in the binary image is traced, and all black regions are labeled. Then, the labeled black area is searched to determine an area that seems to be a character in the black area. Then, an area in the original image corresponding to the black area of the binary image is filled with a color around the black area to create an image A. Then, the image B obtained by reducing the image A is JPEG compressed. Then, the color of the area of the original image (color document image) corresponding to the black area of the binary image is calculated to create a plurality of palettes. Further, a color reduction process is performed on the original image according to the palette to generate a color reduction image. When the reduced color image is 1 bit, the reduced color image is subjected to MMR compression. When the reduced color image is 2 bits or more, the reduced color image is reversibly compressed.
[Problems to be solved by the invention]
However, in the conventional method, when there are many text parts in the image, the partial compression size of the text area is small, but header information such as position coordinates and color information (palette) of the partial image is added to each. As a result, there is a drawback that the compression size increases. For example, in the case of an image in which a table is arranged on the entire surface, each cell of the table is processed as a text area, so the file size after compression becomes large.
[0005]
The present invention has been made in view of the above problems, and an object of the present invention is to suppress the size of compressed data obtained by compressing a color document image including a text area.
[0006]
[Means for Solving the Problems]
In order to achieve the object of the present invention, for example, an image compression apparatus of the present invention comprises the following arrangement.
[0007]
That is, an image compression apparatus for compressing a color document image,
Extracting means for extracting the color of the text area included in the color document image;
Generating means for generating an inclusion image including a text area having a color within a preset color range in the text area;
Compression means for compressing the inclusion image and / or the text region ,
The generating unit includes a determining unit that determines a text region to be combined with a target text region among text regions having a color within a preset color range,
Generating an inclusion image including the attention text area and the text area determined by the determination unit; and information about the inclusion image;
The determining means includes
The first compressed size obtained by the sum of the compressed size estimated when the target text area or the inclusion image including the target text area is compressed and the compressed size estimated when the text area is compressed When,
Obtaining a second compressed size estimated when the attention image area or an inclusion image including the attention text area and an inclusion image including the text area are compressed;
When the second compressed size is smaller than the first compressed size, the text region is combined with the target text region .
[0011]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, the present invention will be described in detail according to preferred embodiments with reference to the accompanying drawings.
[0012]
[First Embodiment]
FIG. 1 shows a basic configuration of an image compression apparatus according to this embodiment. A
[0013]
[0014]
FIG. 2 shows a functional configuration of the image compression apparatus according to this embodiment.
[0015]
A text part
[0016]
2 is stored in a storage medium, and this storage medium is stored in the image compression apparatus shown in FIG. 1 via the storage medium drive 109 (via the storage medium drive 108). It may be read. In this case, when the
[0017]
A color document image compression method according to this embodiment will be described with reference to the functional configuration diagram of FIG.
[0018]
First, the
[0019]
Next, based on the
[0020]
Next, the
[0021]
The text part
[0022]
The
[0023]
A method for specifying a text region using the same color in the
[0024]
If it is desired to determine the same color more accurately, it is preferable to convert the color difference to the LAB format or the YCrCb format for easier comparison of the color difference and round it to 2 bits or 3 bits. To explain, in the RGB format, when comparing black with gray and dark blue, the dark blue becomes closer in distance, but in the LAB and YCrCb formats, the luminance component and the color component are separated, so the black and dark blue can be separated. It becomes possible.
[0025]
The color of the scanned character is slightly different, but if the color is low, such as black characters, the color with the lowest luminance in the text area of the same color is used, and conversely, if the color is high, such as white characters, etc. If the brightest color in the text area of the same color is adopted, the reproducibility of the input image is somewhat lowered but the appearance is improved.
[0026]
The binary
[0027]
On the other hand, when compressing an included image, MMR compression is used. In addition, the palette information and the included image information of the included image are attached to the compression result as a header. Note that palette information exists for each text area, but all text areas in the included image have the same palette information. Therefore, any one palette information of the text area in the inclusion image may be used as the palette information of the inclusion image.
[0028]
In this way, when each text area is compressed, five headers (headers for TEXT1 to TEXT5) are created, whereas in this embodiment, three headers (headers for TEXT1 ′, TEXT2 ′, and TEXT5) are created. Will be created. As a result, the number of headers can be reduced, and as a result, the size of the compressed data is reduced.
[0029]
On the other hand, the character
[0030]
Then, the background
[0031]
As described above, even when a color document image including many text areas is compressed by the image compression apparatus and the image compression method according to the present embodiment, an image including a text area having the same color is generated, Since compression is performed, the number of headers attached to the compressed image can be reduced. At the same time, the size of the compressed data can be reduced.
[0032]
[Second Embodiment]
In the first embodiment, text regions having the same color are included in the same inclusion image and subjected to MMR compression. However, when a small text area that is the same color but is included in the included image is included, the size after compression may increase. In this embodiment, an image compression method in such a case will be described below.
[0033]
The functional configuration of the image compression apparatus in the present embodiment is different from the first embodiment in the processing in the
[0034]
FIG. 4 is a flowchart of specific processing in the
[0035]
First, the
[0036]
A text area in the vicinity of the reference text area that has the same color is searched (step S403). If there is a suitable area that matches this condition, the process proceeds to step S404, and the text that matches this condition is found. A text area closest to the reference text area (hereinafter referred to as a neighboring text area) is selected (step S404). On the other hand, if there is no text area that matches the above-described conditions, the process proceeds to step S409, and an inclusion image including the text area considered to be combined with the reference text area in step S408 described later is created (step S408). S409).
[0037]
Next, an inclusion image rectangle including the reference text region and the neighboring text region is determined (step S405). Then, when each of the reference text area and the neighboring text area is compressed, the total size of the respective compressed data and the compressed size when the inclusion image is compressed are estimated (step S406). Here, there is a method of actually compressing and obtaining an accurate size, but if it is simply calculated by the following method, the processing time can be reduced although the accuracy of the compression size is reduced. When the two areas (reference text area and neighboring text area) are compressed using the compression ratio A of the text area measured in advance, the total size can be estimated by the following equation.
[0038]
[0039]
Then, the
[0040]
FIG. 5 shows an example of a combined list. In the figure, a configuration example of the combined list when the reference text area is TEXT2 is shown, and correspondence between TEXT2 and each text area TEXT1 to TEXT5 is shown. In the figure, 0 is a code indicating that they are not combined, 1 is a code indicating that they are combined, and 999 is a code indicating invalid (cannot be combined with itself). A code (0 in the figure) indicating that all items are not initially combined is set in the combination list, and a code (1 in the figure) indicating that the items are combined only when the process in step S408 is executed. Changed to
[0041]
On the other hand, if the compressed size 2 is larger, that is, if the size of the generated compressed data is larger when compressing the included image than when compressing each area separately (step S407), the process goes to step S403. Go back and search the next neighborhood text area.
[0042]
When the above process is completed and the reference text area and the adjacent text area are combined, the process after step S403 is performed again, except for the text area selected once, and the same color as the reference text area. The text area closest to the reference text area is set as a new neighboring text area (steps S403 and S404). Then, an inclusion image (second inclusion image) rectangle including the reference text area, the previous neighborhood text area, and the current neighborhood text area is determined (step S405), and the second inclusion image and the current neighborhood text area are determined. , The
[0043]
[0044]
[Other Embodiments]
Further, the present invention is not limited to only the apparatus and method for realizing the above-described embodiment, and a software program for realizing the above-described embodiment on a computer (CPU or MPU) in the system or apparatus. A case where the embodiment is realized by supplying a code and causing the computer of the system or apparatus to operate the various devices according to the program code is also included in the scope of the present invention.
[0045]
In this case, the software program code itself realizes the functions of the above embodiment, and the program code itself and means for supplying the program code to the computer, specifically, the program code is stored. The storage medium is included in the category of the present invention.
[0046]
As a storage medium for storing such a program code, for example, a floppy disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a magnetic tape, a nonvolatile memory card, a ROM, or the like can be used.
[0047]
The computer controls various devices according to only the supplied program code, so that not only the functions of the above embodiments are realized, but also the OS (operating system) on which the program code is running on the computer. In the case where the above embodiment is realized in cooperation with other application software or the like, such program code is also included in the scope of the present invention.
[0048]
Further, after the supplied program code is stored in the memory of the function expansion board of the computer or the function expansion unit connected to the computer, the program code is stored in the function expansion board or function storage unit based on the instruction of the program code. A case in which the CPU or the like provided performs part or all of the actual processing and the above-described embodiment is realized by the processing is also included in the scope of the present invention.
[0049]
【The invention's effect】
As described above, according to the present invention, the number of headers provided for each text area is generated by generating an inclusion image including a text area having the same color within a predetermined color range and a header of the inclusion image. The number of headers of the included image can be reduced. As a result, the size of the compressed data obtained by compressing the color document image including the text area can be suppressed.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating a basic configuration of an image compression apparatus according to a first embodiment of the present invention.
FIG. 2 is a diagram illustrating a functional configuration of the image compression apparatus according to the first embodiment of the present invention.
3A is a diagram showing a
3B is a diagram showing a text area of the
FIG. 3C is a diagram showing an inclusion image.
FIG. 3D is a diagram showing details of TEXT1 ′ and TEXT2 ′.
FIG. 3E is a diagram showing a base image.
FIG. 4 is a flowchart of specific processing in an
FIG. 5 is a diagram illustrating an example of a combined list.
Claims (16)
前記カラー文書画像に含まれるテキスト領域の色を抽出する抽出手段と、
前記テキスト領域において、予め設定された色範囲内の色を有するテキスト領域を包含する包含画像を生成する生成手段と、
前記包含画像及び/又は前記テキスト領域に対して圧縮を行う圧縮手段と
を備え、
前記生成手段は、予め設定された色範囲内の色を有するテキスト領域のうち、注目テキスト領域に結合するテキスト領域を決定する決定手段を備え、
前記注目テキスト領域と、前記決定手段が決定したテキスト領域とを包含する包含画像と、当該包含画像に関する情報を生成し、
前記決定手段は、
前記注目テキスト領域、もしくは前記注目テキスト領域を含む包含画像を圧縮した際に推定される圧縮サイズと、前記テキスト領域を圧縮した際に推定される圧縮サイズとの合計により得られる第1の圧縮サイズと、
前記注目テキスト領域、もしくは前記注目テキスト領域を含む包含画像と前記テキスト領域とを包含する包含画像を圧縮した際に推定される第2の圧縮サイズとを求め、
前記第2の圧縮サイズが前記第1の圧縮サイズよりも小さい場合、前記テキスト領域を前記注目テキスト領域に結合する
ことを特徴とする画像圧縮装置。An image compression apparatus for compressing a color document image,
Extracting means for extracting the color of the text area included in the color document image;
Generating means for generating an inclusion image including a text area having a color within a preset color range in the text area;
Compression means for compressing the inclusion image and / or the text region ,
The generating unit includes a determining unit that determines a text region to be combined with a target text region among text regions having a color within a preset color range,
Generating an inclusion image including the attention text area and the text area determined by the determination unit; and information about the inclusion image;
The determining means includes
The first compressed size obtained by the sum of the compressed size estimated when the target text area or the inclusion image including the target text area is compressed and the compressed size estimated when the text area is compressed When,
Obtaining a second compressed size estimated when the attention image area or an inclusion image including the attention text area and an inclusion image including the text area are compressed;
An image compression apparatus for combining the text area with the target text area when the second compression size is smaller than the first compression size .
前記抽出手段は、前記2値画像からテキスト領域を特定し、前記カラー文書画像において、前記特定したテキスト領域に該当する領域に含まれる色を抽出することを特徴とする請求項1に記載の画像圧縮装置。Further, the image processing apparatus includes binarization means for performing binarization processing on the color document image and generating a binary image,
The image according to claim 1, wherein the extraction unit specifies a text region from the binary image, and extracts a color included in a region corresponding to the specified text region in the color document image. Compression device.
前記下地画像を圧縮する下地画像圧縮手段と
を備えることを特徴とする請求項1乃至9のいずれか1項に記載の画像圧縮装置。Further, in the color document image, a background image generation means for generating a background image in which a text area is filled with a predetermined color;
The image compression apparatus according to any one of claims 1 to 9, characterized in that it comprises a base image compressing means for compressing the base image.
前記カラー文書画像に含まれるテキスト領域の色を抽出する抽出工程と、
前記テキスト領域において、予め設定された色範囲内の色を有するテキスト領域を包含する包含画像を生成する生成工程と、
前記包含画像及び/又は前記テキスト領域に対して圧縮を行う圧縮工程と
を備え、
前記生成工程は、予め設定された色範囲内の色を有するテキスト領域のうち、注目テキスト領域に結合するテキスト領域を決定する決定工程を備え、
前記注目テキスト領域と、前記決定工程で決定したテキスト領域とを包含する包含画像と、当該包含画像に関する情報を生成し、
前記決定工程では、
前記注目テキスト領域、もしくは前記注目テキスト領域を含む包含画像を圧縮した際に推定される圧縮サイズと、前記テキスト領域を圧縮した際に推定される圧縮サイズとの合計により得られる第1の圧縮サイズと、
前記注目テキスト領域、もしくは前記注目テキスト領域を含む包含画像と前記テキスト領域とを包含する包含画像を圧縮した際に推定される第2の圧縮サイズとを求め、
前記第2の圧縮サイズが前記第1の圧縮サイズよりも小さい場合、前記テキスト領域を前記注目テキスト領域に結合する
ことを特徴とする画像圧縮方法。An image compression method performed by an image compression apparatus for compressing a color document image,
An extraction step of extracting a color of a text region included in the color document image;
A generating step for generating an inclusion image including a text region having a color within a preset color range in the text region;
A compression step of compressing the inclusion image and / or the text region ,
The generating step includes a determining step of determining a text region to be combined with a target text region among text regions having a color within a preset color range,
Generating an inclusion image including the text region of interest and the text region determined in the determination step, and information about the inclusion image;
In the determination step,
The first compressed size obtained by the sum of the compressed size estimated when the target text area or the inclusion image including the target text area is compressed and the compressed size estimated when the text area is compressed When,
Obtaining a second compressed size estimated when the attention image area or an inclusion image including the attention text area and an inclusion image including the text area are compressed;
An image compression method comprising combining the text area with the text area of interest when the second compressed size is smaller than the first compressed size .
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2001202450A JP4693289B2 (en) | 2001-07-03 | 2001-07-03 | Image compression apparatus, image compression method, program code, and storage medium |
US09/931,890 US7133565B2 (en) | 2000-08-25 | 2001-08-20 | Image processing apparatus and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2001202450A JP4693289B2 (en) | 2001-07-03 | 2001-07-03 | Image compression apparatus, image compression method, program code, and storage medium |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2003018413A JP2003018413A (en) | 2003-01-17 |
JP2003018413A5 JP2003018413A5 (en) | 2008-08-21 |
JP4693289B2 true JP4693289B2 (en) | 2011-06-01 |
Family
ID=19039252
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2001202450A Expired - Fee Related JP4693289B2 (en) | 2000-08-25 | 2001-07-03 | Image compression apparatus, image compression method, program code, and storage medium |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4693289B2 (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005020227A (en) | 2003-06-25 | 2005-01-20 | Pfu Ltd | Picture compression device |
JP4695914B2 (en) * | 2004-07-05 | 2011-06-08 | パナソニック株式会社 | Image processing apparatus and image processing method |
JP4736489B2 (en) * | 2005-03-22 | 2011-07-27 | 富士ゼロックス株式会社 | Image processing device |
JP2007174523A (en) | 2005-12-26 | 2007-07-05 | Canon Inc | Image processing apparatus, image processing method, program code and storage medium |
JP4816328B2 (en) | 2006-08-24 | 2011-11-16 | 富士ゼロックス株式会社 | Image processing system, image compression system, image editing system, image processing program, and image processing apparatus |
JP4707751B2 (en) | 2009-05-21 | 2011-06-22 | シャープ株式会社 | Image compression method, image compression apparatus, image forming apparatus, computer program, and recording medium |
JP5089713B2 (en) | 2010-01-18 | 2012-12-05 | シャープ株式会社 | Image compression apparatus, compressed image output apparatus, image compression method, computer program, and recording medium |
JP5663364B2 (en) * | 2010-03-29 | 2015-02-04 | 株式会社東芝 | Image forming apparatus and control method thereof |
JP5036844B2 (en) | 2010-04-15 | 2012-09-26 | シャープ株式会社 | Image compression apparatus, image output apparatus, image reading apparatus, image compression method, computer program, and recording medium |
USD969880S1 (en) | 2019-09-25 | 2022-11-15 | Raymond E. Bergeron | Clamshell dredging bucket |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06223172A (en) * | 1993-01-22 | 1994-08-12 | Canon Inc | Method and processor for image processing |
JPH11261833A (en) * | 1998-03-11 | 1999-09-24 | Fuji Xerox Co Ltd | Image processor and image transmitter |
JPH11308463A (en) * | 1998-04-17 | 1999-11-05 | Sanyo Electric Co Ltd | Image processor and image processing method |
JP2000125111A (en) * | 1998-10-20 | 2000-04-28 | Fujitsu Ltd | Picture compression method, picture restoration method, picture compression device, picture reader, picture compression program storage medium and picture restoration program storage medium |
JP2000350040A (en) * | 1999-06-07 | 2000-12-15 | Minolta Co Ltd | Image processor, image processing method and recording medium with image processing program recorded therein |
-
2001
- 2001-07-03 JP JP2001202450A patent/JP4693289B2/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06223172A (en) * | 1993-01-22 | 1994-08-12 | Canon Inc | Method and processor for image processing |
JPH11261833A (en) * | 1998-03-11 | 1999-09-24 | Fuji Xerox Co Ltd | Image processor and image transmitter |
JPH11308463A (en) * | 1998-04-17 | 1999-11-05 | Sanyo Electric Co Ltd | Image processor and image processing method |
JP2000125111A (en) * | 1998-10-20 | 2000-04-28 | Fujitsu Ltd | Picture compression method, picture restoration method, picture compression device, picture reader, picture compression program storage medium and picture restoration program storage medium |
JP2000350040A (en) * | 1999-06-07 | 2000-12-15 | Minolta Co Ltd | Image processor, image processing method and recording medium with image processing program recorded therein |
Also Published As
Publication number | Publication date |
---|---|
JP2003018413A (en) | 2003-01-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7133565B2 (en) | Image processing apparatus and method | |
JP4732250B2 (en) | Information processing apparatus, control method, and computer program | |
JP4366011B2 (en) | Document processing apparatus and method | |
US6999619B2 (en) | Processing for accurate reproduction of symbols and other high-frequency areas in a color image | |
JP3828210B2 (en) | Image contrast enhancement method | |
US7352898B2 (en) | Image processing apparatus, image processing method and program product therefor | |
US6898316B2 (en) | Multiple image area detection in a digital image | |
US20040165782A1 (en) | Image processing apparatus | |
JP4366003B2 (en) | Image processing apparatus and image processing method | |
JP2003018412A (en) | Image compressor, and image compression method, program code and storage medium | |
JP4693289B2 (en) | Image compression apparatus, image compression method, program code, and storage medium | |
JP2010056827A (en) | Apparatus and program for processing image | |
JPH10198802A (en) | Image processor, image processing method, and medium recording image processing program | |
JP3715905B2 (en) | Image processing apparatus, image processing method, program, and storage medium | |
US8369614B2 (en) | Edge control in a digital color image via tone and size dependent dilation of pixels | |
US7075681B1 (en) | System and method for reducing the data volume of images | |
US6360006B1 (en) | Color block selection | |
JP2003244447A (en) | Image processor and image processing method | |
US7333240B2 (en) | Color image processor | |
JP4920814B2 (en) | Image processing method, apparatus, and recording medium | |
JP6370080B2 (en) | Image processing apparatus, image processing method, and program. | |
JP4441300B2 (en) | Image processing apparatus, image processing method, image processing program, and recording medium storing the program | |
JP2004120092A (en) | Image processing apparatus, image processing system, image processing method, storage medium, and program | |
JP2003338935A (en) | Image processing equipment and method therefor | |
JP2000013596A (en) | Device and method for processing image and recording medium with image processing program recorded there |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080703 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080703 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20101129 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20101206 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110128 |
|
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: 20110218 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20110222 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140304 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4693289 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |