JP2021061564A - Image processing device, image processing method, and program - Google Patents
Image processing device, image processing method, and program Download PDFInfo
- Publication number
- JP2021061564A JP2021061564A JP2019186008A JP2019186008A JP2021061564A JP 2021061564 A JP2021061564 A JP 2021061564A JP 2019186008 A JP2019186008 A JP 2019186008A JP 2019186008 A JP2019186008 A JP 2019186008A JP 2021061564 A JP2021061564 A JP 2021061564A
- Authority
- JP
- Japan
- Prior art keywords
- character
- image
- color
- character color
- correction
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000012545 processing Methods 0.000 title claims abstract description 54
- 238000003672 processing method Methods 0.000 title claims description 4
- 238000012937 correction Methods 0.000 claims abstract description 67
- 238000000605 extraction Methods 0.000 claims abstract description 32
- 230000009467 reduction Effects 0.000 claims abstract description 30
- 238000000034 method Methods 0.000 claims description 54
- 230000008569 process Effects 0.000 claims description 43
- 230000006835 compression Effects 0.000 claims description 34
- 238000007906 compression Methods 0.000 claims description 34
- 230000008859 change Effects 0.000 claims description 11
- 238000006243 chemical reaction Methods 0.000 claims description 8
- 230000002194 synthesizing effect Effects 0.000 claims 1
- 239000000284 extract Substances 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 23
- 239000003086 colorant Substances 0.000 description 20
- 238000005520 cutting process Methods 0.000 description 6
- 238000004364 calculation method Methods 0.000 description 5
- 238000003708 edge detection Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 230000006866 deterioration Effects 0.000 description 3
- 206010034719 Personality change Diseases 0.000 description 2
- 241000255925 Diptera Species 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 239000000470 constituent Substances 0.000 description 1
- -1 for example Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
Images
Abstract
Description
本発明は、画像処理装置、画像処理方法、およびプログラムに関し、詳しくは、画像圧縮を文字領域と背景領域等その他の領域とで、異なる形態の圧縮を行う技術に関するものである。 The present invention relates to an image processing apparatus, an image processing method, and a program, and more particularly to a technique for performing image compression in different forms in a character area and another area such as a background area.
この種の技術は、圧縮する画像を文字領域とそれ以外の写真領域や背景領域に分け、文字領域にはMMR方式の圧縮を行い、写真領域や背景領域にはJPEG方式の圧縮を行っている。これにより、画像の文字部分をJPEG方式で圧縮する場合に生じ得るモスキートノイズと呼ばれる画像劣化の発生を防いでいる。 In this type of technology, the image to be compressed is divided into a character area and other photographic areas and background areas, the character area is compressed by the MMR method, and the photographic area and the background area are compressed by the JPEG method. .. This prevents the occurrence of image deterioration called mosquito noise that may occur when the character portion of the image is compressed by the JPEG method.
特許文献1は、このように画像の領域を分け、領域ごとに圧縮の方式を異ならせる場合に、圧縮された画像から文字領域の代表色を抽出する際にその色情報が変化するという問題を開示している。そして、この問題を解決すべく、特許文献1では、圧縮を二段階で行い、圧縮率が小さい画像に対して代表色抽出を行い、上記色情報の変化を低減するとしている。
しかしながら、特許文献1では、段階的な圧縮で圧縮率を小さくして文字の色情報の劣化を低減しようとしても、その小さくした圧縮率に応じた色変化がわずかであったとしても生じることになる。これは、程度の差はあれ、最終的に得られる画像において画質劣化の原因となり得る。
However, in
本発明の目的は、圧縮された画像における文字色抽出によって文字の色変化が生じたとしても、最終的に生成する画像における文字の色変化を防ぐことが可能な技術を提供することである。 An object of the present invention is to provide a technique capable of preventing a character color change in a finally generated image even if a character color change occurs due to character color extraction in a compressed image.
上記目的を達成するために本発明の一態様に係る画像処理装置は、第1画像を該第1画像より低い解像度の第2画像に変換する縮小手段と、前記縮小手段によって得られる前記第2画像の文字領域における文字色を抽出する抽出手段と、前記抽出手段によって抽出された文字色を、当該文字色の色値と前記第2画像の文字領域における背景色の色値との関係に基づいて補正する補正手段と、前記補正手段によって文字色が補正された前記文字領域を含む画像として、前記第1画像が圧縮された圧縮画像を生成する生成手段と、を有することを特徴とする。 In order to achieve the above object, the image processing apparatus according to one aspect of the present invention includes a reduction means for converting a first image into a second image having a resolution lower than that of the first image, and the second reduction means obtained by the reduction means. The extraction means for extracting the character color in the character area of the image and the character color extracted by the extraction means are based on the relationship between the color value of the character color and the color value of the background color in the character area of the second image. It is characterized by having a correction means for correcting the image and a generation means for generating a compressed image in which the first image is compressed as an image including the character area whose character color is corrected by the correction means.
本発明によれば、圧縮された画像における文字色抽出によって文字の色変化が生じたとしても、最終的に生成する画像における文字の色変化を防ぐことが可能となる。 According to the present invention, even if the character color change occurs due to the character color extraction in the compressed image, it is possible to prevent the character color change in the finally generated image.
以下、本発明を実施するための形態について図面を参照して詳細に説明する。ただし、この実施形態に記載されている構成要素はあくまで例示であり、本発明の範囲をそれらに限定する趣旨のものではない。また、実施形態で説明されている構成要素の組み合わせのすべてが、課題を解決するための手段に必須のものとは限らず、種々の変形及び変更が可能である。 Hereinafter, embodiments for carrying out the present invention will be described in detail with reference to the drawings. However, the components described in this embodiment are merely examples, and are not intended to limit the scope of the present invention to them. Moreover, not all of the combinations of components described in the embodiments are essential for the means for solving the problem, and various modifications and changes are possible.
先ず、本発明の実施形態を説明する前に、圧縮画像において文字の色抽出を行うことによって文字の色変化が生じることについて説明する。画像圧縮によって、一例として、解像度が300dpiの入力画像における縦横2×2画素の色が、縮小された、解像度が150dpiの画像における1画素の色にまとめられてしまうことを説明する。図1は、この色の変化を説明するための模式図である。図1において、符号601、符号602、符号603は、解像度300dpiの入力画像(第1画像)を示し、それぞれ白背景上の文字、色背景上の文字、反転文字を表している。符号604、符号605、符号606は、上記入力画像のデータを圧縮して得られる、解像度150dpiの縮小画像(第2画像)を示している。符号607、符号608、符号609は、縮小画像604〜606に対して文字色抽出を行って得られる文字色を表した2値画像を示している。
First, before explaining the embodiment of the present invention, it will be described that the color of the character is changed by extracting the color of the character in the compressed image. As an example, it will be described that the color of 2 × 2 pixels in the vertical and horizontal directions in an input image having a resolution of 300 dpi is combined into the color of one pixel in a reduced image having a resolution of 150 dpi by image compression. FIG. 1 is a schematic diagram for explaining this color change. In FIG. 1,
入力画像601を圧縮して得られえる縮小画像604は、縮小によって文字のエッジ部が薄くなっている様子(グレー(R、G、B)=(128、128、128))を示している。これは、図2に示すように、入力画像601における縦横2×2画素の色が、1画素の色にまとめられてしまう(平均化されてしまう)ためである。なお、図2は、入力画像601における画素610、および縮小画像604における画素611を拡大して示す図である。以上のように1画素の色が平均化された色となる縮小画像604に対して文字色抽出を行うと、それによって得られる2値画像607における文字色は、入力画像601における文字と比較して明るい(濃度が薄い)色となる。すなわち、縮小画像における文字の全黒画素と全グレー画素から平均を算出するため、文字色がより明るい状態((R、G、B)=(80、80、80))となる。
The reduced
入力画像602における文字についても、同様に、圧縮した画像に対する文字色抽出によって色変化を生じる。すなわち、入力画像602のピンク色の背景上の黒文字(黒(R、G、B)=(0、0、0))は、縮小画像605において、文字のエッジ部が薄くなり、背景色のピンクが混ざった状態((R、G、B)=(128、100、128))となる。そして、この縮小画像605に対して文字色抽出を行った場合の2値画像608の文字色は、比較的明るい色となり、背景色のピンク(ピンク(R、G、B)=(255、200、255))が混ざった状態((R、G、B)=(100、80、100))となる。反転文字の入力画像603についても同様であり、黒背景上の白文字(白(R、G、B)=(255、255、255))は、縮小画像606において、文字のエッジ部が濃い状態(グレー(R、G、B)=(128、128、128))となる。そして、縮小画像606に対して文字色抽出を行って得られる2値画像609は文字色が暗い状態((R、G、B)=(140、140、140))となる。これは、縮小画像606における全白画素と全グレー画素から平均を算出するためである。
Similarly, the characters in the
以上説明したように、圧縮による縮小画像に対して文字色抽出を行うと、最終的に得られる画像の文字色が変化するという問題が生じ得る。 As described above, when the character color extraction is performed on the reduced image by compression, there may be a problem that the character color of the finally obtained image changes.
本発明の実施形態は、文字色が画像の縮小によって背景色の影響を受ける度合いに応じて、抽出した文字色の補正を行う。これにより、最終的に得られる文字色の、元の画像における文字色からの変化を低減することができる。 In the embodiment of the present invention, the extracted character color is corrected according to the degree to which the character color is affected by the background color due to the reduction of the image. As a result, it is possible to reduce the change in the finally obtained character color from the character color in the original image.
(第1実施形態)
図3は、本発明の一実施形態に係る画像処理システムの構成を示すブロック図である。本実施形態の画像処理システムは、複合機(MFP)101とクライアントPC102が、ネットワーク103を介して接続されることによって構成されている。図3において、破線104、105はそれぞれ処理の流れを示しており、破線104は、ユーザがMFP101のスキャナを用いて紙文書を読み込ませる処理を示す。その際、ユーザは、後述するMFP101の操作部(図4の203)を用いて、スキャン画像を送信する宛先(例えば、クライアントPC102と、スキャンや送信に関わる各種設定を行うことができる。その各種設定として、ユーザは、カラーモード、ファイル形式(例えば、JPEG、TIFF、PDF、PDF(高圧縮))などを指定できる。以下では、データ書式としてPDF(高圧縮)が指定された場合について説明を行う。また、PDF(高圧縮)の詳細については後述する。破線105は、指定された各種設定に基づいて、MFP101のソフトウェアあるいはハードウェア機能を利用してデータを生成し、指定された宛先に送信する処理を示す。ここで、クライアントPC102へ送信された画像は、PDFなどのファイル形式で送信されることになるので、クライアントPC102の有する汎用的なビューアで閲覧可能である。
(First Embodiment)
FIG. 3 is a block diagram showing a configuration of an image processing system according to an embodiment of the present invention. The image processing system of the present embodiment is configured by connecting the multifunction device (MFP) 101 and the client PC 102 via the
図4は、図3に示すMFP101の構成を示すブロック図である。図4に示すように、本実施形態のMFP101は、画像入力デバイスであるスキャナ部201、画像出力デバイスであるプリンタ部202、MFP全体の制御を行う制御ユニット204、ユーザーインタフェースである操作部203等を有して構成されている。制御ユニット204は、スキャナ部201、プリンタ部202、操作部203と信号接続し、一方では、LAN209と信号接続することによって、画像情報やデバイス情報の入出力を行うコントローラである。この制御ユニット204を構成するCPU205はMFP101のシステム全体を制御するプロセッサである。同じくRAM206はCPU205が動作するためのシステムワークメモリであり、画像データを一時記憶するための画像メモリでもある。また、ROM210はブートROMであり、システムのブートプログラム等のプログラムが格納されている。さらに、記憶部211は、ハードディスクドライブ等の不揮発性記憶媒体であり、システム制御ソフトウェアや画像データを格納する。操作部I/F207は操作部(UI)203とのインターフェース部であり、操作部203に表示するための画像データを操作部203に対して出力する。また、操作部I/F207は、操作部203を介して本画像処理装置のユーザが指示した情報を、CPU205に伝える役割をする。NetworkI/F208は本画像処理装置をLAN209に接続し、データの入出力を行う。例えば、PDF形式の圧縮データを別の装置に送信したり、別の装置からPDF形式の圧縮データを受信したりする。以上のデバイスがシステムバス216上に配置される。システムバス216は、制御ユニット204内のデバイスを接続することで、情報を伝達させる。また、ImageBusI/F212は、システムバス216と、画像データを高速で転送する画像バス217とを接続し、データ構造を変換するバスブリッジである。画像バス217は、例えば、PCIバスやIEEE1394で構成される。画像バス217上には以下のデバイスが配置される。RIP部213は、PDL(ページ記述言語)コードを解析し、指定された解像度のビットマップイメージに展開する、いわゆるレンダリング処理を実現する。デバイスI/F214は、信号線218を介して画像入力デバイスであるスキャナ部201を接続し、信号線219を介して画像出力デバイスであるプリンタ部202を接続しており、画像データの同期系/非同期系の変換を行う。データ処理部215では、領域判定や圧縮処理、PDFファイル生成などの処理を行うことによって、PDF(高圧縮)を生成する。生成されたPDF(高圧縮)は、NetworkI/F208及びLAN209を介して、指定された宛先(例えば、クライアントPC102)に送信される。また、このデータ処理部215は、NetworkI/F208及びLAN209を介して受信した圧縮データの伸長を行うこともできる。伸長画像は、デバイスI/F214を介してプリンタ部202に送られ、印刷されることになる。
FIG. 4 is a block diagram showing the configuration of the
図4に示すデータ処理部215は、以上概略を説明したように、入力データからPDF(高圧縮)を生成する画像処理部を構成する。図5は、データ処理部215によって実現される画像処理部の構成を示すブロック図であり、入力データ(RGBの多値画像データ)から出力データ(PDF(高圧縮))を生成するための各処理部を示す。データ処理部215は、プロセッサがコンピュータプログラムを実行することにより、図5に示す各処理部として機能するように構成してもよいし、その一部または全部をASICや電子回路等のハードウェアで構成するようにしてもよい。
As described above, the
図5において、グレー変換部301は、スキャナ部201によって読み取られた入力データ(RGBの多値画像データ)に基づいてグレーの多値画像データを生成する。図6(a)は、スキャナ部201によって読み取られた入力データ(RGBの多値画像データ)の一例を示している。入力データは、「EF」の文字列501、色背景上の「EF」の文字列502、白抜き文字の「EF」の文字列503、写真の画像504を含んでいる。これらを含む入力データに基づいて、下記の(1)式で規定される輝度Yのグレーの画像データが生成される。
In FIG. 5, the
Y=0.299×R+0.587×G+0.114×B ・・・(1)
本実施形態では、グレーの信号として一般的なYUVカラースペースにおいて上記(1)式で定義される輝度Yを用いるが、これに限定されない。
Y = 0.299 × R + 0.587 × G + 0.114 × B ・ ・ ・ (1)
In the present embodiment, the luminance Y defined by the above equation (1) is used as the gray signal in a general YUV color space, but the signal is not limited thereto.
2値化部302は、グレー変換部301で得られるグレーの多値画像データに基づき2値の画像データを生成する。本実施形態で用いる2値化の方法は、グレーの多値画像データから得られるヒストグラムから単一の閾値を算出し、その閾値によって2値化を行う方法である。図6(b)は、図6(a)に示すグレーの多値画像に基づいて2値化部302が生成する2値画像の一例を示している。
The
再び図5を参照すると、第一の領域判定部303は、2値化部302で生成された2値画像データにおいて、文字領域と写真領域を検出する。これにより、図6(a)に示す入力画像の例では、図6(c)に示すように、文字領域情報(X、Y、W、H)521、522、反転文字領域であることを示す情報(以下、反転文字領域情報)523、及び写真領域情報(X、Y、W、H)524が得られる。
Referring to FIG. 5 again, the first
上述した第一の領域判定部303による領域判定処理は、公知の領域識別手法(例えば、特開平06−068301号公報)によってなされる。具体的には、図6(b)に示す2値画像データに対して、領域判定を行う場合についてその概要説明すると次のとおりである。黒画素の輪郭を追跡することにより、黒画素塊を検出する。その結果、図6(d)に示すように黒画素塊1〜6が得られる。そして、得られた黒画素塊を、大きさや形状、黒画素密度のうちの少なくとも1つを用いて、文字か反転文字か写真かに分類する。例えば、縦横比が1に近く、かつ、大きさが定められた範囲の黒画素塊1〜4を、文字を構成する黒画素塊と判定する。また、矩形形状で黒画素密度が高い画素塊5は、反転文字と判定する。そして、残りの黒画素塊6は、写真を構成する画素塊と判定する。さらに、文字を構成する黒画素塊同士の距離が所定の距離(例えば、3画素)以内である場合、その黒画素塊同士を同じグループに分類する。その上で、同じグループに分類された黒画素塊の何れをも包含する外接矩形領域を文字領域と判定する。その結果、図6(d)に示す黒画素塊1、2及び黒画素塊3、4は黒画素塊同士の距離が近いと判断され、文字領域と判定される。以上の判定処理によって、図6(c)に示す情報521、522が文字領域、情報523が反転文字領域、情報524が写真領域であるという判定結果が出力される。
The region determination process by the first
次に、第二の領域判定部304は、第一の領域判定部303で文字領域と判定された領域に対して文字切り出し処理を行う。これにより、文字単位の文字領域情報(x、y、w、h)を得ることができる。図6(e)は、図6(c)に示す文字領域情報521〜523に対して、文字切り出し処理を行った結果を示している。すなわち、文字領域情報521は単位の文字領域情報541、542に、文字領域情報522は単位の文字領域情報543、544に、反転文字領域情報523は単位の文字領域情報545、546に、それぞれ分離して検出される。以上の文字切り出し処理は、文字領域の中で、横方向からの射影と縦方向からの射影にもとづき、各文字の外接矩形を文字切り矩形として切り出すことによって個々の文字を分離して検出する。
Next, the second
再び図5を参照すると、MMR圧縮部305は、2値化部302によって2値化された2値画像データを入力とし、第一の領域判定部303で文字領域と判定された領域に対してMMR圧縮を行う。MMR圧縮が行われたMMRデータは、PDF生成部310へ入力される。
Referring to FIG. 5 again, the
縮小部307は、スキャナ部201によって読み取られた入力データ(RGBの多値画像データ)の縮小を行い、縮小多値画像を生成する。生成された縮小多値画像は、RAM206に一時的に格納される。本実施形態では、縮小とは、低解像度への解像度変換を意味しており、例えばバイキュービック法による解像度変換を行うものである。文字領域穴埋め部308は、2値化部302によって2値化された2値画像データ、及び第一の領域判定部303で得られた文字領域情報(X、Y、W、H)を参照し、文字領域内の背景色の平均値を算出する。また、第二の領域判定部304から得られた単位文字領域情報(x、y、w、h)を参照し、算出した背景色の平均値を縮小多値画像の単位文字領域に割り当てる。つまり、算出した背景色で縮小多値画像の文字領域内の単位文字領域を穴埋めし、穴埋め縮小多値画像を生成する。これにより、後述のJPEG圧縮部309の圧縮率が向上する。JPEG圧縮部309は、文字領域穴埋め部308によって、生成された穴埋め縮小多値画像をJPEG圧縮する。JPEG圧縮されたJPEGデータは、後述するPDF生成部310へ入力される。
The
文字色抽出部306は、第一の領域判定部303及び第二の領域判定部304から得られる文字領域情報(X、Y、W、H)、及び単位文字領域情報(x、y、w、h)を参照する。そして、これらを参照しながら2値化部302によって生成される2値画像データの黒部分と、縮小部307によって生成される縮小多値画像を位置対応させながら文字領域中の文字毎の代表色を抽出する。
The character
図7は、本実施形態の文字色抽出部306の処理を説明するための模式図である。図7において、符号801、符号802、符号803は縮小部307によって生成される、150dpiの縮小多値画像を示し、符号804、符号805、符号806は2値化部302によって生成される、300dpiの2値画像を示している。また、符号807、符号808、符号809は2値画像データ(300dpi)における文字毎の文字色を示し、符号810、符号811、符号812は文字色抽出後の文字色を示している。
FIG. 7 is a schematic diagram for explaining the processing of the character
ここで、文字色810は、2値画像データ804の単位文字領域情報(x、y、w、h)を参照し、その2値画像の黒部分に対応する色値を、縮小多値画像801から取得する。図8(a)および図8(b)は、この処理の詳細を説明するための模式図である。図8(a)は、300dpiの2値画像804を拡大した図である。図8(b)は、150dpiの縮小多値画像801を拡大した図である。なお、図8(a)と図8(b)とは、1画素の大きさを同じにして図示しているため、図8(b)に示す150dpiの画像は、図8(a)に示す300dpiの画像と比べて幅と高さが1/2となる。文字色抽出部306は、図8(b)に示す縮小画像において、図8(a)に示す2値画像の黒画素1503〜1506の位置に対応する色値1507を取得する。このようにして、2値画像の総ての黒画素に対応する色値を取得し、平均値を算出する。
Here, the
図7において、符号807は、このようにして得られた、2値画像における文字毎の平均値の色を示している。平均色807に示すように、文字「E」は、平均色(R、G、B)=(80、80、80)であり、文字「F」は、平均色(R、G、B)=(75、75、75)である。このように、一般には、文字「E」と文字「F」の平均色が異なる。これは、縮小多値画像801は、スキャナによって読み取られたデータを縮小したものであるからである。すなわち、文字「E」も文字「F」も画素毎に色値はばらつきをもっているからであり、また、縮小によって文字のエッジ部に生じる中間調の状態が文字「E」と文字「F」とで異なるからである。これに対し、文字毎の色値を揃えるには、類似した色、例えば、所定の輝度差、色差の範囲内である場合は、一つの代表色に置き換えることを行う。そして、本実施形態では、上記一つの代表色を選択する場合に、平均色算出前の2値画像データにおいて黒画素数が多い文字の平均色を代表色として選択する方法を用いる。すなわち、文字「E」を構成する画素数と、文字「F」を構成する画素数を比較すると、文字「E」を構成する画素数が多い。このため、文字「E」の平均色(R、G、B)=(80、80、80)を代表色として選択する。図7の符号810は、このように選択された代表色である文字「E」の平均色が、文字「F」の代表色(R、G、B)=(80、80、80)とされることを示している。
In FIG. 7,
同様に、図7に示す300dpiの2値画像データ805の単位文字領域情報(x、y、w、h)を参照し、その2値画像データの黒部分に対応する色値を、150dpiの縮小多値画像802から取得する。図7の符号808は、このようにして得られた文字毎の平均色を示している。平均色808に示すように、文字「E」は、平均色(R、G、B)=(100、80、100)であり、文字「F」は、平均色(R、G、B)=(95、75、95)である。また、図7の符号811は、文字「E」、文字「F」の代表色が(R、G、B)=(100、80、100)であることを示している。同様に、図7に示す300dpiの2値画像データ806の単位文字領域情報(x、y、w、h)を参照し、その2値画像データの黒部分に対応する色値を、150dpiの縮小多値画像803から取得する。図7の符号809は、このようにして得られた文字毎の平均色を示している。平均色809に示すように、文字「E」は、平均色(R、G、B)=(140、140、140)であり、文字「F」は、平均色(R、G、B)=(135、135、135)である。また、符号812は、文字「E」、文字「F」ともに代表色が(R、G、B)=(140、140、140)であることを示している。以上のように文字色抽出部306は、文字領域毎の文字色を抽出する。
Similarly, referring to the unit character area information (x, y, w, h) of the
再び図5を参照すると、文字色補正部311は、文字色抽出部306によって得られた文字色を補正する。これにより、入力データ(多値画像データ)の文字のエッジ部分の色値が縮小部307における縮小による背景色の影響を受けて、最終的に得られる文字色の変化を低減することができる。すなわち、文字色を、その文字色と文字の背景の色との関係に基づいて補正する。
Referring to FIG. 5 again, the character
本発明の一実施形態は、下記の(2)式に従って文字色を補正する。
補正後の文字色(R、G、B)=補正前の文字色(R、G、B)+{補正前の文字色(R、G、B)−背景色(R、G、B)}×補正係数 ・・・(2)
In one embodiment of the present invention, the character color is corrected according to the following equation (2).
Character color after correction (R, G, B) = Character color before correction (R, G, B) + {Character color before correction (R, G, B) -Background color (R, G, B)} × Correction coefficient ・ ・ ・ (2)
また、(2)式の補正係数は、以下の(3)式で算出されるものである。
補正係数=エッジを構成する画素の数/文字を構成する画素の数 ・・・(3)
Further, the correction coefficient of the equation (2) is calculated by the following equation (3).
Correction coefficient = number of pixels that make up the edge / number of pixels that make up the character ... (3)
ここで、エッジを構成する画素は次のように検出することができる。図9は、エッジ検出のためのウインドウを模式的に示す図である。図10は、補正係数を具体的に説明するための模式図である。補正係数を具体的に説明するための模式図である。300dpiの2値画像データ(図10の符号901、符号902、符号903)に対して、図9に示すような3×3のウインドウを適用する。3×3のウインドウにおいて、「1」〜「9」は、2値画像データにウインドウを適用する際の2値画像データの画素の位置を示している。このウインドウにおいて、2値画像においてエッジか否かを判断する注目画素に対してウインドウの位置「5」を対応させる。また、注目画素の周囲の画素に対して、位置「1」、「2」、「3」、「4」、「6」、「7」、「8」、「9」をそれぞれ対応させる。このようなウインドウを適用することで、2値画像における「黒=“1”」の画素を注目画素とし、順次注目画素を変えてその注目画素がエッジを構成する画素か否かを判断していく。そして、位置「5」の注目画素が「黒」であり、かつ、位置「1」、「2」、「3」、「4」、「6」、「7」、「8」、「9」の周囲の画素の内、少なくとも1つが「白=“0”」である場合、位置「5」の注目画素は、エッジを構成する画素と判断する。
Here, the pixels forming the edge can be detected as follows. FIG. 9 is a diagram schematically showing a window for edge detection. FIG. 10 is a schematic diagram for specifically explaining the correction coefficient. It is a schematic diagram for explaining the correction coefficient concretely. A 3 × 3 window as shown in FIG. 9 is applied to the binary image data of 300 dpi (
なお、上例は、図2に示したように、300dpiの画像を150dpiの画像に縮小する際の背景の色に影響を受ける画素をエッジとして検出する例である。縮小する率が変わった場合、この背景の色に影響を受ける画素の範囲は変わる。例えば、600dpiの画像を150dpiの画像に縮小する場合は、4×4の画素が1画素に変換される。この場合、縮小によって影響を受ける画素は、4×4の画素のうち3×4の画素になる。従って、これらの画素をエッジとして検出するためのウインドウは7×7のサイズとなる。このように縮小率に応じて、用いるウインドウのサイズを変える。 In the above example, as shown in FIG. 2, a pixel affected by the background color when reducing an image of 300 dpi to an image of 150 dpi is detected as an edge. When the reduction rate changes, the range of pixels affected by this background color changes. For example, when reducing an image of 600 dpi to an image of 150 dpi, 4 × 4 pixels are converted into one pixel. In this case, the pixels affected by the reduction are 3x4 pixels out of the 4x4 pixels. Therefore, the window for detecting these pixels as edges has a size of 7 × 7. In this way, the size of the window to be used is changed according to the reduction ratio.
また、エッジは、上例では、300dpiの2値画像において検出するものとしたが、300dpiの多値画像において検出してもよい。この場合、上記「黒」は、例えば、(0、0、0)で表され、「白」は(255、255、255)で表される。また、反転文字の場合は(図10の符号903)、第一の領域判定部303でから得られる反転文字領域情報に基づいて2値画像データの白黒反転を行った後、図9のウインドウを適用することにより、エッジを構成する画素を検出する。以上のように文字毎にエッジを構成する画素を検出しその数を算出する。
Further, in the above example, the edge is detected in a binary image of 300 dpi, but may be detected in a multi-value image of 300 dpi. In this case, the above "black" is represented by, for example, (0, 0, 0), and "white" is represented by (255, 255, 255). Further, in the case of inverted characters (
本実施形態は、補正係数を(3)式によって求めるのは次の理由からである。文字のエッジ部分の色値が、縮小部307における縮小によって背景色の影響を受けやすいため、その影響度合いを数値化する。つまり、小さい文字(小ポイント文字や、細線を含む文字)ほど、エッジを構成する画素が文字に占める割合は大きく、その文字全体として背景色の影響を受けやすい。このため、小さい文字ほど補正係数を大きくする。逆に、大きい文字ほどエッジを構成する画素が文字に占める割合は小さく、背景色の影響を受けにくい。このため、大きい文字ほど補正係数を小さくする。なお、補正係数を、例えば、文字の大きさそのものに基づいて決定してもよい。具体的には、第二の領域判定部304で得られる単位文字領域情報において、文字毎の幅と高さがわかるため、これらの情報を用いて、直接補正係数を定めることができる。
In this embodiment, the correction coefficient is obtained by the equation (3) for the following reason. Since the color value of the edge portion of the character is easily affected by the background color due to the reduction in the
補正係数に関し、エッジ部分の色値が画像の縮小によって背景色の影響を受ける場合の、その影響度合いは、上述した画素数の比のみに限定されない。例えば、背景色の影響で変化する色の見え方次第で、例えば、画素数の比のべき乗や画素数の差とすることもできる。また、上記画素数の比に加えて、背景色と文字色の色差など、色の違いに応じて補正係数に重みづけをしてもよい。 Regarding the correction coefficient, when the color value of the edge portion is affected by the background color due to the reduction of the image, the degree of influence is not limited to the above-mentioned ratio of the number of pixels. For example, depending on the appearance of the color that changes due to the influence of the background color, it can be, for example, a power of the ratio of the number of pixels or a difference in the number of pixels. Further, in addition to the ratio of the number of pixels, the correction coefficient may be weighted according to the difference in color such as the color difference between the background color and the character color.
なお、上例では、縮小による色の変化を、RGB空間の色値(R、G、B)で説明したが、これに限るものではなく、例えば、YCbCrやLab空間の色値で行ってもよい。 In the above example, the color change due to reduction is described by the color values (R, G, B) in the RGB space, but the present invention is not limited to this, and for example, the color value in the YCbCr or Lab space may be used. Good.
図10は、補正係数の例を具体的に説明するための模式図である。図10において、符号901、符号902、符号903は、2値化部302によって生成される300dpiの2値画像データを示している。符号904、符号905、符号906は、300dpiの2値画像データから得られるエッジ画像を示している。符号907、符号908、符号909は、補正係数を示している。
FIG. 10 is a schematic diagram for specifically explaining an example of the correction coefficient. In FIG. 10,
先ず、小さい文字(小ポイント文字や、細線を含む文字)である場合、2値画像データ901に示すように、文字「E」を構成する画素数は110であり、文字「F」を構成する画素数は90である。従って、この場合、文字を構成する画素数(1文字平均)=100となる。次に、エッジ画像904に示すように、文字「E」のエッジを構成する画素数は36であり、文字「F」のエッジを構成する画素数は44である。従って、エッジを構成する画素数はこれらの1文字あたりの平均=40となる。以上より、補正係数は、補正係数907における演算式で算出されるように0.4となる。
First, in the case of a small character (a small point character or a character including a thin line), as shown in the
同様に、大きい文字である場合、2値画像データ902に示すように、文字「E」を構成する画素数は450であり、文字「F」を構成する画素数は350である。従って、文字を構成する画素数(1文字平均)=400となる。次に、エッジ画像905に示すように、文字「E」のエッジを構成する画素数は85であり、文字「F」のエッジを構成する画素数は75である。従って、エッジを構成する画素数はこれらの1文字あたりの平均=80となる。結果として、補正係数は、補正係数908における演算式で算出されるように0.2となる。
Similarly, in the case of a large character, as shown in the
反転文字の場合、2値画像データ903に示すように、第一の領域判定部303から得られる反転文字領域情報にもとづいて、白黒反転を行った後、文字を構成する画素数、及びエッジを構成する画素数を算出する。文字「E」を構成する画素数は110であり、文字「F」を構成する画素数は90である。従って、文字を構成する画素数は、これらの1文字平均=100となる。次に、エッジ画像906に示すように、文字「E」のエッジを構成する画素数は36であり、文字「F」のエッジを構成する画素数は44である。従って、エッジを構成する画素数は1文字平均=40となる。結果として、補正係数は、補正係数909における演算式で算出されるように0.4となる。
In the case of inverted characters, as shown in
図11は、抽出した文字の代表色を(2)式によって補正した結果を示す図である。補正係数が、前述の通り0.4とすると、補正後の文字色1001に示すように、抽出された代表色810(図7)((R、G、B)=(80、80、80))が、代表色(R、G、B)=(10、10、10)に補正される。このように、抽出された代表色810は、入力画像における文字の色((R、G、B)=(0、0、0))により近い色に補正される。その結果、画像を縮小することによる背景色の文字の色に対する影響を軽減することができる。
FIG. 11 is a diagram showing the result of correcting the representative color of the extracted characters by the equation (2). Assuming that the correction coefficient is 0.4 as described above, as shown in the corrected
同様に、補正後の文字色1002に示すように、代表色811(図7)((R、G、B)=(100、80、100))は、代表色(R、G、B)=(38、32、38)に補正される。さらに同じく、補正後の文字色1003に示すように、代表色812(図7)((R、G、B)=(140、140、140))は、代表色(R、G、B)=(196、196、196)に補正される。
Similarly, as shown in the corrected
再び図5を参照すると、PDF生成部310は、MMR圧縮部305で圧縮されたMMRデータ、文字色補正部311より得られた文字色、JPEG圧縮部309で圧縮されたJPEGデータを合成する。そして、合成したデータをPDFフォーマット(PDFデータ)に変換することにより、PDF(高圧縮)を生成する。
Referring to FIG. 5 again, the
以上説明した実施形態によれば、上記補正された文字色が合成されたPDFデータにおける文字色は、仮に文字色が合成されないPDFデータにおける文字色より、入力画像における文字色に色値が近くなる。 According to the embodiment described above, the character color in the PDF data in which the corrected character color is synthesized has a color value closer to the character color in the input image than the character color in the PDF data in which the character color is not synthesized. ..
図12(a)、図12(b)および図12(c)は、上述したデータ処理部215(図4)が実行する処理を示すフローチャートである。具体的には、これらフローチャートは、データ処理部215が実行する、MMRデータの生成、JPEGデータの生成、および文字色データの生成の各処理を示している。なお、フローチャートが示す処理を実行するプログラムは、図4のROM210、または、記憶部211に格納され、CPU205にて実行される。CPU205は、ImageBusI/F212、システムバス216、画像バス217を用いて、データ処理部215とデータのやり取りをすることが可能である。また、フローチャートの説明における記号「S」は、ステップを表すものとする。この点、以下のフローチャートの説明においても同様とする。
12 (a), 12 (b) and 12 (c) are flowcharts showing the processes executed by the above-mentioned data processing unit 215 (FIG. 4). Specifically, these flowcharts show each process of generating MMR data, generating JPEG data, and generating character color data, which are executed by the
<MMRデータの生成>
図12(a)は、MMRデータの生成処理を示している。S401にて、グレー変換を行う。CPU205は、スキャナ部201によって読み取られた入力データ(RGBの多値画像データ)からグレーの多値画像データを生成する処理を実行する。この処理の詳細はグレー変換部301の動作説明において前述した通りである。次に、S402にて、2値化を行う。CPU205は、S401で得られたグレーの多値画像データから2値画像データを生成する処理を実行する。この処理の詳細は2値化部302の動作説明において前述した通りである。さらに、S403にて、第一の領域判定を行う。CPU205は、S402にて生成された2値画像データから、文字領域と写真領域を検出する処理を実行する。ここで得られた文字領域情報(X、Y、W、H)、及び反転文字領域情報は、RAM206に一時的に格納される。この処理の詳細は、第一の領域判定部303の動作説明において前述した通りである。次に、S404にて、第二の領域判定を行う。CPU205は、S403にて文字領域と判定された領域に対して文字切り出し処理を行う。ここで得られた単位文字領域情報(x、y、w、h)は、RAM206に一時的に格納される。この処理の詳細は、第二の領域判定部304の動作説明において前述した通りである。最後に、S405にて、MMR圧縮を行う。CPU205は、S402にて2値化された2値画像データを入力とし、S403にて文字領域と判定された領域(前記2値画像データ上の文字領域)をMMR圧縮する。この処理の詳細は、MMR圧縮部305の動作説明において前述した通りである。
<Generation of MMR data>
FIG. 12A shows the MMR data generation process. Gray conversion is performed in S401. The
<JPEGデータの生成>
図12(c)は、JPEGデータの生成処理を示すフローチャートである。S420にて、CPU205は、入力データ(RGBの多値画像データ)の縮小を行い、縮小多値画像を生成する。生成された縮小多値画像は、RAM206に一時的に格納される。この処理の詳細は、縮小部307の動作説明において前述した通りである。次に、S421にて、文字領域の穴埋め処理を行う。CPU205は、ステップS402にて生成された2値画像データ、及びS403にて得られた文字領域情報(X、Y、W、H)を参照し、文字領域内の背景色の平均値を算出する。次に、S404にて得られた単位文字領域情報(x、y、w、h)を参照し、算出した背景色の平均値を縮小多値画像の単位文字領域に割り当てる。つまり、算出した背景色で縮小多値画像の単位文字領域を穴埋めし、穴埋め縮小多値画像を生成する。この文字領域穴埋め処理の詳細は、文字領域穴埋め部308の動作説明において前述した通りである。さらに、S422にて、CPU205は、S421にて生成された穴埋め縮小多値画像をJPEG圧縮する。JPEG圧縮の詳細は、JPEG圧縮部309の動作説明において前述した通りである。以上のように生成されたJPEGデータは、RAM206に一時的に格納される。
<Generation of JPEG data>
FIG. 12C is a flowchart showing a JPEG data generation process. In S420, the
<文字色データの生成>
図12(b)は、文字色データの生成処理を示すフローチャートである。S410にて、CPU205は、2値画像データ、及びS403によって得られた文字領域情報(X、Y、W、H)を参照することによって、最初の文字領域を探索する。そして、S411にて、CPU205は、注目領域が文字領域であるか否かを判定する。注目領域が文字領域であるとの判定結果を得た場合(S411のYES)、処理をS412へ移行する。注目領域が文字領域ではないとの判定結果を得た場合(S411のNO)、処理をS414へ移行する。次に、S412にて、CPU205は、S403にて得られる文字領域情報(X,Y、W、H)、及びS404にて得られる単位文字領域情報(x、y、w、h)を参照する。そして、これら情報を参照しながら、2値画像データの黒部分と、S420にて生成される縮小多値画像を位置対応させながら文字領域毎の文字色を抽出する。この代表色の抽出方法については、文字色抽出部306の動作説明において前述した通りである。
<Generation of character color data>
FIG. 12B is a flowchart showing the character color data generation process. In S410, the
次に、S413にて、CPU205は、S412にて得られた文字領域毎の文字色を補正する。図13は、文字色補正処理を示すフローチャートである。なお、本実施形態では、図13が示すフローチャートの処理は、文字領域毎に実行される。また、後述する第2実施形態では、図13が示すフローチャートの処理は、単位文字領域毎に実行される。
Next, in S413, the
図13において、先ず、S701にて、CPU205は、2値画像データ、及びS403にて得られる文字領域情報(X,Y、W、H)を参照し、文字領域内における背景色を算出する。次に、S702にて、CPU205は、S402にて生成された2値画像データからエッジ検出を行う。エッジ検出については、文字色補正部311の動作説明において前述した通りである。さらに、S703にて、CPU205は、S402にて生成された2値画像データと、S702にて生成されたエッジ検出画像を用いて、補正係数を算出する。補正係数の算出については、文字色補正部311の動作説明において前述した通りである。最後に、S704にて、CPU205は、S406にて抽出された文字色と、S701にて算出された背景色と、S703にて算出された補正係数を用いて文字色を補正する。文字色の補正については、文字色補正部311の動作説明において前述した通りである。
In FIG. 13, first, in S701, the
再び図12を参照すると、S413の文字色補正の後、S414にて、CPU205は、全文字領域の探索が終了したか否かを判定する。全文字領域の探索が終了しているとの判定結果を得た場合(S414のYES)、本処理を終了する。全文字領域の探索が終了していないとの判定結果を得た場合(S414のNO)、処理をS415へ移行する。S415にて、CPU205は、次の文字領域を探索する。S415の探索の後、処理をS411へ移行し、S415で探索された次の文字列領域に対しS411以降の処理が行われる。以上のように生成された文字領域毎の文字色データは、RAM206に一時的に格納される。
Referring to FIG. 12 again, after the character color correction in S413, in S414, the
<PDF(高圧縮)の生成>
図12(a)、図12(b)および図12(c)に示すフローチャートで上述したように、MMRデータ、JPEGデータ、文字色データが生成され、CPU205は、これらのデータをPDF形式に変換することでPDF(高圧縮)を生成する。
<Generation of PDF (high compression)>
As described above in the flowcharts shown in FIGS. 12 (a), 12 (b) and 12 (c), MMR data, JPEG data and character color data are generated, and the
以上のように、本実施形態は、PDF(高圧縮)において文字の周囲の色(背景色)、及び文字のエッジ情報にもとづいて文字色抽出後の文字色を補正する。これにより、文字色に周囲の色が混ざってしまうことによる輝度、彩度などの文字色の変化を低減させることが可能となる。 As described above, in the present embodiment, the character color after the character color is extracted is corrected based on the character surrounding color (background color) and the character edge information in PDF (high compression). This makes it possible to reduce changes in the character color such as brightness and saturation due to the surrounding colors being mixed with the character color.
(第2実施形態)
上述した第1実施形態では、文字領域内における背景色を算出し、文字領域内の文字列の文字色を一括して補正を行う場合について説明した。本実施形態では、文字毎に文字色を補正する場合について説明する。これにより、文字領域内で文字ごとに背景色が変化する場合や、文字の大きさが変化する場合には、それぞれの文字に適した文字色補正が可能となる。なお、以下では、第1実施形態と同様の処理については、その説明を省略する。
(Second Embodiment)
In the first embodiment described above, a case where the background color in the character area is calculated and the character color of the character string in the character area is collectively corrected has been described. In the present embodiment, a case where the character color is corrected for each character will be described. As a result, when the background color changes for each character in the character area or when the size of the character changes, it is possible to correct the character color suitable for each character. In the following, the description of the same processing as that of the first embodiment will be omitted.
図14は、同一の文字領域内で背景色が変化し、かつ文字の大きさが変化する画像の一例を示す模式図である。図14において、符号1101は、入力データ(多値画像データ)を示している。ここで、文字「E」は、大文字であり、背景色は白((R、G、B)=(255、255、255))である。文字「F」は、小文字であり、背景色はピンク((R、G、B)=(255、200、255))である。符号1102は、入力データ1101が縮小部(図5の符号307)によって縮小された縮小多値画像を示している。第1実施形態で前述したように、文字のエッジ部では、文字色に背景の色が混ざっていることがわかる。符号1103は、入力データ1101が2値化部(図5の符号307)によって2値化された2値画像データを示している。文字「E」と文字「F」それぞれの単位文字領域情報(x、y、w、h)を示している。そして、符号1104は、2値画像における文字毎の文字色を示し、文字「E」の平均色が((R、G、B)=(50、50、50))であり、文字「F」の平均色が((R、G、B)=(95、75、95))であることを示している。
FIG. 14 is a schematic diagram showing an example of an image in which the background color changes and the size of the characters changes within the same character area. In FIG. 14,
ここで、第1実施形態では、文字毎の色値を揃えるため、文字色の補正前に、類似した色、例えば、所定の輝度差、色差の範囲内にある色を、一つの代表色に置き換えることとしている。これに対し、本実施形態では、文字色の補正前ではなく、文字色の補正後に、一つの代表色に置き換える。これにより、同一の文字領域内に類似した色がある場合、文字色補正後も同じ色値にすることが可能となり、また、異なる色の場合(類似した色ではない場合)は、それぞれの文字に適した文字色補正が可能となる。 Here, in the first embodiment, in order to align the color values for each character, similar colors, for example, colors within a predetermined luminance difference and color difference range, are combined into one representative color before the correction of the character color. It is supposed to be replaced. On the other hand, in the present embodiment, the character color is replaced with one representative color after the character color is corrected, not before the character color is corrected. As a result, if there are similar colors in the same character area, the same color value can be obtained even after the character color correction, and if the colors are different (if they are not similar colors), each character Character color correction suitable for
図15は、図14の文字色1104に示す文字毎の平均色を用いて、文字毎に文字色補正を行った結果を示す模式図である。図15に示すように、文字「E」では、背景色(R、G、B)=(255、255、255)と補正係数0.19(=85/450)を用い、文字「F」では、背景色(R、G、B)=(255、200、255)と、補正係数0.5(=44/90)を用いる。その結果、文字「E」は、文字色(R、G、B)=(11、11、11)に補正され、文字「F」は、文字色(R、G、B)=(15、12、15)に補正される。
FIG. 15 is a schematic diagram showing the result of performing character color correction for each character using the average color for each character shown in the
以上のように補正された、文字「E」の文字色(R、G、B)=(11、11、11)と、文字「F」の文字色(R、G、B)=(15、12、15)は、所定の輝度差(例えば10)の範囲内にある。本実施形態では、この範囲内に色を類似した色とする。従って、文字毎の色値を揃えるため、一つの代表色に置き換える。「E」を構成する画素数と、「F」を構成する画素数を比較し、「E」を構成する画素数が多いため、文字「E」の平均色(R、G、B)=(11、11、11)を代表色として選択する。 The character color (R, G, B) = (11, 11, 11) of the character "E" and the character color (R, G, B) = (15,) of the character "F" corrected as described above. 12 and 15) are within a predetermined luminance difference (for example, 10). In the present embodiment, the colors are similar to each other within this range. Therefore, in order to make the color values for each character uniform, it is replaced with one representative color. The number of pixels constituting "E" is compared with the number of pixels constituting "F", and since the number of pixels constituting "E" is large, the average color of the character "E" (R, G, B) = ( 11, 11, 11) is selected as the representative color.
このように、本実施形態によっても、文字色を補正して最終的に得られる文字の色は、入力画像データにおける文字の色により近いものとなる。その結果、文字色に背景の色が混ざってしまうことによる輝度、彩度など文字色の変化を低減させることが可能となる。 As described above, also in this embodiment, the character color finally obtained by correcting the character color is closer to the character color in the input image data. As a result, it is possible to reduce changes in the character color such as brightness and saturation due to the background color being mixed with the character color.
図16は、本発実施形態に係るデータ処理部215(図4)が実行する処理を示すフローチャートである。フローチャートに示す処理を実行するプログラムは、図4のROM210、または、記憶部211に格納され、CPU205にて実行される。このとき、CPU205は、ImageBusI/F212、システムバス216、画像バス217を用いて、データ処理部215とデータのやり取りをすることができる。以下では、第1実施形態と異なる部分である文字毎に文字色を補正する処理について図16に示すフローチャートを参照して説明する。この説明では、第1実施形態において前述した図12、および図13に示す処理を適宜参照する。また、図16に示すS410、S411、S414およびS415の処理については、図12(b)のS410、S411、S414およびS415と同様の処理であるためそれらの説明を省略する。
FIG. 16 is a flowchart showing a process executed by the data processing unit 215 (FIG. 4) according to the present embodiment. The program that executes the process shown in the flowchart is stored in the
先ず、S1301にて、CPU205は、S411にて文字領域と判定された領域に対して、S404にて得られる単位文字領域情報(x、y、w、h)を参照し、最初の単位文字領域を探索する処理を実行する。次に、S1302にて、CPU205は、S404にて得られる単位文字領域情報(x、y、w、h)を参照する。そして、この情報を参照して2値画像データの黒部分と、S420にて生成される縮小多値画像を位置対応させながら文字領域中の単位文字領域毎の文字色を抽出する処理を実行する。代表色の抽出方法については、文字色抽出部306の動作において前述した通りである。
First, in S1301, the
次に、S1303にて、CPU205は、S1302にて得られた文字色を補正する。ここで、第1実施形態では、この補正処理を文字領域毎に実行した。本実施形態では、図16に示す処理を単位文字領域毎に実行する。
Next, in S1303, the
S1304にて、CPU205は、全単位文字領域の探索が終了したか否かを判定する処理を実行する。全単位文字領域の探索が終了しているとの判定結果を得た場合(S1304のYES)、処理をS1305へ移行する。全単位文字領域の探索が終了していないとの判定結果を得た場合(S1304のNO)、処理をS1306へ移行する。S1306にて、CPU205は、次の単位文字領域を探索する。S1306の探索の後、処理をS1302へ移行し、S1306で探索された次の単位文字列領域に対しS1302以降の処理が行われる。
In S1304, the
S1305にて、CPU205は、S1303にて得られた文字色補正後の文字色を代表色に置き換える処理を実行する。同一の文字領域内に類似した色、例えば、所定の輝度差、色差の範囲内であれば、一つの代表色に置き換える。
In S1305, the
以上のように、文字毎に文字色を補正することにより、文字領域内で背景色が変化する場合や、文字の大きさが変化する場合には、それぞれの文字に適した文字色補正が可能となる。また、同一の文字領域内に類似した色がある場合、文字色補正後も同じ色値にすることが可能となり、異なる色の場合(類似した色ではない場合)は、それぞれの文字に適した文字色補正が可能となる。 As described above, by correcting the character color for each character, when the background color changes in the character area or the size of the character changes, it is possible to correct the character color suitable for each character. It becomes. In addition, if there are similar colors in the same character area, the same color value can be obtained even after character color correction, and if the colors are different (if they are not similar colors), they are suitable for each character. Character color correction is possible.
(その他の実施形態)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other embodiments)
The present invention supplies a program that realizes one or more functions of the above-described embodiment to a system or device via a network or storage medium, and one or more processors in the computer of the system or device reads and executes the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
306 文字色抽出部
307 縮小部
310 PDF生成部
311 文字色補正部
306 Character
Claims (7)
前記縮小手段によって得られる前記第2画像の文字領域における文字色を抽出する抽出手段と、
前記抽出手段によって抽出された文字色を、当該文字色の色値と前記第2画像の文字領域における背景色の色値との関係に基づいて補正する補正手段と、
前記補正手段によって文字色が補正された前記文字領域を含む画像として、前記第1画像が圧縮された圧縮画像を生成する生成手段と、
を有することを特徴とする画像処理装置。 A reduction means for converting the first image into a second image having a resolution lower than that of the first image, and
An extraction means for extracting the character color in the character area of the second image obtained by the reduction means, and an extraction means.
A correction means for correcting the character color extracted by the extraction means based on the relationship between the color value of the character color and the color value of the background color in the character area of the second image.
A generation means for generating a compressed image in which the first image is compressed as an image including the character region whose character color has been corrected by the correction means.
An image processing device characterized by having.
ことを特徴する請求項1に記載の画像処理装置。 The correction means is characterized in that the character color is corrected by multiplying a value obtained by the relationship between the color value of the character color and the color value of the background color in the character area of the second image by a correction coefficient. The image processing apparatus according to claim 1.
前記縮小手段によって得られる前記第2画像の文字領域における文字色を抽出する抽出手段と、
前記抽出手段によって抽出された文字色を、前記第1画像から前記第2画像への変換による解像度の変化によって前記第2画像の色が受ける影響の度合いに応じた補正係数を用いて補正する補正手段と、
前記補正手段によって文字色が補正された前記文字領域を含む画像として、前記第1画像が圧縮された圧縮画像を生成する生成手段と、
を有することを特徴とする画像処理装置。 A reduction means for converting the first image into a second image having a resolution lower than that of the first image, and
An extraction means for extracting the character color in the character area of the second image obtained by the reduction means, and an extraction means.
Correction that corrects the character color extracted by the extraction means by using a correction coefficient according to the degree of influence on the color of the second image due to the change in resolution due to the conversion from the first image to the second image. Means and
A generation means for generating a compressed image in which the first image is compressed as an image including the character region whose character color has been corrected by the correction means.
An image processing device characterized by having.
補正後の文字色=補正前の文字色+(補正前の文字色−背景色}×補正係数
ここで、補正係数は、前記第2画像において、(文字領域における文字のエッジを構成する画素の数)/(文字を構成する画素の数)である
で表される式によって前記文字色を補正する
ことを特徴とする請求項2または3に記載の画像処理装置。 The correction means
Character color after correction = Character color before correction + (Character color before correction-Background color} x Correction coefficient Here, the correction coefficient is (in the second image, the pixel constituting the edge of the character in the character area). The image processing apparatus according to claim 2 or 3, wherein the character color is corrected by an expression represented by (number) / (number of pixels constituting the character).
前記第1画像から生成される2値画像に対する領域判定で取得される前記文字領域の情報に基づき前記2値画像から生成されるMMRデータと、
前記第2画像から生成されるJPEGデータと、
前記補正された文字色と、
に基づいてPDFデータを生成する
ことを特徴とする請求項1から4のいずれか1項に記載の画像処理装置。 The generation means, as the compressed image,
MMR data generated from the binary image based on the information of the character area acquired by the area determination for the binary image generated from the first image, and
The JPEG data generated from the second image and
The corrected text color and
The image processing apparatus according to any one of claims 1 to 4, wherein PDF data is generated based on the above.
前記2値画像に対して領域判定を行い、文字領域情報を取得する領域判定工程と、
前記文字領域情報に基づいて前記2値画像からMMRデータを生成するMMR圧縮工程と、
前記入力画像に対して、縮小を行い、縮小多値画像を生成する縮小工程と、
前記縮小多値画像からJPEGデータを生成するJPEG圧縮工程と、
前記縮小多値画像、前記2値画像および文字領域情報に基づいて、文字色を抽出する抽出工程と、
前記抽出された文字色を補正する補正工程と、
前記MMRデータと前記JPEGデータと前記補正された文字色と、を合成してPDFデータを生成するPDF生成工程と、
を有し、前記補正された文字色が合成されたPDFデータにおける文字色は、前記文字色が合成されないPDFデータにおける文字色より、前記入力画像における文字色に色値が近いことを特徴とする画像処理方法。 A binarization process that generates a binary image from the input image,
An area determination step of performing area determination on the binary image and acquiring character area information, and
An MMR compression step that generates MMR data from the binary image based on the character area information, and
A reduction step of reducing the input image to generate a reduced multi-valued image, and
A JPEG compression step that generates JPEG data from the reduced multi-valued image,
An extraction step of extracting a character color based on the reduced multi-valued image, the binary image, and character area information.
A correction step for correcting the extracted character color and
A PDF generation step of synthesizing the MMR data, the JPEG data, and the corrected character color to generate PDF data.
The character color in the PDF data in which the corrected character color is synthesized is characterized in that the color value is closer to the character color in the input image than the character color in the PDF data in which the character color is not synthesized. Image processing method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019186008A JP7362405B2 (en) | 2019-10-09 | 2019-10-09 | Image processing device, image processing method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019186008A JP7362405B2 (en) | 2019-10-09 | 2019-10-09 | Image processing device, image processing method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2021061564A true JP2021061564A (en) | 2021-04-15 |
JP7362405B2 JP7362405B2 (en) | 2023-10-17 |
Family
ID=75380535
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2019186008A Active JP7362405B2 (en) | 2019-10-09 | 2019-10-09 | Image processing device, image processing method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7362405B2 (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4047192B2 (en) | 2003-02-24 | 2008-02-13 | キヤノン株式会社 | Image compression apparatus and method, image expansion apparatus and method, and program |
JP4442651B2 (en) | 2007-07-05 | 2010-03-31 | コニカミノルタビジネステクノロジーズ株式会社 | Image processing apparatus and program |
JP6370080B2 (en) | 2014-04-02 | 2018-08-08 | キヤノン株式会社 | Image processing apparatus, image processing method, and program. |
JP6740612B2 (en) | 2015-12-25 | 2020-08-19 | 株式会社リコー | Image processing apparatus, image processing method and program |
-
2019
- 2019-10-09 JP JP2019186008A patent/JP7362405B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP7362405B2 (en) | 2023-10-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5875637B2 (en) | Image processing apparatus and image processing method | |
JP5180670B2 (en) | Image processing apparatus and image processing method | |
US8384964B2 (en) | Image processing apparatus and image processing method | |
JP2004320701A (en) | Image processing device, image processing program and storage medium | |
JP4586891B2 (en) | Color reduction method, color reduction processing apparatus, image forming apparatus, and computer program | |
JP5541672B2 (en) | Apparatus, method, program | |
JP6743092B2 (en) | Image processing apparatus, image processing control method, and program | |
JP4632443B2 (en) | Image processing apparatus, image processing method, and program | |
JP4582204B2 (en) | Image processing apparatus, image conversion method, and computer program | |
JP5645612B2 (en) | Image processing apparatus, image processing method, program, and storage medium | |
JP5893379B2 (en) | Image compression apparatus, image compression method, and computer program | |
US11736652B2 (en) | Image processing apparatus, image processing method, and storage medium | |
JP5178490B2 (en) | Image processing apparatus, image processing method, and computer program | |
JP5038231B2 (en) | Image processing apparatus, image processing method, program for executing image processing method, and recording medium | |
JP6370080B2 (en) | Image processing apparatus, image processing method, and program. | |
JP7362405B2 (en) | Image processing device, image processing method, and program | |
JP7134045B2 (en) | Image processing device, image processing method, and program | |
JP4710672B2 (en) | Character color discrimination device, character color discrimination method, and computer program | |
JP2005217984A (en) | Image processing device | |
JP2012231261A (en) | Image processing apparatus and control method thereof | |
US11405525B2 (en) | Image processing apparatus, control method, and product capable of improving compression efficiency by converting close color to background color in a low light reading mode | |
US11924390B2 (en) | Apparatus, method, and storage medium for performing color reduction processing | |
JP7185451B2 (en) | Image processing device, image processing method, and program | |
JP2005110184A (en) | Image processor, image processing program and recording medium | |
JP2020102148A (en) | Image processing device, image processing method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20221004 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20230616 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20230627 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20230825 |
|
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: 20230905 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20231004 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 7362405 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |