JP2021061564A - Image processing device, image processing method, and program - Google Patents

Image processing device, image processing method, and program Download PDF

Info

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
Application number
JP2019186008A
Other languages
Japanese (ja)
Other versions
JP7362405B2 (en
Inventor
三沢 玲司
Reiji Misawa
玲司 三沢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2019186008A priority Critical patent/JP7362405B2/en
Publication of JP2021061564A publication Critical patent/JP2021061564A/en
Application granted granted Critical
Publication of JP7362405B2 publication Critical patent/JP7362405B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

To prevent color variation of a character in a finally generated image, even when the color of the character varies due to character color extraction from a compressed image.SOLUTION: An image processing device comprises: a reduction part 307 which converts a first image to a second image with resolution lower than that of the first image; a character color extraction part 306 which extracts a character color in the character region of the second image obtained by the reduction part; a character color correction part 311 which corrects the character color extracted by the character color extraction part on the basis of the relation between the color value of the character color and the color value of a background color in the character region of the second image; and a PDF generation part 310 which generates a compressed image obtained by compressing the first image, as an image including the character region in which the character color is corrected by the character color correction part.SELECTED DRAWING: Figure 5

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では、圧縮を二段階で行い、圧縮率が小さい画像に対して代表色抽出を行い、上記色情報の変化を低減するとしている。 Patent Document 1 has a problem that when the image region is divided in this way and the compression method is different for each region, the color information changes when the representative color of the character region is extracted from the compressed image. It is disclosed. Then, in order to solve this problem, Patent Document 1 states that compression is performed in two steps, representative color extraction is performed on an image having a small compression rate, and the change in the color information is reduced.

特開2013−125994号公報Japanese Unexamined Patent Publication No. 2013-125994

しかしながら、特許文献1では、段階的な圧縮で圧縮率を小さくして文字の色情報の劣化を低減しようとしても、その小さくした圧縮率に応じた色変化がわずかであったとしても生じることになる。これは、程度の差はあれ、最終的に得られる画像において画質劣化の原因となり得る。 However, in Patent Document 1, even if an attempt is made to reduce the deterioration of character color information by reducing the compression rate by stepwise compression, even if the color change according to the reduced compression rate is slight, it occurs. Become. This can cause, to a greater or lesser extent, deterioration in image quality in the final image.

本発明の目的は、圧縮された画像における文字色抽出によって文字の色変化が生じたとしても、最終的に生成する画像における文字の色変化を防ぐことが可能な技術を提供することである。 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.

実施形態に係る圧縮画像における文字抽出によって文字色が変化することを説明する模式図である。It is a schematic diagram explaining that the character color changes by the character extraction in the compressed image which concerns on embodiment. 図1における画素を拡大して示す模式図である。It is a schematic diagram which shows the pixel in FIG. 1 enlarged. 本発明の一実施形態に係る画像処理システムの構成を示すブロック図である。It is a block diagram which shows the structure of the image processing system which concerns on one Embodiment of this invention. 図3に示すMFPの構成を示すブロック図である。It is a block diagram which shows the structure of the MFP shown in FIG. 本発明の一実施形態に係るデータ処理部によって実現される画像処理部の構成を示すブロック図である。It is a block diagram which shows the structure of the image processing part realized by the data processing part which concerns on one Embodiment of this invention. (a)〜(e)は、本発明の第1実施形態に係るデータ処理部による画像処理で生成される画像を説明する図である。(A) to (e) are diagrams for explaining an image generated by image processing by the data processing unit according to the first embodiment of the present invention. 実施形態に係る文字色抽出部の処理を説明するための模式図である。It is a schematic diagram for demonstrating the process of the character color extraction part which concerns on embodiment. (a)および(b)は、実施形態に係る文字色抽出処理の詳細を説明するための模式図である。(A) and (b) are schematic diagrams for explaining the details of the character color extraction process which concerns on embodiment. 本発明の実施形態で用いるエッジ検出のためのウインドウを模式的に示す図である。It is a figure which shows typically the window for edge detection used in embodiment of this invention. 本発明の一実施形態に係る補正係数を具体的に説明するための模式図である。It is a schematic diagram for concretely explaining the correction coefficient which concerns on one Embodiment of this invention. 本発明の第1実施形態に係る補正によって文字の代表色を補正した結果を示す図である。It is a figure which shows the result of having corrected the representative color of a character by the correction which concerns on 1st Embodiment of this invention. (a)、(b)および(c)は、本発明の第1実施形態に係るデータ処理部が実行する処理を示すフローチャートである。(A), (b) and (c) are flowcharts showing the processing executed by the data processing unit which concerns on 1st Embodiment of this invention. 本発明の第1実施形態に係る文字色補正処理を示すフローチャートである。It is a flowchart which shows the character color correction processing which concerns on 1st Embodiment of this invention. 本発明の第2実施形態に係る、文字ごとに背景色および大きさが変化する画像の一例を示す模式図である。It is a schematic diagram which shows an example of the image which changes the background color and size for each character which concerns on 2nd Embodiment of this invention. 本発明の第2実施形態に係る、文字ごとの文字色補正を行った結果を示す模式図である。It is a schematic diagram which shows the result of having performed the character color correction for each character which concerns on 2nd Embodiment of this invention. 本発明の第2実施形態に係るデータ処理部が実行する処理を示すフローチャートである。It is a flowchart which shows the process executed by the data processing part which concerns on 2nd Embodiment of this invention.

以下、本発明を実施するための形態について図面を参照して詳細に説明する。ただし、この実施形態に記載されている構成要素はあくまで例示であり、本発明の範囲をそれらに限定する趣旨のものではない。また、実施形態で説明されている構成要素の組み合わせのすべてが、課題を解決するための手段に必須のものとは限らず、種々の変形及び変更が可能である。 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, reference numeral 601, reference numeral 602, and reference numeral 603 indicate an input image (first image) having a resolution of 300 dpi, and represent characters on a white background, characters on a color background, and inverted characters, respectively. Reference numerals 604, 605, and 606 indicate a reduced image (second image) having a resolution of 150 dpi obtained by compressing the data of the input image. Reference numerals 607, 608, and 609 indicate binary images representing the character colors obtained by extracting the character colors from the reduced images 604 to 606.

入力画像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 image 604 obtained by compressing the input image 601 shows a state in which the edge portion of the character is thinned by the reduction (gray (R, G, B) = (128, 128, 128)). This is because, as shown in FIG. 2, the colors of the vertical and horizontal 2 × 2 pixels in the input image 601 are combined (averaged) into the colors of one pixel. Note that FIG. 2 is an enlarged view showing pixels 610 in the input image 601 and pixels 611 in the reduced image 604. When the character color extraction is performed on the reduced image 604 in which the color of one pixel is the averaged color as described above, the character color in the binary image 607 obtained thereby is compared with the character in the input image 601. It becomes a bright (light density) color. That is, since the average is calculated from all the black pixels and all the gray pixels of the characters in the reduced image, the character color becomes brighter ((R, G, B) = (80, 80, 80)).

入力画像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 input image 602 also undergo color changes due to the character color extraction of the compressed image. That is, the black characters (black (R, G, B) = (0, 0, 0)) on the pink background of the input image 602 have the edge portion of the characters thinned in the reduced image 605, and the background color is pink. ((R, G, B) = (128, 100, 128)). Then, the character color of the binary image 608 when the character color is extracted from the reduced image 605 becomes a relatively bright color, and the background color pink (pink (R, G, B) = (255, 200). , 255)) are mixed ((R, G, B) = (100, 80, 100)). The same applies to the input image 603 of the inverted character, and the white character (white (R, G, B) = (255, 255, 255)) on the black background is in a state where the edge portion of the character is dark in the reduced image 606. (Gray (R, G, B) = (128, 128, 128)). Then, the binary image 609 obtained by extracting the character color from the reduced image 606 is in a state where the character color is dark ((R, G, B) = (140, 140, 140)). This is to calculate the average from all white pixels and all gray pixels in the reduced image 606.

以上説明したように、圧縮による縮小画像に対して文字色抽出を行うと、最終的に得られる画像の文字色が変化するという問題が生じ得る。 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 network 103. In FIG. 3, the broken lines 104 and 105 show the flow of processing, respectively, and the broken line 104 shows the process of causing the user to read the paper document using the scanner of the MFP 101. At that time, the user can make various settings related to scanning and transmission with the client PC 102 (for example, the client PC 102) by using the operation unit (203 in FIG. 4) of the MFP 101 described later. As a setting, the user can specify a color mode, a file format (for example, JPEG, TIFF, PDF, PDF (high compression)), etc. In the following, a case where PDF (high compression) is specified as a data format will be described. Further, the details of PDF (high compression) will be described later. The broken line 105 generates data by using the software or hardware function of the MFP 101 based on various specified settings, and sends the data to the specified destination. The process of transmitting is shown. Here, since the image transmitted to the client PC 102 is transmitted in a file format such as PDF, it can be viewed by a general-purpose viewer of the client PC 102.

図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 MFP 101 shown in FIG. As shown in FIG. 4, the MFP 101 of the present embodiment includes a scanner unit 201 which is an image input device, a printer unit 202 which is an image output device, a control unit 204 which controls the entire MFP, an operation unit 203 which is a user interface, and the like. It is configured to have. The control unit 204 is a controller that inputs / outputs image information and device information by signal-connecting the scanner unit 201, the printer unit 202, and the operation unit 203, and on the other hand, by connecting the signal to the LAN 209. The CPU 205 constituting the control unit 204 is a processor that controls the entire system of the MFP 101. Similarly, the RAM 206 is a system work memory for operating the CPU 205, and is also an image memory for temporarily storing image data. Further, the ROM 210 is a boot ROM, and stores programs such as a system boot program. Further, the storage unit 211 is a non-volatile storage medium such as a hard disk drive, and stores system control software and image data. The operation unit I / F 207 is an interface unit with the operation unit (UI) 203, and outputs image data to be displayed on the operation unit 203 to the operation unit 203. Further, the operation unit I / F 207 plays a role of transmitting information instructed by the user of the image processing device to the CPU 205 via the operation unit 203. NetworkI / F208 connects this image processing device to LAN209 and inputs / outputs data. For example, the compressed data in PDF format is transmitted to another device, or the compressed data in PDF format is received from another device. The above devices are arranged on the system bus 216. The system bus 216 transmits information by connecting the devices in the control unit 204. The ImageBusI / F212 is a bus bridge that connects the system bus 216 and the image bus 217 that transfers image data at high speed to convert the data structure. The image bus 217 is composed of, for example, a PCI bus or IEEE 1394. The following devices are arranged on the image bus 217. The RIP unit 213 realizes a so-called rendering process that analyzes the PDL (Page Description Language) code and develops it into a bitmap image having a specified resolution. The device I / F 214 connects the scanner unit 201, which is an image input device, via the signal line 218, and the printer unit 202, which is an image output device, via the signal line 219. Perform asynchronous conversion. The data processing unit 215 generates PDF (high compression) by performing processing such as area determination, compression processing, and PDF file generation. The generated PDF (high compression) is transmitted to a designated destination (for example, client PC102) via NetworkI / F208 and LAN209. Further, the data processing unit 215 can also decompress the compressed data received via the Network I / F208 and LAN209. The stretched image is sent to the printer unit 202 via the device I / F 214 and printed.

図4に示すデータ処理部215は、以上概略を説明したように、入力データからPDF(高圧縮)を生成する画像処理部を構成する。図5は、データ処理部215によって実現される画像処理部の構成を示すブロック図であり、入力データ(RGBの多値画像データ)から出力データ(PDF(高圧縮))を生成するための各処理部を示す。データ処理部215は、プロセッサがコンピュータプログラムを実行することにより、図5に示す各処理部として機能するように構成してもよいし、その一部または全部をASICや電子回路等のハードウェアで構成するようにしてもよい。 As described above, the data processing unit 215 shown in FIG. 4 constitutes an image processing unit that generates PDF (high compression) from the input data. FIG. 5 is a block diagram showing a configuration of an image processing unit realized by the data processing unit 215, and each for generating output data (PDF (high compression)) from input data (RGB multi-valued image data). Indicates the processing unit. The data processing unit 215 may be configured to function as each processing unit shown in FIG. 5 by executing a computer program by the processor, or a part or all of the data processing unit 215 may be configured by hardware such as an ASIC or an electronic circuit. It may be configured.

図5において、グレー変換部301は、スキャナ部201によって読み取られた入力データ(RGBの多値画像データ)に基づいてグレーの多値画像データを生成する。図6(a)は、スキャナ部201によって読み取られた入力データ(RGBの多値画像データ)の一例を示している。入力データは、「EF」の文字列501、色背景上の「EF」の文字列502、白抜き文字の「EF」の文字列503、写真の画像504を含んでいる。これらを含む入力データに基づいて、下記の(1)式で規定される輝度Yのグレーの画像データが生成される。 In FIG. 5, the gray conversion unit 301 generates gray multi-valued image data based on the input data (RGB multi-valued image data) read by the scanner unit 201. FIG. 6A shows an example of input data (RGB multi-valued image data) read by the scanner unit 201. The input data includes the character string 501 of "EF", the character string 502 of "EF" on the color background, the character string 503 of the outline character "EF", and the image 504 of the photograph. Based on the input data including these, gray image data having a brightness Y defined by the following equation (1) is generated.

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 binarization unit 302 generates binary image data based on the gray multi-valued image data obtained by the gray conversion unit 301. The binarization method used in the present embodiment is a method of calculating a single threshold value from a histogram obtained from gray multi-valued image data and performing binarization according to the threshold value. FIG. 6B shows an example of a binary image generated by the binarization unit 302 based on the gray multivalued image shown in FIG. 6A.

再び図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 area determination unit 303 detects the character area and the photographic area in the binary image data generated by the binarization unit 302. As a result, in the example of the input image shown in FIG. 6A, as shown in FIG. 6C, it is shown that the character area information (X, Y, W, H) is 521, 522, and the inverted character area. Information (hereinafter, inverted character area information) 523 and photographic area information (X, Y, W, H) 524 are obtained.

上述した第一の領域判定部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 region determination unit 303 described above is performed by a known region identification method (for example, Japanese Patent Application Laid-Open No. 06-066301). Specifically, the case where the area determination is performed on the binary image data shown in FIG. 6B will be outlined as follows. Black pixel clusters are detected by tracking the contours of black pixels. As a result, black pixel clusters 1 to 6 are obtained as shown in FIG. 6 (d). Then, the obtained black pixel block is classified into a character, an inverted character, and a photograph by using at least one of the size, shape, and black pixel density. For example, black pixel clusters 1 to 4 having an aspect ratio close to 1 and a predetermined size are determined to be black pixel clusters constituting characters. Further, the pixel block 5 having a rectangular shape and a high black pixel density is determined to be an inverted character. Then, the remaining black pixel block 6 is determined to be a pixel block constituting the photograph. Further, when the distance between the black pixel clusters constituting the character is within a predetermined distance (for example, 3 pixels), the black pixel clusters are classified into the same group. Then, the circumscribed rectangular area including any of the black pixel clusters classified in the same group is determined to be the character area. As a result, it is determined that the black pixel clusters 1 and 2 and the black pixel clusters 3 and 4 shown in FIG. 6D are close to each other, and the black pixel clusters are determined to be character regions. By the above determination process, the determination result that the information 521 and 522 shown in FIG. 6C is the character area, the information 523 is the inverted character area, and the information 524 is the photographic area is output.

次に、第二の領域判定部304は、第一の領域判定部303で文字領域と判定された領域に対して文字切り出し処理を行う。これにより、文字単位の文字領域情報(x、y、w、h)を得ることができる。図6(e)は、図6(c)に示す文字領域情報521〜523に対して、文字切り出し処理を行った結果を示している。すなわち、文字領域情報521は単位の文字領域情報541、542に、文字領域情報522は単位の文字領域情報543、544に、反転文字領域情報523は単位の文字領域情報545、546に、それぞれ分離して検出される。以上の文字切り出し処理は、文字領域の中で、横方向からの射影と縦方向からの射影にもとづき、各文字の外接矩形を文字切り矩形として切り出すことによって個々の文字を分離して検出する。 Next, the second area determination unit 304 performs character cutting processing on the area determined to be the character area by the first area determination unit 303. As a result, character area information (x, y, w, h) for each character can be obtained. FIG. 6E shows the result of performing character cutting processing on the character area information 521 to 523 shown in FIG. 6C. That is, the character area information 521 is separated into the unit character area information 541 and 542, the character area information 522 is separated into the unit character area information 543 and 544, and the inverted character area information 523 is separated into the unit character area information 545 and 546. Is detected. In the above character cutting process, each character is separated and detected by cutting out the circumscribing rectangle of each character as a character cutting rectangle based on the projection from the horizontal direction and the projection from the vertical direction in the character area.

再び図5を参照すると、MMR圧縮部305は、2値化部302によって2値化された2値画像データを入力とし、第一の領域判定部303で文字領域と判定された領域に対してMMR圧縮を行う。MMR圧縮が行われたMMRデータは、PDF生成部310へ入力される。 Referring to FIG. 5 again, the MMR compression unit 305 takes the binary image data binarized by the binarization unit 302 as input, and with respect to the area determined to be the character area by the first area determination unit 303. Perform MMR compression. The MMR data that has been MMR-compressed is input to the PDF generation unit 310.

縮小部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 reduction unit 307 reduces the input data (RGB multi-value image data) read by the scanner unit 201 to generate a reduced multi-value image. The generated reduced multi-valued image is temporarily stored in the RAM 206. In the present embodiment, the reduction means the resolution conversion to a low resolution, for example, the resolution conversion by the bicubic method is performed. The character area fill-in-the-blank unit 308 refers to the binary image data binarized by the binarization unit 302 and the character area information (X, Y, W, H) obtained by the first area determination unit 303. , Calculate the average value of the background color in the character area. Further, the unit character area information (x, y, w, h) obtained from the second area determination unit 304 is referred to, and the calculated average value of the background color is assigned to the unit character area of the reduced multi-valued image. That is, the unit character area in the character area of the reduced multi-valued image is filled with the calculated background color, and the filled-in reduced multi-valued image is generated. As a result, the compression rate of the JPEG compression unit 309, which will be described later, is improved. The JPEG compression unit 309 JPEG-compresses the fill-in-the-blank reduced multi-valued image generated by the character area fill-in-the-blank section 308. The JPEG-compressed JPEG data is input to the PDF generation unit 310 described later.

文字色抽出部306は、第一の領域判定部303及び第二の領域判定部304から得られる文字領域情報(X、Y、W、H)、及び単位文字領域情報(x、y、w、h)を参照する。そして、これらを参照しながら2値化部302によって生成される2値画像データの黒部分と、縮小部307によって生成される縮小多値画像を位置対応させながら文字領域中の文字毎の代表色を抽出する。 The character color extraction unit 306 includes character area information (X, Y, W, H) obtained from the first area determination unit 303 and the second area determination unit 304, and unit character area information (x, y, w, See h). Then, referring to these, the black portion of the binary image data generated by the binarization unit 302 and the reduced multi-valued image generated by the reduction unit 307 are positioned to correspond to each other, and the representative color of each character in the character area is matched. Is extracted.

図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 color extraction unit 306 of the present embodiment. In FIG. 7, reference numerals 801 and 802 and reference numeral 803 indicate reduced multi-valued images of 150 dpi generated by the reduction unit 307, and reference numerals 804, reference 805 and reference numeral 806 are generated by the binarization unit 302, 300 dpi. The binary image of is shown. Further, reference numerals 807, reference numeral 808, and reference numeral 809 indicate the character color for each character in the binary image data (300 dpi), and reference numeral 810, reference numeral 811 and reference numeral 812 indicate the character color after the character color extraction.

ここで、文字色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 character color 810 refers to the unit character area information (x, y, w, h) of the binary image data 804, and reduces the color value corresponding to the black portion of the binary image to the reduced multi-value image 801. Get from. 8 (a) and 8 (b) are schematic views for explaining the details of this process. FIG. 8A is an enlarged view of a 300 dpi binary image 804. FIG. 8B is an enlarged view of a reduced multi-valued image 801 of 150 dpi. Since FIGS. 8 (a) and 8 (b) are shown with the same pixel size, the 150 dpi image shown in FIG. 8 (b) is shown in FIG. 8 (a). The width and height are halved compared to the 300 dpi image. The character color extraction unit 306 acquires the color value 1507 corresponding to the positions of the black pixels 1503 to 1506 of the binary image shown in FIG. 8A in the reduced image shown in FIG. 8B. In this way, the color values corresponding to all the black pixels of the binary image are acquired, and the average value is calculated.

図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, reference numeral 807 indicates the color of the average value for each character in the binary image thus obtained. As shown in the average color 807, the letter "E" is the average color (R, G, B) = (80, 80, 80), and the letter "F" is the average color (R, G, B) =. (75, 75, 75). As described above, in general, the average colors of the letters "E" and the letters "F" are different. This is because the reduced multi-valued image 801 is a reduced version of the data read by the scanner. That is, the color values of both the character "E" and the character "F" vary from pixel to pixel, and the halftone state generated at the edge of the character due to reduction is the character "E" and the character "F". Because it is different. On the other hand, in order to make the color values for each character uniform, similar colors, for example, if they are within a predetermined luminance difference or color difference range, are replaced with one representative color. Then, in the present embodiment, when selecting the one representative color, a method is used in which the average color of characters having a large number of black pixels is selected as the representative color in the binary image data before the average color calculation. That is, when the number of pixels constituting the character "E" is compared with the number of pixels constituting the character "F", the number of pixels constituting the character "E" is large. Therefore, the average color (R, G, B) = (80, 80, 80) of the character "E" is selected as the representative color. In reference numeral 810 of FIG. 7, the average color of the character "E", which is the representative color selected in this way, is the representative color (R, G, B) of the character "F" = (80, 80, 80). Which indicates that.

同様に、図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 binary image data 805 of 300 dpi shown in FIG. 7, the color value corresponding to the black portion of the binary image data is reduced by 150 dpi. Obtained from the multi-valued image 802. Reference numeral 808 in FIG. 7 indicates the average color for each character thus obtained. As shown in the average color 808, the letter "E" is the average color (R, G, B) = (100, 80, 100), and the letter "F" is the average color (R, G, B) =. (95, 75, 95). Further, reference numeral 811 in FIG. 7 indicates that the representative colors of the character “E” and the character “F” are (R, G, B) = (100, 80, 100). Similarly, referring to the unit character area information (x, y, w, h) of the binary image data 806 of 300 dpi shown in FIG. 7, the color value corresponding to the black portion of the binary image data is reduced by 150 dpi. Obtained from the multi-valued image 803. Reference numeral 809 in FIG. 7 indicates the average color for each character thus obtained. As shown in the average color 809, the letter "E" is the average color (R, G, B) = (140, 140, 140), and the letter "F" is the average color (R, G, B) =. (135, 135, 135). Further, reference numeral 812 indicates that the representative colors of both the character "E" and the character "F" are (R, G, B) = (140, 140, 140). As described above, the character color extraction unit 306 extracts the character color for each character area.

再び図5を参照すると、文字色補正部311は、文字色抽出部306によって得られた文字色を補正する。これにより、入力データ(多値画像データ)の文字のエッジ部分の色値が縮小部307における縮小による背景色の影響を受けて、最終的に得られる文字色の変化を低減することができる。すなわち、文字色を、その文字色と文字の背景の色との関係に基づいて補正する。 Referring to FIG. 5 again, the character color correction unit 311 corrects the character color obtained by the character color extraction unit 306. As a result, the color value of the character edge portion of the input data (multi-valued image data) is affected by the background color due to the reduction in the reduction unit 307, and the change in the character color finally obtained can be reduced. That is, the character color is corrected based on the relationship between the character color and the background color of 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 (reference numeral 901, reference numeral 902, reference numeral 903 in FIG. 10). In the 3 × 3 window, “1” to “9” indicate the positions of the pixels of the binary image data when the window is applied to the binary image data. In this window, the position "5" of the window is made to correspond to the pixel of interest that determines whether or not it is an edge in the binary image. Further, the positions "1", "2", "3", "4", "6", "7", "8", and "9" are associated with the pixels around the pixel of interest, respectively. By applying such a window, the pixel of "black =" 1 "" in the binary image is set as the pixel of interest, and the pixel of interest is sequentially changed to determine whether or not the pixel of interest is a pixel constituting an edge. I will go. Then, the pixel of interest at the position "5" is "black", and the positions "1", "2", "3", "4", "6", "7", "8", "9" When at least one of the pixels around the is "white =" 0 "", the pixel of interest at the position "5" is determined to be a pixel constituting the edge.

なお、上例は、図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 (reference numeral 903 in FIG. 10), after performing black-and-white inversion of the binary image data based on the inverted character area information obtained from the first area determination unit 303, the window of FIG. 9 is opened. By applying, the pixels that make up the edge are detected. As described above, the pixels constituting the edge for each character are detected and the number is calculated.

本実施形態は、補正係数を(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 reduction unit 307, the degree of influence is quantified. That is, the smaller the character (small point character or character including a thin line), the larger the ratio of the pixels constituting the edge to the character, and the character as a whole is easily affected by the background color. Therefore, the smaller the character, the larger the correction coefficient. On the contrary, the larger the character, the smaller the ratio of the pixels constituting the edge to the character, and the less affected by the background color. Therefore, the larger the character, the smaller the correction coefficient. The correction coefficient may be determined based on, for example, the character size itself. Specifically, since the width and height of each character are known in the unit character area information obtained by the second area determination unit 304, the correction coefficient can be directly determined by using this information.

補正係数に関し、エッジ部分の色値が画像の縮小によって背景色の影響を受ける場合の、その影響度合いは、上述した画素数の比のみに限定されない。例えば、背景色の影響で変化する色の見え方次第で、例えば、画素数の比のべき乗や画素数の差とすることもできる。また、上記画素数の比に加えて、背景色と文字色の色差など、色の違いに応じて補正係数に重みづけをしてもよい。 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, reference numerals 901, 902, and 903 indicate binary image data of 300 dpi generated by the binarization unit 302. Reference numerals 904, 905, and 906 indicate edge images obtained from binary image data of 300 dpi. Reference numerals 907, 908, and 909 indicate correction coefficients.

先ず、小さい文字(小ポイント文字や、細線を含む文字)である場合、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 binary image data 901, the number of pixels constituting the character "E" is 110, and the character "F" is formed. The number of pixels is 90. Therefore, in this case, the number of pixels constituting the character (average of one character) = 100. Next, as shown in the edge image 904, the number of pixels constituting the edge of the character "E" is 36, and the number of pixels constituting the edge of the character "F" is 44. Therefore, the number of pixels constituting the edge is an average of 40 per character. From the above, the correction coefficient is 0.4 as calculated by the calculation formula in the correction coefficient 907.

同様に、大きい文字である場合、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 binary image data 902, the number of pixels constituting the character "E" is 450, and the number of pixels constituting the character "F" is 350. Therefore, the number of pixels constituting the character (average of one character) = 400. Next, as shown in the edge image 905, the number of pixels constituting the edge of the character "E" is 85, and the number of pixels constituting the edge of the character "F" is 75. Therefore, the number of pixels constituting the edge is an average of 80 per character. As a result, the correction coefficient is 0.2 as calculated by the calculation formula at the correction coefficient 908.

反転文字の場合、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 binary image data 903, after performing black-and-white inversion based on the inverted character area information obtained from the first area determination unit 303, the number of pixels and edges constituting the character are determined. Calculate the number of constituent pixels. The number of pixels constituting the character "E" is 110, and the number of pixels constituting the character "F" is 90. Therefore, the number of pixels constituting the character is the average of these characters = 100. Next, as shown in the edge image 906, the number of pixels constituting the edge of the character "E" is 36, and the number of pixels constituting the edge of the character "F" is 44. Therefore, the number of pixels constituting the edge is one character average = 40. As a result, the correction coefficient is 0.4 as calculated by the calculation formula at the correction coefficient 909.

図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 character color 1001, the extracted representative colors 810 (FIG. 7) ((R, G, B) = (80, 80, 80)). ) Is corrected to the representative color (R, G, B) = (10, 10, 10). In this way, the extracted representative color 810 is corrected to a color closer to the character color ((R, G, B) = (0, 0, 0)) in the input image. As a result, it is possible to reduce the influence of the background color on the character color due to the reduction of the image.

同様に、補正後の文字色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 character color 1002, the representative color 811 (FIG. 7) ((R, G, B) = (100, 80, 100)) is the representative color (R, G, B) =. It is corrected to (38, 32, 38). Similarly, as shown in the corrected character color 1003, the representative color 812 (FIG. 7) ((R, G, B) = (140, 140, 140)) is the representative color (R, G, B) =. It is corrected to (196, 196, 196).

再び図5を参照すると、PDF生成部310は、MMR圧縮部305で圧縮されたMMRデータ、文字色補正部311より得られた文字色、JPEG圧縮部309で圧縮されたJPEGデータを合成する。そして、合成したデータをPDFフォーマット(PDFデータ)に変換することにより、PDF(高圧縮)を生成する。 Referring to FIG. 5 again, the PDF generation unit 310 synthesizes the MMR data compressed by the MMR compression unit 305, the character color obtained from the character color correction unit 311 and the JPEG data compressed by the JPEG compression unit 309. Then, PDF (high compression) is generated by converting the synthesized data into a PDF format (PDF data).

以上説明した実施形態によれば、上記補正された文字色が合成された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 data processing unit 215. The program that executes the process shown in the flowchart is stored in the ROM 210 or the storage unit 211 of FIG. 4 and is executed by the CPU 205. The CPU 205 can exchange data with the data processing unit 215 by using the ImageBusI / F212, the system bus 216, and the image bus 217. Further, the symbol "S" in the description of the flowchart represents a step. The same applies to the description of the following flowchart.

<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 CPU 205 executes a process of generating gray multi-valued image data from the input data (RGB multi-valued image data) read by the scanner unit 201. The details of this process are as described above in the operation description of the gray conversion unit 301. Next, binarization is performed in S402. The CPU 205 executes a process of generating binary image data from the gray multi-valued image data obtained in S401. The details of this process are as described above in the operation description of the binarization unit 302. Further, in S403, the first region determination is performed. The CPU 205 executes a process of detecting a character area and a photographic area from the binary image data generated in S402. The character area information (X, Y, W, H) obtained here and the inverted character area information are temporarily stored in the RAM 206. The details of this process are as described above in the operation description of the first area determination unit 303. Next, in S404, the second region determination is performed. The CPU 205 performs character cutting processing on the area determined to be the character area in S403. The unit character area information (x, y, w, h) obtained here is temporarily stored in the RAM 206. The details of this process are as described above in the operation description of the second area determination unit 304. Finally, MMR compression is performed in S405. The CPU 205 takes the binary image data binarized in S402 as input, and MMR compresses the area determined to be the character area in S403 (the character area on the binary image data). The details of this process are as described above in the operation description of the MMR compression unit 305.

<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 CPU 205 reduces the input data (RGB multi-valued image data) to generate a reduced multi-valued image. The generated reduced multi-valued image is temporarily stored in the RAM 206. The details of this process are as described above in the operation description of the reduction unit 307. Next, in S421, a fill-in-the-blank process is performed in the character area. The CPU 205 refers to the binary image data generated in step S402 and the character area information (X, Y, W, H) obtained in S403, and calculates the average value of the background color in the character area. .. Next, the unit character area information (x, y, w, h) obtained in S404 is referred to, and the calculated average value of the background color is assigned to the unit character area of the reduced multi-valued image. That is, the unit character area of the reduced multi-valued image is filled with the calculated background color, and the reduced multi-valued image is generated. The details of this character area fill-in-the-blank process are as described above in the operation description of the character area fill-in-the-blank portion 308. Further, in S422, the CPU 205 JPEG-compresses the fill-in-the-blank reduced multi-valued image generated in S421. The details of JPEG compression are as described above in the operation description of the JPEG compression unit 309. The JPEG data generated as described above is temporarily stored in the RAM 206.

<文字色データの生成>
図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 CPU 205 searches for the first character area by referring to the binary image data and the character area information (X, Y, W, H) obtained by S403. Then, in S411, the CPU 205 determines whether or not the region of interest is a character region. When the determination result that the region of interest is the character region is obtained (YES in S411), the process shifts to S412. When the determination result that the region of interest is not the character region is obtained (NO in S411), the process shifts to S414. Next, in S412, the CPU 205 refers to the character area information (X, Y, W, H) obtained in S403 and the unit character area information (x, y, w, h) obtained in S404. .. Then, while referring to these information, the character color for each character area is extracted while the black portion of the binary image data and the reduced multi-value image generated in S420 are positioned to correspond to each other. The representative color extraction method is as described above in the operation description of the character color extraction unit 306.

次に、S413にて、CPU205は、S412にて得られた文字領域毎の文字色を補正する。図13は、文字色補正処理を示すフローチャートである。なお、本実施形態では、図13が示すフローチャートの処理は、文字領域毎に実行される。また、後述する第2実施形態では、図13が示すフローチャートの処理は、単位文字領域毎に実行される。 Next, in S413, the CPU 205 corrects the character color for each character area obtained in S412. FIG. 13 is a flowchart showing the character color correction process. In this embodiment, the processing of the flowchart shown in FIG. 13 is executed for each character area. Further, in the second embodiment described later, the processing of the flowchart shown in FIG. 13 is executed for each unit character area.

図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 CPU 205 refers to the binary image data and the character area information (X, Y, W, H) obtained in S403, and calculates the background color in the character area. Next, in S702, the CPU 205 performs edge detection from the binary image data generated in S402. The edge detection is as described above in the operation description of the character color correction unit 311. Further, in S703, the CPU 205 calculates the correction coefficient using the binary image data generated in S402 and the edge detection image generated in S702. The calculation of the correction coefficient is as described above in the operation description of the character color correction unit 311. Finally, in S704, the CPU 205 corrects the character color using the character color extracted in S406, the background color calculated in S701, and the correction coefficient calculated in S703. The character color correction is as described above in the operation description of the character color correction unit 311.

再び図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 CPU 205 determines whether or not the search for the entire character area is completed. When the determination result that the search of the entire character area is completed is obtained (YES in S414), this process is terminated. When a determination result is obtained that the search for the entire character area has not been completed (NO in S414), the process shifts to S415. In S415, the CPU 205 searches for the next character area. After the search in S415, the processing is shifted to S411, and the processing after S411 is performed on the next character string area searched in S415. The character color data for each character area generated as described above is temporarily stored in the RAM 206.

<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 CPU 205 converts these data into PDF format. By doing so, PDF (high compression) is generated.

以上のように、本実施形態は、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, reference numeral 1101 indicates input data (multi-valued image data). Here, the character "E" is an uppercase letter, and the background color is white ((R, G, B) = (255, 255, 255)). The letter "F" is lowercase and the background color is pink ((R, G, B) = (255, 200, 255)). Reference numeral 1102 indicates a reduced multi-valued image in which the input data 1101 is reduced by the reduction unit (reference numeral 307 in FIG. 5). As described above in the first embodiment, it can be seen that the background color is mixed with the character color at the edge portion of the character. Reference numeral 1103 indicates binary image data in which the input data 1101 is binarized by the binarization unit (reference numeral 307 in FIG. 5). The unit character area information (x, y, w, h) of each of the character "E" and the character "F" is shown. The reference numeral 1104 indicates the character color for each character in the binary image, the average color of the character "E" is ((R, G, B) = (50, 50, 50)), and the character "F". Indicates that the average color of is ((R, G, B) = (95, 75, 95)).

ここで、第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 character color 1104 of FIG. As shown in FIG. 15, the character "E" uses the background color (R, G, B) = (255, 255, 255) and the correction coefficient 0.19 (= 85/450), and the character "F" uses the character "F". , Background color (R, G, B) = (255, 200, 255) and correction coefficient 0.5 (= 44/90) are used. As a result, the character "E" is corrected to the character color (R, G, B) = (11, 11, 11), and the character "F" is corrected to the character color (R, G, B) = (15, 12). , 15).

以上のように補正された、文字「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 ROM 210 or the storage unit 211 of FIG. 4 and is executed by the CPU 205. At this time, the CPU 205 can exchange data with the data processing unit 215 using the ImageBusI / F212, the system bus 216, and the image bus 217. Hereinafter, the process of correcting the character color for each character, which is a portion different from that of the first embodiment, will be described with reference to the flowchart shown in FIG. In this description, the processes shown in FIGS. 12 and 13 described above in the first embodiment will be referred to as appropriate. Further, since the processing of S410, S411, S414 and S415 shown in FIG. 16 is the same processing as that of S410, S411, S414 and S415 of FIG. 12B, the description thereof will be omitted.

先ず、S1301にて、CPU205は、S411にて文字領域と判定された領域に対して、S404にて得られる単位文字領域情報(x、y、w、h)を参照し、最初の単位文字領域を探索する処理を実行する。次に、S1302にて、CPU205は、S404にて得られる単位文字領域情報(x、y、w、h)を参照する。そして、この情報を参照して2値画像データの黒部分と、S420にて生成される縮小多値画像を位置対応させながら文字領域中の単位文字領域毎の文字色を抽出する処理を実行する。代表色の抽出方法については、文字色抽出部306の動作において前述した通りである。 First, in S1301, the CPU 205 refers to the unit character area information (x, y, w, h) obtained in S404 with respect to the area determined to be the character area in S411, and refers to the first unit character area. Executes the process of searching for. Next, in S1302, the CPU 205 refers to the unit character area information (x, y, w, h) obtained in S404. Then, referring to this information, a process of extracting the character color for each unit character area in the character area is executed while aligning the black part of the binary image data with the reduced multi-value image generated in S420. .. The representative color extraction method is as described above in the operation of the character color extraction unit 306.

次に、S1303にて、CPU205は、S1302にて得られた文字色を補正する。ここで、第1実施形態では、この補正処理を文字領域毎に実行した。本実施形態では、図16に示す処理を単位文字領域毎に実行する。 Next, in S1303, the CPU 205 corrects the character color obtained in S1302. Here, in the first embodiment, this correction process is executed for each character area. In the present embodiment, the process shown in FIG. 16 is executed for each unit character area.

S1304にて、CPU205は、全単位文字領域の探索が終了したか否かを判定する処理を実行する。全単位文字領域の探索が終了しているとの判定結果を得た場合(S1304のYES)、処理をS1305へ移行する。全単位文字領域の探索が終了していないとの判定結果を得た場合(S1304のNO)、処理をS1306へ移行する。S1306にて、CPU205は、次の単位文字領域を探索する。S1306の探索の後、処理をS1302へ移行し、S1306で探索された次の単位文字列領域に対しS1302以降の処理が行われる。 In S1304, the CPU 205 executes a process of determining whether or not the search for all unit character areas has been completed. When the determination result that the search for all unit character areas is completed is obtained (YES in S1304), the process shifts to S1305. When a determination result is obtained that the search for all unit character areas has not been completed (NO in S1304), the process shifts to S1306. In S1306, the CPU 205 searches for the next unit character area. After the search for S1306, the processing shifts to S1302, and the processing after S1302 is performed on the next unit character string area searched for in S1306.

S1305にて、CPU205は、S1303にて得られた文字色補正後の文字色を代表色に置き換える処理を実行する。同一の文字領域内に類似した色、例えば、所定の輝度差、色差の範囲内であれば、一つの代表色に置き換える。 In S1305, the CPU 205 executes a process of replacing the character color after the character color correction obtained in S1303 with a representative color. If similar colors are within the same character area, for example, within a predetermined luminance difference and color difference range, they are replaced with one representative color.

以上のように、文字毎に文字色を補正することにより、文字領域内で背景色が変化する場合や、文字の大きさが変化する場合には、それぞれの文字に適した文字色補正が可能となる。また、同一の文字領域内に類似した色がある場合、文字色補正後も同じ色値にすることが可能となり、異なる色の場合(類似した色ではない場合)は、それぞれの文字に適した文字色補正が可能となる。 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 color extraction unit 307 Reduction unit 310 PDF generation unit 311 Character color correction unit

Claims (7)

第1画像を該第1画像より低い解像度の第2画像に変換する縮小手段と、
前記縮小手段によって得られる前記第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.
前記補正手段は、前記文字色の色値と前記第2画像の文字領域における背景色の色値との関係によって求められる値に、補正係数を乗じることにより、前記文字色を補正する
ことを特徴する請求項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.
第1画像を該第1画像より低い解像度の第2画像に変換する縮小手段と、
前記縮小手段によって得られる前記第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値化工程と、
前記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.
コンピュータに請求項6に記載の画像処理方法を実行させるためのプログラム。 A program for causing a computer to execute the image processing method according to claim 6.
JP2019186008A 2019-10-09 2019-10-09 Image processing device, image processing method, and program Active JP7362405B2 (en)

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)

* Cited by examiner, † Cited by third party
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

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