JP2014072750A - Image processor, and computer program - Google Patents

Image processor, and computer program Download PDF

Info

Publication number
JP2014072750A
JP2014072750A JP2012218014A JP2012218014A JP2014072750A JP 2014072750 A JP2014072750 A JP 2014072750A JP 2012218014 A JP2012218014 A JP 2012218014A JP 2012218014 A JP2012218014 A JP 2012218014A JP 2014072750 A JP2014072750 A JP 2014072750A
Authority
JP
Japan
Prior art keywords
image data
gray
image
color
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2012218014A
Other languages
Japanese (ja)
Other versions
JP6145983B2 (en
Inventor
Ryohei Ozawa
良平 小澤
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.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
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 Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2012218014A priority Critical patent/JP6145983B2/en
Publication of JP2014072750A publication Critical patent/JP2014072750A/en
Application granted granted Critical
Publication of JP6145983B2 publication Critical patent/JP6145983B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To effectively compress image data representing an image including a character area and a non-character area.SOLUTION: An image processor includes: a specification part for specifying a character area, a gray area representing a gray image, and a color area representing a color image in an object image; a first processing part for generating compressed character image data by executing first processing by using a partial image data corresponding to the character area; a second processing part for generating compressed gray image data by performing processing for acquiring gray component data composed of one kind of a component value and processing for compressing the gray component data by using partial image data corresponding to the gray area; and a third processing part for generating compressed color image data by performing processing for acquiring color component data including a plurality of pieces component data and processing for compressing the color component data by using partial image data corresponding to the color area.

Description

本発明は、文字を表す文字領域と、文字領域とは異なる非文字領域と、を含む画像を表す画像データに対する画像処理に関する。   The present invention relates to image processing for image data representing an image including a character region representing a character and a non-character region different from the character region.

文字を含む対象画像を表す対象画像データを高い圧縮率で圧縮する技術が知られている(例えば、特許文献1)。この技術は、カラー文字を表すカラー文字画像データと、モノクロ文字を表すモノクロ文字画像データと、文字を含まない非文字画像データとに分離する。この技術は、分離された各画像を、各画像の圧縮に適した圧縮方式で圧縮することによって、対象画像データ全体の圧縮率を向上させている。   A technique for compressing target image data representing a target image including characters at a high compression rate is known (for example, Patent Document 1). This technique separates color character image data representing color characters, monochrome character image data representing monochrome characters, and non-character image data not containing characters. This technique improves the compression rate of the entire target image data by compressing each separated image by a compression method suitable for compression of each image.

例えば、モノクロ文字画像データは、MMR(Modified Modified Read)形式で圧縮され、カラー文字画像データは、GIF(Graphic Interchange Format)形式で圧縮され、非文字画像データは、JPEG(Joint Photographic Experts Group)形式で圧縮される。   For example, monochrome character image data is compressed in MMR (Modified Modified Read) format, color character image data is compressed in GIF (Graphic Interchange Format) format, and non-character image data is compressed in JPEG (Joint Photographic Experts Group) format. It is compressed with.

特開2005−124066号公報JP 2005-1224066 A

しかしながら、上記技術では、非文字画像データの圧縮について十分に工夫されているとは言えず、対象画像データを効果的に圧縮できない可能性があった。例えば、非文字画像データの割合に対して文字画像データの割合が少ない対象画像データは、十分にデータサイズを縮小できないなど、効果的にデータサイズを縮小できない可能性があった。   However, in the above technique, it cannot be said that the compression of the non-character image data is sufficiently devised, and there is a possibility that the target image data cannot be effectively compressed. For example, there is a possibility that the target image data in which the ratio of the character image data is smaller than the ratio of the non-character image data cannot be reduced effectively because the data size cannot be reduced sufficiently.

本発明の主な利点は、文字を表す文字領域と、文字領域とは異なる非文字領域と、を含む画像を表す画像データを効果的に圧縮する新たな技術を提供することである。   A main advantage of the present invention is to provide a new technique for effectively compressing image data representing an image including a character region representing a character and a non-character region different from the character region.

本発明は、上述の課題の少なくとも一部を解決するためになされたものであり、以下の適用例として実現することが可能である。   SUMMARY An advantage of some aspects of the invention is to solve at least a part of the problems described above, and the invention can be implemented as the following application examples.

[適用例1] 対象画像を表す対象画像データであって、複数の色成分に対応する複数の成分データを含む対象画像データを取得する取得部と、
前記対象画像において、文字を表す文字領域と、文字とは異なるグレー画像を表すグレー領域と、文字とは異なるカラー画像を表すカラー領域と、を特定する特定部と、
前記対象画像データのデータサイズを低減するための低減処理部であって、
前記文字領域に対応する部分画像データを用いて、第1の処理を実行することによって、圧縮済みの文字画像データを生成する第1処理部と、
前記グレー領域に対応する部分画像データを用いて、前記第1の処理とは異なる第2の処理を実行することによって、1種類の成分値で構成された圧縮済みのグレー画像データを生成する第2処理部であって、前記第2の処理は、1種類の成分値で構成されたグレー成分データを取得する処理と、前記グレー成分データを圧縮する処理と、を行うことで前記圧縮済みのグレー画像データを生成することを含む、前記第2処理部と、
前記カラー領域に対応する部分画像データを用いて、前記第1の処理および前記第2の処理とは異なる第3の処理を実行することによって、複数種類の成分値で構成された圧縮済みのカラー画像データを生成する第3処理部であって、前記第3の処理は、複数の成分データを含むカラー成分データを取得する処理と、前記カラー成分データを圧縮する処理と、を行うことで前記圧縮済みのカラー画像データを生成することを含む、前記第3処理部と、
を有する、前記低減処理部と、
前記圧縮済みの文字画像データと、前記圧縮済みのグレー画像データと、前記圧縮済みのカラー画像データと、を用いて、前記対象画像を表す圧縮済みの対象画像データを生成する生成部と、
を備える、画像処理装置。
Application Example 1 An acquisition unit that acquires target image data that represents a target image and includes a plurality of component data corresponding to a plurality of color components;
In the target image, a specifying unit that specifies a character region representing a character, a gray region representing a gray image different from the character, and a color region representing a color image different from the character,
A reduction processing unit for reducing the data size of the target image data,
A first processing unit that generates compressed character image data by executing a first process using partial image data corresponding to the character region;
A second process different from the first process is executed using the partial image data corresponding to the gray area, thereby generating compressed gray image data composed of one type of component value. A second processing unit, wherein the second processing is performed by performing processing for obtaining gray component data composed of one kind of component value and processing for compressing the gray component data; Generating the gray image data, the second processing unit;
By executing a third process different from the first process and the second process using partial image data corresponding to the color area, a compressed color composed of a plurality of types of component values A third processing unit for generating image data, wherein the third process performs a process of acquiring color component data including a plurality of component data and a process of compressing the color component data. Generating the compressed color image data, the third processing unit;
The reduction processing unit,
A generating unit that generates compressed target image data representing the target image using the compressed character image data, the compressed gray image data, and the compressed color image data;
An image processing apparatus comprising:

上記構成によれば、圧縮済みの文字画像データと、圧縮済みのグレー画像データと、圧縮済みのカラー画像データと、をそれぞれ異なる処理を用いて生成する。そして、圧縮済みのグレー画像データは、1種類の成分値で構成されたグレー成分画像データを取得する処理と、グレー成分画像データを圧縮する処理と、を含む第2の処理によって生成される。また、圧縮済みのカラー画像データは、複数の成分データを含むカラー画像データを取得する処理と、カラー画像データを圧縮する処理を含む第3の処理によって生成される。この結果、文字、文字とは異なるグレー画像、文字とは異なるカラー画像とにそれぞれ適した処理を実行するので、対象画像データを効果的に圧縮して、圧縮済みの対象画像データを生成することができる。   According to the above configuration, the compressed character image data, the compressed gray image data, and the compressed color image data are generated using different processes. The compressed gray image data is generated by a second process including a process of acquiring gray component image data composed of one type of component value and a process of compressing the gray component image data. The compressed color image data is generated by a third process including a process of acquiring color image data including a plurality of component data and a process of compressing the color image data. As a result, processing suitable for a character, a gray image different from the character, and a color image different from the character are executed, so that the target image data is effectively compressed to generate compressed target image data. Can do.

本発明は、種々の形態で実現することが可能であり、例えば、上記装置の機能を実現する方法、上記装置の機能を実現するコンピュータプログラム、当該コンピュータプログラムを記録した記録媒体、等の形態で実現することができる。   The present invention can be realized in various forms, for example, in the form of a method for realizing the function of the device, a computer program for realizing the function of the device, a recording medium on which the computer program is recorded, and the like. Can be realized.

本発明の一実施例としての計算機200の構成を示すブロック図である。It is a block diagram which shows the structure of the computer 200 as one Example of this invention. 画像処理のフローチャートである。It is a flowchart of an image process. 画像領域特定処理の全体の流れを示す概略図である。It is the schematic which shows the whole flow of an image area | region identification process. 本実施例におけるエッジ強度の算出式を示している。The calculation formula of the edge intensity | strength in a present Example is shown. 統合処理のフローチャートである。It is a flowchart of an integration process. 2個の領域の統合を示す概略図である。It is the schematic which shows integration of two area | regions. 第3条件F3の階調差TDの算出式を示している。The calculation formula of the gradation difference TD under the third condition F3 is shown. 4個の領域L34〜L37の統合を示す概略図である。It is the schematic which shows integration of four area | regions L34-L37. 判断テーブル292の一例を示す図である。It is a figure which shows an example of the judgment table 292. 分布幅Wと色数Cとの説明図である。It is explanatory drawing of the distribution width W and the number C of colors. グレー判断処理のフローチャートである。It is a flowchart of a gray determination process. ヒストグラムの作成のフローチャートである。It is a flowchart of creation of a histogram. 非文字オブジェクト領域の外縁部の一例を示す図である。It is a figure which shows an example of the outer edge part of a non-character object area | region. グレー領域とカラー領域の判断について説明する図である。It is a figure explaining judgment of a gray area and a color area. 第1実施例の低減処理のフローチャートである。It is a flowchart of the reduction process of 1st Example. 第1実施例の低減処理で生成される画像データについて説明する図である。It is a figure explaining the image data produced | generated by the reduction process of 1st Example. 第2実施例の低減処理のフローチャートである。It is a flowchart of the reduction process of 2nd Example. 第2実施例の低減処理で生成される画像データについて説明する図である。It is a figure explaining the image data produced | generated by the reduction process of 2nd Example.

A.第1実施例:
A−1:計算機200の構成
次に、本発明の実施の形態を実施例に基づき説明する。図1は、本発明の一実施例としての計算機200の構成を示すブロック図である。計算機200は、例えば、パーソナルコンピュータであり、CPU210と、DRAM等を含む揮発性記憶装置240と、フラッシュメモリやハードディスクドライブ等を含む不揮発性記憶装置290と、タッチパネルやキーボード等の操作部270と、外部装置と通信を行うためのインタフェースである通信部280と、を備えている。
A. First embodiment:
A-1: Configuration of Computer 200 Next, an embodiment of the present invention will be described based on examples. FIG. 1 is a block diagram showing a configuration of a computer 200 as an embodiment of the present invention. The computer 200 is, for example, a personal computer, a CPU 210, a volatile storage device 240 including a DRAM, a non-volatile storage device 290 including a flash memory and a hard disk drive, an operation unit 270 such as a touch panel and a keyboard, And a communication unit 280 which is an interface for communicating with an external device.

計算機200は、通信部280を介して、外部装置(ここでは、スキャナ300と複合機400)に、通信可能に接続されている。スキャナ300は、光学的に対象物(例えば、紙の文書)を読み取ることによってスキャンデータを取得する画像読取装置である。複合機400は、光学的に対象物を読み取ることによってスキャンデータを取得する画像読取部(図示省略)を備えている。   The computer 200 is communicably connected to an external device (here, the scanner 300 and the multifunction device 400) via the communication unit 280. The scanner 300 is an image reading device that acquires scan data by optically reading an object (for example, a paper document). The multifunction device 400 includes an image reading unit (not shown) that acquires scan data by optically reading an object.

揮発性記憶装置240には、CPU210が処理を行う際に生成される種々の中間データを一時的に格納するバッファ領域241が設けられている。不揮発性記憶装置290は、ドライバプログラム291と、後述する画像処理にて用いられる判断テーブル292と、を格納している。ドライバプログラム291は、例えば、CD−ROMやDVD−ROMなどに格納された形態で提供される。あるいは、ドライバプログラム291は、ネットワークを介して計算機200に接続されたサーバからダウンロードされる形態で提供される。   The volatile storage device 240 is provided with a buffer area 241 for temporarily storing various intermediate data generated when the CPU 210 performs processing. The nonvolatile storage device 290 stores a driver program 291 and a determination table 292 used in image processing to be described later. The driver program 291 is provided in a form stored in, for example, a CD-ROM or DVD-ROM. Alternatively, the driver program 291 is provided in a form downloaded from a server connected to the computer 200 via a network.

CPU210は、ドライバプログラム291を実行することにより、スキャナドライバ100として機能する。スキャナドライバ100は、対象画像データ(例えば、スキャンデータ)に対して後述する画像処理を実行して、圧縮PDFファイルを生成する画像処理機能を備えている。スキャナドライバ100は、当該画像処理機能を実現するための機能部として、取得部110と、特定部120と、低減処理部130と、生成部150と、を備えている。取得部110は、対象画像データを取得する。特定部120は、対象画像データを解析して領域特定を実行する。特定部120は、グレー領域判断処理を行う判断部125を備えている。低減処理部130は、対象画像データのデータサイズを低減するための低減処理を実行する。低減処理部130は、対象画像のうち、文字を表す文字領域に関する処理を行う第1処理部131と、対象画像に含まれる文字とは異なるグレー画像を表すグレー領域に関する処理を行う第2処理部132と、対象画像に含まれる文字とは異なるカラー画像を表すカラー領域に関する処理を行う第3処理部133と、を備えている。生成部150は、低減処理部130によって処理された画像データを用いて圧縮PDFファイルを生成する。これらの各機能部110〜150が実行する処理については後述する。   The CPU 210 functions as the scanner driver 100 by executing the driver program 291. The scanner driver 100 has an image processing function for executing a later-described image process on target image data (for example, scan data) to generate a compressed PDF file. The scanner driver 100 includes an acquisition unit 110, an identification unit 120, a reduction processing unit 130, and a generation unit 150 as functional units for realizing the image processing function. The acquisition unit 110 acquires target image data. The specifying unit 120 analyzes the target image data and executes region specification. The specifying unit 120 includes a determination unit 125 that performs a gray area determination process. The reduction processing unit 130 executes a reduction process for reducing the data size of the target image data. The reduction processing unit 130 includes a first processing unit 131 that performs processing related to a character region representing a character in the target image, and a second processing unit that performs processing related to a gray region representing a gray image different from the character included in the target image. 132, and a third processing unit 133 that performs processing related to a color region representing a color image different from the character included in the target image. The generation unit 150 generates a compressed PDF file using the image data processed by the reduction processing unit 130. Processing executed by each of these functional units 110 to 150 will be described later.

A−2:画像処理
図2は、画像処理のフローチャートである。ステップS100では、取得部110(図1)は、通信部280を介して、スキャンデータを、対象画像データとして取得し、取得したスキャンデータを、バッファ領域241(図1)に格納する。具体的には、取得部110は、スキャナ300または複合機400の画像読取部を制御して、スキャンデータを取得する。スキャンデータは、例えば、紙の文書(原稿とも呼ぶ)の読み取り結果を表している。また、スキャンデータは、複数の画素毎の色をRGB値で表すビットマップデータである。
A-2: Image Processing FIG. 2 is a flowchart of image processing. In step S100, the acquisition unit 110 (FIG. 1) acquires scan data as target image data via the communication unit 280, and stores the acquired scan data in the buffer area 241 (FIG. 1). Specifically, the acquisition unit 110 controls the image reading unit of the scanner 300 or the multifunction device 400 to acquire scan data. The scan data represents, for example, a reading result of a paper document (also called a manuscript). The scan data is bitmap data that represents the color of each of the plurality of pixels as an RGB value.

図3は、画像領域特定処理(図2のステップS150〜S450の処理)の全体の流れを示す概略図である。図3(A)の対象画像SIは、対象画像データ(例えば、スキャンデータ)によって表される画像の一例である。対象画像SIでは、図示しない複数の画素が、第一方向D1と、第一方向D1と直交する第二方向D2と、に沿って、マトリクス状に配置されている。1個の画素の画素データ(すなわち、RGB値)は、例えば、赤(R)と緑(G)と青(B)との3個の色成分の階調値(以下、成分値とも呼ぶ)を含んでいる。本実施例では、各成分値の階調数は、256階調である。すなわち、対象画像データは、RGBの3個の成分にそれぞれ対応する3個の成分データを含んでいるということができる。成分データは、3個の成分値のうちの1個の成分値で構成される画像データである。   FIG. 3 is a schematic diagram showing an overall flow of the image region specifying process (the processes in steps S150 to S450 in FIG. 2). The target image SI in FIG. 3A is an example of an image represented by target image data (for example, scan data). In the target image SI, a plurality of pixels (not shown) are arranged in a matrix along a first direction D1 and a second direction D2 orthogonal to the first direction D1. Pixel data of one pixel (that is, RGB value) is, for example, the gradation values (hereinafter also referred to as component values) of three color components of red (R), green (G), and blue (B). Is included. In this embodiment, the number of gradations of each component value is 256 gradations. That is, it can be said that the target image data includes three component data respectively corresponding to the three RGB components. The component data is image data composed of one component value among the three component values.

図3(A)の例では、対象画像SIは、背景Bgと、3個の非文字オブジェクトOb1〜Ob3と、4個の文字オブジェクトOb4〜Ob7と、を含んでいる。非文字オブジェクトは、例えば、写真オブジェクトや描画オブジェクトである。写真オブジェクトは、デジタルカメラによる撮影等によって得られる写真を表すオブジェクトである。描画オブジェクトは、イラスト、表、グラフ、線図、ベクトルグラフィックス、模様等の、描画を表すオブジェクトである。本実施例の3個の非文字オブジェクトのうち、2個の非文字オブジェクトOb1、Ob2は、グレー(無彩色)オブジェクトであり、1個の非文字オブジェクトOb3は、カラー(有彩色)オブジェクトである。また、本実施例の4個の文字オブジェクトOb4〜Ob7のうち、3個の文字オブジェクトOb4〜Ob6(E、F、Gの文字)は、互いに同じ色の文字であり、1個の文字オブジェクトOb7(Hの文字)は、他の3個の文字オブジェクトOb4〜Ob6とは、異なる色の文字であるとする。   In the example of FIG. 3A, the target image SI includes a background Bg, three non-character objects Ob1 to Ob3, and four character objects Ob4 to Ob7. The non-character object is, for example, a photo object or a drawing object. The photographic object is an object representing a photograph obtained by photographing with a digital camera. The drawing object is an object representing drawing, such as an illustration, a table, a graph, a diagram, vector graphics, or a pattern. Of the three non-character objects of the present embodiment, two non-character objects Ob1 and Ob2 are gray (achromatic) objects, and one non-character object Ob3 is a color (chromatic) object. . Of the four character objects Ob4 to Ob7 in this embodiment, three character objects Ob4 to Ob6 (characters E, F, and G) are the same color characters, and one character object Ob7. It is assumed that (letter H) is a character of a different color from the other three character objects Ob4 to Ob6.

ここで、グレーオブジェクトは、観察者が通常の観察距離で観察した場合に、グレーに見えるオブジェクトである。例えば、原稿が、CMYの3種類の印刷材を用いて印刷された原稿である場合を例に説明する。当該原稿を読み取って得られるスキャン画像において、通常の観察距離で観察した場合に無彩色に見えるオブジェクトを表す個々の画素は、有彩色を有しているが、当該無彩色に見えるオブジェクトは、本実施例におけるグレーオブジェクトに、含まれる。カラーオブジェクトは、観察者が通常の観察距離で観察した場合に、有彩色に見えるオブジェクトである。   Here, the gray object is an object that looks gray when the observer observes at a normal observation distance. For example, a case where the document is a document printed using three types of printing materials of CMY will be described as an example. In the scanned image obtained by scanning the original, each pixel representing an object that appears achromatic when viewed at a normal observation distance has a chromatic color, but the object that appears achromatic is It is included in the gray object in the embodiment. The color object is an object that looks chromatic when the observer observes at a normal observation distance.

ここで、対象画像SIのうち、文字オブジェクトを表す部分画像を文字画像とも呼び、写真オブジェクトを表す部分画像を写真画像とも呼び、描画オブジェクトを表す部分画像を描画画像とも呼ぶ。写真画像と描画画像とを総称して、非文字画像ともよぶ。また、グレーオブジェクトを表す部分画像をグレー画像とも呼び、カラーオブジェクトを表す部分画像をカラー画像とも呼ぶ。   Here, in the target image SI, a partial image representing a character object is also called a character image, a partial image representing a photographic object is also called a photographic image, and a partial image representing a drawing object is also called a drawing image. Photo images and drawn images are collectively referred to as non-character images. A partial image representing a gray object is also called a gray image, and a partial image representing a color object is also called a color image.

図2のステップS150では、特定部120(図1)は、対象画像SI(スキャンデータ)を用いて、エッジ画像データを生成して、バッファ領域241に格納する。図3(B)は、エッジ画像データによって表されるエッジ画像EIの概略図である。   In step S150 of FIG. 2, the specifying unit 120 (FIG. 1) generates edge image data using the target image SI (scan data) and stores it in the buffer area 241. FIG. 3B is a schematic diagram of the edge image EI represented by the edge image data.

エッジ画像EIは、対象画像SI内の各画素位置におけるエッジ強度を表している。エッジ強度は、画像内の位置の変化に対する階調値の変化の大きさ(例えば、微分)、すなわち、互いに隣り合う複数個の画素間の階調値の差分の大きさを表している。図4は、本実施例におけるエッジ強度の算出式を示している。本実施例では、特定部120は、いわゆるソーベルオペレータ(Sobel operator)を用いて、RGBの3個の色成分毎に、エッジ強度Seを算出する。   The edge image EI represents the edge intensity at each pixel position in the target image SI. The edge strength represents the magnitude (for example, differentiation) of the gradation value with respect to the change in position in the image, that is, the magnitude of the difference in gradation value between a plurality of adjacent pixels. FIG. 4 shows a formula for calculating the edge strength in this embodiment. In the present embodiment, the specifying unit 120 calculates the edge strength Se for each of the three color components of RGB using a so-called Sobel operator.

図4の階調値P(x,y)は、対象画像SI内の特定の画素位置(x,y)の階調値を表している。位置xは、第一方向D1の画素位置を示し、位置yは、第二方向D2の画素位置を示している。図示するように、対象画像SI内の画素位置(x,y)におけるエッジ強度Se(x,y)は、その画素位置(x,y)を中心とし隣り合う3行3列の9つの画素を用いて算出される。図4の算出式の第1項および第2項は、9つの位置の画素の階調値に、対応する係数をそれぞれ乗じた値の和の絶対値である。第1項は、第一方向D1の階調値の微分(すなわち、横方向の微分)であり、第2項は、第二方向D2の階調値の微分(すなわち、縦方向の微分)である。   The gradation value P (x, y) in FIG. 4 represents the gradation value at a specific pixel position (x, y) in the target image SI. The position x indicates the pixel position in the first direction D1, and the position y indicates the pixel position in the second direction D2. As shown in the figure, the edge intensity Se (x, y) at the pixel position (x, y) in the target image SI is obtained by calculating nine pixels in three rows and three columns adjacent to each other at the pixel position (x, y). Is used to calculate. The first and second terms of the calculation formula of FIG. 4 are absolute values of the sum of values obtained by multiplying the gradation values of the pixels at nine positions by the corresponding coefficients, respectively. The first term is the differentiation of the gradation value in the first direction D1 (that is, the differentiation in the horizontal direction), and the second term is the differentiation of the gradation value in the second direction D2 (that is, the differentiation in the vertical direction). is there.

図3(B)のエッジ画像EIは、各画素位置における、R成分のエッジ強度とG成分のエッジ強度とB成分のエッジ強度とを平均して得られるエッジ強度(以下、参考エッジ強度と呼ぶ)を表している。図3(B)の一点破線Eg1〜Eg7は、参考エッジ強度が比較的大きい画素(エッジ画素とも呼ぶ)の位置を表している。図3(B)のエッジ画像EIは、対象画像SIのオブジェクトOb1〜Ob7にそれぞれ対応するエッジ画素Eg1〜Eg7を含んでいることが解る。   The edge image EI in FIG. 3B is obtained by averaging the edge strength of the R component, the edge strength of the G component, and the edge strength of the B component at each pixel position (hereinafter referred to as reference edge strength). ). Dotted lines Eg1 to Eg7 in FIG. 3B represent the positions of pixels (also referred to as edge pixels) having a relatively high reference edge strength. It can be seen that the edge image EI in FIG. 3B includes edge pixels Eg1 to Eg7 corresponding to the objects Ob1 to Ob7 of the target image SI, respectively.

エッジ画像データを生成した後、続くステップS200では、特定部120は、複数個の画素を含むブロックBLをエッジ画像EI上に設定する。図3(B)の破線は、エッジ画像EI上にマトリクス状に配置されたブロックBLを示している。1個のブロックBLは、例えば、BLn行×BLn列(BLnは、2以上の整数)の画素PXで構成されたブロックである。BLnの値には、例えば、10〜50の範囲内の値を採用可能である。エッジ画像EIと対象画像SIとは、互いに同じサイズ(縦横の画素数が等しい)であるので、ブロックBLは、対象画像SI上に設定されていると言うこともできる。   After generating the edge image data, in the subsequent step S200, the specifying unit 120 sets a block BL including a plurality of pixels on the edge image EI. The broken lines in FIG. 3B indicate the blocks BL arranged in a matrix on the edge image EI. One block BL is, for example, a block composed of pixels PX of BLn rows × BLn columns (BLn is an integer of 2 or more). As the value of BLn, for example, a value within the range of 10 to 50 can be adopted. Since the edge image EI and the target image SI have the same size (the same number of vertical and horizontal pixels), it can be said that the block BL is set on the target image SI.

ブロックBLが設定されると、続くステップS250では、特定部120は、ブロックBL単位で、ベタ領域と非ベタ領域とを特定する。ベタ領域は、領域が有するエッジ強度が所定の基準未満の領域であり、非ベタ領域とは、領域が有するエッジ強度が所定の基準以上の領域である。具体的には、特定部120は、ブロックBL毎に、平均エッジ強度(ERave、EGave、EBave)を算出する。平均エッジ強度(ERave、EGave、EBave)は、RGBの3個の色成分毎に、算出される。特定部120は、処理対象のブロックBLの平均エッジ強度と所定の基準とを比較して、処理対象のブロックBLを、ベタブロックおよび非ベタブロックのいずれかに分類する。ベタブロックは、平均エッジ強度が所定の基準より小さいブロックBLである。非ベタブロックは、平均エッジ強度が所定の基準以上であるブロックBLである。本実施例では、特定部120は、平均エッジ強度(ERave、EGave、EBave)を、色成分ごとに定められた基準値(ETr、ETg、ETb)と比較する。この結果、特定部120は、ERave<ETr、かつ、EGave<ETg、かつ、EBave<ETbが成立する場合には、処理対象のブロックBLをベタブロックに分類する。ERave≧ETr、および、EGave≧ETg、および、EBave≧ETbのうちの少なくとも一つが成立する場合には、特定部120は、処理対象のブロックBLを非ベタブロックに分類する。   When the block BL is set, in the subsequent step S250, the specifying unit 120 specifies a solid area and a non-solid area in units of the block BL. A solid region is a region where the edge strength of the region is less than a predetermined reference, and a non-solid region is a region where the edge strength of the region is greater than or equal to a predetermined reference. Specifically, the specifying unit 120 calculates an average edge strength (ERave, EGave, EBave) for each block BL. The average edge strength (ERave, EGave, EBave) is calculated for each of the three RGB color components. The identifying unit 120 compares the average edge strength of the processing target block BL with a predetermined reference, and classifies the processing target block BL as either a solid block or a non-solid block. A solid block is a block BL whose average edge strength is smaller than a predetermined reference. A non-solid block is a block BL whose average edge strength is greater than or equal to a predetermined reference. In the present embodiment, the specifying unit 120 compares the average edge strength (ERave, EGave, EBave) with reference values (ETr, ETg, ETb) determined for each color component. As a result, when ERave <ETr, EGave <ETg, and EBave <ETb are satisfied, the specifying unit 120 classifies the processing target block BL as a solid block. When at least one of ERave ≧ ETr, EGave ≧ ETg, and EBave ≧ ETb is satisfied, the specifying unit 120 classifies the processing target block BL as a non-solid block.

図3(B)のエッジ画像EIにおいて、非ベタブロックには、ハッチングが付され、ベタブロックには、ハッチングが付されていない。全てのブロックBLを、ベタブロックと非ベタブロックとに分類された後、特定部120は、互いに隣り合う(連続する)1個以上の非ベタブロックに対応する領域を、1個の非ベタ領域として特定する。また、特定部120は、互いに隣り合う1個以上のベタブロックに対応する領域を、1個のベタ領域として特定する。このように、連続する1個以上の非ベタブロックは、1個の非ベタ領域に組み込まれるので、非ベタ領域は、通常は、ベタ領域に囲まれている。図3(B)の例では、対象画像SI(図3(A))の3個の非文字オブジェクトOb1〜Ob3にそれぞれ対応する3個の非ベタ領域L11〜L13が特定されている。また、対象画像SIの2個の文字オブジェクトOb4、Ob5に対応する1個の非ベタ領域L14と、2個の文字オブジェクトOb6、Ob7に対応する1個の非ベタ領域L15と、が特定されている。さらに、対象画像SIの背景Bgに対応する1個のベタ領域L10が特定されている。エッジ画像EIにおいて、ベタ領域と非ベタ領域が特定されることは、対象画像SIにおいて、同様にベタ領域と非ベタ領域が特定されること、と同義である。   In the edge image EI of FIG. 3B, the non-solid block is hatched and the solid block is not hatched. After all the blocks BL are classified into a solid block and a non-solid block, the specifying unit 120 defines an area corresponding to one or more non-solid blocks adjacent to each other (continuous) as one non-solid area. As specified. Further, the specifying unit 120 specifies a region corresponding to one or more solid blocks adjacent to each other as one solid region. Thus, since one or more continuous non-solid blocks are incorporated into one non-solid area, the non-solid area is usually surrounded by a solid area. In the example of FIG. 3B, three non-solid regions L11 to L13 corresponding to the three non-character objects Ob1 to Ob3 of the target image SI (FIG. 3A) are specified. Further, one non-solid region L14 corresponding to the two character objects Ob4 and Ob5 of the target image SI and one non-solid region L15 corresponding to the two character objects Ob6 and Ob7 are specified. Yes. Furthermore, one solid area L10 corresponding to the background Bg of the target image SI is specified. Specifying a solid region and a non-solid region in the edge image EI has the same meaning as specifying a solid region and a non-solid region in the target image SI.

続く、ステップS300では、特定部120は、対象画像SI内の各非ベタ領域を二値化するための基準値(以下、二値化基準値とも呼ぶ)を、対象画像SI内の非ベタ領域の周囲を囲むベタ領域内の画素値(言い換えると、色値)を用いて、非ベタ領域L11〜L15毎に決定する。本実施例では、二値化基準値は、RGBの成分毎に決定される。具体的には、非ベタ領域の周囲を囲むベタ領域の全ての画素についての、RGBの各成分値の平均値(Rr、Gr、Br)が、二値化基準値として採用される。図3(B)の例では、全ての非ベタ領域L11〜L15は、背景Bgに対応する1個のベタ領域L10に囲まれているので、全ての非ベタ領域L11〜L15の二値化基準値は、同じ値、すなわち、ベタ領域L10内の各成分値の平均値となる。   In step S300, the specifying unit 120 uses a reference value for binarizing each non-solid region in the target image SI (hereinafter also referred to as a binarization reference value) as a non-solid region in the target image SI. Is determined for each of the non-solid regions L11 to L15 using pixel values (in other words, color values) in the solid region surrounding the periphery of the region. In this embodiment, the binarization reference value is determined for each RGB component. Specifically, the average value (Rr, Gr, Br) of the RGB component values for all the pixels in the solid area surrounding the non-solid area is adopted as the binarization reference value. In the example of FIG. 3B, since all the non-solid regions L11 to L15 are surrounded by one solid region L10 corresponding to the background Bg, the binarization criterion for all the non-solid regions L11 to L15. The value is the same value, that is, the average value of the component values in the solid region L10.

二値化基準値(Rr、Gr、Br)が決定されると、次のステップS350では、特定部120は、非ベタ領域L11〜L15毎に、二値画像データを生成して、バッファ領域241に格納する。本実施例では、特定部120は、二値化基準値(Rr、Gr、Br)を用いて算出される6個の閾値R1、R2、G1、G2、B1、B2を用いて二値化処理を実行する。
R成分の下限閾値R1=Rr−dV、R成分の上限閾値R2=Rr+dV
G成分の下限閾値G1=Gr−dV、G成分の上限閾値G2=Gr+dV
B成分の下限閾値B1=Br−dV、B成分の上限閾値B2=Br+dV
ここで、値dVは、予め決められた値である。これらの値R1、R2、G1、G2、B1、B2は、二値化基準値(Rr、Gr、Br)、すなわち、二値化対象のベタ領域を囲むベタ領域の平均色に比較的近い色の範囲、すなわち、背景の色に比較的近い色の範囲を、定めている。
When the binarization reference values (Rr, Gr, Br) are determined, in the next step S350, the specifying unit 120 generates binary image data for each of the non-solid regions L11 to L15, and the buffer region 241. To store. In the present embodiment, the specifying unit 120 performs binarization processing using six threshold values R1, R2, G1, G2, B1, and B2 calculated using the binarization reference values (Rr, Gr, and Br). Execute.
R component lower limit threshold R1 = Rr−dV, R component upper limit threshold R2 = Rr + dV
G component lower limit threshold G1 = Gr−dV, G component upper limit threshold G2 = Gr + dV
B component lower limit threshold B1 = Br−dV, B component upper limit threshold B2 = Br + dV
Here, the value dV is a predetermined value. These values R1, R2, G1, G2, B1, and B2 are binarization reference values (Rr, Gr, Br), that is, colors that are relatively close to the average color of the solid area surrounding the binarization target solid area. That is, a color range relatively close to the background color.

特定部120は、これらの6個の閾値R1、R2、G1、G2、B1、B2を用いて、対象画像SIにおける非ベタ領域内の各画素を、1画素毎に、オブジェクト画素と、非オブジェクト画素とに分類することによって、非ベタ領域の二値画像データを生成する。例えば、生成された二値画像データにおいて、画素値「1」は、オブジェクト画素を示し、画素値「0」は、非オブジェクト画素を示す。   The specifying unit 120 uses these six threshold values R1, R2, G1, G2, B1, and B2 to set each pixel in the non-solid region in the target image SI to an object pixel and a non-object for each pixel. By classifying it into pixels, binary image data of a non-solid region is generated. For example, in the generated binary image data, the pixel value “1” indicates an object pixel, and the pixel value “0” indicates a non-object pixel.

具体的には、非ベタ領域内の画素Pxiの3個の色成分(RGB)の階調値(Ri、Gi、Bi)が、以下の3つの条件を全て満たす場合に、特定部120は、画素Pxiを、非オブジェクト画素に分類し、以下の3つの条件のいずれかを満たさない場合に、画素Pxiをオブジェクト画素に分類する。
(第1条件)R1<Ri<R2
(第2条件)G1<Gi<G2
(第3条件)B1<Bi<B2
Specifically, when the gradation values (Ri, Gi, Bi) of the three color components (RGB) of the pixel Pxi in the non-solid region satisfy all the following three conditions, the specifying unit 120: The pixel Pxi is classified as a non-object pixel, and when any of the following three conditions is not satisfied, the pixel Pxi is classified as an object pixel.
(First condition) R1 <Ri <R2
(Second condition) G1 <Gi <G2
(Third condition) B1 <Bi <B2

このように、ベタ領域内の画素の色を用いて算出された背景の色に比較的近い画素を、非オブジェクト画素に分類し、その他の画素をオブジェクト画素に分類することによって、オブジェクトを構成するオブジェクト画素を精度良く特定した二値画像データを生成することができる。   In this way, an object is configured by classifying pixels that are relatively close to the background color calculated using the color of the pixels in the solid area as non-object pixels and classifying other pixels as object pixels. It is possible to generate binary image data that accurately identifies object pixels.

図3(C)には、生成された二値画像データによって表される二値画像BIが示されている。実際には、上述した非ベタ領域L11〜L15毎に、別々の二値画像データが生成されるが、図3(C)では、1個の二値画像BIで示している。   FIG. 3C shows a binary image BI represented by the generated binary image data. Actually, separate binary image data is generated for each of the non-solid regions L11 to L15 described above, but in FIG. 3C, it is represented by one binary image BI.

二値画像データを生成された後、続くステップS400では、特定部120は、は、二値画像データを利用して、オブジェクト領域と非オブジェクト領域とを特定して、特定された領域に識別子を付すラベリングを実行する。ラベリングの結果、例えば、各領域と、識別子とを、対応付けたラベルデータが生成されて、バッファ領域241に格納される。   After the binary image data is generated, in the subsequent step S400, the specifying unit 120 uses the binary image data to specify the object region and the non-object region, and assigns an identifier to the specified region. Execute the attached labeling. As a result of labeling, for example, label data in which each area is associated with an identifier is generated and stored in the buffer area 241.

具体的には、特定部120は、連続する1個以上のオブジェクト画素(すなわち、二値化後の階調値が「1」である画素)で構成される1個の領域を、1個のオブジェクト領域として特定する。また、特定部120は、連続する1個以上の非オブジェクト画素(すなわち、二値化後の階調値が「ゼロ」である画素)で構成される1個の領域を、1個の非オブジェクト領域として特定する。   Specifically, the specifying unit 120 converts one region including one or more continuous object pixels (that is, a pixel whose gradation value after binarization is “1”) to one Identifies as an object area. In addition, the specifying unit 120 converts one area formed of one or more continuous non-object pixels (that is, a pixel whose gradation value after binarization is “zero”) into one non-object. Specify as an area.

図3(C)の例では、対象画像SIの6個のオブジェクトOb1〜Ob7(図3(A))にそれぞれ対応する7つのオブジェクト領域L21〜L27と、対象画像SIの背景Bgに対応する1個の非オブジェクト領域L20と、が特定される。特定部120は、特定した領域に、領域を識別する識別子を割り当てる。二値画像BIを構成する各画素は、対象画像SIを構成する各画素と対応しているので、二値画像BIにおいて、領域L20〜L27が特定されることは、図3(D)に示すように、対象画像SIにおいて、同様に、領域L30〜L37が特定されること、と同義である。以下では、基本的に各領域(すなわち、オブジェクト領域および非オブジェクト領域)を表す符号には、図3(D)に示す符号L30〜L37を用いる。また、単にオブジェクト領域に対応する画像と呼ぶときには、対象画像SIの対応する部分画像のことを指し、オブジェクト領域内の画素の画素値とは、対象画像SIの対応する画素の画素値、すなわち、対象画像データに対応する画素値(例えば、RGB値)のことを指すものとする。   In the example of FIG. 3C, seven object regions L21 to L27 respectively corresponding to the six objects Ob1 to Ob7 (FIG. 3A) of the target image SI and 1 corresponding to the background Bg of the target image SI. Pieces of non-object regions L20 are identified. The identification unit 120 assigns an identifier for identifying the area to the identified area. Since each pixel constituting the binary image BI corresponds to each pixel constituting the target image SI, it is shown in FIG. 3D that the regions L20 to L27 are specified in the binary image BI. As described above, in the target image SI, similarly, the regions L30 to L37 are specified. In the following description, the symbols L30 to L37 shown in FIG. 3D are basically used as symbols representing the respective regions (that is, the object region and the non-object region). Further, when simply calling an image corresponding to an object region, it refers to a corresponding partial image of the target image SI, and a pixel value of a pixel in the object region is a pixel value of a corresponding pixel of the target image SI, that is, The pixel value (for example, RGB value) corresponding to the target image data is indicated.

ラベリングに続いて、ステップS450では、特定部120は、ラベリングされた複数個のオブジェクト領域のうち、統合条件を満たす複数個のオブジェクト領域を統合する統合処理を実行する。この統合処理は、互いに異なるオブジェクト領域として分離されている複数個の文字の領域を1個のオブジェクト領域として特定する統合するための処理である。   Subsequent to the labeling, in step S450, the specifying unit 120 executes an integration process for integrating a plurality of object areas satisfying the integration condition among the plurality of labeled object areas. This integration processing is processing for specifying a plurality of character areas separated as different object areas as one object area.

図5は、統合処理のフローチャートである。ステップS4500では、特定部120は、特定部120によって特定された複数個の領域(例えば、図3(D)の領域L30〜L37)の中から、背景領域を選択する。背景領域は、対象画像SI(図3(A))の縁部分に対応するベタ領域である。図3(D)の例では、非オブジェクト領域L30が、背景領域として選択される。この背景領域L30は、統合の対象から外される。   FIG. 5 is a flowchart of the integration process. In step S4500, the specifying unit 120 selects a background region from a plurality of regions specified by the specifying unit 120 (for example, the regions L30 to L37 in FIG. 3D). The background region is a solid region corresponding to the edge portion of the target image SI (FIG. 3A). In the example of FIG. 3D, the non-object region L30 is selected as the background region. This background region L30 is excluded from integration targets.

背景領域が選択された後、ステップS4505では、特定部120(図1)は、1個の未処理の領域を、処理対象領域Nとして選択する。次いで、ステップS4510では、特定部120は、処理対象領域Nの画素数が、所定の画素数基準以下であるか否かを判断する。画素数基準は、予め決められている。例えば、画素数基準としては、処理対象領域Nが他の領域と統合すべき文字を表す場合に、処理対象領域Nの画素数が取り得る最大値を若干上回る値を、採用可能である。画素数基準は、処理対象領域Nが1個の文字を表す場合の画素数が取り得る最大値を若干上回る値に、予め設定されている。処理対象領域Nの画素数が画素数基準を超える場合には(ステップS4510:NO)、特定部120は、ステップS4505に戻る、この結果、選択された処理対象領域Nは、統合の対象から外れる。この場合には、現行の処理対象領域Nは、典型的な文字よりも大きいので、文字以外のオブジェクトを表している可能性が高い。この画素数基準を適切に設定されることによって、図3(C)の例では、非文字オブジェクトを表す3個のオブジェクト領域L31〜L33は、統合の対象から外れ、文字オブジェクトを表す4個のオブジェクト領域L34〜L37は、統合の対象とされる。なお、本実施例では、処理対象領域Nの画素数は、対象画像SIにおける、処理対象領域Nに外接する最小矩形に含まれる画素数である。   After the background area is selected, the specifying unit 120 (FIG. 1) selects one unprocessed area as the process target area N in step S <b> 4505. Next, in step S4510, the specifying unit 120 determines whether or not the number of pixels in the processing target area N is equal to or less than a predetermined pixel number reference. The pixel number standard is determined in advance. For example, when the processing target area N represents a character to be integrated with another area, a value slightly larger than the maximum value that the number of pixels of the processing target area N can take can be adopted as the pixel number standard. The pixel number reference is set in advance to a value slightly larger than the maximum value that the number of pixels when the processing target area N represents one character. When the number of pixels in the processing target area N exceeds the pixel number reference (step S4510: NO), the specifying unit 120 returns to step S4505. As a result, the selected processing target area N is excluded from integration targets. . In this case, since the current processing target area N is larger than a typical character, there is a high possibility that it represents an object other than a character. By appropriately setting the pixel number reference, in the example of FIG. 3C, the three object regions L31 to L33 representing the non-character object are excluded from the integration targets, and the four object regions representing the character object are displayed. The object areas L34 to L37 are targeted for integration. In the present embodiment, the number of pixels in the processing target area N is the number of pixels included in the minimum rectangle circumscribing the processing target area N in the target image SI.

図6は、2個の領域の統合を示す概略図である。図中には、文字「E」を表す処理対象領域Lnが示されている。図中の矩形LnRは、処理対象領域Lnに外接する最小矩形である。この矩形LnR内に含まれる画素数が、処理対象領域Lnの画素数である。ここで、「領域に外接する最小矩形」は、以下のような矩形である。すなわち、矩形は、第一方向D1と平行な2本の辺と、第二方向D2と平行な2本の辺と、で構成されている。そして、矩形の上辺が、領域の上端と接し、矩形の下辺が、領域の下端と接し、矩形の左辺が、領域の左端と接し、矩形の右辺が、領域の右端と接している。ここで、上辺および上端は、第二方向D2の反対方向側の辺および端であり、下辺および下端は、第二方向D2側の辺および端であり、左辺および左端は、第一方向D1の反対方向側の辺および端であり、右辺および右端は、第一方向D1側の辺および端である。なお、特定部120は、処理対象領域Nの画素のみをカウントすることによって、処理対象領域Nの画素数を算出してもよい。すなわち、特定部120は、外接矩形内の複数個の画素のうちの処理対象領域Nに含まれない画素をカウントせずに、画素数を算出してもよい。   FIG. 6 is a schematic diagram showing the integration of two regions. In the figure, a processing target area Ln representing the character “E” is shown. A rectangle LnR in the drawing is a minimum rectangle circumscribing the processing target region Ln. The number of pixels included in the rectangle LnR is the number of pixels in the processing target area Ln. Here, the “minimum rectangle circumscribing the region” is the following rectangle. That is, the rectangle is composed of two sides parallel to the first direction D1 and two sides parallel to the second direction D2. The upper side of the rectangle is in contact with the upper end of the region, the lower side of the rectangle is in contact with the lower end of the region, the left side of the rectangle is in contact with the left end of the region, and the right side of the rectangle is in contact with the right end of the region. Here, the upper side and the upper end are sides and ends on the opposite side of the second direction D2, the lower side and the lower end are sides and ends on the second direction D2, and the left side and the left end are in the first direction D1. The sides and ends on the opposite direction side, and the right side and the right end are sides and ends on the first direction D1 side. The specifying unit 120 may calculate the number of pixels in the processing target area N by counting only the pixels in the processing target area N. That is, the specifying unit 120 may calculate the number of pixels without counting pixels that are not included in the processing target area N among the plurality of pixels in the circumscribed rectangle.

図5のS4510で、処理対象領域Nの画素数が、所定の画素数基準以下である場合(ステップS4510:YES)、ステップS4515では、特定部120は、統合の候補領域Mのリストを初期化する。特定部120は、ステップS4505で処理対象領域Nとして選択されたことがない領域のリストを、生成する。例えば、図3(D)の例では、初めて実行されるステップS4505で領域L31が処理対象領域Nとして選択された場合には、残りの6個の領域L32〜L37が、リストに挙げられる。次回のステップS4505で領域L32が処理対象領域Nとして選択された場合には、残りの5個の領域L33〜L37が、リストに挙げられる。なお、他の領域に統合済の領域は、リストから除かれる。   In S4510 of FIG. 5, when the number of pixels in the processing target area N is equal to or smaller than a predetermined pixel number reference (Step S4510: YES), in Step S4515, the specifying unit 120 initializes a list of candidate areas M for integration. To do. The specifying unit 120 generates a list of areas that have not been selected as the processing target area N in step S4505. For example, in the example of FIG. 3D, when the region L31 is selected as the processing target region N in step S4505 executed for the first time, the remaining six regions L32 to L37 are listed. When the region L32 is selected as the processing target region N in the next step S4505, the remaining five regions L33 to L37 are listed. Note that areas that have been integrated with other areas are excluded from the list.

次いで、ステップS4520では、特定部120は、生成したリストの中から、1個の未選択の領域を、候補領域Mとして選択する。特定部120は、続く3つのステップS4525、S4530、S4535で、候補領域Mを処理対象領域Nに統合するか否かを判断する。各ステップS4525、S4530、S4535では、以下の条件が判断される。   Next, in step S4520, the specifying unit 120 selects one unselected area as a candidate area M from the generated list. The specifying unit 120 determines whether or not to integrate the candidate area M into the process target area N in the following three steps S4525, S4530, and S4535. In steps S4525, S4530, and S4535, the following conditions are determined.

(ステップS4525:第1条件F1)候補領域Mの画素数≦画素数基準
(ステップS4530:第2条件F2)第1距離Dis1≦距離基準、かつ、第2距離Dis2≦距離基準
(ステップS4535:第3条件F3)階調差TD≦階調差基準
(Step S4525: First Condition F1) Number of Pixels in Candidate Region M ≦ Pixel Number Reference (Step S4530: Second Condition F2) First Distance Dis1 ≦ Distance Reference and Second Distance Dis2 ≦ Distance Reference (Step S4535: First 3 condition F3) gradation difference TD ≦ gradation difference reference

候補領域Mが、これら全ての条件F1、F2、F3を満たす場合(ステップS4525:YES、かつ、S4530:YES、かつ、S4535:YES)に、図5のステップS4540で、特定部120は、候補領域Mを処理対象領域Nに統合する。   When the candidate area M satisfies all these conditions F1, F2, and F3 (step S4525: YES, S4530: YES, and S4535: YES), the specifying unit 120 selects candidates in step S4540 of FIG. The region M is integrated into the processing target region N.

ステップS4525の第1条件F1は、ステップS4510の条件と同様の条件である。候補領域Mが第1条件F1を満たさない場合には(ステップS4525:NO)、候補領域Mは、文字とは異なる種類のオブジェクトを表している可能性が高い。この場合には、特定部120は、ステップS4540をスキップすることによって、候補領域Mを処理対象領域Nに統合しない。   The first condition F1 in step S4525 is the same as the condition in step S4510. When the candidate area M does not satisfy the first condition F1 (step S4525: NO), it is highly likely that the candidate area M represents an object of a type different from characters. In this case, the specifying unit 120 does not integrate the candidate area M into the process target area N by skipping step S4540.

ステップS4530の第2条件F2は、候補領域Mが処理対象領域Nに比較的近い場合に満たされる条件である。図6は、第2条件F2の第1距離Dis1と第2距離Dis2との概略を示している。図中には、処理対象領域Lnと候補領域Lmとが示されている。対象矩形LnRは、処理対象領域Lnに外接する最小矩形であり、候補矩形LmRは、候補領域Lmに外接する最小矩形である。   The second condition F2 in step S4530 is a condition that is satisfied when the candidate area M is relatively close to the process target area N. FIG. 6 shows an outline of the first distance Dis1 and the second distance Dis2 under the second condition F2. In the figure, a processing target area Ln and a candidate area Lm are shown. The target rectangle LnR is the smallest rectangle circumscribing the processing target region Ln, and the candidate rectangle LmR is the smallest rectangle circumscribing the candidate region Lm.

第1距離Dis1は、図6(A)に示すように、対象矩形LnRと候補矩形LmRとの間の、第一方向D1に沿った最短距離であり、例えば、画素数で表される。図6(B)に示すように、対象矩形LnRの第一方向D1の位置の範囲(左端PnL〜右端PnR)が、候補矩形LmRの第一方向D1の位置の範囲(左端PmL〜右端PmR)の少なくとも一部と重なる場合には、第1距離Dis1は、ゼロである。   As shown in FIG. 6A, the first distance Dis1 is the shortest distance along the first direction D1 between the target rectangle LnR and the candidate rectangle LmR, and is represented by, for example, the number of pixels. As shown in FIG. 6B, the range of the position of the target rectangle LnR in the first direction D1 (left end PnL to right end PnR) is the range of the position of the candidate rectangle LmR in the first direction D1 (left end PmL to right end PmR). The first distance Dis1 is zero when it overlaps at least a part of.

第2距離Dis2は、図6(B)に示すように、対象矩形LnRと候補矩形LmRとの間の、第二方向D2に沿った最短距離であり、例えば、画素数で表される。図6(A)に示すように、対象矩形LnRの第二方向D2の位置の範囲(すなわち、上端PnT〜下端PnBの範囲)が、候補矩形LmRの第二方向D2の位置の範囲(すなわち、上端PmT〜下端PmBの範囲)の少なくとも一部と重なる場合には、第2距離Dis2は、ゼロである。   As shown in FIG. 6B, the second distance Dis2 is the shortest distance along the second direction D2 between the target rectangle LnR and the candidate rectangle LmR, and is represented by, for example, the number of pixels. As shown in FIG. 6A, the range of the position of the target rectangle LnR in the second direction D2 (that is, the range of the upper end PnT to the lower end PnB) is the range of the position of the candidate rectangle LmR in the second direction D2 (that is, The second distance Dis2 is zero when it overlaps at least part of the upper end PmT to the lower end PmB.

第2条件F2の距離基準は、予め決められている。例えば、距離基準としては、統合すべき2個の文字の間の距離がとり得る最大値を若干上回る値を、採用可能である。候補領域Mが第2条件F2を満たす場合には、候補領域Mと処理対象領域Nとが、同じ文字列に含まれる文字を表している可能性が高い。候補領域Mが第2条件F2を満たさない場合には(ステップS4530:NO)、候補領域Mは、処理対象領域Nとは関連しないオブジェクトを表している可能性が高い。この場合には、特定部120は、ステップS4540をスキップすることによって、候補領域Mを処理対象領域Nに統合しない。   The distance reference of the second condition F2 is determined in advance. For example, as the distance reference, a value slightly exceeding the maximum value that the distance between two characters to be integrated can take can be adopted. When the candidate area M satisfies the second condition F2, it is highly likely that the candidate area M and the processing target area N represent characters included in the same character string. When the candidate area M does not satisfy the second condition F2 (step S4530: NO), it is highly likely that the candidate area M represents an object that is not related to the processing target area N. In this case, the specifying unit 120 does not integrate the candidate area M into the process target area N by skipping step S4540.

ステップS4535の第3条件F3は、第3条件F3は、候補領域Mの色が処理対象領域Nと比較的近い場合に満たされる。図7は、第3条件F3の階調差TDの算出式を示している。本実施例では、階調差TDは、RGB色空間における、処理対象領域Nの平均色(すなわち、Rav_n、Gav_n、Bav_n)と、候補領域Mの平均色(すなわち、Rav_m、Gav_m、Bav_m)との間のユークリッド距離の二乗である。第3条件F3の階調差基準は、予め決められている。例えば、階調差基準としては、実質的に同じ色であると、通常の観察者に認識される2つの色の色差の上限値が採用可能である。例えば、2つの色が、2個の文字の色としてそれぞれ用いられた場合に、当該2個の文字を見た通常の観察者が、当該2個の文字の色は互いに同じであると認識する場合に、当該2つの色は、実質的に同じ色であると、判断できる。ここで、第3条件F3を条件としているのは、後述するように、文字画像を圧縮する際に、実質的に異なる色で表現された複数個の文字は、別々に処理する必要があるからである。候補領域Mが第3条件F3を満たさない場合には(ステップS4530:NO)、特定部120は、ステップS4540をスキップすることによって、候補領域Mを処理対象領域Nに統合しない。   The third condition F3 in step S4535 is satisfied when the color of the candidate area M is relatively close to the process target area N. FIG. 7 shows a formula for calculating the gradation difference TD under the third condition F3. In the present embodiment, the gradation difference TD is calculated by comparing the average color of the processing target area N (ie, Rav_n, Gav_n, Bav_n) and the average color of the candidate area M (ie, Rav_m, Gav_m, Bav_m) in the RGB color space. Is the square of the Euclidean distance between. The gradation difference reference for the third condition F3 is determined in advance. For example, as the gradation difference reference, the upper limit value of the color difference between two colors recognized by a normal observer can be adopted as substantially the same color. For example, when two colors are used as the colors of two characters, a normal observer who sees the two characters recognizes that the colors of the two characters are the same. In this case, it can be determined that the two colors are substantially the same color. Here, the condition of the third condition F3 is that, as will be described later, when a character image is compressed, a plurality of characters expressed in substantially different colors must be processed separately. It is. When the candidate area M does not satisfy the third condition F3 (step S4530: NO), the specifying unit 120 does not integrate the candidate area M into the process target area N by skipping step S4540.

図5のステップS4540で、候補領域Mを処理対象領域Nに統合した後、または、ステップS4525、ステップS4530、ステップS4535のいずれかのステップでNOと判断した後、ステップS4545では、特定部120は、リストの全ての候補領域Mの処理が終了したか否かを判断する。未処理の候補領域Mが残っている場合には(ステップS4545:NO)、特定部120は、ステップS4520に戻り、未処理の候補領域Mに対して、ステップS4520〜S4540の処理を実行する。リストの全ての候補領域Mの処理が終了した場合には(ステップS4545:YES)、特定部120は、ステップS4550に処理を移行する。   After integrating the candidate area M into the process target area N in step S4540 in FIG. 5 or after determining NO in any one of steps S4525, S4530, and S4535, in step S4545, the specifying unit 120 Then, it is determined whether or not the processing of all candidate areas M in the list has been completed. When the unprocessed candidate area M remains (step S4545: NO), the specifying unit 120 returns to step S4520 and executes the processes of steps S4520 to S4540 on the unprocessed candidate area M. When the process for all candidate areas M in the list is completed (step S4545: YES), the specifying unit 120 shifts the process to step S4550.

ステップS4550では、特定部120は、最後にステップS4515が実行された後に、処理対象領域Nが拡張されたか否か、すなわち、処理対象領域Nに統合された候補領域Mの総数が1以上であるか否か、を判断する。処理対象領域Nが拡張された場合には(ステップS4550:YES)、特定部120は、拡張済の処理対象領域Nを利用して、再び、ステップS4515〜S4545の処理を実行する。従って、特定部120は、3個以上の領域を統合し得る。   In step S4550, the specifying unit 120 determines whether or not the processing target area N has been expanded after step S4515 is executed last, that is, the total number of candidate areas M integrated into the processing target area N is one or more. Or not. When the processing target area N is expanded (step S4550: YES), the specifying unit 120 executes the processes of steps S4515 to S4545 again using the expanded processing target area N. Therefore, the specifying unit 120 can integrate three or more regions.

図8は、4個の領域L34〜L37の統合を示す概略図である。ここでは、統合処理が、図8(A)〜図8(C)の順に、進行する。   FIG. 8 is a schematic diagram showing the integration of the four regions L34 to L37. Here, the integration process proceeds in the order of FIG. 8 (A) to FIG. 8 (C).

図8(A)では、「E」の文字を表す領域L34が、処理対象領域Nである(図5:S4505)。領域L34の隣に配置された「F」の文字を表す領域L35は、上記条件F1〜F3を満たすので、特定部120(図1)は、領域L35を領域L34に統合する(ステップS4540)。また、「G」の文字を表す領域L36と「H」の文字を表す領域L37とは、領域L34からの距離が遠いので、第2条件F2を満たさない。したがって、2つの領域L36、L37は、領域L34に統合されない。   In FIG. 8A, the region L34 representing the character “E” is the processing target region N (FIG. 5: S4505). Since the region L35 representing the letter “F” arranged next to the region L34 satisfies the above conditions F1 to F3, the specifying unit 120 (FIG. 1) integrates the region L35 into the region L34 (step S4540). Further, the region L36 representing the character “G” and the region L37 representing the character “H” do not satisfy the second condition F2 because the distance from the region L34 is long. Therefore, the two regions L36 and L37 are not integrated into the region L34.

上述したように、領域L35が領域L34に統合された場合、図5のステップS4550では、特定部120は、処理対象領域N(例えば、領域L34)が拡張された、と判断する(S4550:YES)。続くステップS4515では、特定部120は、領域L35を含む拡張済の領域L34B(図8(B))のためのリストを生成する。生成されるリストは、領域L36と領域L37とを含んでいる。   As described above, when the region L35 is integrated into the region L34, in step S4550 of FIG. 5, the specifying unit 120 determines that the processing target region N (for example, the region L34) has been expanded (S4550: YES). ). In subsequent step S4515, the specifying unit 120 generates a list for the expanded region L34B (FIG. 8B) including the region L35. The generated list includes a region L36 and a region L37.

図8(B)では、拡張済の領域L34Bが、処理対象領域Nである。領域L34Bの隣に配置された領域L36は、上記条件F1〜F3を満たすので、特定部120は、領域L36を、領域L34Bに統合する(ステップS4540)。条件F1〜F3の判断には、拡張済の領域L34B(すなわち、「E」の文字と「F」の文字とを表す領域)に外接する最小矩形が利用される。領域L37は、領域L34Bからの距離が遠いので、領域L34Bに統合されない。   In FIG. 8B, the expanded region L34B is the processing target region N. Since the region L36 arranged next to the region L34B satisfies the above conditions F1 to F3, the specifying unit 120 integrates the region L36 into the region L34B (step S4540). For the determination of the conditions F1 to F3, a minimum rectangle circumscribing the expanded region L34B (that is, a region representing the characters “E” and “F”) is used. The region L37 is not integrated with the region L34B because the distance from the region L34B is long.

上述したように、領域L36が拡張済みの領域L34Bに統合された場合、図5のステップS4550では、特定部120(図1)は、処理対象領域N(この場合には、領域L34B)が拡張された、と判断する(S4550:YES)。続くステップS4515では、特定部120は、領域L36を含む拡張済の領域L34C(図8(C))のためのリストを生成する。生成されるリストは、領域L37を含んでいる。   As described above, when the region L36 is integrated into the expanded region L34B, the specifying unit 120 (FIG. 1) expands the processing target region N (in this case, the region L34B) in step S4550 of FIG. (S4550: YES). In subsequent step S4515, the specifying unit 120 generates a list for the expanded region L34C (FIG. 8C) including the region L36. The generated list includes an area L37.

図8(C)では、拡張済の領域L34Cが、処理対象領域である。領域L34Cの隣に配置された領域L37は、領域L34Cとの距離が比較的近いので、上記条件F1を満たすが、領域L34Cと実質的に色が異なるので、条件F3を満たさない。したがって、特定部120は、領域L37を、領域L34Cには、統合しない。したがって、統合処理後には、図3(D)および図8(A)の3個の文字オブジェクト領域L34〜L36が統合された1個の文字オブジェクト領域L34Cと、文字オブジェクト領域L37と、の2個の文字オブジェクト領域が特定されることになる(図3(D)、図8(C))。   In FIG. 8C, the expanded area L34C is the processing target area. The region L37 disposed next to the region L34C satisfies the condition F1 because the distance to the region L34C is relatively short, but does not satisfy the condition F3 because the color is substantially different from the region L34C. Therefore, the specifying unit 120 does not integrate the region L37 into the region L34C. Therefore, after the integration process, two character object areas L34C, which are an integration of the three character object areas L34 to L36 shown in FIGS. 3D and 8A, and a character object area L37. Is specified (FIG. 3D, FIG. 8C).

図5のステップS4550にて、処理対象領域Nの拡張がされていない場合には(ステップS4550:NO)、ステップS4555で、特定部120は、全ての領域の処理が完了したか否かを判断する。未処理の領域が残っている場合には(ステップS4555:NO)、特定部120は、ステップS4505に戻る。全ての領域の処理が完了した場合には(ステップS4555:YES)、特定部120は、ステップS4560で、領域の識別子を更新する。具体的には、特定部120は、図2のS400において生成されて、バッファ領域241に格納されたラベルデータを更新する。ラベルデータの更新が終了すると、特定部120は、統合処理を終了する。   If the processing target area N has not been expanded in step S4550 in FIG. 5 (step S4550: NO), in step S4555, the identifying unit 120 determines whether or not the processing for all the areas has been completed. To do. If an unprocessed area remains (step S4555: NO), the identifying unit 120 returns to step S4505. When the processing for all the areas is completed (step S4555: YES), the specifying unit 120 updates the area identifier in step S4560. Specifically, the specifying unit 120 updates the label data generated in S400 of FIG. 2 and stored in the buffer area 241. When the update of the label data ends, the specifying unit 120 ends the integration process.

統合処理の後、図2のステップS500では、判断部125(図1)は、統合処理後に複数個の領域毎に、画像の種類、すなわち、領域内のオブジェクトの種類が「文字」であるか否かを判断するオブジェクト属性判断処理を実行する。   After the integration process, in step S500 of FIG. 2, the determination unit 125 (FIG. 1) determines whether the type of image, that is, the type of object in the area is “character” for each of the plurality of areas after the integration process. Object attribute determination processing is performed to determine whether or not.

図9は、判断テーブル292の一例を示す図である。判断部125は、判断テーブル292を参照して、オブジェクト属性判断処理を実行する。判断部125は、色の分布幅Wと色数Cと画素密度Sとに応じて種類を識別する。判断部125は、特定されたオブジェクト領域ごとに、図10に示すようなヒストグラムを生成して、分布幅Wと色数Cと画素密度Sとを算出する。生成されたヒストグラムおよび分布幅Wと色数Cと画素密度Sは、バッファ領域241に格納され、例えば、オブジェクト判断処理後に消去される。   FIG. 9 is a diagram illustrating an example of the determination table 292. The determination unit 125 refers to the determination table 292 and executes object attribute determination processing. The determination unit 125 identifies the type according to the color distribution width W, the number of colors C, and the pixel density S. The determination unit 125 generates a histogram as shown in FIG. 10 for each identified object region, and calculates the distribution width W, the number of colors C, and the pixel density S. The generated histogram, distribution width W, number of colors C, and pixel density S are stored in the buffer area 241 and are deleted after the object determination processing, for example.

図10は、分布幅Wと色数Cとの説明図である。図中には、輝度のヒストグラムが示されている。この輝度ヒストグラムは、処理対象のオブジェクト領域(以下、対象領域と呼ぶ)内の画素値から算出される輝度のヒストグラムである。本実施例では、各画素の輝度は、各画素の階調値(赤Rと緑Gと青Bの3個の色成分の階調値)から、算出される。算出式としては、例えば、RGBの各階調値から、YCbCr色空間のY成分(輝度成分)を算出する算出式が、利用される。   FIG. 10 is an explanatory diagram of the distribution width W and the number C of colors. In the figure, a histogram of luminance is shown. This luminance histogram is a luminance histogram calculated from pixel values in a processing target object region (hereinafter referred to as a target region). In this embodiment, the luminance of each pixel is calculated from the gradation value of each pixel (gradation values of three color components of red R, green G, and blue B). As the calculation formula, for example, a calculation formula for calculating the Y component (luminance component) of the YCbCr color space from the RGB gradation values is used.

色数Cは、0〜255までの256個の輝度値のうち、頻度値(すなわち、画素数)が所定の閾値Th以上である輝度値の数である。図10のヒストグラムは、閾値Thを越える3個のピークP1、P2、P3を含んでいる。図10の例では、色数Cは、第1ピークP1の閾値Thを越える部分の幅C1と、第2ピークP2の閾値Thを越える部分の幅C2と、第3ピークP3の閾値Thを越える部分の幅C3と、の和に相当する。一般的に、文字は少ない色で表現されることが多いので、対象領域が文字オブジェクトを表す場合には、色数Cは比較的少なくなる。対象領域が非文字オブジェクトを表す場合には、色数Cは、比較的多くなる。例えば、写真オブジェクトは、撮影された被写体の種々の色を表すので、対象領域が写真オブジェクトを表す場合には、色数Cが比較的多くなる。   The color number C is the number of luminance values whose frequency value (that is, the number of pixels) is equal to or greater than a predetermined threshold Th among 256 luminance values from 0 to 255. The histogram of FIG. 10 includes three peaks P1, P2, and P3 that exceed the threshold Th. In the example of FIG. 10, the number of colors C exceeds the width C1 of the portion exceeding the threshold Th of the first peak P1, the width C2 of the portion exceeding the threshold Th of the second peak P2, and the threshold Th of the third peak P3. This corresponds to the sum of the width C3 of the portion. In general, since characters are often expressed with a small number of colors, the number of colors C is relatively small when the target area represents a character object. When the target area represents a non-character object, the number of colors C is relatively large. For example, since a photographic object represents various colors of a photographed subject, the number of colors C is relatively large when the target region represents a photographic object.

分布幅Wは、頻度値(すなわち、画素数)が所定の閾値Th以上である輝度値の最低値と最高値との間の差(幅)である。色数Cの説明と同じ理由により、対象領域が文字オブジェクトを表す場合には、分布幅Wが比較的小さくなり、対象領域が非文字オブジェクトを表す場合には、分布幅Wが比較的大きくなる。   The distribution width W is a difference (width) between the lowest value and the highest value of the luminance values whose frequency value (that is, the number of pixels) is equal to or greater than a predetermined threshold Th. For the same reason as the description of the number of colors C, the distribution width W is relatively small when the target area represents a character object, and the distribution width W is relatively large when the target area represents a non-character object. .

画素密度Sは、対象領域に外接する最小矩形内の総画素数に対するオブジェクト画素の画素数(単位面積当たりの画素数)である。一般的に、文字は、背景上に、背景とは異なる色の細線で、書かれている。対象領域が文字オブジェクトを表す場合には、画素密度Sが比較的小さくなる。対象領域が非文字オブジェクトを表す場合には、画素密度Sが比較的大きくなる。例えば、写真オブジェクトは、外接する最小矩形の大部分を占める可能性が高いので、対象領域が写真オブジェクトを表す場合には、画素密度Sが比較的大きくなる。   The pixel density S is the number of object pixels (the number of pixels per unit area) with respect to the total number of pixels in the minimum rectangle circumscribing the target region. In general, characters are written on the background with thin lines having a different color from the background. When the target area represents a character object, the pixel density S is relatively small. When the target area represents a non-character object, the pixel density S is relatively large. For example, since the photo object is likely to occupy most of the circumscribed minimum rectangle, the pixel density S is relatively large when the target region represents the photo object.

図9の判断テーブル292は、上記説明を考慮して、作成されている。具体的には、判断部125は、所定の判断条件が満たされる場合には、対象領域は、文字オブジェクトを表す文字オブジェクト領域であると判断する。判断部125は、所定の判断条件が満たされない場合には、対象領域は、非文字オブジェクトを表す非文字オブジェクト領域であると判断する。   The determination table 292 in FIG. 9 is created in consideration of the above description. Specifically, the determination unit 125 determines that the target region is a character object region representing a character object when a predetermined determination condition is satisfied. When the predetermined determination condition is not satisfied, the determination unit 125 determines that the target region is a non-character object region representing a non-character object.

所定の判断条件は、判断テーブル292から解るように、以下の2つの条件のいずれかが満たされることである。
1)分布幅Wが分布幅閾値Wth以上、かつ、色数Cが色数閾値Cth未満、かつ、画素密度Sが画素密度閾値Sth未満であること
2)分布幅Wが分布幅閾値Wth未満、かつ、画素密度Sが画素密度閾値Sth未満であること
As is understood from the determination table 292, the predetermined determination condition is that one of the following two conditions is satisfied.
1) The distribution width W is greater than or equal to the distribution width threshold value Wth, the color number C is less than the color number threshold value Cth, and the pixel density S is less than the pixel density threshold value Sth. 2) The distribution width W is less than the distribution width threshold value Wth. In addition, the pixel density S is less than the pixel density threshold Sth.

図3(D)の例では、オブジェクト領域L31、L32、L33は、非文字オブジェクトを表す領域(以下、非文字オブジェクト領域とも呼ぶ)であると判断され、オブジェクト領域L34C、L37は、それぞれ文字オブジェクトを表す領域(以下、文字オブジェクト領域とも呼ぶ)であると判断される。   In the example of FIG. 3D, the object areas L31, L32, and L33 are determined to be areas representing non-character objects (hereinafter also referred to as non-character object areas), and the object areas L34C and L37 are character objects. (Hereinafter also referred to as a character object region).

オブジェクト属性判断処理に続いて、ステップS550では、判断部125は、グレー判断処理を実行する。   Subsequent to the object attribute determination process, in step S550, the determination unit 125 executes a gray determination process.

図11は、グレー判断処理のフローチャートである。
ステップS551では、判断部125は、ステップS500で非文字オブジェクト領域であると判断された領域を選択する。図3(D)の例では、3個の非文字オブジェクト領域L31〜L33が順次に選択される。
FIG. 11 is a flowchart of the gray determination process.
In step S551, the determination unit 125 selects an area determined to be a non-character object area in step S500. In the example of FIG. 3D, three non-character object areas L31 to L33 are sequentially selected.

ステップS552では、選択された非文字オブジェクト領域内の画像を平滑化する平滑化処理を実行する。具体的には、対象画像データのうち、選択された非文字オブジェクト領域に対応する部分画像データに対して、平滑化フィルタFL(図11)を適用する。なお、平滑化フィルタFLは、処理対象の部分画像データに含まれる3個の成分データ(すなわち、R成分データ、G成分データ、B成分データ)のそれぞれに対して適用される。すなわち、判断部125は、処理対象の成分データが表す画像内の注目画素に、平滑化フィルタFLの中心位置FCが重なるように平滑化フィルタFLを配置する。判断部125は、注目画素を中心とした平滑化フィルタFL(例えば、縦5画素×横5画素)内の複数個の成分値の平均値を算出する。判断部125は、注目画素の成分値を、算出された平均値に変更する。判断部125は、各成分データ内のすべての画素を注目画素に設定して、同様の処理を実行する。平滑化処理後の部分画像データは、バッファ領域241に格納される。   In step S552, a smoothing process for smoothing the image in the selected non-character object region is executed. Specifically, the smoothing filter FL (FIG. 11) is applied to the partial image data corresponding to the selected non-character object region in the target image data. The smoothing filter FL is applied to each of the three component data (that is, R component data, G component data, and B component data) included in the partial image data to be processed. That is, the determination unit 125 arranges the smoothing filter FL so that the center position FC of the smoothing filter FL overlaps the target pixel in the image represented by the processing target component data. The determination unit 125 calculates an average value of a plurality of component values in the smoothing filter FL (for example, 5 pixels in the vertical direction × 5 pixels in the horizontal direction) centered on the target pixel. The determination unit 125 changes the component value of the target pixel to the calculated average value. The determination unit 125 sets all the pixels in each component data as the target pixel and executes the same processing. The partial image data after the smoothing process is stored in the buffer area 241.

平滑化処理の意義について説明する。上述したように、原稿を読み取って得られるスキャンデータによって表される画像において、通常の観察距離で観察した場合に無彩色に見える画像の個々の画素が、有彩色を有している場合がある。例えば、原稿が、CMYの3種類の印刷材を用いて印刷された原稿である場合である。個々の画素が有彩色を有している場合であっても、通常の観察距離で観察した場合にグレーに見える画像(すなわち、領域)は、比較的狭い領域(例えば、通常の観察距離で識別可能な最小の大きさの領域)内の個々の画素の平均色は、無彩色であると考えられる。このために、平滑化処理を行うことによって、無彩色に見える領域内の個々の画素が有彩色を有している場合に、これらの画素の色を無彩色に近づけることができる。したがって、後述するグレー領域であるか否かの判断精度を向上することができる。   The significance of the smoothing process will be described. As described above, in an image represented by scan data obtained by reading a document, each pixel of an image that appears achromatic when observed at a normal observation distance may have a chromatic color. . For example, the document is a document printed using three types of printing materials of CMY. Even when individual pixels have a chromatic color, images that appear gray when viewed at a normal viewing distance (ie, regions) are identified by a relatively narrow region (eg, a normal viewing distance) The average color of the individual pixels within the smallest possible area) is considered to be achromatic. For this reason, by performing the smoothing process, when the individual pixels in the region that appears to be an achromatic color have a chromatic color, the color of these pixels can be brought close to the achromatic color. Therefore, it is possible to improve the accuracy of determining whether or not it is a gray region described later.

平滑化処理に続くステップS553では、判断部125は、機器独立色空間であるCIELAB色空間(以下、単にLaB色空間とも呼ぶ)における*a値と、*b値の分布を表すヒストグラムを作成して、バッファ領域241に格納する。このヒストグラムは、例えば、*a値および*b値毎に、*a値を有する画素数、および、*b値を有する画素数を、カウントしたヒストグラムである。   In step S553 following the smoothing process, the determination unit 125 creates a histogram representing the distribution of the * a value and the * b value in the CIELAB color space (hereinafter also simply referred to as LaB color space), which is a device-independent color space. And stored in the buffer area 241. This histogram is, for example, a histogram obtained by counting the number of pixels having the * a value and the number of pixels having the * b value for each * a value and * b value.

図12は、ヒストグラムの作成のフローチャートである。
ステップS5531では、判断部125は、対象画像SIにおいて、処理対象の非文字オブジェクト領域内の画素を処理対象画素として選択する。ステップS5532では、判断部125は、処理対象画素に対応する二値画像BI(図3(C))内の画素のエッジ強度EPを算出する。エッジ強度EPは、例えば、図4に示す算出式を用いて算出される。
FIG. 12 is a flowchart for creating a histogram.
In step S5531, the determination unit 125 selects a pixel in the non-character object region to be processed as a processing target pixel in the target image SI. In step S5532, the determination unit 125 calculates the edge intensity EP of the pixel in the binary image BI (FIG. 3C) corresponding to the processing target pixel. The edge strength EP is calculated using, for example, a calculation formula shown in FIG.

エッジ強度EPが算出されると、続くステップS5533では、判断部125は、エッジ強度EPは、エッジ基準値Eth以下であるか否かを判断する。エッジ強度EPがエッジ基準値Eth以下である場合には(ステップS5533:YES)、判断部125は、処理対象画素の画素値を用いて、ヒストグラムを更新する。すなわち、判断部125は、処理対象画素の画素値(RGB値)をLab値に変換して、当該Lab値に応じて、上述したヒストグラムを更新する。   When the edge strength EP is calculated, in the subsequent step S5533, the determination unit 125 determines whether or not the edge strength EP is equal to or less than the edge reference value Eth. When the edge intensity EP is equal to or less than the edge reference value Eth (step S5533: YES), the determination unit 125 updates the histogram using the pixel value of the processing target pixel. That is, the determination unit 125 converts the pixel value (RGB value) of the processing target pixel into a Lab value, and updates the above-described histogram according to the Lab value.

エッジ強度EPがエッジ基準値Ethより大きい場合には(ステップS5533:NO)、判断部125は、ステップS5534をスキップする。すなわち、処理対象画素のエッジ強度EPが基準値Etより大きい場合には、処理対象画素は、ヒストグラムの作成には使用されない。   When the edge strength EP is larger than the edge reference value Eth (step S5533: NO), the determination unit 125 skips step S5534. That is, when the edge intensity EP of the processing target pixel is larger than the reference value Et, the processing target pixel is not used for creating a histogram.

図13は、非文字オブジェクト領域の外縁部の一例を示す図である。図3(C)に示すように、二値画像BIでは、オブジェクト領域の内部の画素値は、全て「1」である(具体的には、図3(C)の黒で表されている)ので、エッジ強度EPが基準値Etより大きい画素は、オブジェクト領域の外縁部分(非オブジェクト領域と接する部分)に現れ、オブジェクト領域のうち、外縁部分を除いた領域には、現れない。したがって、図13に示すように、各非文字オブジェクト領域L31〜L33の各外縁部OE1〜OE3(具体的には、図13においてハッチングされた領域)の画素が、ヒストグラムの作成から除外される。すなわち、非文字オブジェクト領域L31〜L33の各外縁部OE1〜OE3の画素は、後述するステップS554〜S556の処理にて実行される、グレー領域であるか否かの判断には用いられない。   FIG. 13 is a diagram illustrating an example of the outer edge portion of the non-character object region. As shown in FIG. 3C, in the binary image BI, the pixel values inside the object area are all “1” (specifically, it is represented by black in FIG. 3C). Therefore, pixels whose edge intensity EP is larger than the reference value Et appear in the outer edge portion of the object region (portion in contact with the non-object region), and do not appear in the region other than the outer edge portion of the object region. Therefore, as shown in FIG. 13, the pixels of the outer edge portions OE1 to OE3 (specifically, hatched regions in FIG. 13) of the non-character object regions L31 to L33 are excluded from the creation of the histogram. That is, the pixels of the outer edge portions OE1 to OE3 of the non-character object regions L31 to L33 are not used for determining whether or not they are gray regions, which are executed in the processes of steps S554 to S556 described later.

続くステップS5535では、判断部125は、処理対象の非文字オブジェクト領域内の全ての画素を選択したか否かを判断する。判断部125は、全ての画素を選択した場合には(ステップS5535:YES)、ヒストグラムの作成を終了する。判断部125は、未選択の画素がある場合には(ステップS5535:NO)、ステップS5531に戻って、未選択の画素を新たに選択して、上述したステップS5532〜S5535の処理を繰り返す。   In subsequent step S5535, determination unit 125 determines whether or not all pixels in the non-character object region to be processed have been selected. When all the pixels are selected (step S5535: YES), the determination unit 125 ends the creation of the histogram. If there is an unselected pixel (step S5535: NO), the determination unit 125 returns to step S5531, newly selects an unselected pixel, and repeats the processing of steps S5532 to S5535 described above.

ヒストグラムが作成されると、図11のステップS554では、判断部125は、処理対象の非文字オブジェクト領域内の全画素に対する有彩色の画素が占める割合PN(すなわち、有彩色比率)が、グレー判断基準値Nth未満であるか否かを判断する。   When the histogram is created, in step S554 in FIG. 11, the determination unit 125 determines that the ratio PN (that is, the chromatic color ratio) occupied by chromatic pixels to all the pixels in the non-character object region to be processed is gray. It is determined whether it is less than the reference value Nth.

図14は、グレー領域とカラー領域の判断について説明する図である。
本実施例では、判断部125は、Lab色空間における無彩色軸(すなわち、*a=*b=0の軸)との距離Rが、所定の基準距離Rth(図14)未満である色は、無彩色であると判断し、Lab色空間における無彩色軸(すなわち、*a=*b=0の軸)との距離Rが、所定の基準距離Rth以上である色は、有彩色であると判断する。ここで、距離Rは、Lab色空間におけるユークリッド距離(具体的には、R=(*a)+(*b)の式で表される。)である。基準距離Rthは、観察者が無彩色であると認識する色と、有彩色であると認識する色と、を分離できる値であって、経験的に定められる。判断部125は、ヒストグラムを参照して、有彩色比率PNを算出して、グレー判断基準値Nth未満であるか否かを判断する。
FIG. 14 is a diagram for explaining determination of a gray area and a color area.
In the present embodiment, the determination unit 125 determines colors whose distance R to the achromatic color axis (that is, the axis of * a = * b = 0) in the Lab color space is less than a predetermined reference distance Rth (FIG. 14). A color whose distance R from the achromatic color axis (that is, the axis of * a = * b = 0) in the Lab color space is equal to or greater than a predetermined reference distance Rth is a chromatic color. Judge. Here, the distance R is the Euclidean distance in the Lab color space (specifically, it is represented by the formula R 2 = (* a) 2 + (* b) 2 ). The reference distance Rth is a value that can separate the color recognized by the observer as an achromatic color and the color recognized as a chromatic color, and is determined empirically. The determination unit 125 refers to the histogram, calculates the chromatic color ratio PN, and determines whether it is less than the gray determination reference value Nth.

有彩色比率PNがグレー判断基準値Nth未満である場合には(ステップS554:YES)、判断部125は、処理対象の非文字オブジェクト領域は、グレー領域であると判断する(ステップS555)。有彩色比率PNがグレー判断基準値Nth以上である場合には(ステップS554:NO)、判断部125は、処理対象の非文字オブジェクト領域は、カラー領域であると判断する(ステップS556)。図14(A)は、グレー領域であると判断される非文字オブジェクト領域内の画像の色分布の例を示し、図14(B)は、カラー領域であると判断される非文字オブジェクト領域内の画像の色分布の例を示している。図14(A)の例では、ほとんどの画素の色が、無彩色軸から基準距離Rth内の範囲(無彩色範囲とも呼ぶ)に分布していることが解る。一方、図14(B)の例では、比較的高い割合の画素の色が、無彩色軸から基準距離Rth以上離れた範囲(有彩色範囲とも呼ぶ)に分布していることが解る。なお、グレー判断基準値Nthは、一例として、0.3以下であることが好ましく、0.15以下であることがさらに好ましい。判断部125は、処理対象の非文字オブジェクト領域が、グレー領域であるか、カラー領域であるかを判断すると、平滑化処理後の部分画像データ、および、ヒストグラムデータを、バッファ領域241から消去する。   When the chromatic color ratio PN is less than the gray determination reference value Nth (step S554: YES), the determination unit 125 determines that the non-character object region to be processed is a gray region (step S555). When the chromatic color ratio PN is equal to or greater than the gray determination reference value Nth (step S554: NO), the determination unit 125 determines that the non-character object region to be processed is a color region (step S556). FIG. 14A shows an example of the color distribution of the image in the non-character object area determined to be a gray area, and FIG. 14B shows the inside of the non-character object area determined to be a color area. The example of the color distribution of the image of is shown. In the example of FIG. 14A, it can be seen that the color of most pixels is distributed in a range (also referred to as an achromatic color range) within the reference distance Rth from the achromatic color axis. On the other hand, in the example of FIG. 14B, it can be seen that a relatively high proportion of pixel colors are distributed in a range (also referred to as a chromatic color range) separated from the achromatic color axis by a reference distance Rth or more. As an example, the gray determination reference value Nth is preferably 0.3 or less, and more preferably 0.15 or less. When determining whether the non-character object region to be processed is a gray region or a color region, the determination unit 125 deletes the partial image data and the histogram data after the smoothing process from the buffer region 241. .

続くステップS557では、判断部125は、全ての非文字オブジェクト領域を選択したか否かを判断する。判断部125は、全ての非文字オブジェクト領域を選択した場合には(ステップS557:YES)、グレー判定処理を終了する。判断部125は、未選択の非文字オブジェクト領域がある場合には(ステップS557:NO)、ステップS551に戻って、未選択の非文字オブジェクト領域を新たに選択して、上述したステップS552〜S557の処理を繰り返す。   In subsequent step S557, determination unit 125 determines whether or not all non-character object regions have been selected. If all the non-character object regions are selected (step S557: YES), the determination unit 125 ends the gray determination process. If there is an unselected non-character object area (step S557: NO), the determination unit 125 returns to step S551, newly selects an unselected non-character object area, and the above-described steps S552 to S557. Repeat the process.

ここで、非文字オブジェクト領域L31〜L33の各外縁部OE1〜OE3の画素を、グレー画像か否かの判断に用いない理由を説明する。これらの外縁部OE1〜OE3は、オブジェクト領域と、非オブジェクト領域(背景領域)との境界に位置する。これらの境界部分は、オブジェクト領域の本来の色とは異なる色を有する場合がある。一般的なスキャナは、イメージセンサの原稿に対する位置を副走査方向に移動させながら、イメージセンサによって原稿からの光を受光して、スキャンデータを生成する。このとき、境界部分の画素データは、原稿のオブジェクト領域からの光と、背景領域からの光との両方に基づいて生成され得る。したがって、本実施例のように、対象画像データがスキャンデータである場合には、境界部分は、オブジェクト領域の本来の色と、背景領域の色との中間色になる場合がある。本実施例では、各外縁部OE1〜OE3の画素を、グレー領域か否かの判断に用いないことによって、オブジェクト領域の本来の色が、無彩色であるか有彩色であるかを精度良く判断することができる。   Here, the reason why the pixels of the outer edge portions OE1 to OE3 of the non-character object regions L31 to L33 are not used for determining whether or not the image is a gray image will be described. These outer edge portions OE1 to OE3 are located at the boundary between the object region and the non-object region (background region). These boundary portions may have a color different from the original color of the object area. A general scanner receives light from an original by the image sensor while moving the position of the image sensor relative to the original in the sub-scanning direction, and generates scan data. At this time, the pixel data of the boundary portion can be generated based on both the light from the object area of the document and the light from the background area. Accordingly, when the target image data is scan data as in the present embodiment, the boundary portion may be an intermediate color between the original color of the object area and the color of the background area. In this embodiment, the pixels of the outer edge portions OE1 to OE3 are not used for determining whether or not they are gray regions, thereby accurately determining whether the original color of the object region is an achromatic color or a chromatic color. can do.

図11のグレー判断処理によって、図3(D)の例では、2個の非文字オブジェクト領域L31、L32は、グレー領域であると判断され、1個の非文字オブジェクト領域L33は、カラー領域であると判断される。   In the example of FIG. 3D, the two non-character object regions L31 and L32 are determined to be gray regions by the gray determination process of FIG. 11, and one non-character object region L33 is a color region. It is judged that there is.

グレー判断処理が終了すると、図2のステップS600では、低減処理部130は、対象画像データのデータサイズを低減するための低減処理を実行する。   When the gray determination process is completed, in step S600 of FIG. 2, the reduction processing unit 130 executes a reduction process for reducing the data size of the target image data.

図15は、第1実施例の低減処理のフローチャートである。
低減処理が開始されると、先ず、ステップS605では、処理対象の1個のオブジェクト領域(文字オブジェクト領域または非文字オブジェクト領域)が選択される。図3(D)の例では、5個のオブジェクト領域L31〜L33、L34C、L37が、1個ずつ順次に選択される。
FIG. 15 is a flowchart of the reduction process of the first embodiment.
When the reduction process is started, first, in step S605, one object area (character object area or non-character object area) to be processed is selected. In the example of FIG. 3D, five object areas L31 to L33, L34C, and L37 are sequentially selected one by one.

処理対象のオブジェクト領域が選択されると、次のステップS610では、低減処理部130は、処理対象のオブジェクト領域が、文字オブジェクト領域であるか否かを判断する。低減処理部130は、処理対象のオブジェクト領域が、文字オブジェクト領域である場合には(ステップS610:YES)には、低減処理部130の第1処理部131は、処理対象の文字オブジェクト領域内の文字画像の色を表す文字色値TCを決定する(ステップS620)。第1処理部131は、例えば、処理対象の文字オブジェクト領域内の全ての画素についての、RGBの各成分値の平均値(Rave1、Gave1、Bave1)を、文字色値TCとして算出する。第1処理部131は、文字色値TCとして他の値を算出しても良く、例えば、文字オブジェクト領域内の画素のうち、文字オブジェクト領域の外縁部(背景との境界部)を除く画素のみを用いて、文字色値TCを算出しても良い。   When the processing target object area is selected, in the next step S610, the reduction processing unit 130 determines whether or not the processing target object area is a character object area. In the case where the object area to be processed is a character object area (step S610: YES), the reduction processing section 130 causes the first processing section 131 of the reduction processing section 130 to include a character object area within the processing target character object area. A character color value TC representing the color of the character image is determined (step S620). For example, the first processing unit 131 calculates an average value (Rave1, Gave1, Bave1) of RGB component values for all pixels in the character object area to be processed as the character color value TC. The first processing unit 131 may calculate other values as the character color value TC. For example, only the pixels in the character object region excluding the outer edge portion (boundary portion with the background) of the character object region. May be used to calculate the character color value TC.

文字色値TCが決定されると、続くステップS625では、低減処理部130の第3処理部133は、バッファ領域241に格納された対象画像データにおいて、処理対象の文字オブジェクト領域内の画素の画素値を背景色値BCに変更する。すなわち、第3処理部133は、対象画像SIから処理対象の文字オブジェクト領域の文字画像を消去する。背景色値BCは、例えば、処理対象の文字オブジェクト領域を囲む非オブジェクト領域(背景領域)内の全ての画素についての、RGBの各成分値の平均値(Rave2、Gave2、Bave2)が採用される。図3(D)の例では、文字オブジェクト領域L34C、L37の背景色値BCは、非オブジェクト領域L30内の画素の画素値を用いて算出される。背景色値BCは、他の値が採用されても良く、例えば、第3処理部133は、処理対象の文字オブジェクト領域を囲む非オブジェクト領域内の複数個の画素のうち、文字オブジェクト領域に比較的近い複数個の画素のみを用いて、背景色値BCを算出しても良い。   When the character color value TC is determined, in the subsequent step S625, the third processing unit 133 of the reduction processing unit 130 uses the pixel of the pixel in the processing target character object region in the target image data stored in the buffer region 241. The value is changed to the background color value BC. That is, the third processing unit 133 deletes the character image in the character object area to be processed from the target image SI. As the background color value BC, for example, an average value (Rave2, Gave2, Bave2) of RGB component values for all pixels in the non-object area (background area) surrounding the character object area to be processed is adopted. . In the example of FIG. 3D, the background color value BC of the character object areas L34C and L37 is calculated using the pixel values of the pixels in the non-object area L30. Other values may be adopted as the background color value BC. For example, the third processing unit 133 compares the background color value BC with the character object area among a plurality of pixels in the non-object area surrounding the character object area to be processed. The background color value BC may be calculated using only a plurality of close pixels.

続くステップS630では、第1処理部131は、処理対象の文字オブジェクト領域に対応する二値画像データを取得して、当該二値画像データを、FLATE圧縮方式により圧縮する。本ステップにおいて、処理対象の文字オブジェクト領域内の文字を表す圧縮済みの文字画像データが生成される。生成された圧縮済みの文字画像データは、後述する圧縮PDFファイルの生成まで(図2:S700)まで、バッファ領域241に格納される。文字オブジェクト領域に対応する二値画像データは、文字オブジェクトに外接する最小矩形に対応する二値画像を表す。例えば、図3(D)の文字オブジェクト領域L34Cに対応する二値画像データによって表される二値画像は、図3(C)における二値画像BI4である。また、図3(D)の文字オブジェクト領域L37に対応する二値画像データによって表される二値画像は、図3(C)における二値画像BI7である。   In subsequent step S630, the first processing unit 131 obtains binary image data corresponding to the character object region to be processed, and compresses the binary image data by the FLATE compression method. In this step, compressed character image data representing characters in the character object area to be processed is generated. The generated compressed character image data is stored in the buffer area 241 until a compressed PDF file to be described later is generated (FIG. 2: S700). The binary image data corresponding to the character object area represents a binary image corresponding to the smallest rectangle circumscribing the character object. For example, the binary image represented by the binary image data corresponding to the character object region L34C in FIG. 3D is the binary image BI4 in FIG. Further, the binary image represented by the binary image data corresponding to the character object region L37 in FIG. 3D is the binary image BI7 in FIG.

FLATE圧縮方式は、ZIPファイルの作成などに使用されている可逆圧縮方式であり、比較的階調数の少ない画像の圧縮に適している。FLATE圧縮方式を用いれば、二値画像データを、高い圧縮率で、かつ、解像度を落とすことなく圧縮することができる。文字は、色の再現性よりも読みやすさが優先されると考えられるので、階調性の維持よりも解像度の維持が優先される。このために、本実施例では、圧縮済みの文字画像データを、二値画像データをFLATE圧縮方式で圧縮することによって生成している。FLATE圧縮方式により圧縮済みの文字画像データが生成されると、低減処理部130は、ステップS650に処理を移行する。   The FLATE compression method is a reversible compression method used for creating a ZIP file and is suitable for compression of an image having a relatively small number of gradations. If the FLATE compression method is used, binary image data can be compressed at a high compression rate and without reducing the resolution. Since it is considered that the readability is given priority over the color reproducibility, maintaining the resolution has priority over maintaining the gradation. For this reason, in this embodiment, the compressed character image data is generated by compressing the binary image data by the FLATE compression method. When the compressed character image data is generated by the FLATE compression method, the reduction processing unit 130 shifts the process to step S650.

上述した図6のステップS610にて、処理対象のオブジェクト領域が、文字オブジェクト領域でない場合には(ステップS610:NO)には、低減処理部130は、処理対象のオブジェクト領域が、グレー領域であるか否かを判断する(ステップS615)。グレー領域は、上述したとおり、非文字オブジェクト領域のうち、グレー判断処理(図2:ステップS550)にて、グレー領域であると判断された領域である。処理対象のオブジェクト領域が、グレー領域でない場合には(ステップS615:NO)、すなわち、処理対象のオブジェクト領域がカラー領域である場合には、低減処理部130は、ステップS650に処理を移行する。   In step S610 of FIG. 6 described above, if the object area to be processed is not a character object area (step S610: NO), the reduction processing unit 130 indicates that the object area to be processed is a gray area. Whether or not (step S615). As described above, the gray area is an area determined as a gray area in the non-character object area by the gray determination process (FIG. 2: step S550). If the object area to be processed is not a gray area (step S615: NO), that is, if the object area to be processed is a color area, the reduction processing unit 130 shifts the process to step S650.

処理対象のオブジェクト領域が、グレー領域である場合には(ステップS615:YES)、低減処理部130の第2処理部132は、処理対象のグレー領域内の画像を表す1個の成分データを取得する(ステップS635)。本実施例では、第2処理部132は、対象画像データのうち、処理対象のグレー領域に対応する部分画像データに含まれる3個の成分データ(すなわち、R成分データ、G成分データ、B成分データ)のうちの1個の成分データを選択する。無彩色(すなわち、グレー)は、3個の成分値が互いに等しいRGB値で表されるから、グレー領域に対応する部分画像データに含まれる3個の成分データは、互いにほぼ等しいと考えられる。したがって、本ステップでは、3個の成分データのうちいずれの成分データが選択されても良い。   When the object region to be processed is a gray region (step S615: YES), the second processing unit 132 of the reduction processing unit 130 acquires one component data representing an image in the gray region to be processed. (Step S635). In the present embodiment, the second processing unit 132 includes three component data (that is, R component data, G component data, and B component) included in the partial image data corresponding to the gray region to be processed among the target image data. Data) is selected. Since an achromatic color (that is, gray) is represented by RGB values having the same three component values, the three component data included in the partial image data corresponding to the gray region are considered to be substantially equal to each other. Therefore, in this step, any component data among the three component data may be selected.

続くステップS640では、第3処理部133は、バッファ領域241に格納された対象画像データにおいて、処理対象のグレー領域内の画素の画素値を背景色値BCに変更する。すなわち、第3処理部133は、対象画像SIから処理対象のグレー領域内の画像を消去する。背景色値BCは、上述したステップS625において、文字オブジェクト領域内の文字を消去する際に使用した背景色値BCと同様に、処理対象のグレー領域を囲む非オブジェクト領域(すなわち、背景領域)内の画素の画素値を用いて算出される。   In subsequent step S640, the third processing unit 133 changes the pixel value of the pixel in the gray area to be processed to the background color value BC in the target image data stored in the buffer area 241. That is, the third processing unit 133 deletes the image in the gray area to be processed from the target image SI. The background color value BC is stored in the non-object region (that is, the background region) surrounding the gray region to be processed in the same manner as the background color value BC used when erasing characters in the character object region in step S625 described above. It is calculated using the pixel value of each pixel.

次のステップS645では、第2処理部132は、ステップS635で取得された1個の成分データを、グレー成分データ上に配置する。具体的には、グレー成分データは、対象画像SIと同じ大きさの領域を有する1個の成分データであり、初期状態では、全ての画素値が、白(すなわち、最大輝度値)を表す値、例えば、「255」にされている。先ず、初期状態のグレー成分データがバッファ領域241に準備され、本ステップでは、第2処理部132は、このグレー成分データのうち、処理対象のグレー領域に対応する部分データを、ステップS635で取得された1個の成分データに置換する。   In the next step S645, the second processing unit 132 arranges one component data acquired in step S635 on the gray component data. Specifically, the gray component data is one component data having a region having the same size as the target image SI, and in the initial state, all pixel values are values representing white (that is, the maximum luminance value). For example, “255” is set. First, the gray component data in the initial state is prepared in the buffer area 241. In this step, the second processing unit 132 acquires partial data corresponding to the gray area to be processed from the gray component data in step S635. It is replaced with one component data.

次のステップS647では、第2処理部132は、処理対象のグレー領域に対応する二値画像データを取得して、グレーマスクデータ上に配置する。具体的には、グレーマスクデータは、対象画像SIと同じ大きさの領域、すなわち、グレー成分データと同じ大きさの領域を有する二値画像データであり、初期状態では、全ての画素値が「0」にされている。先ず、初期状態のグレー成分データがバッファ領域241に準備され、本ステップでは、第2処理部132は、このグレーマスクデータのうち、処理対象のグレー領域に対応する部分データを、グレー領域に対応する二値画像データに置換する。グレー領域に対応する二値画像データは、グレー領域(すなわち、非文字オブジェクト)に外接する最小矩形に対応する二値画像を表す。例えば、図3(D)のグレー領域(すなわち、非文字オブジェクト領域)L31に対応する二値画像データによって表される二値画像は、図3(C)における二値画像BI1である。また、図3(D)のグレー領域(すなわち、非文字オブジェクト領域)L32に対応する二値画像データによって表される二値画像は、図3(C)における二値画像BI2である。処理対象のグレー領域に対応する二値画像データを取得して、グレーマスクデータ上に配置すると、低減処理部130は、ステップS650に処理を移行する。   In the next step S647, the second processing unit 132 acquires binary image data corresponding to the gray region to be processed, and arranges it on the gray mask data. Specifically, the gray mask data is binary image data having an area having the same size as that of the target image SI, that is, an area having the same size as that of the gray component data. 0 ”. First, the gray component data in the initial state is prepared in the buffer area 241. In this step, the second processing unit 132 corresponds to the gray area of the partial data corresponding to the gray area to be processed among the gray mask data. Replace with binary image data. The binary image data corresponding to the gray area represents a binary image corresponding to the smallest rectangle circumscribing the gray area (that is, the non-character object). For example, the binary image represented by the binary image data corresponding to the gray region (that is, the non-character object region) L31 in FIG. 3D is the binary image BI1 in FIG. Also, the binary image represented by the binary image data corresponding to the gray region (that is, the non-character object region) L32 in FIG. 3D is the binary image BI2 in FIG. When the binary image data corresponding to the gray area to be processed is acquired and placed on the gray mask data, the reduction processing unit 130 shifts the process to step S650.

ステップS650では、低減処理部130は、全てのオブジェクト領域を選択したか否かを判断する。低減処理部130は、全てのオブジェクト領域を選択した場合には(ステップS650:YES)、ステップS655に処理を進める。低減処理部130は、未選択のオブジェクト領域がある場合には(ステップS650:NO)、ステップS605に戻って、未選択のオブジェクト領域を新たに選択して、上述したステップS610〜S650の処理を繰り返す。   In step S650, the reduction processing unit 130 determines whether all object areas have been selected. If all the object areas have been selected (step S650: YES), the reduction processing unit 130 proceeds with the process to step S655. If there is an unselected object area (step S650: NO), the reduction processing unit 130 returns to step S605, newly selects an unselected object area, and performs the above-described processing of steps S610 to S650. repeat.

図16は、第1実施例の低減処理で生成される画像データについて説明する図である。
対象画像SIに対して上記の各処理を終え、ステップS655に移行した時点で、1個のカラー成分データ(図16(A))と、2個の圧縮済みの文字画像データ(図16(B))と、1個のグレー成分データ(図16(C))と、1個のグレーマスクデータ(図16(D))と、が生成され、バッファ領域241に、それぞれ格納されている。
FIG. 16 is a diagram for explaining image data generated by the reduction process of the first embodiment.
When each of the above-described processes is completed for the target image SI and the process proceeds to step S655, one color component data (FIG. 16A) and two compressed character image data (FIG. 16B) )), One gray component data (FIG. 16C), and one gray mask data (FIG. 16D) are generated and stored in the buffer area 241 respectively.

カラー成分データは、低減処理部130の第3処理部133による処理(図15:ステップS625、S640)によって、生成される。ステップS625、S640の処理から解るように、カラー成分データは、対象画像データ内の複数個の画素値のうち、文字オブジェクト領域内の各画素の画素値と、グレー領域内の各画素の画素値とを、背景色値BCに置換して得られる画像データである。カラー成分データは、対象画像データのうち、カラー領域に対応する部分画像データを、含んでいる。したがって、図16(A)に示すように、カラー成分データによって表されるカラー成分画像CIは、対象画像SIの非オブジェクト領域L30(図3(D))に対応する背景Bgと、カラー領域L33(図3(D))に対応するカラーオブジェクトOb3と、を表す部分画像を含んでいる。また、カラー成分データは、対象画像データと同じように、3個の色成分に対応する3個の成分データ(すなわち、R成分データ、G成分データ、B成分データ)を含んでいる。   The color component data is generated by the processing by the third processing unit 133 of the reduction processing unit 130 (FIG. 15: steps S625 and S640). As understood from the processing of steps S625 and S640, the color component data includes the pixel value of each pixel in the character object area and the pixel value of each pixel in the gray area among the plurality of pixel values in the target image data. Is the image data obtained by substituting the background color value BC. The color component data includes partial image data corresponding to the color area in the target image data. Accordingly, as shown in FIG. 16A, the color component image CI represented by the color component data includes the background Bg corresponding to the non-object region L30 (FIG. 3D) of the target image SI and the color region L33. A partial image representing the color object Ob3 corresponding to (FIG. 3D) is included. In addition, the color component data includes three component data (that is, R component data, G component data, and B component data) corresponding to the three color components, like the target image data.

圧縮済みの文字画像データは、低減処理部130の第1処理部131による処理(すなわち、図15:ステップS630)によって、生成される。ステップS630の処理から解るように、圧縮済みの文字画像データは、対象画像データのうち、文字オブジェクト領域に対応する部分画像データを二値化して得られる二値画像データをFLAT圧縮方式で圧縮したデータである。図16(B)の例では、対象画像SIの文字オブジェクト領域L34C(図3(D))に対応する3個の文字オブジェクトOb4〜Ob6を表す二値画像TI1と、領域L37(図3(D))に対応する1個の文字オブジェクトOb7を表す二値画像TI2と、をそれぞれ表す2個の圧縮済みの文字画像データが生成されている。   The compressed character image data is generated by the processing by the first processing unit 131 of the reduction processing unit 130 (ie, step S630 in FIG. 15). As understood from the processing of step S630, the compressed character image data is binary image data obtained by binarizing the partial image data corresponding to the character object area in the target image data, and compressed by the FLAT compression method. It is data. In the example of FIG. 16B, a binary image TI1 representing three character objects Ob4 to Ob6 corresponding to the character object region L34C (FIG. 3D) of the target image SI, and a region L37 (FIG. 3D )), Two compressed character image data respectively representing a binary image TI2 representing one character object Ob7 are generated.

グレー成分データは、低減処理部130の第2処理部132による処理(図15:ステップS635、S645)によって、生成される。ステップS635、S645の処理から解るように、グレー成分データは、対象画像SIに含まれる1個以上のグレー領域をそれぞれ表す部分成分データを含んでいる。したがって、図16(C)に示すように、グレー成分データによって表されるグレー成分画像GIは、対象画像SI内の2個のグレー領域L31、L32にそれぞれ対応する2個のグレーオブジェクトOb1、Ob2、を表す2個のグレー部分画像PG1、PG2を含んでいる。また、グレー成分データは、対象画像データとは異なり、1個の成分値から構成された1個の成分データである。   The gray component data is generated by the processing (FIG. 15: steps S635 and S645) by the second processing unit 132 of the reduction processing unit 130. As understood from the processing in steps S635 and S645, the gray component data includes partial component data each representing one or more gray regions included in the target image SI. Therefore, as shown in FIG. 16C, the gray component image GI represented by the gray component data includes two gray objects Ob1 and Ob2 corresponding to the two gray regions L31 and L32 in the target image SI, respectively. , Two gray partial images PG1 and PG2 are included. Further, unlike the target image data, the gray component data is one component data composed of one component value.

グレーマスクデータは、低減処理部130の第2処理部132による処理(図15:ステップS647)によって、生成される。ステップS647の処理から解るように、グレーマスクデータによって表されるグレーマスク画像MIは、対応するグレー成分画像GI(図16(C))内の2個のグレー部分画像PG1、PG2にそれぞれ対応する2個のマスク部分画像PM1、PM2と、を含んでいる。2個のマスク部分画像PM1、PM2は、対応する2個のグレー部分画像PG1、PG2内のオブジェクト画素の位置を示している。すなわち、グレーマスクデータは、グレー成分画像GI内のオブジェクト画素の位置を表す値「1」と、非オブジェクト画素の位置を表す値「0」と、から構成される二値データである。言い換えれば、グレーマスク画像MIは、グレー成分画像GIが、カラー成分画像CI上に重ねて表示される場合に、表示すべき画素(すなわち、画素値「1」の画素)と、表示しない画素(すなわち、画素値「0」の画素)と、を規定した二値画像である。   The gray mask data is generated by the processing (FIG. 15: step S647) by the second processing unit 132 of the reduction processing unit 130. As understood from the processing in step S647, the gray mask image MI represented by the gray mask data corresponds to the two gray partial images PG1 and PG2 in the corresponding gray component image GI (FIG. 16C), respectively. Two mask partial images PM1 and PM2 are included. The two mask partial images PM1 and PM2 indicate the positions of the object pixels in the corresponding two gray partial images PG1 and PG2. That is, the gray mask data is binary data composed of a value “1” representing the position of the object pixel in the gray component image GI and a value “0” representing the position of the non-object pixel. In other words, the gray mask image MI includes pixels to be displayed (that is, pixels having a pixel value “1”) and pixels not to be displayed (when the gray component image GI is displayed over the color component image CI). That is, a binary image defining a pixel having a pixel value “0”).

ステップS655では、先ず、低減処理部130の第2処理部132は、グレー成分データをJPEG圧縮方式で圧縮する。JPEG圧縮方式は、デジタルカメラで撮影することによって生成された画像データの圧縮などに使用されている不可逆圧縮方式であり、写真のように、比較的階調性が高い画像、すなわち、色数Cが多く、階調の変化が緩やかな画像の圧縮に適している。一方、JPEG圧縮方式は、急激に階調が変化するエッジを大きく劣化させるので、文字のように、読みやすさや見栄えの観点からエッジの再現性が重要な画像の圧縮には不向きである。本ステップにて圧縮されたグレー成分データを、圧縮済みのグレー画像データとも呼ぶ。生成された圧縮済みのグレー画像データは、バッファ領域241に格納され、圧縮前のグレー成分データは消去される。   In step S655, first, the second processing unit 132 of the reduction processing unit 130 compresses the gray component data using the JPEG compression method. The JPEG compression method is an irreversible compression method used for compression of image data generated by taking a picture with a digital camera, and is an image having a relatively high gradation, such as a photograph, that is, the number of colors C Therefore, it is suitable for compression of images with a gradual change in gradation. On the other hand, the JPEG compression method greatly deteriorates an edge whose gradation changes rapidly, and thus is not suitable for compression of an image in which reproducibility of an edge is important from the viewpoint of readability and appearance like characters. The gray component data compressed in this step is also called compressed gray image data. The generated compressed gray image data is stored in the buffer area 241 and the gray component data before compression is deleted.

圧縮済みのグレー画像データが生成されると、次のステップS660では、第2処理部132は、グレーマスクデータをFLATE圧縮方式で圧縮して、圧縮済みのグレーマスクデータを生成する。FLATE圧縮方式は、上述したように、二値データのような階調数が比較的少ない画像の圧縮に適している。生成された圧縮済みのグレーマスクデータは、バッファ領域241に格納され、圧縮前のグレーマスクデータは消去される。   When the compressed gray image data is generated, in the next step S660, the second processing unit 132 generates the compressed gray mask data by compressing the gray mask data by the FLATE compression method. As described above, the FLATE compression method is suitable for compression of an image having a relatively small number of gradations such as binary data. The generated compressed gray mask data is stored in the buffer area 241, and the gray mask data before compression is deleted.

圧縮済みのグレーマスクデータが生成されると、次のステップS665では、低減処理部130の第3処理部133は、カラー成分データをJPEG圧縮方式で圧縮する。カラー成分データは、上述したように、3個の成分データを含んでいるため、3個の成分データがそれぞれ圧縮されることになる。本ステップにて圧縮されたカラー成分データを、圧縮済みのカラー画像データとも呼ぶ。生成された圧縮済みのカラー画像データは、バッファ領域241に格納され、圧縮前のカラー成分データは消去される。圧縮済みのカラー画像データが生成されると、低減処理部130は、低減処理を終了する。   When the compressed gray mask data is generated, in the next step S665, the third processing unit 133 of the reduction processing unit 130 compresses the color component data by the JPEG compression method. As described above, since the color component data includes three component data, the three component data are respectively compressed. The color component data compressed in this step is also called compressed color image data. The generated compressed color image data is stored in the buffer area 241, and the color component data before compression is deleted. When the compressed color image data is generated, the reduction processing unit 130 ends the reduction processing.

低減処理が終了されると、図2のステップS700では、生成部150は、圧縮済みの文字画像データと、圧縮済みのグレー画像データと、圧縮済みのカラー画像データと、圧縮済みのグレーマスクデータと、を用いて圧縮PDFファイルを生成する。   When the reduction process is completed, in step S700 of FIG. 2, the generation unit 150 causes the compressed character image data, the compressed gray image data, the compressed color image data, and the compressed gray mask data. And generate a compressed PDF file.

具体的には、生成部150は、圧縮済みのカラー画像データを、最下層のレイヤーとして表示させる画像データとして、PDFファイルに格納する。   Specifically, the generation unit 150 stores the compressed color image data in the PDF file as image data to be displayed as the lowest layer.

また、生成部150は、圧縮済みの文字画像データを、圧縮済みのカラー画像データより上位層のレイヤーとして表示する画像データとして、PDFファイルに格納する。圧縮済みの文字画像データは、文字色値TCおよび座標値CDと関連付けて、PDFファイルに格納される。文字色値TCは、文字の色を表すRGB値であり、図15のステップS620で算出された値である。座標値CDは、圧縮済みのカラー画像データによって表されるカラー成分画像CIに対して、圧縮済みの文字画像データによって表される二値画像TIが配置されるべき位置を表す情報である。座標値CDは、例えば、二値画像TIに外接する最小矩形の左上の角の画素の座標値(X、Y)で表される。図16(B)の例では、3個の文字オブジェクトOb4〜Ob6を表す二値画像TI1を表す文字画像データには、文字色値TC1(R1、G1、B1)と、座標値CD1(X1、Y1)と、が関連付けられている。また、1個の文字オブジェクトOb7を表す二値画像TI2には、文字色値TC2(R2、G2、B2)と、座標値CD2(X2、Y2)と、が関連付けられている。   Further, the generation unit 150 stores the compressed character image data in the PDF file as image data to be displayed as a layer higher than the compressed color image data. The compressed character image data is stored in the PDF file in association with the character color value TC and the coordinate value CD. The character color value TC is an RGB value representing the color of the character, and is the value calculated in step S620 in FIG. The coordinate value CD is information representing a position where the binary image TI represented by the compressed character image data should be arranged with respect to the color component image CI represented by the compressed color image data. The coordinate value CD is represented by, for example, the coordinate value (X, Y) of the pixel at the upper left corner of the smallest rectangle that circumscribes the binary image TI. In the example of FIG. 16B, character image data representing a binary image TI1 representing three character objects Ob4 to Ob6 includes a character color value TC1 (R1, G1, B1) and a coordinate value CD1 (X1, Y1) are associated with each other. In addition, a character color value TC2 (R2, G2, B2) and a coordinate value CD2 (X2, Y2) are associated with the binary image TI2 representing one character object Ob7.

また、生成部150は、圧縮済みのグレー画像データを、圧縮済みのカラー画像データより上位層のレイヤーとして表示する画像データとして、PDFファイルに格納する。圧縮済みのグレー画像データは、圧縮済みのグレーマスクデータと関連付けて、PDFファイルに格納される。   Further, the generation unit 150 stores the compressed gray image data in the PDF file as image data to be displayed as a layer higher than the compressed color image data. The compressed gray image data is stored in the PDF file in association with the compressed gray mask data.

圧縮PDFファイルが生成されると、例えば、スキャナドライバ100は、生成されたPDFファイルを、例えば、不揮発性記憶装置290に格納し、バッファ領域241に格納された圧縮済みの文字画像データと、圧縮済みのグレー画像データと、圧縮済みのカラー画像データと、圧縮済みのグレーマスクデータとをそれぞれ消去した後、画像処理を終了する。
PDFファイルは、複数個の異なる形式の画像データを1個のファイルに格納可能であり、当該ファイルを用いて画像を表示する際には、格納された複数個の画像データを重畳して1個の画像として再現可能なように規格が定められている。ステップS700において、生成部150は、PDF規格に従って、各圧縮済みの画像データ(図16)をPDFファイルに格納するので、本実施例にて作成された圧縮PDFファイルは、PDFファイルの閲覧ソフトを用いて表示すると、対象画像SI(図3(A))を、再現することができる。
When the compressed PDF file is generated, for example, the scanner driver 100 stores the generated PDF file in, for example, the nonvolatile storage device 290 and the compressed character image data stored in the buffer area 241 and the compressed PDF file. After erasing the already-processed gray image data, the compressed color image data, and the compressed gray mask data, the image processing is terminated.
A PDF file can store a plurality of different types of image data in a single file. When an image is displayed using the file, a plurality of stored image data is superimposed on a single file. Standards have been established so that images can be reproduced. In step S700, the generation unit 150 stores each compressed image data (FIG. 16) in a PDF file in accordance with the PDF standard. Therefore, the compressed PDF file created in this embodiment is a PDF file viewing software. When used and displayed, the target image SI (FIG. 3A) can be reproduced.

以上説明した第1実施例によれば、第1処理部131は、対象画像データのうち、文字領域に対応する部分画像データを用いて、圧縮済みの文字画像データを生成する。また、第2処理部132は、対象画像データのうち、グレー領域に対応する部分画像データを用いて、1種類の成分値で構成された圧縮済みのグレー画像データを生成する。第2処理部132は、1種類の成分値で構成されたグレー成分データを取得する処理(図15:ステップS635、S645)と、グレー成分データを圧縮する処理(図15:ステップS655)と、を行うことで圧縮済みのグレー画像データを生成する。第3処理部133は、対象画像データのうち、カラー領域に対応する部分画像データを用いて、複数種類の成分値で構成された圧縮済みのカラー画像データを生成する。第3処理部133は、複数個の成分データを含むカラー成分データを取得する処理(図15:ステップS625、S640)と、カラー成分データを圧縮する処理(図15:ステップS665)と、を行うことで圧縮済みのカラー画像データを生成する。第1処理部131と、第2処理部132と、第3処理部133と、が行う処理は、互いに異なる。この結果、文字、文字とは異なるグレー画像、文字とは異なるカラー画像とにそれぞれ適した処理を実行するので、対象画像データを効果的に圧縮して、圧縮済みの対象画像データを生成することができる。   According to the first embodiment described above, the first processing unit 131 generates compressed character image data using the partial image data corresponding to the character region in the target image data. In addition, the second processing unit 132 generates compressed gray image data composed of one type of component value using partial image data corresponding to the gray region in the target image data. The second processing unit 132 acquires gray component data composed of one type of component value (FIG. 15: steps S635 and S645), processing for compressing gray component data (FIG. 15: step S655), To generate compressed gray image data. The third processing unit 133 generates compressed color image data composed of a plurality of types of component values using partial image data corresponding to the color area in the target image data. The third processing unit 133 performs a process of acquiring color component data including a plurality of component data (FIG. 15: steps S625 and S640) and a process of compressing the color component data (FIG. 15: step S665). As a result, compressed color image data is generated. The processes performed by the first processing unit 131, the second processing unit 132, and the third processing unit 133 are different from each other. As a result, processing suitable for a character, a gray image different from the character, and a color image different from the character are executed, so that the target image data is effectively compressed to generate compressed target image data. Can do.

具体的には、階調性よりエッジの再現性が重要であると考えられる文字領域については、二値画像データをFLATE圧縮方式で圧縮して、圧縮済みの文字画像データを生成する。この結果、圧縮率を高く維持しつつ、かつ、文字の読みやすさを損なわない態様で、文字領域を表す画像を保存することができる。   Specifically, for a character region in which edge reproducibility is considered to be more important than gradation, binary image data is compressed by the FLATE compression method to generate compressed character image data. As a result, an image representing a character region can be stored in a manner that maintains a high compression ratio and does not impair the readability of characters.

さらに、エッジの再現性より階調性が重要であると考えられる写真領域を含み得る非文字領域のうち、グレー領域については、1個の成分で構成されたグレー成分データを、JPEG圧縮方式で圧縮して、圧縮済みのグレー画像データを生成する。この結果、1個の成分で構成されたグレー成分データを用いることで、圧縮率を高めることができるとともに、多階調の圧縮に適したJPEG圧縮方式を用いることで、グレーの写真などを含み得るグレー領域の画質(階調性など)を損なわない態様で、グレー領域を表す画像を保存することができる。   Further, among non-character areas that can include photographic areas where gradation is more important than edge reproducibility, for gray areas, gray component data composed of one component is converted into JPEG compression. Compressed gray image data is generated. As a result, it is possible to increase the compression rate by using gray component data composed of one component, and to include gray photographs by using the JPEG compression method suitable for multi-tone compression. An image representing the gray area can be stored in a manner that does not impair the image quality (gradation, etc.) of the obtained gray area.

さらに、エッジの再現性より階調性が重要であると考えられる写真領域を含み得る非文字領域のうち、カラー領域については、複数種類の色成分(例えば、RGBの3種類)で構成されたカラー成分データを、JPEG圧縮方式で圧縮して、圧縮済みのカラー画像データを生成する。この結果、カラー写真などを含み得るカラー領域の画質(色相や階調性)を損なわない態様で、カラー領域を表す画像を保存することができる。   Further, among the non-character areas that can include a photographic area where gradation is considered to be more important than edge reproducibility, the color area is composed of a plurality of types of color components (for example, three types of RGB). The color component data is compressed by the JPEG compression method to generate compressed color image data. As a result, an image representing the color area can be stored in a manner that does not impair the image quality (hue and gradation) of the color area that may include a color photograph.

以上の結果、文字領域と、グレー領域と、カラー領域と、を含む対象画像SIを表す対象画像データを、全体として高い画質を維持しつつ、圧縮率を向上できる形式に変換して保存することができる。   As a result, the target image data representing the target image SI including the character area, the gray area, and the color area is converted and saved in a format that can improve the compression rate while maintaining high image quality as a whole. Can do.

さらに、第2処理部132は、グレー領域に対応する部分画像データに含まれる3個の成分データ(すなわち、R成分データ、G成分データ、B成分データ)のうちの1個の成分データを選択することによって、グレー成分データを生成する(図15:ステップS635)。この結果、グレー成分データを簡単に取得することができる。   Further, the second processing unit 132 selects one component data out of three component data (that is, R component data, G component data, and B component data) included in the partial image data corresponding to the gray area. Thus, gray component data is generated (FIG. 15: step S635). As a result, gray component data can be easily obtained.

さらに、圧縮済みのグレー画像データは、図16(C)に示すグレー成分画像GIを表す画像データであり、図16(C)から解るように対象画像SIの全体に対応する領域を表す1個の画像データである。また、圧縮済みのカラー画像データは、図16(A)に示すカラー成分画像CIを表す画像データであり、図16(A)から解るように、対象画像SIの全体に対応する領域を表す1個の画像データである。この結果、例えば、比較的多数のグレー領域が存在する場合であっても、圧縮済みの画像データの数が過度に増加することを抑制できる。   Further, the compressed gray image data is image data representing the gray component image GI shown in FIG. 16C, and one piece representing an area corresponding to the entire target image SI as can be seen from FIG. Image data. Further, the compressed color image data is image data representing the color component image CI shown in FIG. 16A, and as shown in FIG. 16A, 1 represents a region corresponding to the entire target image SI. Pieces of image data. As a result, for example, even when a relatively large number of gray regions exist, it is possible to suppress an excessive increase in the number of compressed image data.

さらに、判断部125は、判断対象のオブジェクト領域に含まれる複数個の画素のうちの有彩色を表す画素の割合PNがグレー判断基準値Nth以上である場合には、判断対象のオブジェクト領域を、カラー領域であると判断し、有彩色を表す画素の割合PNがグレー判断基準値Nth未満である場合には、判断対象の領域を、グレー領域であると判断する(図11)。したがって、判断部125は、グレー領域であるか、カラー領域であるか、を適切に判断することができる。   Furthermore, when the ratio PN of pixels representing a chromatic color among the plurality of pixels included in the object region to be determined is equal to or greater than the gray determination reference value Nth, the determination unit 125 determines the object region to be determined as If it is determined that the area is a color area and the ratio PN of pixels representing a chromatic color is less than the gray determination reference value Nth, the determination target area is determined to be a gray area (FIG. 11). Therefore, the determination unit 125 can appropriately determine whether the region is a gray region or a color region.

さらに、判断部125は、処理対象のオブジェクト領域に含まれる色数C(言い換えれば、色の種類の数)に応じて、文字領域と、グレー領域およびカラー領域を含む非文字領域と、を特定する(図9、図10)。この結果、特定部120は、色数Cで表される領域の階調性の違いを利用して、文字領域と、非文字領域とを、精度良く特定することができる。   Further, the determination unit 125 identifies a character region and a non-character region including a gray region and a color region according to the number of colors C (in other words, the number of color types) included in the object region to be processed. (FIGS. 9 and 10). As a result, the specification unit 120 can specify the character region and the non-character region with high accuracy by using the difference in gradation of the region represented by the number of colors C.

さらに、上記実施例では、特定部120は、ラベリングや統合処理(図5)を行うことにより、文字領域を文字の色毎に分離して特定する。そして、文字領域ごとに圧縮された二値データを作成して、各二値データに文字色値TCを関連付けている(図16)。したがって、文字色を再現しつつ、高い圧縮率で圧縮された圧縮PDFファイルを作成することができる。   Further, in the above-described embodiment, the specifying unit 120 performs the labeling and the integration process (FIG. 5) to separate and specify the character area for each character color. Then, binary data compressed for each character area is created, and a character color value TC is associated with each binary data (FIG. 16). Therefore, it is possible to create a compressed PDF file that is compressed at a high compression rate while reproducing the character color.

B.第2実施例
図17は、第2実施例の低減処理のフローチャートである。図17において、第1実施例の低減処理(図15)と同一のステップには、図15と同一の符号を付し、第1実施例の低減処理と異なるステップには、符号の末尾に「A」を付した。
B. Second Embodiment FIG. 17 is a flowchart of a reduction process according to the second embodiment. In FIG. 17, the same steps as those of the reduction process (FIG. 15) of the first embodiment are denoted by the same reference numerals as those of FIG. 15, and steps different from those of the reduction process of the first embodiment are denoted by “ A ”is attached.

第2実施例の低減処理では、第1実施例におけるステップS645、S647(図15)に代えて、図17に示すステップS645A、S647Aを実行し、第1実施例におけるステップS655、S660を実行しない。   In the reduction process of the second embodiment, steps S645A and S647A shown in FIG. 17 are executed instead of steps S645 and S647 (FIG. 15) in the first embodiment, and steps S655 and S660 in the first embodiment are not executed. .

図17のステップS645Aでは、第2処理部132は、ステップS635にて取得されて、バッファ領域241に格納されている処理対象のグレー領域の画像を表す1個の成分データの階調数(例えば、255階調)を低減して、グレー領域の画像を表すグレー成分データを生成する。本実施例では、第2処理部132は、グレー領域の画像を表す1個の成分データを二値データに変換する(階調数を2階調に低減する)。   In step S645A of FIG. 17, the second processing unit 132 acquires the number of gradations of one component data (for example, representing the image of the gray area to be processed that is acquired in step S635 and stored in the buffer area 241). Gray component data representing a gray region image is generated. In the present embodiment, the second processing unit 132 converts one component data representing a gray area image into binary data (reducing the number of gradations to two gradations).

続くステップS647Aでは、第2処理部132は、ステップS645Aで生成された2階調のグレー成分データを、比較的階調数の少ない画像の圧縮に適したFLATE圧縮方式により圧縮して、圧縮済みのグレー成分データを生成する。本ステップにおいて、処理対象のグレー領域の画像を表す圧縮済みのグレー画像データが生成される。生成された圧縮済みのグレー画像データは、バッファ領域241に格納され、圧縮前の二値化された成分データは、消去される。   In the subsequent step S647A, the second processing unit 132 compresses the two-gradation gray component data generated in step S645A by using the FLATE compression method suitable for compressing an image having a relatively small number of gradations. Of gray component data is generated. In this step, compressed gray image data representing the gray region image to be processed is generated. The generated compressed gray image data is stored in the buffer area 241 and the binarized component data before compression is deleted.

以上の説明から解るように、本実施例では、グレー領域毎に、圧縮済みのグレー画像データが生成される。従って、複数個のグレー領域が存在する場合には、複数個の圧縮済みのグレー画像データが生成されて、バッファ領域241に格納される。   As can be understood from the above description, in this embodiment, compressed gray image data is generated for each gray region. Accordingly, when there are a plurality of gray areas, a plurality of compressed gray image data are generated and stored in the buffer area 241.

第2実施例の低減処理では、グレー領域毎に圧縮済みのグレー画像データが生成されるので、第1実施例のステップS655の処理(1個のグレー成分データを圧縮する処理)は、存在しない。また、第2実施例の低減処理では、圧縮済みのグレー画像データは二値データであるので、カラー成分画像CIと重畳された場合に、表示すべき画素(すなわち、画素値「1」の画素)と、表示しない画素(すなわち、画素値「0」の画素)と、の区別は明らかである。このために、第2実施例の低減処理では、グレーマスクデータ(図16(D))が生成されない。したがって、第2実施例の低減処理では、第1実施例のステップS660の処理は、存在しない。   In the reduction process of the second embodiment, compressed gray image data is generated for each gray area, and therefore the process of step S655 of the first embodiment (a process of compressing one gray component data) does not exist. . In the reduction process of the second embodiment, the compressed gray image data is binary data. Therefore, when superimposed on the color component image CI, the pixel to be displayed (that is, the pixel having the pixel value “1”). ) And non-displayed pixels (that is, pixels having a pixel value “0”) are clear. For this reason, gray mask data (FIG. 16D) is not generated in the reduction process of the second embodiment. Therefore, in the reduction process of the second embodiment, the process of step S660 of the first embodiment does not exist.

図18は、第2実施例の低減処理で生成される画像データについて説明する図である。
第2実施例の低減処理では、図3(A)の対象画像SIを表す対象画像データを用いる場合には、図18に示すように、1個の圧縮済みのカラー成分データ(図18(A))と、2個の圧縮済みの文字画像データ(図18(B))と、2個の圧縮済みのグレー成分データ(図18(C))と、が生成されて、バッファ領域241に、それぞれ格納される。
FIG. 18 is a diagram for explaining image data generated by the reduction process of the second embodiment.
In the reduction process of the second embodiment, when the target image data representing the target image SI of FIG. 3A is used, as shown in FIG. 18, one compressed color component data (FIG. 18A )), Two compressed character image data (FIG. 18B), and two compressed gray component data (FIG. 18C) are generated in the buffer area 241. Each is stored.

1個の圧縮済みのカラー成分データ(図18(A))と、2個の圧縮済みの文字画像データ(図18(B))とは、第1実施例の同名のデータ(図16(A)、図16(B))と同じである。   One compressed color component data (FIG. 18A) and two compressed character image data (FIG. 18B) are data having the same name in the first embodiment (FIG. 16A). ) And FIG. 16 (B)).

圧縮済みのグレー成分データは、グレー領域、すなわち、グレーと判断された非文字オブジェクト領域毎に生成され、グレー領域に外接する最小矩形に対応するサイズを有する二値画像を表すデータである。したがって、図18(C)の例では、2個のグレーオブジェクトOb1、Ob2をそれぞれ表す2個の二値画像GI1、GI2をそれぞれ表す2個の圧縮済みのグレー画像データが生成される。図2のステップS700にて、二値画像GI1を表す圧縮済みのグレー画像データは、座標値CD3(X3、Y3)と関連付けて、PDFファイルに格納され、二値画像GI2を表す圧縮済みのグレー画像データは、座標値CD4(X4、Y4)と関連付けて、PDFファイルに格納される。   The compressed gray component data is data representing a binary image having a size corresponding to a minimum rectangle circumscribing the gray region, which is generated for each gray region, that is, a non-character object region determined to be gray. Accordingly, in the example of FIG. 18C, two compressed gray image data respectively representing two binary images GI1 and GI2 representing two gray objects Ob1 and Ob2 are generated. In step S700 of FIG. 2, the compressed gray image data representing the binary image GI1 is stored in the PDF file in association with the coordinate value CD3 (X3, Y3), and the compressed gray image representing the binary image GI2 is stored. The image data is stored in the PDF file in association with the coordinate value CD4 (X4, Y4).

以上説明した第2実施例によれば、第1実施例と同様に、文字領域と、グレー領域と、カラー領域と、を含む対象画像SIを表す対象画像データを、全体として高い画質を維持しつつ、圧縮率を向上できる形式に変換して保存することができる。   According to the second embodiment described above, as in the first embodiment, the target image data representing the target image SI including the character area, the gray area, and the color area is maintained with high image quality as a whole. However, it can be converted and saved in a format that can improve the compression rate.

さらに、第2実施例によれば、第2処理部132は、グレー成分データに含まれる成分値の諧調数を減らす処理を実行する(図17:ステップS645A)。この結果、さらに、グレー成分データのデータ量を低減することができる。   Furthermore, according to the second embodiment, the second processing unit 132 executes a process for reducing the number of gradations of the component values included in the gray component data (FIG. 17: step S645A). As a result, the amount of gray component data can be further reduced.

さらに、グレー成分データの階調数を2階調に減らしたことに応じて、グレー成分データを圧縮する圧縮方式に、比較的少ない階調に適したFLATE圧縮方式が採用されている(図17:ステップS647A)。この結果、グレー成分データの階調数に応じて、より圧縮率の向上を図ることができる。   Further, the FLATE compression method suitable for relatively few gradations is adopted as the compression method for compressing the gray component data in accordance with the reduction of the number of gradations of the gray component data to 2 gradations (FIG. 17). : Step S647A). As a result, the compression rate can be further improved according to the number of gray levels of the gray component data.

また、圧縮済みのカラー画像データは、対象画像SIの全体に対応する領域(すなわち、カラー成分画像CI(図18(A)))を表す1個の画像データである。そして、圧縮済みのグレー画像データは、対象画像SIの一部分に対応する領域を表す1個以上のグレー成分画像(図18(C)の例では、2個のグレー成分画像GI1、GI2)を表す1個以上の部分画像データである。1個以上の圧縮済みのグレー画像データは、対象画像SI内の位置を表す位置情報(図18の例では、座標値CD1、CD2)と対応付けられている。この結果、例えば、グレー領域が比較的小さい場合に、一部分の領域のグレー画像データを保持すれば良いので、効率的である。   The compressed color image data is one piece of image data representing an area (that is, the color component image CI (FIG. 18A)) corresponding to the entire target image SI. The compressed gray image data represents one or more gray component images (two gray component images GI1 and GI2 in the example of FIG. 18C) that represent an area corresponding to a part of the target image SI. One or more partial image data. One or more compressed gray image data is associated with position information (coordinate values CD1, CD2 in the example of FIG. 18) indicating the position in the target image SI. As a result, for example, when the gray area is relatively small, it is only necessary to hold gray image data of a partial area, which is efficient.

C.変形例:
(1)上記第1および第2実施例では、圧縮済みの文字画像データの生成には、FLATE圧縮方式が採用されているが、これに限られない。例えば、二値画像データの圧縮に適した他の圧縮方式が採用されても良く、例えば、可逆圧縮方式であるMMR(Modified Modified Read)方式(CCITT-G4方式とも呼ばれる。)が採用されても良い。
C. Variations:
(1) In the first and second embodiments, the FLATE compression method is used to generate compressed character image data. However, the present invention is not limited to this. For example, another compression method suitable for compression of binary image data may be employed. For example, an MMR (Modified Modified Read) method (also referred to as CCITT-G4 method) that is a lossless compression method may be employed. good.

(2)上記第1実施例では、圧縮済みのグレー画像データの生成および圧縮済みのカラー画像データの生成には、共にJPEG圧縮方式が採用されているが、これに限られない。例えば、GIF(Graphic Interchange Format)形式や、TIFF(Tagged Image File Format)形式の画像ファイルの圧縮に用いられるLZW圧縮などが採用されても良い。 (2) In the first embodiment, the JPEG compression method is employed for both the generation of compressed gray image data and the generation of compressed color image data. However, the present invention is not limited to this. For example, the GIF (Graphic Interchange Format) format or the LZW compression used for compressing the TIFF (Tagged Image File Format) format image file may be employed.

(3)上記第2実施例のステップS645A(図17)では、第2処理部132は、処理対象のグレー領域の画像を表す1個の成分データの階調数(例えば、255階調(8ビット))を2階調(1ビット)に低減しているが、これに限られない。これに代えて、第2処理部132は、グレー領域の画像を表す1個の成分データの階調数を、4階調(2ビット)、8階調(3ビット)、16階調(4ビット)、32階調(5ビット)、64階調(6ビット)、128階調(7ビット)のいずれかに低減しても良い。 (3) In step S645A (FIG. 17) of the second embodiment, the second processing unit 132 determines the number of gradations of one component data (eg, 255 gradations (8 Bit)) is reduced to 2 gradations (1 bit), but is not limited thereto. Instead, the second processing unit 132 sets the number of gradations of one component data representing the gray area image to 4 gradations (2 bits), 8 gradations (3 bits), and 16 gradations (4 Bit), 32 gradations (5 bits), 64 gradations (6 bits), or 128 gradations (7 bits).

(4)スキャナドライバ100は、第1実施例における画像処理の一部の処理と、第2実施例における画像処理の一部の処理と、を組合わせた画像処理を実行しても良い。具体的には、スキャナドライバ100は、第1実施例の低減処理(図15)のステップS635にて取得されたグレー領域内の画像を表す1個の成分データに対して、第2実施例の低減処理(図17)のステップS645Aの階調数を低減する処理を実行しても良い。この場合には、階調数が低減された1個のグレー成分データであって、対象画像SIの全体に対応する領域を表す1個のグレー成分データが生成される。逆に、スキャナドライバ100は、第2実施例の低減処理(図7)において、ステップS645Aの階調数を低減する処理は、省略されても良い。この場合には、階調数が低減されていない、例えば、256階調の成分値で構成された1個以上のグレー成分データであって、対象画像SIの一部分に対応する領域を表す1個以上のグレー成分データが生成される。 (4) The scanner driver 100 may execute image processing in which part of the image processing in the first embodiment and part of the image processing in the second embodiment are combined. Specifically, the scanner driver 100 applies the one component data representing the image in the gray area acquired in step S635 of the reduction process (FIG. 15) of the first embodiment to the second embodiment. You may perform the process which reduces the number of gradations of step S645A of a reduction process (FIG. 17). In this case, one piece of gray component data with a reduced number of gradations and one piece of gray component data representing an area corresponding to the entire target image SI is generated. Conversely, the scanner driver 100 may omit the process of reducing the number of gradations in step S645A in the reduction process (FIG. 7) of the second embodiment. In this case, the number of gradations is not reduced, for example, one or more pieces of gray component data composed of component values of 256 gradations, each representing an area corresponding to a part of the target image SI The above gray component data is generated.

(5)上記第1実施例では、ステップS635(図15)において、第2処理部132は、対象画像データのうち、処理対象のグレー領域に対応する部分画像データに含まれる3個の成分データ(すなわち、R成分データ、G成分データ、B成分データ)のうちの1個の成分データを選択することによって、グレー領域を表す1個の成分データを取得している。これに代えて、第2処理部132は、処理対象のグレー領域内の画像を表す1個の成分データを、当該グレー領域に対応する部分画像データに含まれる3個の成分データ(すなわち、R成分データ、G成分データ、B成分データ)を用いて生成しても良い。具体的には、第2処理部132は、当該グレー領域内の複数個の画素のそれぞれの輝度値Yを、以下の式によって算出しても良い。
Y=R×0.29891+G×0.58661+B×0.11448
上記の式のR、G、Bは、3個の成分データの対応する画素の画素値、すなわち、R成分値、G成分値、B成分値である。第2処理部132は、算出された輝度値を各画素の1個の成分値とする1個の成分データを、当該グレー領域内の画像を表す1個の成分データとしても良い。
(5) In the first embodiment, in step S635 (FIG. 15), the second processing unit 132 includes, among the target image data, three component data included in the partial image data corresponding to the gray area to be processed. One component data representing a gray region is acquired by selecting one component data from among (ie, R component data, G component data, B component data). Instead, the second processing unit 132 converts one component data representing an image in the gray area to be processed into three component data (that is, R data) included in the partial image data corresponding to the gray area. (Component data, G component data, B component data) may be used. Specifically, the second processing unit 132 may calculate the luminance value Y of each of the plurality of pixels in the gray area using the following formula.
Y = R × 0.29871 + G × 0.58661 + B × 0.11448
R, G, and B in the above formula are the pixel values of the corresponding pixels of the three component data, that is, the R component value, the G component value, and the B component value. The second processing unit 132 may use one component data having the calculated luminance value as one component value of each pixel as one component data representing an image in the gray area.

(6)図2:ステップS150におけるエッジ強度Seの算出や、図12のステップS5532におけるエッジ強度EPの算出の算出式としては、図5のソーベルオペレータを用いた算出法に限らず、他の任意の方法を採用可能である。例えば、プレウィットオペレータ(Prewitt operator)、または、ロバーツクロスオペレータ(Roberts Cross operator)など種々のエッジ検出用オペレータを利用可能である。また、エッジ強度は、RGBの各色成分に限らず、他の色成分(例えば、輝度)の階調値を用いて算出されてもよい。 (6) FIG. 2: The calculation formula of the edge strength Se in step S150 and the calculation formula of the edge strength EP in step S5532 in FIG. 12 are not limited to the calculation method using the Sobel operator in FIG. Any method can be adopted. For example, various edge detection operators such as a Prewitt operator or a Roberts Cross operator can be used. The edge strength is not limited to the RGB color components, and may be calculated using gradation values of other color components (for example, luminance).

(7)上記実施例では、判断部125は、各画素の色が有彩色であるか否かの判断を、Lab色空間を用いて行っている。すなわち、判断部125は、当該画素の画素値(言い換えれば、色値)をLab色空間の表色値に変換して、当該表色値とLab色空間の無彩色軸との距離Rが、基準距離Rth未満か否かによって、当該画素の色が有彩色であるか否か判断している。これに限らず、一般的には、判断部125は、無彩色軸を有する任意の色空間、例えば、RGB色空間、Lab色空間、HSV色空間、YCrCb色空間において、無彩色軸に比較的近い色を表す画素を、無彩色を有する画素であると判断し、無彩色軸から比較的遠い色を表す画素を、有彩色を有する画素であると判断すれば良い。 (7) In the above-described embodiment, the determination unit 125 determines whether the color of each pixel is a chromatic color using the Lab color space. That is, the determination unit 125 converts the pixel value of the pixel (in other words, the color value) into a color value of the Lab color space, and the distance R between the color value and the achromatic color axis of the Lab color space is Whether or not the color of the pixel is a chromatic color is determined based on whether or not the distance is less than the reference distance Rth. However, the determination unit 125 is not limited to this, and in general, the determination unit 125 is relatively in the achromatic color axis in an arbitrary color space having an achromatic color axis, for example, an RGB color space, a Lab color space, an HSV color space, and a YCrCb color space. A pixel representing a close color may be determined to be a pixel having an achromatic color, and a pixel representing a color relatively far from the achromatic color axis may be determined to be a pixel having a chromatic color.

(8)計算機200のスキャナドライバ100による画像処理機能は、光学的に対象物を読み取ることによって対象物を表す画像データを生成する画像読取部を含む画像処理装置によって実現されてもよい(例えば、複合機400やスキャナ300や図示しないデジタルカメラ)。この場合には、画像処理装置は、自身の画像読取部によって生成された画像データを用いて、画像処理(例えば、図2の処理)を行えばよい。 (8) The image processing function by the scanner driver 100 of the computer 200 may be realized by an image processing apparatus including an image reading unit that generates image data representing an object by optically reading the object (for example, MFP 400, scanner 300, or digital camera (not shown). In this case, the image processing apparatus may perform image processing (for example, the processing in FIG. 2) using the image data generated by its own image reading unit.

一般的には、画像処理(例えば、図2の処理)を実現する画像処理装置は、計算機200に限らず、種々の装置であってよい。例えば、プリンタ、デジタルカメラ、スキャナなどの画像関連機器の内部のコンピュータ、汎用のパーソナルコンピュータ、ネットワークに接続されたサーバ等を採用可能である。また、ネットワークを介して互いに通信可能な複数個のコンピュータが、画像処理に要する機能を一部ずつ分担して、全体として、画像処理の機能を提供してもよい。この場合、複数個のコンピュータの全体が、特許請求の範囲における画像処理装置に対応する。   In general, an image processing apparatus that realizes image processing (for example, the process of FIG. 2) is not limited to the computer 200, and may be various apparatuses. For example, a computer inside an image-related device such as a printer, a digital camera, or a scanner, a general-purpose personal computer, a server connected to a network, or the like can be employed. A plurality of computers that can communicate with each other via a network may share a part of the functions required for image processing and provide the image processing functions as a whole. In this case, the entirety of the plurality of computers corresponds to the image processing apparatus in the claims.

(9)上記各実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部あるいは全部をハードウェアに置き換えるようにしてもよい。 (9) In each of the above embodiments, a part of the configuration realized by hardware may be replaced with software, and conversely, part or all of the configuration realized by software is replaced with hardware. You may do it.

以上、実施例、変形例に基づき本発明について説明してきたが、上記した発明の実施の形態は、本発明の理解を容易にするためのものであり、本発明を限定するものではない。本発明は、その趣旨並びに特許請求の範囲を逸脱することなく、変更、改良され得ると共に、本発明にはその等価物が含まれる。   As mentioned above, although this invention was demonstrated based on the Example and the modification, Embodiment mentioned above is for making an understanding of this invention easy, and does not limit this invention. The present invention can be changed and improved without departing from the spirit and scope of the claims, and equivalents thereof are included in the present invention.

100...スキャナドライバ、110...取得部、120...特定部、125...判断部、130...低減処理部、131...第1処理部、132...第2処理部、133...第3処理部、150...生成部、200...計算機、210...CPU、240...揮発性記憶装置、241...バッファ領域、270...操作部、280...通信部、290...不揮発性記憶装置、291...ドライバプログラム、292...判断テーブル、300...スキャナ、400...複合機     DESCRIPTION OF SYMBOLS 100 ... Scanner driver, 110 ... Acquisition part, 120 ... Identification part, 125 ... Judgment part, 130 ... Reduction process part, 131 ... 1st process part, 132 ... 1st 2 processing units, 133 ... third processing unit, 150 ... generation unit, 200 ... computer, 210 ... CPU, 240 ... volatile storage device, 241 ... buffer area, 270. ..Operation unit, 280 ... communication unit, 290 ... nonvolatile storage device, 291 ... driver program, 292 ... judgment table, 300 ... scanner, 400 ... multifunction device

Claims (10)

対象画像を表す対象画像データであって、複数の色成分に対応する複数の成分データを含む対象画像データを取得する取得部と、
前記対象画像において、文字を表す文字領域と、文字とは異なるグレー画像を表すグレー領域と、文字とは異なるカラー画像を表すカラー領域と、を特定する特定部と、
前記対象画像データのデータサイズを低減するための低減処理部であって、
前記文字領域に対応する部分画像データを用いて、第1の処理を実行することによって、圧縮済みの文字画像データを生成する第1処理部と、
前記グレー領域に対応する部分画像データを用いて、前記第1の処理とは異なる第2の処理を実行することによって、1種類の成分値で構成された圧縮済みのグレー画像データを生成する第2処理部であって、前記第2の処理は、1種類の成分値で構成されたグレー成分データを取得する処理と、前記グレー成分データを圧縮する処理と、を行うことで前記圧縮済みのグレー画像データを生成することを含む、前記第2処理部と、
前記カラー領域に対応する部分画像データを用いて、前記第1の処理および前記第2の処理とは異なる第3の処理を実行することによって、複数種類の成分値で構成された圧縮済みのカラー画像データを生成する第3処理部であって、前記第3の処理は、複数の成分データを含むカラー成分データを取得する処理と、前記カラー成分データを圧縮する処理と、を行うことで前記圧縮済みのカラー画像データを生成することを含む、前記第3処理部と、
を有する、前記低減処理部と、
前記圧縮済みの文字画像データと、前記圧縮済みのグレー画像データと、前記圧縮済みのカラー画像データと、を用いて、前記対象画像を表す圧縮済みの対象画像データを生成する生成部と、
を備える、画像処理装置。
An acquisition unit that acquires target image data that represents a target image and includes a plurality of component data corresponding to a plurality of color components;
In the target image, a specifying unit that specifies a character region representing a character, a gray region representing a gray image different from the character, and a color region representing a color image different from the character,
A reduction processing unit for reducing the data size of the target image data,
A first processing unit that generates compressed character image data by executing a first process using partial image data corresponding to the character region;
A second process different from the first process is executed using the partial image data corresponding to the gray area, thereby generating compressed gray image data composed of one type of component value. A second processing unit, wherein the second processing is performed by performing processing for obtaining gray component data composed of one kind of component value and processing for compressing the gray component data; Generating the gray image data, the second processing unit;
By executing a third process different from the first process and the second process using partial image data corresponding to the color area, a compressed color composed of a plurality of types of component values A third processing unit for generating image data, wherein the third process performs a process of acquiring color component data including a plurality of component data and a process of compressing the color component data. Generating the compressed color image data, the third processing unit;
The reduction processing unit,
A generating unit that generates compressed target image data representing the target image using the compressed character image data, the compressed gray image data, and the compressed color image data;
An image processing apparatus comprising:
請求項1に記載の画像処理装置であって、
前記グレー成分データは、前記グレー領域に対応する部分画像データに含まれる前記複数の成分データの中から選択された1個の成分データを含む、画像処理装置。
The image processing apparatus according to claim 1,
The image processing apparatus, wherein the gray component data includes one component data selected from the plurality of component data included in the partial image data corresponding to the gray region.
請求項1または請求項2に記載の画像処理装置であって、
前記第2処理部による前記グレー成分データの圧縮に用いられる圧縮方式と、前記第3処理部による前記カラー成分データに含まれる前記複数の成分データのそれぞれの圧縮に用いられる圧縮方式とは、同じ方式である、画像処理装置。
The image processing apparatus according to claim 1 or 2,
The compression method used for compression of the gray component data by the second processing unit and the compression method used for compression of each of the plurality of component data included in the color component data by the third processing unit are the same An image processing apparatus.
請求項1ないし請求項3のいずれかに記載の画像処理装置であって、
前記2の処理は、前記グレー成分データに含まれる成分値の諧調数を減らす処理を含む、画像処理装置。
An image processing apparatus according to any one of claims 1 to 3,
The image processing apparatus according to claim 2, wherein the second process includes a process of reducing the number of gradations of component values included in the gray component data.
請求項1ないし請求項4のいずれかに記載の画像処理装置であって、
前記圧縮済みのグレー画像データは、前記対象画像の全体に対応する領域を表す1個の画像データであり、
前記圧縮済みのカラー画像データは、前記対象画像の全体に対応する領域を表す1個の画像データである、画像処理装置。
An image processing apparatus according to any one of claims 1 to 4,
The compressed gray image data is a piece of image data representing an area corresponding to the entire target image,
The image processing apparatus, wherein the compressed color image data is one piece of image data representing an area corresponding to the entire target image.
請求項1ないし請求項4のいずれかに記載の画像処理装置であって、
前記圧縮済みのカラー画像データは、前記対象画像の全体に対応する領域を表す1個の画像データであり、
前記圧縮済みのグレー画像データは、前記対象画像の一部分に対応する領域を表す1個以上の画像データであり、前記対象画像内の位置を表す位置情報と対応付けられている、画像処理装置。
An image processing apparatus according to any one of claims 1 to 4,
The compressed color image data is one piece of image data representing an area corresponding to the entire target image,
The compressed gray image data is one or more pieces of image data representing a region corresponding to a part of the target image, and is associated with position information representing a position in the target image.
請求項1ないし請求項6のいずれかに記載の画像処理装置であって、
前記特定部は、前記対象画像内の領域が、前記グレー領域であるか、前記カラー領域であるか、を判断する判断部を備え、
前記判断部は、判断対象の領域に含まれる有彩色を表す画素の割合が基準値以上である場合には、前記判断対象の領域を、前記カラー領域であると判断し、
前記判断部は、判断対象の領域に含まれる有彩色を表す画素の割合が基準値未満である場合には、前記判断対象の領域を、前記グレー領域であると判断する、画像処理装置。
An image processing apparatus according to any one of claims 1 to 6,
The specifying unit includes a determination unit that determines whether an area in the target image is the gray area or the color area,
The determination unit determines that the determination target area is the color area when the ratio of pixels representing a chromatic color included in the determination target area is equal to or greater than a reference value.
The image processing apparatus, wherein the determination unit determines that the determination target area is the gray area when a ratio of pixels representing a chromatic color included in the determination target area is less than a reference value.
請求項7に記載の画像処理装置であって、
前記判断部は、前記判断対象の領域に含まれる複数の画素の中から、前記判断対象の領域の外縁部分に位置する複数の外縁画素を除いた複数の画素を用いて、前記グレー領域であるか、前記カラー領域であるか、を判断する、画像処理装置。
The image processing apparatus according to claim 7,
The determination unit is the gray region by using a plurality of pixels excluding a plurality of outer edge pixels located at an outer edge portion of the determination target region from a plurality of pixels included in the determination target region. Or an image processing apparatus for determining whether the color area is present.
請求項1ないし請求項8に記載の画像処理装置であって、
前記特定部は、処理対象の領域に含まれる色の種類の数に応じて、前記文字領域と、前記グレー領域および前記カラー領域を含む領域と、を特定する、画像処理装置。
The image processing apparatus according to claim 1, wherein:
The specifying unit specifies the character region and the region including the gray region and the color region according to the number of types of colors included in the processing target region.
対象画像を表す対象画像データであって、複数の色成分に対応する複数の成分データを含む対象画像データを取得する取得機能と、
前記対象画像において、文字を表す文字領域と、文字とは異なるグレー画像を表すグレー領域と、文字とは異なるカラー画像を表すカラー領域と、を特定する特定機能と、
前記対象画像データのデータサイズを低減するための低減処理機能であって、
前記文字領域に対応する部分画像データを用いて、第1の処理を実行することによって、圧縮済みの文字画像データを生成する第1処理機能と、
前記グレー領域に対応する部分画像データを用いて、前記第1の処理とは異なる第2の処理を実行することによって、1種類の成分値で構成された圧縮済みのグレー画像データを生成する第2処理機能であって、前記第2の処理は、1種類の成分値で構成されたグレー成分データを取得する処理と、前記グレー成分データを圧縮する処理と、を行うことで前記圧縮済みのグレー画像データを生成することを含む、前記第2処理機能と、
前記カラー領域に対応する部分画像データを用いて、前記第1の処理および前記第2の処理とは異なる第3の処理を実行することによって、複数種類の成分値で構成された圧縮済みのカラー画像データを生成する第3処理機能であって、前記第3の処理は、複数の成分データを含むカラー成分データを取得する処理と、前記カラー成分データを圧縮する処理と、を行うことで前記圧縮済みのカラー画像データを生成することを含む、前記第3処理機能と、
を有する、前記低減処理機能と、
前記圧縮済みの文字画像データと、前記圧縮済みのグレー画像データと、前記圧縮済みのカラー画像データと、を用いて、前記対象画像を表す圧縮済みの対象画像データを生成する生成機能と、
をコンピュータに実現させる、コンピュータプログラム。
An acquisition function for acquiring target image data representing a target image, the target image data including a plurality of component data corresponding to a plurality of color components;
In the target image, a specific function for specifying a character region representing a character, a gray region representing a gray image different from the character, and a color region representing a color image different from the character;
A reduction processing function for reducing the data size of the target image data,
A first processing function for generating compressed character image data by executing a first process using partial image data corresponding to the character region;
A second process different from the first process is executed using the partial image data corresponding to the gray area, thereby generating compressed gray image data composed of one type of component value. A second processing function, wherein the second processing is performed by performing processing for obtaining gray component data composed of one type of component value and processing for compressing the gray component data. Generating said second image function, comprising generating gray image data;
By executing a third process different from the first process and the second process using partial image data corresponding to the color area, a compressed color composed of a plurality of types of component values A third processing function for generating image data, wherein the third processing performs processing for acquiring color component data including a plurality of component data and processing for compressing the color component data; Generating said compressed color image data, said third processing function;
The reduction processing function,
A generation function for generating compressed target image data representing the target image using the compressed character image data, the compressed gray image data, and the compressed color image data;
A computer program that causes a computer to realize
JP2012218014A 2012-09-28 2012-09-28 Image processing apparatus and computer program Active JP6145983B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012218014A JP6145983B2 (en) 2012-09-28 2012-09-28 Image processing apparatus and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012218014A JP6145983B2 (en) 2012-09-28 2012-09-28 Image processing apparatus and computer program

Publications (2)

Publication Number Publication Date
JP2014072750A true JP2014072750A (en) 2014-04-21
JP6145983B2 JP6145983B2 (en) 2017-06-14

Family

ID=50747566

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012218014A Active JP6145983B2 (en) 2012-09-28 2012-09-28 Image processing apparatus and computer program

Country Status (1)

Country Link
JP (1) JP6145983B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508721A (en) * 2018-11-08 2019-03-22 烟台职业学院 The realization of figure identification and color identification based on OpenCV

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03104380A (en) * 1989-09-19 1991-05-01 Nippon Telegr & Teleph Corp <Ntt> Character separation coding method
JPH03231565A (en) * 1990-02-06 1991-10-15 Canon Inc Picture coding device
JPH04220086A (en) * 1990-12-19 1992-08-11 Ricoh Co Ltd Image data control system
JPH06152985A (en) * 1992-11-13 1994-05-31 Fuji Xerox Co Ltd Picture encoder and decoder
JPH06225167A (en) * 1993-01-22 1994-08-12 Sharp Corp Digital color copying machine
JPH0774966A (en) * 1993-09-02 1995-03-17 Canon Inc Picture processor
JPH0856287A (en) * 1994-08-15 1996-02-27 Toshiba Corp Image discrimination device
JPH08228294A (en) * 1994-11-30 1996-09-03 Xerox Corp Picture compressing device and data compressing method
JPH11252381A (en) * 1998-03-03 1999-09-17 Minolta Co Ltd Image processor
JP2001143076A (en) * 1999-11-11 2001-05-25 Fuji Xerox Co Ltd Image processor
JP2004140683A (en) * 2002-10-18 2004-05-13 Ricoh Co Ltd Image processor
JP2005027037A (en) * 2003-07-02 2005-01-27 Canon Inc Format conversion method and image processing apparatus
JP2005124066A (en) * 2003-10-20 2005-05-12 Kyocera Mita Corp Color image processor and color image data compression method
JP2006054817A (en) * 2004-08-16 2006-02-23 Fuji Xerox Co Ltd Document processor
JP2006262258A (en) * 2005-03-18 2006-09-28 Fuji Xerox Co Ltd Image processor, and image processing method and program
JP2007174606A (en) * 2005-12-26 2007-07-05 Seiko Epson Corp Image output apparatus and image output method
JP2008153948A (en) * 2006-12-18 2008-07-03 Ricoh Co Ltd Image processing method, image processing apparatus, image processing program, and computer readable recording medium recorded the same

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03104380A (en) * 1989-09-19 1991-05-01 Nippon Telegr & Teleph Corp <Ntt> Character separation coding method
JPH03231565A (en) * 1990-02-06 1991-10-15 Canon Inc Picture coding device
JPH04220086A (en) * 1990-12-19 1992-08-11 Ricoh Co Ltd Image data control system
JPH06152985A (en) * 1992-11-13 1994-05-31 Fuji Xerox Co Ltd Picture encoder and decoder
JPH06225167A (en) * 1993-01-22 1994-08-12 Sharp Corp Digital color copying machine
JPH0774966A (en) * 1993-09-02 1995-03-17 Canon Inc Picture processor
JPH0856287A (en) * 1994-08-15 1996-02-27 Toshiba Corp Image discrimination device
JPH08228294A (en) * 1994-11-30 1996-09-03 Xerox Corp Picture compressing device and data compressing method
JPH11252381A (en) * 1998-03-03 1999-09-17 Minolta Co Ltd Image processor
JP2001143076A (en) * 1999-11-11 2001-05-25 Fuji Xerox Co Ltd Image processor
JP2004140683A (en) * 2002-10-18 2004-05-13 Ricoh Co Ltd Image processor
JP2005027037A (en) * 2003-07-02 2005-01-27 Canon Inc Format conversion method and image processing apparatus
JP2005124066A (en) * 2003-10-20 2005-05-12 Kyocera Mita Corp Color image processor and color image data compression method
JP2006054817A (en) * 2004-08-16 2006-02-23 Fuji Xerox Co Ltd Document processor
JP2006262258A (en) * 2005-03-18 2006-09-28 Fuji Xerox Co Ltd Image processor, and image processing method and program
JP2007174606A (en) * 2005-12-26 2007-07-05 Seiko Epson Corp Image output apparatus and image output method
JP2008153948A (en) * 2006-12-18 2008-07-03 Ricoh Co Ltd Image processing method, image processing apparatus, image processing program, and computer readable recording medium recorded the same

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508721A (en) * 2018-11-08 2019-03-22 烟台职业学院 The realization of figure identification and color identification based on OpenCV

Also Published As

Publication number Publication date
JP6145983B2 (en) 2017-06-14

Similar Documents

Publication Publication Date Title
JP5958023B2 (en) Image processing apparatus and image processing program
JP5935454B2 (en) Image processing apparatus and image processing program
JP6098298B2 (en) Image processing apparatus and computer program
JPH11220632A (en) Picture processor and picture processing method and medium for recording picture processing control program
EP2645697B1 (en) Image processing apparatus and method
JP5939154B2 (en) Image processing apparatus and computer program
JP2009232085A (en) Image processing method, image processor, image forming apparatus, program, and storage medium
JP2005521116A (en) Device for detecting edges in image blocks
JP3931651B2 (en) Image processing device
JP2003289550A (en) Data storage format, image data storing method, and storage data using method
JP2004229261A (en) Image-compressing method, image-compressing device, program, and recording media
JP6145983B2 (en) Image processing apparatus and computer program
US7177476B2 (en) Method of decoding data encoded in a monochrome medium
JP4453979B2 (en) Image reproducing apparatus, image reproducing method, program, and recording medium
JP4857975B2 (en) Image processing system and image processing program
CN110674336A (en) System for identifying and retrieving image files
JP4648073B2 (en) Image processing apparatus, image reading apparatus including the same, and image processing method
JP3838981B2 (en) Image processing apparatus, image processing method, and image processing program
JP4228905B2 (en) Image processing apparatus and program
RU2737001C1 (en) Image processing device and method and data medium
JP5206468B2 (en) Image processing apparatus and image processing program
JP4165599B2 (en) Image processing device
JP5884605B2 (en) Image processing apparatus and program
JP2871570B2 (en) Character recognition apparatus and method
JP4032735B2 (en) Image processing apparatus and image processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150803

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20161108

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170105

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170501

R150 Certificate of patent or registration of utility model

Ref document number: 6145983

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150