JP2010187179A - Image processing apparatus, image forming apparatus, image processing method, computer program, and recording medium - Google Patents
Image processing apparatus, image forming apparatus, image processing method, computer program, and recording medium Download PDFInfo
- Publication number
- JP2010187179A JP2010187179A JP2009029633A JP2009029633A JP2010187179A JP 2010187179 A JP2010187179 A JP 2010187179A JP 2009029633 A JP2009029633 A JP 2009029633A JP 2009029633 A JP2009029633 A JP 2009029633A JP 2010187179 A JP2010187179 A JP 2010187179A
- Authority
- JP
- Japan
- Prior art keywords
- index
- image
- color
- pixel
- pixels
- 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.)
- Pending
Links
Images
Abstract
Description
本発明は、各画素の色をインデックス化することにより高効率で画像データを圧縮することができる画像処理装置、画像形成装置、画像処理方法、コンピュータプログラム及び記録媒体に関する。 The present invention relates to an image processing apparatus, an image forming apparatus, an image processing method, a computer program, and a recording medium that can compress image data with high efficiency by indexing the color of each pixel.
紙等に記録された画像を光学的に読み取って画像データを生成する画像処理装置は、スキャナ装置、ファクシミリ装置又は複写装置として広く利用されている。画像処理装置が生成した画像データは、ファクシミリ通信若しくは電子メール等を用いて送受信されるか、又はデータベースに蓄積される等して種々の用途に利用される。画像を光学的に読み取って生成した画像データは、一般的にデータ量が多くなるので、送受信又は蓄積を効率的に行なうためには、画像データの圧縮が必要不可欠となっている。 An image processing apparatus that optically reads an image recorded on paper or the like to generate image data is widely used as a scanner apparatus, a facsimile apparatus, or a copying apparatus. Image data generated by the image processing apparatus is transmitted and received using facsimile communication, electronic mail, or the like, or stored in a database and used for various purposes. Image data generated by optically reading an image generally has a large amount of data. Therefore, compression of image data is indispensable for efficient transmission / reception or storage.
高圧縮率を実現するための圧縮技術の1つにレイヤ分離に基づく圧縮技術がある。レイヤ分離に基づく圧縮技術は、画像を文字及び/又は線画を表わす前景レイヤとその他の画像を表わす背景レイヤとに分離し、前景レイヤ及び背景レイヤを夫々に適した圧縮方法を用いて圧縮し、最終的に圧縮画像を生成する技術である。 One compression technique for realizing a high compression rate is a compression technique based on layer separation. The compression technique based on layer separation separates an image into a foreground layer representing characters and / or line drawings and a background layer representing other images, and compresses the foreground layer and the background layer using a compression method suitable for each, This is a technique for finally generating a compressed image.
背景レイヤは、JPEG(Joint Photographic Experts Group)等の非可逆圧縮技術を用いて圧縮されるのが一般的である。非可逆圧縮技術は、圧縮率の制御が簡易であるので、用途に応じてデータ量の削減又は画質の劣化防止等を行なうことができる。
一方、前景レイヤは、JBIG(Joint Bi-level Image Experts Group)、MMR(Modified Modified Read)、又はLZW(Lempel Ziv Welch)といった可逆圧縮技術を用いて圧縮されるのが一般的である。可逆圧縮技術は、圧縮率を制御することが難しいため、圧縮率を向上させることが困難である。
The background layer is generally compressed using a lossy compression technique such as JPEG (Joint Photographic Experts Group). Since the lossy compression technique is easy to control the compression rate, it is possible to reduce the amount of data or prevent deterioration of the image quality depending on the application.
On the other hand, the foreground layer is generally compressed using a reversible compression technique such as JBIG (Joint Bi-level Image Experts Group), MMR (Modified Modified Read), or LZW (Lempel Ziv Welch). In the reversible compression technique, it is difficult to control the compression rate, so it is difficult to improve the compression rate.
特許文献1には、圧縮率を向上させることができる圧縮技術が開示されている。特許文献1に記載の技術では、カラー画像に含まれる各画素の色をインデックスで表わし、インデックスで表わされた色毎の画素数を含むカラー情報、及びそれらを用いて生成した背景色情報から、インデックスの統合を行なっている。
特許文献1に記載の技術は、1枚分の画像内に含まれる同一の色を同一のインデックスで表わし、各インデックスに各色の画素の最大・最小座標から矩形領域を切り出して2値化・圧縮を行なっている。従って、一のインデックスについて切り出した矩形領域には、このインデックスに無関係な領域も含まれることとなるので、圧縮後のデータには不要なデータが含まれてしまう。この結果、圧縮後のデータ量が大きくなり、圧縮効率が悪いという問題が生じる。
The technique described in
本発明は斯かる問題を解決するためになされたものであり、その主たる目的は、各インデックスに係る画素が高い割合で含まれる領域を抽出できるようにすることにより、圧縮後のデータ量を削減することができる画像処理装置、画像形成装置、画像処理方法、コンピュータプログラム及び記録媒体を提供することにある。 The present invention has been made to solve such a problem, and a main object of the present invention is to reduce the amount of data after compression by making it possible to extract an area containing a high percentage of pixels related to each index. An image processing apparatus, an image forming apparatus, an image processing method, a computer program, and a recording medium are provided.
本発明に係る画像処理装置は、複数の画素で構成された画像を受け付ける受付手段と、該受付手段が受け付けた画像を構成する画素の内、文字及び/又は線画に対応する画素を抽出する抽出手段と、該抽出手段が抽出した各画素の色を複数の識別子のいずれかで表わした前景レイヤを生成する前景レイヤ生成手段と、前記受付手段が受け付けた画像から文字及び/又は線画を省いた背景レイヤを生成する背景レイヤ生成手段と、前記前景レイヤ生成手段が生成した前景レイヤに含まれる識別子毎に、特定の識別子で表わされる画素とその他の画素とからなる2値画像を生成する2値画像生成手段と、該2値画像生成手段が生成した2値画像、及び前記背景レイヤ生成手段が生成した背景レイヤを夫々圧縮する圧縮手段とを備え、画像を圧縮する処理を行なう画像処理装置において、前記前景レイヤ生成手段は、各画素の色に応じて、特定の色に関連付けられた識別子を各画素に対応付ける識別子対応手段と、該識別子対応手段による対応付けによって同一の識別子が対応付けられた画素の内、画像上で所定距離より離隔している画素間で異なる識別子を対応付けることによって識別子を分離する識別子分離手段と、前記識別子対応手段による対応付け及び前記識別子分離手段による分離の後、異なる識別子の内、該識別子に対応付けられている色同士が所定の範囲内で近似している識別子を統合する識別子統合手段とを有することを特徴とする。 An image processing apparatus according to the present invention includes an accepting unit that accepts an image composed of a plurality of pixels, and an extraction that extracts pixels corresponding to a character and / or a line drawing from among pixels constituting the image accepted by the accepting unit. Means, a foreground layer generating means for generating a foreground layer representing the color of each pixel extracted by the extracting means by any of a plurality of identifiers, and characters and / or line drawings from the image received by the receiving means. A binary for generating a binary image composed of a pixel represented by a specific identifier and other pixels for each identifier included in the foreground layer generated by the background layer generating unit that generates the background layer and the foreground layer generating unit. An image generation unit; and a compression unit that compresses the binary image generated by the binary image generation unit and the background layer generated by the background layer generation unit, respectively, and compresses the image In the image processing apparatus that performs processing, the foreground layer generation unit is the same by an identifier corresponding unit that associates an identifier associated with a specific color with each pixel according to the color of each pixel, and an association by the identifier corresponding unit. Among the pixels associated with the identifiers, identifier separating means for separating the identifiers by associating different identifiers between pixels separated from each other by a predetermined distance on the image, association by the identifier correspondence means, and the identifier separation After the separation by the means, there is provided an identifier integrating means for integrating identifiers whose colors associated with the identifiers are similar within a predetermined range among different identifiers.
本発明に係る画像処理装置は、前記識別子統合手段は、前記識別子対応手段による対応付け及び前記識別子分離手段による分離の後、対応付けられている色同士が同一である識別子を除いて、異なる識別子の内、該識別子に対応付けられている色同士が所定の範囲内で近似している識別子を統合するようにしてあることを特徴とする。 In the image processing apparatus according to the present invention, the identifier integration unit may include different identifiers except for identifiers in which the associated colors are the same after association by the identifier association unit and separation by the identifier separation unit. Among these, identifiers whose colors associated with the identifiers are approximated within a predetermined range are integrated.
本発明に係る画像処理装置は、前記識別子分離手段は、所定の選択順に従って、画素を順次選択する選択手段と、選択済みの画素の内で選択中の画素と同一の識別子が対応付けられた画素と、前記選択中の画素との間の最小距離を演算する最小演算手段と、該最小演算手段が演算した最小距離が所定の閾値より大きい場合に、前記選択中の画素に対応付けられた識別子を、該識別子と同一の色に関連付けられた新たな識別子に変更する手段とを有することを特徴とする。 In the image processing apparatus according to the present invention, the identifier separating unit is associated with a selecting unit that sequentially selects pixels according to a predetermined selection order, and the same identifier as the currently selected pixel among the selected pixels. A minimum calculation means for calculating a minimum distance between a pixel and the selected pixel; and a minimum distance calculated by the minimum calculation means that is associated with the selected pixel when the minimum distance is greater than a predetermined threshold. And a means for changing the identifier to a new identifier associated with the same color as the identifier.
本発明に係る画像処理装置は、前記選択手段は、画像上の一方向を主走査方向とし、前記一方向に直交する方向を副走査方向として、画素を順次選択するように構成してあり、前記最小演算手段が演算する距離として、主走査方向の距離と、副走査方向の距離と、主走査方向及び副走査方向の両方の距離とを切り替える手段を更に備えることを特徴とする。 The image processing apparatus according to the present invention is configured such that the selection unit sequentially selects pixels with one direction on the image as a main scanning direction and a direction orthogonal to the one direction as a sub-scanning direction, The distance calculated by the minimum calculation means further includes means for switching between a distance in the main scanning direction, a distance in the sub scanning direction, and a distance in both the main scanning direction and the sub scanning direction.
本発明に係る画像処理装置は、各画素の色は、複数の原色の色強度を示す情報からなることを特徴とする。 The image processing apparatus according to the present invention is characterized in that the color of each pixel includes information indicating the color intensities of a plurality of primary colors.
本発明に係る画像処理装置は、各画素の色は、単色の色強度を示す情報からなることを特徴とする。 The image processing apparatus according to the present invention is characterized in that the color of each pixel includes information indicating a single color intensity.
本発明に係る画像形成装置は、前述の画像処理装置を備えることを特徴とする。 An image forming apparatus according to the present invention includes the above-described image processing apparatus.
本発明に係る画像処理方法は、複数の画素で構成された画像を受け付けるステップと、受け付けた画像を構成する画素の内、文字及び/又は線画に対応する画素を抽出するステップと、抽出した各画素の色を複数の識別子のいずれかで表わした前景レイヤを生成する前景レイヤ生成ステップと、受け付けた画像から文字及び/又は線画を省いた背景レイヤを生成するステップと、前記前景レイヤに含まれる識別子毎に、特定の識別子で表わされる画素とその他の画素とからなる2値画像を生成するステップと、生成した2値画像及び背景レイヤを夫々圧縮するステップとを含む画像処理方法において、前記前景レイヤ生成ステップは、各画素の色に応じて、特定の色に関連付けられた識別子を各画素に対応付けるステップと、同一の識別子が対応付けられた画素の内、画像上で所定距離より離隔している画素間で異なる識別子を対応付けることによって識別子を分離するステップと、識別子の対応付け及び分離の後、異なる識別子の内、該識別子に対応付けられている色同士が所定の範囲内で近似している識別子を統合するステップとを含むことを特徴とする。 The image processing method according to the present invention includes a step of accepting an image composed of a plurality of pixels, a step of extracting pixels corresponding to a character and / or a line drawing among pixels constituting the accepted image, A foreground layer generating step of generating a foreground layer representing a pixel color by any of a plurality of identifiers; a step of generating a background layer from which characters and / or line drawings are omitted from the received image; and the foreground layer In the image processing method, the method includes: generating a binary image including a pixel represented by a specific identifier and other pixels for each identifier; and compressing the generated binary image and the background layer, respectively. In the layer generation step, according to the color of each pixel, an identifier associated with a specific color is associated with each pixel, and the same identifier is used. A step of separating identifiers by associating different identifiers between pixels that are spaced apart from each other by a predetermined distance on the image, and after the association and separation of the identifiers, the identifiers among the different identifiers And integrating the identifiers whose colors that are associated with each other are approximated within a predetermined range.
本発明に係るコンピュータプログラムは、コンピュータに、画像を構成する画素の内、文字及び/又は線画に対応する画素を抽出する手順と、抽出した各画素の色を複数の識別子のいずれかで表わした前景レイヤを生成する前景レイヤ生成手順と、前記画像から文字及び/又は線画を省いた背景レイヤを生成する手順と、前記前景レイヤに含まれる識別子毎に、特定の識別子で表わされる画素とその他の画素とからなる2値画像を生成する手順と、生成した2値画像及び背景レイヤを夫々圧縮する手順とを含む処理を実行させることによって、画像を圧縮する処理を実行させるためのコンピュータプログラムであって、前記前景レイヤ生成手順は、各画素の色に応じて、特定の色に関連付けられた識別子を各画素に対応付ける手順と、同一の識別子が対応付けられた画素の内、画像上で所定距離より離隔している画素間で異なる識別子を対応付けることによって識別子を分離する手順と、識別子の対応付け及び分離の後、異なる識別子の内、該識別子に対応付けられている色同士が所定の範囲内で近似している識別子を統合する手順とを含むことを特徴とする。 The computer program according to the present invention indicates, to a computer, a procedure for extracting pixels corresponding to a character and / or a line drawing from among pixels constituting an image, and the color of each extracted pixel by any one of a plurality of identifiers. A foreground layer generation procedure for generating a foreground layer, a procedure for generating a background layer from which characters and / or line drawings are omitted from the image, a pixel represented by a specific identifier and other information for each identifier included in the foreground layer A computer program for executing a process of compressing an image by executing a process including a procedure of generating a binary image including pixels and a procedure of compressing the generated binary image and a background layer, respectively. The foreground layer generation procedure is the same as the procedure of associating each pixel with an identifier associated with a specific color according to the color of each pixel. A procedure for separating identifiers by associating different identifiers between pixels that are separated from a predetermined distance on the image among pixels associated with a different child, and after association and separation of identifiers, And a procedure for integrating identifiers in which colors associated with the identifiers are approximated within a predetermined range.
本発明に係る記録媒体は、前述のコンピュータプログラムを記録してあることを特徴とする。 A recording medium according to the present invention stores the above-described computer program.
本発明にあっては、画像処理装置は、まず、受け付けた画像から文字及び/又は線画に対応する画素を抽出し、次に、抽出した画素の色を識別子で表わした前景レイヤを生成し、また、画像から文字及び/又は線画を省いた背景レイヤを生成し、更に、前景レイヤから、各識別子に係る画素と他の画素とを区別した2値画像を生成し、最後に、全ての2値画像及び背景レイヤを夫々圧縮することによって圧縮画像を生成する。 In the present invention, the image processing apparatus first extracts pixels corresponding to characters and / or line drawings from the received image, and then generates a foreground layer representing the color of the extracted pixels by an identifier, Further, a background layer in which characters and / or line drawings are omitted from the image is generated, and further, a binary image in which a pixel related to each identifier is distinguished from other pixels is generated from the foreground layer. A compressed image is generated by compressing the value image and the background layer, respectively.
画像処理装置は、前景レイヤを生成する際には、色に関連付けた識別子を各画素に一旦対応付け、次いで、同一の識別子が対応付けられた画素の内で所定距離より離隔した画素間で異なる識別子を対応付けることによって識別子を分離する。このため、色が同一でありながら異なる識別子が対応付けられた画素は、互いに異なる2値画像に含まれることとなり、個々の2値画像内では、各識別子に係る画素がより狭い領域に集中する。
識別子の対応付け及び分離の後、画像処理装置は、近似した色に関連付けられている識別子を統合する。この結果、識別子の個数が減少するため、生成すべき2値画像の枚数が減少する。つまり、識別子の分離によって識別子の個数が過剰に増大してしまう不都合が抑制される。
When the foreground layer is generated, the image processing apparatus temporarily associates an identifier associated with a color with each pixel, and then differs between pixels separated by a predetermined distance among pixels associated with the same identifier. Separate identifiers by associating identifiers. For this reason, pixels that have the same color but are associated with different identifiers are included in different binary images, and in each binary image, the pixels associated with each identifier are concentrated in a narrower region. .
After the association and separation of the identifiers, the image processing apparatus integrates the identifiers associated with the approximate colors. As a result, since the number of identifiers decreases, the number of binary images to be generated decreases. That is, the disadvantage that the number of identifiers increases excessively due to the separation of identifiers is suppressed.
本発明にあっては、画像処理装置は、識別子の対応付け及び分離の後、近似した色に関連付けられている識別子を統合する。ただし、識別子を統合する際、画像処理装置は、同一の色に関連付けられている識別子は統合しない。このため、前段の処理で分離された識別子を無用に統合してしまう不都合が抑制される。 In the present invention, the image processing apparatus integrates the identifiers associated with the approximate colors after the association and separation of the identifiers. However, when integrating identifiers, the image processing apparatus does not integrate identifiers associated with the same color. For this reason, the inconvenience of unnecessarily integrating the identifiers separated in the preceding process is suppressed.
本発明にあっては、画像処理装置は、画像を構成する画素を順に選択する。以下では、選択中の画素に対応付けられた識別子と同一の識別子を、同一識別子という。
次いで、画像処理装置は、選択済みの画素の内で同一識別子が対応付けられた画素と、選択中の画素との間の最小距離を求め、求めた最小距離が所定の閾値より大きい場合に、選択中の画素に対応付けられた識別子を、同一識別子と同一の色に関連付けられた新たな識別子に変更する。この結果、画素同士の距離が遠い識別子が適切に分離される。
一方、求めた最小距離が所定の閾値より小さい場合(即ち、画素同士の距離が近い場合)には、選択中の画素の識別子は変更されず、識別子の分離は起こらない。
In the present invention, the image processing apparatus sequentially selects pixels constituting the image. Hereinafter, an identifier that is the same as the identifier associated with the currently selected pixel is referred to as the same identifier.
Next, the image processing apparatus obtains a minimum distance between a pixel associated with the same identifier among the selected pixels and the currently selected pixel, and when the obtained minimum distance is larger than a predetermined threshold, The identifier associated with the currently selected pixel is changed to a new identifier associated with the same color as the same identifier. As a result, identifiers with a long distance between pixels are appropriately separated.
On the other hand, when the determined minimum distance is smaller than the predetermined threshold (that is, when the distance between the pixels is short), the identifier of the currently selected pixel is not changed, and no separation of the identifier occurs.
本発明にあっては、画素間の距離として、主走査方向の距離と、副走査方向の距離と、主走査方向及び副走査方向の両方の距離とを利用可能であり、必要に応じていずれかを切り換えて処理を実行することにより、スキャナで読み取った画像を90°右回転させる場合等、状況に応じた識別子の分離を行なう。 In the present invention, as the distance between the pixels, a distance in the main scanning direction, a distance in the sub scanning direction, and a distance in both the main scanning direction and the sub scanning direction can be used, and any of them may be used as necessary. By switching between these, the identifiers are separated according to the situation, such as when the image read by the scanner is rotated 90 ° to the right.
本発明にあっては、赤緑青等の複数の原色の色強度を識別子に関連付けて画像の圧縮処理を行なうことにより、カラー画像の圧縮を可能とする。 In the present invention, a color image can be compressed by associating the color intensities of a plurality of primary colors such as red, green, and blue with an identifier and performing an image compression process.
本発明にあっては、単色の色強度を識別子に関連付けて画像の圧縮処理を行なうことにより、グレースケールのモノクロ画像の圧縮を可能とする。 In the present invention, by compressing an image by associating a single color intensity with an identifier, it is possible to compress a grayscale monochrome image.
本発明の画像処理装置、画像形成装置、画像処理方法、コンピュータプログラム及び記録媒体による場合、個々の2値画像内では、各識別子に係る画素がより狭い領域に集中している。従って、圧縮の際に2値画像から抽出した各識別子に係る画素が含まれる矩形領域においては、各識別子に係る画素の割合がより高くなる。つまり、圧縮後のデータに含まれる不要なデータを削減することができる。
しかも、識別子を統合する事によって、2値画像の枚数は最小限に抑えられている。
In the case of the image processing apparatus, the image forming apparatus, the image processing method, the computer program, and the recording medium according to the present invention, the pixels related to each identifier are concentrated in a narrower area in each binary image. Therefore, in the rectangular area including the pixels related to each identifier extracted from the binary image at the time of compression, the ratio of the pixels related to each identifier becomes higher. That is, unnecessary data included in the compressed data can be reduced.
In addition, by integrating the identifiers, the number of binary images is minimized.
以上の結果、画像を圧縮した圧縮画像データのデータ量を削減し、画像の圧縮効率を向上させることができる。また、画像を圧縮するために必要な処理時間を短縮することが可能となる。
更に、圧縮画像データを送受信する際には、送受信すべきデータ量を削減し、送受信に必要な時間を短縮することが可能となる等、本発明は優れた効果を奏する。
As a result, the amount of compressed image data obtained by compressing an image can be reduced, and the compression efficiency of the image can be improved. In addition, the processing time required for compressing the image can be shortened.
Furthermore, when transmitting / receiving compressed image data, the present invention has excellent effects such as reducing the amount of data to be transmitted / received and shortening the time required for transmission / reception.
以下、本発明を、その実施の形態を示す図面に基づいて詳述する。 Hereinafter, the present invention will be described in detail with reference to the drawings illustrating embodiments thereof.
実施の形態 1.
実施の形態1では、本発明の画像処理装置が、カラー画像を形成する画像形成装置の一部をなす形態を示す。
図1は、実施の形態1に係る画像形成装置の内部の機能構成を示すブロック図である。
本発明の実施の形態に係る画像形成装置は、カラー画像を光学的に読み取るカラー画像入力装置11を備えており、カラー画像入力装置11には、読み取ったカラー画像に応じた画像データ及び圧縮画像データを生成する処理を行なうカラー画像処理装置2が接続されている。カラー画像処理装置2は、本発明における画像処理装置として機能する。
In the first embodiment, the image processing apparatus of the present invention is a part of an image forming apparatus that forms a color image.
FIG. 1 is a block diagram illustrating an internal functional configuration of the image forming apparatus according to the first embodiment.
An image forming apparatus according to an embodiment of the present invention includes a color
カラー画像処理装置2には、カラー画像処理装置2が生成した画像データに基づいてカラー画像を出力するカラー画像出力装置13、及びカラー画像処理装置2が生成した圧縮画像データを外部へ送信する送信装置14が接続されている。
カラー画像入力装置11、カラー画像処理装置2、カラー画像出力装置13及び送信装置14には、使用者からの操作を受け付ける操作パネル12が接続されている。
The color
An
カラー画像入力装置11は、CCD(Charge Coupled Device )光センサを備えたスキャナにて構成されており、紙等の記録担体上に記録されたカラー画像からの反射光像をR(赤)G(緑)B(青)に分解してCCDで読み取り、RGBのアナログ信号に変換してカラー画像処理装置2へ出力する構成となっている。
カラー画像処理装置2は、カラー画像入力装置11から入力されたRGBのアナログ信号に対して所定の信号処理を行なってデジタルの画像データを生成する。また、カラー画像処理装置2は、デジタルのC(シアン)M(マゼンタ)Y(イエロー)K(ブラック)信号からなる画像データを生成してカラー画像出力装置13へ出力する。更にまた、カラー画像処理装置2は、生成したデジタルの画像データを後述する圧縮処理により圧縮した圧縮画像データを生成し、圧縮画像データを送信装置14へ出力する。
The color
The color
カラー画像出力装置13は、カラー画像処理装置2から入力された画像データに基づいて、熱転写、電子写真、又はインクジェット等の方式により記録担体上に画像を形成することによって、カラー画像を出力する。
送信装置14は、図示しない公衆回線網、LAN(Local Area Network)又はインターネット等の通信ネットワークに接続可能であり、ファクシミリ又は電子メール等の通信方法により通信ネットワークを介して外部へ圧縮画像データを送信する。
操作パネル12は、画像形成装置の操作に必要な情報を表示する液晶ディスプレイ等の表示部と、画像形成装置の動作を制御する指示を使用者の操作により受け付けるタッチパネル又はテンキー等の受付部とを含んで構成されている。
The color
The
The
カラー画像処理装置2は、カラー画像入力装置11から入力されたアナログ信号をA/D変換部20でデジタル信号に変換し、シェーディング補正部21、入力階調補正部22、領域分離処理部23、色補正部24、黒生成下色除去部25、空間フィルタ処理部26、出力階調補正部27、及び階調再現処理部28の順に送り、デジタルのCMYK信号からなる画像データをカラー画像出力装置13へ出力する構成となっている。また、カラー画像処理装置2は、デジタル信号を領域分離処理部23から圧縮処理部3へ送り、圧縮画像データを送信装置14へ出力する構成となっている。
The color
A/D変換部20は、カラー画像入力装置11からカラー画像処理装置2へ入力されたRGBのアナログ信号を受け付け、RGBのアナログ信号をデジタルのRGB信号へ変換し、RGB信号をシェーディング補正部21へ出力する。
シェーディング補正部21は、A/D変換部20から入力されたRGB信号に対して、カラー画像入力装置11の照明系、結像系及び撮像系で生じる各種の歪みを取り除く処理を行なう。
次いで、シェーディング補正部21は、歪みを取り除いたRGB信号を入力階調補正部22へ出力する。
The A /
The
Next, the
入力階調補正部22は、シェーディング補正部21から入力されたRGB信号に対して、カラーバランスを調整する。シェーディング補正部21から入力階調補正部22へ入力されたRGB信号はRGBの反射率信号であり、入力階調補正部22は、シェーディング補正部21から入力されたRGB信号を、カラー画像処理装置2で処理しやすい濃度信号等の信号へ変換する。
次いで、入力階調補正部22は、処理を行なったRGB信号を領域分離処理部23へ出力する。
The input
Next, the input
領域分離処理部23は、入力階調補正部22から入力されたRGB信号が表わす画像中の各画素を、文字領域、網点領域、又は写真領域のいずれかに分離し、分離結果に基づき、各画素がいずれの領域に属しているかを示す領域識別信号を、黒生成下色除去部25、空間フィルタ処理部26、及び階調再現処理部28へ夫々出力する。また、領域分離処理部23は、入力階調補正部22から入力されたRGB信号を色補正部24及び圧縮処理部3へ夫々出力する。
The region
圧縮処理部3は、領域分離処理部23からRGB信号でなる画像データを入力され、本発明の実施の形態に係る画像処理方法(後述)を用いて圧縮画像データを生成する処理を実行する。圧縮処理部3は、生成した圧縮画像データを、ハードディスク等の不揮発性の記憶媒体を用いて構成された記憶部29に記憶させる。また、圧縮処理部3は、生成した圧縮画像データを送信装置14へ出力する。
The
色補正部24は、領域分離処理部23から入力されたRGB信号をCMY信号へ変換し、色再現の忠実化実現のために、不要吸収成分を含むCMY色材の分光特性に基づいた色濁りをCMY信号から取り除く処理を行なう。
次いで、色補正部24は、色補正を行なったCMY信号を黒生成下色除去部25へ出力する。
The
Next, the
黒生成下色除去部25は、色補正部24から入力されたCMYの3色信号からK信号を生成する黒生成処理を行ない、元のCMY信号から黒生成処理によって得られたK信号を差し引くことによって、CMYの3色信号をCMYKの4色信号へ変換する。黒生成処理の一例としては、スケルトンブラックにより黒生成を行なう方法がある。この方法では、スケルトンカーブの入出力特性をy=f(x)、変換前のデータをC,M,Y、UCR(Under Color Removal )率をα(0<α<1)とすると、変換後のデータC',M',Y',K'は下記の式(1)〜式(4)で表わされる。
The black generation lower
K'=f(min (C,M,Y))…(1)
C'=C−αK'…(2)
M'=M−αK'…(3)
Y'=Y−αK'…(4)
K ′ = f (min (C, M, Y)) (1)
C ′ = C−αK ′ (2)
M ′ = M−αK ′ (3)
Y ′ = Y−αK ′ (4)
ここで、UCR率α(0<α<1)は、CMYが重なっている部分をKに置き換えてCMYをどの程度削減するかを示す。式(1)は、CMYの各信号強度の内の最も小さい信号強度に応じてK信号が生成されることを示している。
次いで、黒生成下色除去部25は、CMY信号を変換したCMYK信号を空間フィルタ処理部26へ出力する。
Here, the UCR rate α (0 <α <1) indicates how much CMY is reduced by replacing the portion where CMY overlaps with K. Equation (1) indicates that the K signal is generated in accordance with the smallest signal strength among the signal strengths of CMY.
Next, the black generation and under
空間フィルタ処理部26は、黒生成下色除去部25から入力されたCMYK信号が表わす画像に対して、領域分離処理部23から入力された領域識別信号に基づいてデジタルフィルタによる空間フィルタ処理を行なうことにより、画像のぼやけ又は粒状性劣化を改善する。例えば、領域分離処理部23にて文字に分離された領域に対しては、空間フィルタ処理部26は、文字の再現性を高めるために、高周波成分の強調量が大きいフィルタを用いて空間フィルタ処理を行なう。また、領域分離処理部23にて網点に分離された領域に対しては、空間フィルタ処理部26は、入力網点成分を除去するためのローパス・フィルタ処理を行なう。
次いで、空間フィルタ処理部26は、処理後のCMYK信号を出力階調補正部27へ出力する。
The spatial
Next, the spatial
出力階調補正部27は、空間フィルタ処理部26から入力されたCMYK信号に対して、カラー画像出力装置13の特性に基づく出力階調補正処理を行ない、出力階調補正処理後のCMYK信号を階調再現処理部28へ出力する。
The output
階調再現処理部28は、出力階調補正部27から入力されたCMYK信号に対して、領域分離処理部23から入力された領域識別信号に基づいて、領域に応じた中間調処理を行なう。例えば、領域分離処理部23にて文字に分離された領域に対しては、階調再現処理部28は、高域周波成分の再現に適した高解像度のスクリーンによる2値化又は多値化の処理を行なう。また、領域分離処理部23にて網点に分離された領域に対しては、階調再現処理部28は、階調再現性を重視したスクリーンでの2値化又は多値化の処理を行なう。
次いで、階調再現処理部28は、処理後の画像データをカラー画像出力装置13へ出力する。
The gradation
Next, the gradation
カラー画像出力装置13は、カラー画像処理装置2から入力されたCMYK信号でなる画像データに基づいて、紙等の記録担体上にCMYKのカラー画像を形成する。画像データに基づいて画像を形成することにより、画像形成装置は、受け付けた画像に基づいた画像を形成する。
The color
次に、圧縮処理部3の構成及び圧縮処理部3が行なう処理を説明する。
図2及び図3は、圧縮処理部3が画像を圧縮する処理の概要を示す模式図である。
図2に示す圧縮前の画像は、白地に書かれた「TEST画像」という赤色の文字と、緑色のベタ塗り領域に書かれた「これはテスト画像です」という青色の文字と、多彩な色合いを有する絵とを含んでいる。
図2に示す如く、圧縮処理部3は、入力された画像を、文字を表わす前景レイヤとその他を表わす背景レイヤとに分離する。背景レイヤには、画像から文字を省いたものが含まれる。また、前景レイヤには、各文字の色を示す情報が含まれる。
Next, the configuration of the
2 and 3 are schematic diagrams illustrating an outline of processing in which the
The uncompressed image shown in Fig. 2 consists of a red text "TEST image" written on a white background, a blue text "This is a test image" written in a solid green area, and various colors. Including a picture with.
As shown in FIG. 2, the
更に、図3に示す如く、圧縮処理部3は、前景レイヤから各色毎に2値画像を生成する。例えば、圧縮処理部3は、図3に示すように、「TEST画像」の文字の画素値を“1”として他の画素値を“0”とした2値画像Aと、「これはテスト画像です」の文字の画素値を“1”として他の画素値を“0”とした2値画像Bとを生成する。2値画像Aには、「TEST画像」の文字の色(赤色)を示す色情報が付加され、また、2値画像Bには、「これはテスト画像です」の文字の色(青色)を示す色情報が付加される。
圧縮処理部3は、背景レイヤと色情報が付加された各2値画像とを夫々圧縮することにより、圧縮画像データを生成する。
Further, as shown in FIG. 3, the
The
図4は、圧縮処理部3の内部構成を示すブロック図である。
圧縮処理部3は、領域分離処理部23から入力された画像データに基づいて前景マスク生成処理部31で文字の画素を示す前景マスクを生成し、前景色インデックス化処理部32で文字の画素の色をインデックス(識別子)で表わした前景レイヤを生成する構成となっている。また、圧縮処理部3は、背景レイヤ生成処理部33で背景レイヤを生成し、2値画像生成処理部34で前景レイヤから各色の2値画像を生成し、画像圧縮処理部35で背景レイヤ及び各色の2値画像を圧縮することにより圧縮画像データを生成し、圧縮画像データを出力する構成となっている。
FIG. 4 is a block diagram showing an internal configuration of the
The
以下では、圧縮処理部3の各部について、更に詳細に説明する。
前景マスク生成処理部31は、領域分離処理部23から圧縮処理部3へ入力された画像データを受け付け、受け付けた画像データが表わす画像を構成する画素から、文字に対応する画素を前景として抽出し、抽出した画素の位置を示す前景マスクを生成する。抽出した画素以外の画素は、背景の画素である。前景マスク生成処理部31は、本発明における受付手段及び抽出手段夫々として機能する。
Below, each part of the
The foreground mask
前景マスク生成処理部31は、具体的には、画素の輝度値に対して画像上の一方向に微分処理を行ない、輝度が明るく変化するエッジ部位と、暗く変化するエッジ部位とを検知し、検知したエッジ部位に基づいて文字画像を2値化する。更に詳細には、前景マスク生成処理部31は、画像上の画素を一方向に走査し、正方向の微分値が出現してから負方向の微分値が出現するまでの範囲を文字の画素として抽出し、抽出した画素の画素値を“1”として他の画素値を“0”とした2値画像を生成する。
以上のようにして生成された2値画像が前景マスクである。前景マスクは、例えば、図2及び図3夫々に示す前景レイヤから色情報を省いたものとなる。
Specifically, the foreground mask
The binary image generated as described above is a foreground mask. The foreground mask is obtained, for example, by omitting color information from the foreground layer shown in FIGS.
前景マスク生成処理部31は、生成した前景マスクのデータ、及び画像データを前景色インデックス化処理部32へ出力する。なお、圧縮処理部3は、領域分離処理部23から領域識別信号を受け付け、前景マスク生成処理部31は、領域識別信号が示す文字領域に含まれる画素を抽出する処理を行なう構成であってもよい。
The foreground mask
図5は、前景色インデックス化処理部32の内部構成を示すブロック図である。
前景色インデックス化処理部32は、本発明における前景レイヤ生成手段として機能する。このために、前景色インデックス化処理部32は、インデックス生成部321、インデックス統合部322、及びインデックス補正部323を備える。
FIG. 5 is a block diagram showing an internal configuration of the foreground color
The foreground
ここで、本発明の実施の形態の特徴を説明する。
図6は、圧縮処理部3が圧縮すべき画像の例を示す概念図である。
図中に示すx座標及びy座標は、カラー画像入力装置11でカラー画像を読み取る際の主走査方向及び副走査方向に対応する。座標(x,y)は画像上の画素の位置を示し、座標によって各画素を特定することができる。
図6中の画素群P1〜P5は、夫々前景を示す画素群であり、画素群P1〜P5以外の画素群は、背景を示す画素群である。
Here, features of the embodiment of the present invention will be described.
FIG. 6 is a conceptual diagram illustrating an example of an image to be compressed by the
The x coordinate and y coordinate shown in the figure correspond to the main scanning direction and the sub scanning direction when the color
Pixel groups P1 to P5 in FIG. 6 are each a pixel group indicating the foreground, and pixel groups other than the pixel groups P1 to P5 are pixel groups indicating the background.
ここで、画素群P1〜P3が同色(例えば赤色)の画素群であり、画素群P4が全く異なる色(例えば青色)の画素群であり、画素群P5が、画素群P1〜P3の色に近似する色(例えば薄い赤色)の画素群であるものとする。
この場合、画素群P1〜P3夫々の各画素に、例えばインデックス“1”が対応付けられ、画素群P4の各画素に、インデックス“2”が対応付けられ、画素群P5の各画素に、インデックス“3”が対応付けられる(インデックス対応処理)。
Here, the pixel groups P1 to P3 are pixel groups of the same color (for example, red), the pixel group P4 is a pixel group of a completely different color (for example, blue), and the pixel group P5 is the color of the pixel groups P1 to P3. It is assumed that the pixel group is an approximate color (for example, light red).
In this case, for example, an index “1” is associated with each pixel of the pixel groups P1 to P3, an index “2” is associated with each pixel of the pixel group P4, and an index is associated with each pixel of the pixel group P5. “3” is associated (index correspondence processing).
仮に、このようにインデックス化された画像(以下、初期インデックス画像という)から、同一のインデックスの画素を含む最小面積の矩形領域を切り出す場合、インデックス“1”については、座標(2,2)〜座標(11,18)の矩形領域が切り出される。
初期インデックス画像に係るインデックスを、以下では初期インデックスということもある。図6に示す画像の場合、初期インデックスの個数は3個である。
切り出された座標(2,2)〜座標(11,18)の矩形領域は、インデックス“1”の画素を含まない領域(例えば、座標(2,8)〜座標(11,14)の矩形領域)を広く有する。換言すれば、矩形領域はインデックス“1”とは無関係な領域を多量に含む。このため、個々の矩形領域のデータ量が大きくなり、圧縮効率が悪くなる。
If a rectangular area having a minimum area including pixels with the same index is cut out from an image indexed in this way (hereinafter referred to as an initial index image), the index “1” has coordinates (2, 2) to A rectangular area with coordinates (11, 18) is cut out.
Hereinafter, an index related to the initial index image may be referred to as an initial index. In the case of the image shown in FIG. 6, the number of initial indexes is three.
The rectangular area of the extracted coordinates (2, 2) to coordinates (11, 18) is an area that does not include the pixel with the index “1” (for example, a rectangular area of coordinates (2, 8) to coordinates (11, 14). ) Widely. In other words, the rectangular area includes a large number of areas unrelated to the index “1”. For this reason, the data amount of each rectangular area becomes large, and the compression efficiency deteriorates.
そこで、圧縮効率を向上させるべく、同一の初期インデックスが対応付けられている画素間の距離を考慮して、インデックスを分離することがなされる。
画素群P1と画素群P2とは互いに距離が近いが、画素群P1,P2夫々と画素群P3とは互いに距離が遠い。従って、画素群P1,P2夫々の各画素に、インデックス“1”がそのまま対応付けられ、画素群P3の各画素に、新たなインデックス“4”が改めて対応付けられる(インデックス分離処理)。
Therefore, in order to improve the compression efficiency, the indexes are separated in consideration of the distance between pixels associated with the same initial index.
The pixel group P1 and the pixel group P2 are close to each other, but the pixel groups P1 and P2 and the pixel group P3 are far from each other. Therefore, the index “1” is directly associated with each pixel of the pixel groups P1 and P2, and the new index “4” is associated with each pixel of the pixel group P3 again (index separation process).
仮に、このようにインデックス化された画像(以下、分離インデックス画像という)から、同一のインデックスに対応付けられた画素を含む最小面積の矩形領域を切り出す場合、インデックス“1”については座標(2,2)〜座標(11,7)の矩形領域が切り出され、インデックス“4”については座標(6,15)〜座標(9,18)の矩形領域が切り出される。
分離インデックス画像に係るインデックスを、以下では分離インデックスということもある。図6に示す画像の場合、分離インデックスの個数は4個であり、初期インデックスの個数よりも多い。
インデックス分離処理を実行した後は、インデックスの個数が非常に多くなる(即ち、切り出すべき矩形領域の個数が非常に多くなる)虞がある。このため、矩形領域のデータ量の総和が大きくなり、圧縮効率が悪くなる。
If a rectangular area having the minimum area including the pixels associated with the same index is cut out from the indexed image (hereinafter referred to as a separated index image), the index “1” has coordinates (2, 2) to a rectangular area of coordinates (11, 7) are cut out, and for the index “4”, a rectangular area of coordinates (6, 15) to coordinates (9, 18) is cut out.
Hereinafter, an index related to a separation index image may be referred to as a separation index. In the case of the image shown in FIG. 6, the number of separation indexes is four, which is larger than the number of initial indexes.
After performing the index separation process, there is a possibility that the number of indexes will be very large (that is, the number of rectangular areas to be cut out will be very large). For this reason, the total amount of data in the rectangular area is increased, and the compression efficiency is deteriorated.
そこで、インデックスの個数を減少させるために、異なるインデックスの内、近似色が関連付けられているインデックス同士を統合することがなされる。
従って、画素群P1,P2及び画素群P5について、インデックスの統合が実行される(インデックス統合処理)。
ここで、インデックス統合処理の実行による画質の劣化を抑制するために、画素群P1,P2の画素数と画素群P5の画素数とが比較される。何故ならば、画素数が少ない方を画素数が多い方に統合した画像は、画素数が多い方を画素数が少ない方に統合した画像に比べて、各画素の色の変化が目立たないからである。
従って、画素群P1,P2に画素群P5が統合され、画素群P5の各画素に、画素群P1,P2と同じインデックス“1”が改めて対応付けられる。
Therefore, in order to reduce the number of indexes, indexes that are associated with approximate colors among different indexes are integrated.
Accordingly, index integration is executed for the pixel groups P1 and P2 and the pixel group P5 (index integration processing).
Here, the number of pixels in the pixel groups P1 and P2 is compared with the number of pixels in the pixel group P5 in order to suppress deterioration in image quality due to the execution of the index integration process. This is because an image in which the smaller number of pixels is integrated into the larger number of pixels is less noticeable in the color change of each pixel than an image in which the larger number of pixels is integrated into the smaller number of pixels. It is.
Therefore, the pixel group P5 is integrated with the pixel groups P1 and P2, and the same index “1” as that of the pixel groups P1 and P2 is associated with each pixel of the pixel group P5 again.
このようにインデックス化された画像(以下、統合インデックス画像という)から、同一のインデックスに対応付けられた画素を含む矩形領域を最小面積の切り出す場合、インデックス“1”については座標(2,2)〜座標(15,11)の矩形領域が切り出される。
統合インデックス画像に係るインデックスを、以下では統合インデックスということもある。図6に示す画像の場合、統合インデックスの個数は3個であり、分離インデックスの個数よりも少ない。
When a rectangular area including pixels associated with the same index is cut out from an image indexed in this way (hereinafter referred to as an integrated index image), coordinates (2, 2) for the index “1” A rectangular area having coordinates (15, 11) is cut out.
Hereinafter, an index related to the integrated index image may be referred to as an integrated index. In the case of the image shown in FIG. 6, the number of integrated indexes is 3, which is smaller than the number of separation indexes.
本実施の形態では、インデックス統合処理では、同一色が関連付けられているインデックス同士を統合することはない。何故ならば、画素群P1,P2と画素群P3とが統合されてしまうと、インデックス分離処理の実行結果が統合インデックス画像に反映されなくなるからである。
なお、近似色が存在しない場合、又は近似色が関連付けられているインデックス同士の統合のみではインデックスの個数を十分に減少させることができない場合には、同一色が関連付けられているインデックス同士を統合してもよい。この場合、画素間の距離が比較的近いもの同士を統合することが望ましい。
In the present embodiment, in the index integration process, indexes associated with the same color are not integrated. This is because if the pixel groups P1, P2 and the pixel group P3 are integrated, the execution result of the index separation process is not reflected in the integrated index image.
If there is no approximate color, or if the number of indices cannot be reduced sufficiently by simply integrating the indexes associated with the approximate colors, the indexes associated with the same color are integrated. May be. In this case, it is desirable to integrate those having a relatively short distance between pixels.
以上の結果、画素群P1,P2,P5にインデックス“1”、画素群P3にインデックス“4”、画素群P4にインデックス“2”が夫々対応付けられ、各インデックスについて矩形領域が切り出される。このため、同一のインデックスが含まれる矩形領域の面積は必要最小限になり、且つ、インデックスの個数が必要最小限になる。
そして、このような統合インデックス画像が、前景レイヤとして出力される。
As a result, the index “1” is associated with the pixel groups P1, P2, and P5, the index “4” is associated with the pixel group P3, and the index “2” is associated with the pixel group P4, and a rectangular area is cut out for each index. For this reason, the area of the rectangular area including the same index is minimized, and the number of indexes is minimized.
Then, such an integrated index image is output as a foreground layer.
インデックス“3”は、インデックス統合処理によって空インデックスとなるが、インデックス統合処理の実行後に、インデックス“4”をインデックス“3”に変換して、インデックス“4”を空インデックスにすることによって、空インデックスを詰めることができる。なお、インデックス“3”を空インデックスのままにして、インデックス“1”,“2”,“4”を用いる構成でもよい。 The index “3” becomes an empty index by the index integration process, but after the index integration process is executed, the index “4” is converted to the index “3”, and the index “4” is changed to an empty index. You can pack the index. Note that the index “3” may be left as an empty index and the indexes “1”, “2”, and “4” may be used.
図7、図8、及び図9は、初期インデックス画像、分離インデックス画像、及び統合インデックス画像の例を示す概念図である。
本実施の形態では、分離インデックス画像及び統合インデックス画像夫々のデータは生成されるが、初期インデックス画像のデータは生成されない。ただし、分離インデックス画像との比較のために、初期インデックス画像も例示してある。
図7〜図9中に示すx座標は、前景色インデックス化処理部32へ入力された画像データが表わす画像中の主走査方向の画素の位置に対応し、y座標は、副走査方向の画素の位置に対応する。各インデックス画像の主走査方向及び副走査方向は、カラー画像入力装置11でカラー画像を読み取る際の主走査方向及び副走査方向に対応する。座標(x,y)は画像上の画素の位置を示し、座標によって各画素を特定することができる。
7, 8, and 9 are conceptual diagrams illustrating examples of the initial index image, the separation index image, and the integrated index image.
In the present embodiment, the data of each of the separation index image and the integrated index image is generated, but the data of the initial index image is not generated. However, the initial index image is also illustrated for comparison with the separated index image.
The x coordinate shown in FIGS. 7 to 9 corresponds to the position of the pixel in the main scanning direction in the image represented by the image data input to the foreground color
各インデックス画像では、前景マスクで前景とされている各画素に、夫々の色(例えば赤色、及び青色等)を示すインデックスが対応付けられている。前景を示すインデックスは、“1”以上のいずれかの数値を有する。また、各インデックス画像では、前景マスクで背景とされている各画素に、前景の色とは異なる色(例えば白色)を示すインデックスが対応付けられている。背景を示すインデックスは“0”である。 In each index image, an index indicating each color (for example, red, blue, etc.) is associated with each pixel set as the foreground in the foreground mask. The index indicating the foreground has any numerical value of “1” or more. In each index image, an index indicating a color (for example, white) different from the foreground color is associated with each pixel that is set as the background in the foreground mask. The index indicating the background is “0”.
図10〜図13は、インデックステーブル、インデックスカラーテーブル、及び座標テーブルの例を示す図表である。
インデックステーブルは、アドレスとインデックスとを関連付けたテーブルである。
10 to 13 are diagrams illustrating examples of an index table, an index color table, and a coordinate table.
The index table is a table in which addresses and indexes are associated with each other.
インデックスカラーテーブルは、アドレスと、RGB各色の色強度で表わされた色情報と、画素数とを関連付けたテーブルである。インデックスカラーテーブルのアドレスは、インデックステーブルのインデックスに対応する。換言すれば、インデックスカラーテーブルは、インデックスと、このインデックスに関連付けられた色情報と、このインデックスが対応付けられた画素の画素数とを関連付けたテーブルである。背景を示すインデックス“0”には、白色を示す色情報と、画素数243とが関連付けられている。以下では、各色の色情報をRGB値(Rの色強度,Gの色強度,Bの色強度)で表わす。例えば、白色はRGB値(255,255,255)と表わされる。
The index color table is a table in which addresses, color information represented by color intensities of RGB colors, and the number of pixels are associated with each other. The address of the index color table corresponds to the index of the index table. In other words, the index color table is a table that associates an index, color information associated with the index, and the number of pixels associated with the index. The index “0” indicating the background is associated with color information indicating white color and the number of
座標テーブルは、アドレスと、最小x座標値、最小y座標値、最大x座標値、及び最大y座標値とを関連付けたテーブルである。座標テーブルのアドレスは、インデックステーブルのインデックスに対応する。換言すれば、座標テーブルは、インデックスと、このインデックスが対応付けられた画素が存在する画像上の矩形領域の、主走査方向の最小座標値及び最大座標値並びに副走査方向の最小座標値及び最大座標値とを関連付けたテーブルである。 The coordinate table is a table in which addresses are associated with minimum x coordinate values, minimum y coordinate values, maximum x coordinate values, and maximum y coordinate values. The address of the coordinate table corresponds to the index of the index table. In other words, the coordinate table includes the minimum coordinate value and the maximum coordinate value in the main scanning direction and the minimum coordinate value and the maximum coordinate value in the sub-scanning direction of the rectangular area on the image where the index and the pixel associated with the index exist. It is a table in which coordinate values are associated.
図10(a)に示す分離インデックステーブル、図10(b)に示す分離インデックスカラーテーブル、及び図11に示す分離座標テーブルは、図8に示す分離インデックス画像に対応する。
図12(a)に示す統合インデックステーブル、図12(b)に示す統合インデックスカラーテーブル、及び図13に示す統合座標テーブルは、図9に示す統合インデックス画像に対応する。
統合インデックステーブルのアドレスは、分離インデックステーブルのインデックスに対応する。換言すれば、統合インデックステーブルは、分離インデックスと統合インデックスとを関連付けたテーブルである。
The separation index table shown in FIG. 10A, the separation index color table shown in FIG. 10B, and the separation coordinate table shown in FIG. 11 correspond to the separation index image shown in FIG.
The integrated index table shown in FIG. 12A, the integrated index color table shown in FIG. 12B, and the integrated coordinate table shown in FIG. 13 correspond to the integrated index image shown in FIG.
The address of the integrated index table corresponds to the index of the separation index table. In other words, the integrated index table is a table in which the separation index and the integrated index are associated with each other.
図8に示す分離インデックス画像において、座標(7,2)〜座標(11,7)の矩形領域に含まれるインデックス“2”の画素(以下、第1の青画素群という)と、座標(10,16)〜座標(12,16)の矩形領域に含まれるインデックス“6”の画素(以下、第2の青画素群という)とは、いずれもRGB値(0,0,255)の画素(青色の画素)である。
このため、図7に示すように、初期インデックス画像では、第1の青座標群及び第2の青座標群の両方に、インデックス“2”が対応付けられている。
In the separation index image shown in FIG. 8, the pixel of index “2” (hereinafter referred to as the first blue pixel group) included in the rectangular area of coordinates (7, 2) to coordinates (11, 7), and coordinates (10 , 16) to the pixel of index “6” (hereinafter referred to as the second blue pixel group) included in the rectangular area of coordinates (12, 16) is a pixel having an RGB value (0, 0, 255) ( Blue pixels).
Therefore, as shown in FIG. 7, in the initial index image, the index “2” is associated with both the first blue coordinate group and the second blue coordinate group.
しかしながら、図11に示す分離座標テーブルを参照すればわかるように、第1の青画素群と第2の青画素群との副走査方向の最小距離は、第2の青画素群の最小y座標値“16”から第1の青画素群の最大y座標値“7”を減算した減算結果“9”であり、非常に遠い。
このため、図8に示す分離インデックス画像では、第1の青座標群に係るインデックスと及び第2の青座標群に係るインデックスとは分離されて、異なるインデックスが対応付けられている。
However, as can be seen from the separation coordinate table shown in FIG. 11, the minimum distance in the sub-scanning direction between the first blue pixel group and the second blue pixel group is the minimum y coordinate of the second blue pixel group. The subtraction result “9” obtained by subtracting the maximum y-coordinate value “7” of the first blue pixel group from the value “16” is very far.
For this reason, in the separation index image shown in FIG. 8, the index related to the first blue coordinate group and the index related to the second blue coordinate group are separated, and different indexes are associated with each other.
図8に示す分離インデックス画像において、座標(1,14)〜座標(3,18)の矩形領域に含まれるインデックス“5”の画素(以下、第1の緑画素群という)は、RGB値(120,240,120)の画素(薄い緑色の画素)である。また、座標(4,18)〜座標(4,19)の矩形領域に含まれるインデックス“7”の画素(以下、第2の緑画素群という)は、RGB値(135,240,135)の画素(更に薄い緑色の画素)である。
第1の緑画素群の色と第2の緑画素群の色とは非常に近似している。しかも、第1の緑画素群の画素数“11”は第2の緑画素群の画素数“2”より多い。
In the separation index image shown in FIG. 8, the pixel of index “5” (hereinafter referred to as the first green pixel group) included in the rectangular area of coordinates (1, 14) to coordinates (3, 18) has an RGB value ( 120, 240, 120) pixels (light green pixels). Also, the pixel of index “7” (hereinafter referred to as the second green pixel group) included in the rectangular area of coordinates (4, 18) to coordinates (4, 19) has an RGB value (135, 240, 135). A pixel (a lighter green pixel).
The color of the first green pixel group and the color of the second green pixel group are very close. Moreover, the number of pixels “11” in the first green pixel group is larger than the number of pixels “2” in the second green pixel group.
従って、図10(a)に示す分離インデックステーブルにおいてアドレス“7”に関連付けられていたインデックス“7”は、図12(a)に示す統合インデックステーブルではインデックス“5”に変更されている。
また、図12(b)に示す統合インデックスカラーテーブルでは、アドレス“7”に関連付けられていた色情報及び画素数が、夫々デフォルト値(本実施の形態では“0”)に変更されている。更に、アドレス“5”に関連付けられていた画素数が、“13”に変更されている。画素数“13”とは、図10(b)に示す分離インデックスカラーテーブルでアドレス“5”に関連付けられていた画素数“11”とアドレス“7”に関連付けられていた画素数“2”とを加算した加算結果である。
Accordingly, the index “7” associated with the address “7” in the separation index table shown in FIG. 10A is changed to the index “5” in the integrated index table shown in FIG.
In the integrated index color table shown in FIG. 12B, the color information and the number of pixels associated with the address “7” are respectively changed to default values (“0” in the present embodiment). Further, the number of pixels associated with the address “5” is changed to “13”. The number of pixels “13” is the number of pixels “11” associated with the address “5” and the number of pixels “2” associated with the address “7” in the separation index color table shown in FIG. Is the addition result.
更に、図13に示す統合座標テーブルでは、アドレス“7”に関連付けられていた各種座標値がデフォルト値に変更されている。最小x座標値のデフォルト値は、画像の主走査方向の画素数以上の数値である“4095”であり、最小y座標値のデフォルト値は、画像の副走査方向の画素数以上の数値である“8191”であり、最大x座標値のデフォルト値は“0”であり、最大y座標値のデフォルト値は“0”である。ここでは、A3サイズで解像度が300dpiの画素数に基づいて、デフォルト値が設定されている。 Furthermore, in the integrated coordinate table shown in FIG. 13, various coordinate values associated with the address “7” are changed to default values. The default value of the minimum x coordinate value is “4095” which is a numerical value equal to or larger than the number of pixels in the main scanning direction of the image, and the default value of the minimum y coordinate value is a numerical value equal to or larger than the number of pixels in the sub scanning direction of the image. “8191”, the default value of the maximum x coordinate value is “0”, and the default value of the maximum y coordinate value is “0”. Here, a default value is set based on the number of pixels with an A3 size and a resolution of 300 dpi.
更にまた、統合座標テーブルでは、アドレス“5”に関連付けられていた各種座標値が、インデックス“5”が対応付けられた画素が存在する矩形領域の最小x座標値“1”、最小y座標値“14”、最大x座標値“4”、及び最大y座標値“19”に変更されている。ここで、図11に示す分離座標テーブルを参照すればわかるように、図13に示す統合座標テーブルにおけるインデックス“5”の最小x座標値及び最小y座標値は、分離座標テーブルにおけるインデックス“5”,“7”夫々の最小x座標値及び最小y座標値の内の最小値に等しく、統合座標テーブルにおけるインデックス“5”の最大x座標値及び最大y座標値は、分離座標テーブルにおけるインデックス“5”,“7”夫々の最大x座標値及び最大y座標値の内の最大値に等しい。 Furthermore, in the integrated coordinate table, various coordinate values associated with the address “5” are the minimum x coordinate value “1” and the minimum y coordinate value of the rectangular area where the pixel associated with the index “5” is present. It is changed to “14”, the maximum x coordinate value “4”, and the maximum y coordinate value “19”. Here, as can be understood by referring to the separation coordinate table shown in FIG. 11, the minimum x coordinate value and the minimum y coordinate value of the index “5” in the integrated coordinate table shown in FIG. 13 are the index “5” in the separation coordinate table. , “7” equal to the minimum value of the minimum x coordinate value and the minimum y coordinate value of each, and the maximum x coordinate value and the maximum y coordinate value of the index “5” in the integrated coordinate table are the index “5” in the separated coordinate table. It is equal to the maximum value among the maximum x coordinate value and the maximum y coordinate value of “7” and “7”, respectively.
図5に示すインデックス生成部321では、前景レイヤのデータ及び画像データに基づいて、インデックス対応処理とインデックス分離処理とが実行される。インデックス生成部321は、本発明における識別子対応手段及び識別子分離手段として機能する。
インデックス対応処理では、各画素の色に応じて、特定の色に関連付けられたインデックスを各画素に対応付けることがなされる。
また、インデックス分離処理では、インデックス対応処理で同一のインデックスが対応付けられた画素の内、画像上で所定距離より離隔している画素間でインデックスを分離することがなされる。本実施の形態では、この所定距離として、後述する図22に示す最小距離Δyを用いる。
In the
In the index correspondence processing, an index associated with a specific color is associated with each pixel according to the color of each pixel.
In the index separation process, among the pixels associated with the same index in the index correspondence process, the index is separated between pixels that are separated from the predetermined distance on the image. In the present embodiment, the minimum distance Δy shown in FIG. 22 described later is used as the predetermined distance.
ただし、インデックス生成部321は、1枚分の画像データの各画素に対してインデックス対応処理及びインデックス分離処理を実行して分離インデックス画像のデータを生成する構成である(後述する図14〜図16に示すフローチャート参照)。つまり、インデックス生成部321は、1枚分の画像データに対してインデックス対応処理を実行して初期インデックス画像のデータを生成し、次いで、初期インデックス画像のデータに対してインデックス分離処理を実行して分離インデックス画像のデータを生成する構成ではない。
However, the
従って、インデックス生成部321からは、図8、図10及び図11に示すような分離インデックス画像のデータ、分離インデックステーブル、分離インデックスカラーテーブル、及び分離座標テーブルが出力される。
インデックス生成部321では、初期インデックスを一時的に記憶しておくための初期インデックステーブルも生成する。初期インデックステーブルに記憶される初期インデックスは、分離インデックステーブルのアドレスに対応する。
Therefore, the
The
初期インデックステーブルは、インデックス生成部321の後段では使用されない。なお、次の図14〜図16に示すフローチャートにおいて、インデックス生成部321が、S11で分離インデックステーブルを生成せずに、S13でNOと判定した後に、初期インデックステーブルのデータを書き直すことによって分離インデックステーブルを生成してもよい。この場合、初期インデックステーブル及び分離インデックステーブルの一方だけを、例えば図示しないメモリに記憶しておけばよいため、ハードウェアリソースを節約することができる。
The initial index table is not used in the subsequent stage of the
図14〜図16は、インデックス生成部321が行なう処理の手順を示すフローチャートである。
図14に示すように、インデックス生成部321は、初期インデックステーブルと、分離インデックステーブル、分離インデックスカラーテーブル、及び分離座標テーブルと、分離インデックス画像とを生成する(S11)。
S11の処理が実行されることによって、初期インデックステーブルには、アドレス“0”,“1”,“2”,…と、初期インデックスのデフォルト値“0”とが記憶され、分離インデックステーブルには、アドレス“0”,“1”,“2”,…と、分離インデックスのデフォルト値とが記憶される。分離インデックスのデフォルト値は、分離インデックスに関連付けられているアドレスに等しい。
14 to 16 are flowcharts showing a procedure of processing performed by the
As illustrated in FIG. 14, the
By executing the process of S11, addresses “0”, “1”, “2”,... And a default value “0” of the initial index are stored in the initial index table. , Addresses “0”, “1”, “2”,... And the default value of the separation index are stored. The default value for the isolation index is equal to the address associated with the isolation index.
また、分離インデックスカラーテーブルには、アドレス“0”,“1”,“2”,…と、RGB値のデフォルト値と、画素数のデフォルト値“0”とが記憶される。アドレス“0”に関連付けられるRGB値のデフォルト値はRGB値(255,255,255)であるが、アドレス“0”以外のアドレスに関連付けられるRGB値のデフォルト値はRGB値(0,0,0)である。
分離座標テーブルには、アドレス“0”,“1”,“2”,…と、各種座標値のデフォルト値とが記憶される。
分離インデックス画像の各画素には、デフォルト値として、インデックス“0”(即ち背景のインデックス)が付与される。
In addition, the separation index color table stores addresses “0”, “1”, “2”,..., A default value of RGB values, and a default value “0” of the number of pixels. The default RGB value associated with the address “0” is the RGB value (255, 255, 255), but the default RGB value associated with an address other than the address “0” is the RGB value (0, 0, 0). ).
In the separation coordinate table, addresses “0”, “1”, “2”,..., And default values of various coordinate values are stored.
Each pixel of the separation index image is given an index “0” (that is, a background index) as a default value.
S11の処理終了後、インデックス生成部321は、初期インデックスカウンタidxcnt及び副走査カウンタycntを夫々“0”にリセットする(S12)。初期インデックスカウンタidxcntは、本処理にて初期インデックスを付与するためのカウンタである。副走査カウンタycntは、注目画素の画像上の副走査方向の画素位置を示すカウンタである。
次いで、インデックス生成部321は、副走査カウンタycntが、画像の副走査方向の画素数より小さいか否かを判定する(S13)。副走査カウンタycntが副走査方向の画素数以上である場合(S13でNO)、1枚分の画像データの入力が全て終了したため、インデックス生成部321は、本処理を終了する。
After the processing of S11 ends, the
Next, the
副走査カウンタycntが、副走査方向の画素数より小さい場合(S13でYES)、インデックス生成部321は、主走査カウンタxcntを“0”にリセットする(S14)。主走査カウンタxcntは、注目画素の画像上の主走査方向の画素位置を示すカウンタである。
次いで、インデックス生成部321は、主走査カウンタxcntが、画像の主走査方向の画素数より小さいか否かを判定する(S15)。主走査カウンタxcntが主走査方向の画素数以上である場合(S15でNO)、1ライン分の主走査方向の画素の選択が全て終了したため、インデックス生成部321は、副走査カウンタycntをインクリメントし(S16)、処理をS13へ戻す。
If the sub-scanning counter ycnt is smaller than the number of pixels in the sub-scanning direction (YES in S13), the
Next, the
主走査カウンタxcntが、主走査方向の画素数より小さい場合(S15でYES)、インデックス生成部321は、S17以降の処理を実行する。このとき、注目画素の位置は、主走査カウンタxcntと副走査カウンタycntとで表現される。本実施の形態においては、注目画素(xcnt,ycnt)が、選択中の画素である。また、注目画素(xcnt,ycnt)が選択されるよりも前に選択された各画素が、選択済みの画素である。
インデックス生成部321は、前景マスクを参照し、注目画素(xcnt,ycnt)が前景の画素であるか否かを判定する(S17)。
When the main scanning counter xcnt is smaller than the number of pixels in the main scanning direction (YES in S15), the
The
注目画素(xcnt,ycnt)が背景の画素である場合(S17でNO)、インデックス生成部321は、アドレスaddrに“0”を代入し(S18)、分離インデックスカラーテーブルをアドレスaddrについて更新する(S19)。S19の処理では、インデックス生成部321は、アドレスaddrに関連付けられた画素数(即ち背景の画素数)をインクリメントする。
次いで、インデックス生成部321は、座標テーブル更新処理のサブルーチン(後述する図17参照)を呼び出すことによって、分離座標テーブルをアドレスaddrについて更新する(S20)。
S20の処理終了後、インデックス生成部321は、主走査カウンタxcntをインクリメントして(S21)、処理をS15へ戻す。
When the target pixel (xcnt, ycnt) is a background pixel (NO in S17), the
Next, the
After the process of S20 ends, the
図17は、座標テーブル更新処理のサブルーチンの処理の手順を示すフローチャートである。
以下では、アドレスaddrに関連付けられている最小x座標値、最小y座標値、最大x座標値、及び最大y座標値を、最小x座標値xmin[addr]、最小y座標値ymin[addr]、最大x座標値xmax[addr]、及び最大y座標値ymax[addr]と記載する。
インデックス生成部321は、分離座標テーブルに記録された最小x座標値xmin[addr]が主走査カウンタxcntより大きいか否かを判定する(S31)。
最小x座標値xmin[addr]が主走査カウンタxcntより大きい場合(S31でYES)、インデックス生成部321は、アドレスaddrに関連付けられた最小x座標値xmin[addr]に主走査カウンタxcntを代入する(S32)。
FIG. 17 is a flowchart showing the procedure of the subroutine of the coordinate table update process.
In the following, the minimum x coordinate value, the minimum y coordinate value, the maximum x coordinate value, and the maximum y coordinate value associated with the address addr are represented as a minimum x coordinate value xmin [addr], a minimum y coordinate value ymin [addr], The maximum x coordinate value xmax [addr] and the maximum y coordinate value ymax [addr] are described.
The
When the minimum x coordinate value xmin [addr] is larger than the main scanning counter xcnt (YES in S31), the
S32が終了した場合、又はS31で最小x座標値xmin[addr]が主走査カウンタxcnt以下である場合(S31でNO)、インデックス生成部321は、分離座標テーブルに記録された最小y座標値ymin[addr]が副走査カウンタycntより大きいか否かを判定する(S33)。
最小y座標値ymin[addr]が副走査カウンタycntより大きい場合(S33でYES)、インデックス生成部321は、アドレスaddrに関連付けられた最小y座標値ymin[addr]に副走査カウンタycntを代入する(S34)。
When S32 ends, or when the minimum x coordinate value xmin [addr] is equal to or smaller than the main scanning counter xcnt in S31 (NO in S31), the
When the minimum y coordinate value ymin [addr] is larger than the sub-scanning counter ycnt (YES in S33), the
S34が終了した場合、又はS33で最小y座標値ymin[addr]が副走査カウンタycnt以下である場合(S33でNO)、インデックス生成部321は、分離座標テーブルに記録された最大x座標値xmax[addr]が主走査カウンタxcntより小さいか否かを判定する(S35)。
最大x座標値xmax[addr]が主走査カウンタxcntより小さい場合(S35でYES)、インデックス生成部321は、アドレスaddrに関連付けられた最大x座標値xmax[addr]に主走査カウンタxcntを代入する(S36)。
When S34 ends, or when the minimum y coordinate value ymin [addr] is equal to or smaller than the sub-scanning counter ycnt in S33 (NO in S33), the
When the maximum x coordinate value xmax [addr] is smaller than the main scanning counter xcnt (YES in S35), the
S36が終了した場合、又はS35で最大x座標値xmax[addr]が主走査カウンタxcnt以上である場合(S35でNO)、インデックス生成部321は、分離座標テーブルに記録された最大y座標値ymax[addr]が副走査カウンタycntより小さいか否かを判定する(S37)。
最大y座標値ymax[addr]が副走査カウンタycntより小さい場合(S37でYES)、インデックス生成部321は、アドレスaddrに関連付けられた最大y座標値ymax[addr]に副走査カウンタycntを代入する(S38)。
When S36 ends, or when the maximum x coordinate value xmax [addr] is greater than or equal to the main scanning counter xcnt in S35 (NO in S35), the
When the maximum y coordinate value ymax [addr] is smaller than the sub-scanning counter ycnt (YES in S37), the
S38が終了した場合、又はS37で最大y座標値ymax[addr]が副走査カウンタycnt以上である場合(S37でNO)、インデックス生成部321は、座標テーブル更新処理のサブルーチンの処理を終了し、処理をメインルーチンへ戻す。
When S38 ends, or when the maximum y coordinate value ymax [addr] is equal to or greater than the sub-scanning counter ycnt in S37 (NO in S37), the
図14に示すように、注目画素(xcnt,ycnt)が前景の画素である場合(S17でYES)、図15に示すように、インデックス生成部321は、注目画素(xcnt,ycnt)の色情報に基づいて、減色処理を行なう(S41)。
S41における減色処理としては、例えば特許文献1に記載された方法を用いることができる。この場合の減色処理とは、画像データに含まれる各画素の色情報に対し、予め定められた色数への減色を行なう処理である。例えば、RGB各色の色強度を8ビットで表わしている色情報のビット数を、2−2−2、3−3−2、又は3−3−3ビット等のビット数に落とす。ビット数の選び方は、色判定をどの程度の精度で行なうかによって任意に選択可能である。
As shown in FIG. 14, when the target pixel (xcnt, ycnt) is a foreground pixel (YES in S17), as shown in FIG. 15, the
As the color reduction processing in S41, for example, the method described in
図18は、減色処理テーブルの例を示す図表である。
本実施の形態では、RGB各色情報のビット数を2−2−2とした場合に、図18に示す減色処理テーブルを用いて、減色処理が行なわれる。この場合、RGB各色は夫々4階調となる。
減色処理テーブルでは、Rの色強度、Gの色強度、及びBの色強度と、Rの減色結果col_r 、Gの減色結果col_g 、及びBの減色結果col_b とが関連付けられている。このような減色処理テーブルは、図示しないメモリに予め記憶されている。
S41では、インデックス生成部321は、減色処理テーブルを参照し、注目画素(xcnt,ycnt)の色情報に基づいて、減色結果col_r ,col_g ,col_b を取得する。
FIG. 18 is a chart showing an example of the color reduction processing table.
In the present embodiment, when the number of bits of RGB color information is 2-2-2, color reduction processing is performed using the color reduction processing table shown in FIG. In this case, each RGB color has 4 gradations.
In the color reduction processing table, the R color intensity, the G color intensity, and the B color intensity are associated with the R color reduction result col_r, the G color reduction result col_g, and the B color reduction result col_b. Such a color reduction processing table is stored in advance in a memory (not shown).
In S41, the
次いで、インデックス生成部321は、減色結果を初期インデックスに対応付けるために、初期インデックステーブルへのアドレスcoladrを、下記の式(5)を用いて算出する(S42)。この結果、アドレスcoladrは“0”以上、“63”以下の範囲内のいずれかの値を取る。つまり、色情報に対して最大64通りの初期インデックスを付与することができる。
coladr=col_r +col_g ×4+col_b ×16…(5)
Next, the
coladr = col_r + col_g × 4 + col_b × 16 (5)
以下に、初期インデックステーブルへのアドレスcoladrの具体例を挙げる。
注目画素(xcnt,ycnt)=(2,2)はRGB値(128,0,128)である(図8に示す分離インデックス画像及び図10(b)に示す分離インデックスカラーテーブル参照)。この場合、図18に示す減色処理テーブルを参照すると、減色結果col_r ,col_g ,col_b =2,0,2となるため、初期インデックステーブルへのアドレスcoladrは、以下の式(6)のように算出される。
coladr=2+0×4+2×16=34…(6)
A specific example of the address coladr to the initial index table is given below.
The target pixel (xcnt, ycnt) = (2, 2) is an RGB value (128, 0, 128) (see the separation index image shown in FIG. 8 and the separation index color table shown in FIG. 10B). In this case, referring to the color reduction processing table shown in FIG. 18, since the color reduction results col_r, col_g, col_b = 2, 0, 2, the address coladr to the initial index table is calculated as in the following equation (6). Is done.
coladr = 2 + 0 × 4 + 2 × 16 = 34 (6)
以下では、注目画素(xcnt,ycnt)=(2,2)を第1の注目画素(2,2)という。第1の注目画素(2,2)は、インデックスが分離されない画素の例である。このため、第1の注目画素(2,2)に対応付けられる分離インデックスは、初期インデックスに等しい。 Hereinafter, the target pixel (xcnt, ycnt) = (2, 2) is referred to as a first target pixel (2, 2). The first target pixel (2, 2) is an example of a pixel whose index is not separated. For this reason, the separation index associated with the first target pixel (2, 2) is equal to the initial index.
注目画素(xcnt,ycnt)=(10,16)はRGB値(0,0,255)である。この場合、減色結果col_r ,col_g ,col_b =0,0,3となるため、初期インデックステーブルへのアドレスcoladrは、以下の式(7)のように算出される。
coladr=0+0×4+3×16=48…(7)
The pixel of interest (xcnt, ycnt) = (10, 16) is an RGB value (0, 0, 255). In this case, since the color reduction results col_r, col_g, col_b = 0, 0, 3, the address coladr to the initial index table is calculated as in the following equation (7).
coladr = 0 + 0 × 4 + 3 × 16 = 48 (7)
以下では、注目画素(xcnt,ycnt)=(10,16)を第2の注目画素(10,16)という。第2の注目画素(10,16)は、インデックスが分離される画素の例である。このため、第2の注目画素(10,16)に対応付けられる分離インデックスは、初期インデックスとは異なる。 Hereinafter, the target pixel (xcnt, ycnt) = (10, 16) is referred to as a second target pixel (10, 16). The second pixel of interest (10, 16) is an example of a pixel from which an index is separated. For this reason, the separation index associated with the second pixel of interest (10, 16) is different from the initial index.
次いで、インデックス生成部321は、初期インデックステーブルを参照し、アドレスcoladrの初期インデックスtmpidx[coladr]を読み出し、読み出した初期インデックスtmpidx[coladr]が“0”であるか否かを判定する(S43)。S43の判定処理は、初期インデックスtmpidx[coladr]が未登録であるか登録済みであるかを判定する処理である。
初期インデックスtmpidx[coladr]が“0”である場合(S43でYES)、初期インデックスtmpidx[coladr]が未登録である。このため、インデックス生成部321は、初期インデックスカウンタidxcntをインクリメントする(S44)。
Next, the
When the initial index tmpidx [coladr] is “0” (YES in S43), the initial index tmpidx [coladr] is not registered. Therefore, the
図19及び図20は、第1の注目画素(2,2)及び第2の注目画素(10,16)に対する処理の手順を説明するための図表である。図19及び図20夫々の(a)は初期インデックステーブルを示し、(b)は分離座標テーブルを示し、(c)は分離インデックスカラーテーブルを示している。
図19(a)に示すように、アドレスcoladr=34である第1の注目画素(2,2)は、初期インデックスtmpidx[coladr]=0である。また、初期インデックスカウンタidxcnt=1である。このため、第1の注目画素(2,2)には、初期インデックス“1”が新規に付与される。
FIGS. 19 and 20 are tables for explaining the processing procedure for the first pixel of interest (2, 2) and the second pixel of interest (10, 16). 19A and 19B, (a) shows an initial index table, (b) shows a separation coordinate table, and (c) shows a separation index color table.
As shown in FIG. 19A, the first target pixel (2, 2) having the address coladr = 34 has the initial index tmpidx [coladr] = 0. The initial index counter idxcnt = 1. Therefore, the initial index “1” is newly assigned to the first target pixel (2, 2).
図15に示すように、インデックス生成部321は、初期インデックステーブルのアドレスcoladrに関連付けられている初期インデックスtmpidx[coladr]を初期インデックスカウンタidxcntの値に更新する(S45)。
図19(a)の場合、インデックス生成部321は、初期インデックステーブルのアドレス“34”に関連付けられている初期インデックス“0”を“1”に更新する。
As shown in FIG. 15, the
In the case of FIG. 19A, the
次いで、図15に示すように、インデックス生成部321は、分離インデックス画像を更新する(S46)。具体的には、インデックス生成部321は、分離インデックス画像における注目画素(xcnt,ycnt)の画素値に、初期インデックスカウンタidxcntの値を上書きする。
更に、インデックス生成部321は、アドレスaddrに初期インデックスtmpidx[coladr]を代入し(S47)、座標テーブル更新処理のサブルーチン(図17参照)を呼び出すことによって、分離座標テーブルをアドレスaddrについて更新する(S48)。
Next, as shown in FIG. 15, the
Further, the
図19(a)に示すように、第1の注目画素(2,2)に対応付けられた初期インデックスtmpidx[coladr]=1である。このため、S46の処理を実行することによって、図8に示すように、分離インデックス画像における座標(2,2)の画素の画素値が“1”になる。また、S48の処理を実行することによって、図19(b)に示すように分離座標テーブルが更新される。この結果、分離座標テーブルでは、アドレス“1”に関連付けて、最小x座標値“2”、最小y座標値“2”、最大x座標値“2”、及び最大y座標値“2”が記憶される。 As shown in FIG. 19A, the initial index tmpidx [coladr] = 1 associated with the first pixel of interest (2, 2). Therefore, by executing the processing of S46, the pixel value of the pixel at the coordinate (2, 2) in the separation index image becomes “1” as shown in FIG. Further, by executing the processing of S48, the separation coordinate table is updated as shown in FIG. As a result, in the separation coordinate table, the minimum x coordinate value “2”, the minimum y coordinate value “2”, the maximum x coordinate value “2”, and the maximum y coordinate value “2” are stored in association with the address “1”. Is done.
更にまた、インデックス生成部321は、インデックスカラーテーブル更新処理のサブルーチン(後述する図21参照)を呼び出すことによって、分離インデックスカラーテーブルをアドレスaddrについて更新する(S49)。
図19(a)に示すように、第1の注目画素(2,2)に対応付けられた初期インデックスtmpidx[coladr]=1である。このため、S49の処理を実行することによって、図19(c)に示すように分離インデックスカラーテーブルが更新される。S49の処理の実行以前は、アドレス“1”に関連付けられた色情報はRGB値(0,0,0)であり、画素数は“0”であるため、S49の処理の結果、分離インデックスカラーテーブルでは、アドレス“1”に関連付けて、第1の注目画素(2,2)のRGB値(128,0,128)と、画素数“1”とが記憶される(後述する図21に示すS52,S53参照)。
Furthermore, the
As shown in FIG. 19A, the initial index tmpidx [coladr] = 1 associated with the first pixel of interest (2, 2). For this reason, by executing the processing of S49, the separation index color table is updated as shown in FIG. Prior to the execution of the process of S49, the color information associated with the address “1” is an RGB value (0, 0, 0) and the number of pixels is “0”. In the table, the RGB value (128, 0, 128) of the first target pixel (2, 2) and the number of pixels “1” are stored in association with the address “1” (shown in FIG. 21 described later). (See S52 and S53).
図21は、インデックスカラーテーブル更新処理のサブルーチンの処理の手順を示すフローチャートである。
インデックス生成部321は、分離インデックスカラーテーブルを参照して、アドレスaddrに関連付けられている画素数が“0”であるか否かを判定する(S51)。S51の判定処理は、初期インデックステーブルの初期インデックス“addr”に対応付けられたRGB値が未登録であるか登録済みであるかを判定する処理である。
FIG. 21 is a flowchart showing the procedure of the subroutine of the index color table update process.
The
画素数が“0”である場合(S51でYES)、RGB値は未登録であるため、インデックス生成部321は、注目画素(xcnt,ycnt)のRGB値を分離インデックスカラーテーブルに記憶させ(S52)、画素数をインクリメントして(S53)、インデックスカラーテーブル更新処理のサブルーチンの処理を終了し、処理をメインルーチンへ戻す。
When the number of pixels is “0” (YES in S51), since the RGB value is not registered, the
S52の処理を実行する場合、初期インデックス“addr”に対応付けるべきRGB各色の色強度rcol[addr],gcol[addr],bcol[addr]は、注目画素(xcnt,ycnt)の色強度rcol[注目画素],gcol[注目画素],bcol[注目画素]を用いて、以下の式(8)〜(10)のように算出される。
rcol[addr]←rcol[注目画素]…(8)
gcol[addr]←gcol[注目画素]…(9)
bcol[addr]←bcol[注目画素]…(10)
When executing the processing of S52, the color intensities rcol [addr], gcol [addr], and bcol [addr] of RGB colors to be associated with the initial index “addr” are the color intensities rcol [attention of the pixel of interest (xcnt, ycnt). Pixels], gcol [target pixel], and bcol [target pixel] are used to calculate the following formulas (8) to (10).
rcol [addr] <-rcol [target pixel] (8)
gcol [addr] <-gcol [target pixel] (9)
bcol [addr] <-bcol [target pixel] (10)
画素数が“0”ではない場合(S51でNO)、RGB値は登録済みであるため、インデックス生成部321は、分離インデックスカラーテーブルからアドレスaddrに関連付けられているRGB値を読み出し、読み出したRGB値と注目画素(xcnt,ycnt)のRGB値とに基づき、RGB各色の色強度の平均値を算出する(S54)。
次いで、インデックス生成部321は、S54で算出したRGB各色の色強度の平均値をアドレスaddrに関連付けて分離インデックスカラーテーブルに記憶させ(S55)、処理をS53へ移す。
When the number of pixels is not “0” (NO in S51), since the RGB value has already been registered, the
Next, the
なお、S51でNOの場合、インデックス生成部321は、S54及びS55の処理を行なわずに、S53の処理を実行してもよい。何故ならば、減色結果が同じRGB各色の色強度が分離インデックスカラーテーブルに既に記憶されているからである。
In the case of NO in S51, the
S54の処理を実行する場合、初期インデックス“addr”に対応付けるべきRGB各色の色強度rcol[addr],gcol[addr],bcol[addr]は、既に初期インデックス“addr”に対応付けられているRGB各色の色強度rcol[addr],gcol[addr],bcol[addr]を用いて、以下の式(11)〜(13)のように算出される。
rcol[addr]←{rcol[addr]+rcol[注目画素]}/2…(11)
gcol[addr]←{gcol[addr]+gcol[注目画素]}/2…(12)
bcol[addr]←{bcol[addr]+bcol[注目画素]}/2…(13)
When executing the processing of S54, the color intensities rcol [addr], gcol [addr], bcol [addr] of the RGB colors to be associated with the initial index “addr” are already associated with the initial index “addr”. Using the color intensities rcol [addr], gcol [addr], and bcol [addr] of each color, the following equations (11) to (13) are calculated.
rcol [addr] ← {rcol [addr] + rcol [target pixel]} / 2 (11)
gcol [addr] ← {gcol [addr] + gcol [target pixel]} / 2 (12)
bcol [addr] ← {bcol [addr] + bcol [target pixel]} / 2 (13)
ところで、S54の処理は非常に簡易であるが、平均値を算出する都度、色強度rcol[addr],gcol[addr],bcol[addr]が誤差を含んでしまう虞がある。
このような不都合を回避するためには、例えば、S54の処理で、インデックス生成部321が、前述の式(11)〜(13)の代わりに、以下の式(14)〜(16)を用いて色強度rcol[addr],gcol[addr],bcol[addr]を算出し、算出した色強度rcol[addr],gcol[addr],bcol[addr]を、S55の処理で分離インデックスカラーテーブルに記憶させることが考えられる。
By the way, although the process of S54 is very simple, every time the average value is calculated, the color intensities rcol [addr], gcol [addr], and bcol [addr] may include an error.
In order to avoid such inconvenience, for example, in the process of S54, the
rcol[addr]←rcol[addr]+rcol[注目画素]…(14)
gcol[addr]←gcol[addr]+gcol[注目画素]…(15)
bcol[addr]←bcol[addr]+bcol[注目画素]…(16)
このような式(14)〜(16)は、注目画素(xcnt,ycnt)の色強度を単純に加算したものである。
rcol [addr] ← rcol [addr] + rcol [target pixel] (14)
gcol [addr] ← gcol [addr] + gcol [target pixel] (15)
bcol [addr] ← bcol [addr] + bcol [target pixel] (16)
Such equations (14) to (16) are obtained by simply adding the color intensities of the target pixel (xcnt, ycnt).
そして、インデックス生成部321は、S13でNOの場合、即ち1枚分の画像データの入力が全て終了した場合に、分離インデックスカラーテーブルを更新する処理を実行する。このとき、インデックス生成部321は、変数tempad=1,2,…を順に発生させ、分離インデックスカラーテーブルにおいて、アドレスtempadに関連付けられた画素数cnt [tempad]を用い、最終的な色強度rcol[tempad],gcol[tempad],bcol[tempad]を、以下の式(17)〜(19)のように算出する。最後に、インデックス生成部321は、算出した色強度rcol[tempad],gcol[tempad],bcol[tempad]を、分離インデックスカラーテーブルに記憶させる。
Then, the
rcol[tempad]←rcol[tempad]/cnt [tempad]…(17)
gcol[tempad]←gcol[tempad]/cnt [tempad]…(18)
bcol[tempad]←bcol[tempad]/cnt [tempad]…(19)
rcol [tempad] <-rcol [tempad] / cnt [tempad] (17)
gcol [tempad] <-gcol [tempad] / cnt [tempad] (18)
bcol [tempad] <-bcol [tempad] / cnt [tempad] (19)
図15に示すS49の処理が終了することによって、注目画素(xcnt,ycnt)に対する処理が終了する。そこで、インデックス生成部321は、処理を図14に示すS21へ戻す。この後、インデックス生成部321は、S21で主走査カウンタxcntをインクリメントしてから、注目画素(xcnt,ycnt)について、S15以降の処理を実行する。
When the process of S49 shown in FIG. 15 ends, the process for the pixel of interest (xcnt, ycnt) ends. Therefore, the
図15に示すように、初期インデックスtmpidx[coladr]が“0”ではない場合(S43でNO)、初期インデックスtmpidx[coladr]は登録済みである。このため、インデックス生成部321は、図16に示すように、アドレスaddrに初期インデックスtmpidx[coladr]を代入し(S61)、分離座標テーブルを参照して、アドレスaddrに関連付けられている最大y座標値ymax[addr]を読み出す(S62)。
次いで、インデックス生成部321は、副走査カウンタycntから最大y座標値ymax[addr]を減算した結果を最小距離Δyに代入し(S63)、最小距離Δyが所定閾値lm_yより大きいか否かを判定する(S64)。
ここで、本実施の形態では、所定閾値lm_y=3とする。
As shown in FIG. 15, when the initial index tmpidx [coladr] is not “0” (NO in S43), the initial index tmpidx [coladr] is already registered. Therefore, as shown in FIG. 16, the
Next, the
Here, in this embodiment, the predetermined threshold value lm_y = 3.
図22は、注目画素(xcnt,ycnt)と副走査方向の最小距離Δyとの関係を示す模式図である。
注目画素(xcnt,ycnt)は、画像上の座標(xcnt,ycnt)で位置が指定される。注目画素(xcnt,ycnt)のインデックスは、初期インデックステーブルを参照すればわかるように、初期インデックスtmpidx[coladr]である。
図22中にハッチングで示した領域は、注目画素(xcnt,ycnt)のインデックスと同一のインデックス(以下、同一インデックスという)が対応付けられている画素が占める領域である。この領域に含まれる画素の座標の最小値及び最大値が、最小x座標値xmin[addr]、最小y座標値ymin[addr]、最大x座標値xmax[addr]、及び最大y座標値ymax[addr]である。ただし、図22中は「[addr]」の記載は省略してある。
FIG. 22 is a schematic diagram showing the relationship between the target pixel (xcnt, ycnt) and the minimum distance Δy in the sub-scanning direction.
The position of the target pixel (xcnt, ycnt) is designated by coordinates (xcnt, ycnt) on the image. The index of the pixel of interest (xcnt, ycnt) is the initial index tmpidx [coladr], as can be seen by referring to the initial index table.
The area indicated by hatching in FIG. 22 is an area occupied by pixels associated with the same index (hereinafter referred to as the same index) as the index of the target pixel (xcnt, ycnt). The minimum and maximum coordinate values of the pixels included in this area are the minimum x coordinate value xmin [addr], the minimum y coordinate value ymin [addr], the maximum x coordinate value xmax [addr], and the maximum y coordinate value ymax [ addr]. However, the description of “[addr]” is omitted in FIG.
本実施の形態においては、この領域に含まれる画素の内でy座標が最大値である画素と注目画素(xcnt,ycnt)とのy座標値の差を、副走査方向の最小距離Δyとしている。注目画素(xcnt,ycnt)は座標(0,0)の位置から順に選択されるので、最小距離Δyは、注目画素(xcnt,ycnt)と、選択済みの画素の内で同一インデックスが対応付けられた画素との間の最小距離となる。 In the present embodiment, the difference between the y coordinate values of the pixel having the maximum y coordinate and the target pixel (xcnt, ycnt) among the pixels included in this region is defined as the minimum distance Δy in the sub-scanning direction. . Since the target pixel (xcnt, ycnt) is selected in order from the position of the coordinates (0, 0), the minimum distance Δy is associated with the same index among the target pixel (xcnt, ycnt) and the selected pixel. It is the minimum distance between the pixels.
図20(a)に示すように、coladr=48である第2の注目画素(10,16)は、初期インデックスtmpidx[coladr]=2である。このため、S61の処理で、アドレスaddrに“2”が代入され、S62の処理で、図20(a)に示す分離座標テーブルが参照されて、最大y座標値ymax[addr]=7が読み出される。更に、S63の処理で、最小距離Δy=16−7=9が算出されて、S64で、最小距離Δyが所定閾値lm_yより大きいと判定される。 As shown in FIG. 20A, the second target pixel (10, 16) with coladr = 48 has an initial index tmpidx [coladr] = 2. Therefore, “2” is assigned to the address addr in the process of S61, and the separated coordinate table shown in FIG. 20A is referred to in the process of S62, and the maximum y coordinate value ymax [addr] = 7 is read. It is. Further, the minimum distance Δy = 16−7 = 9 is calculated in the process of S63, and it is determined in S64 that the minimum distance Δy is greater than the predetermined threshold value lm_y.
つまり、S64の判定処理は、注目画素(xcnt,ycnt)が、同一インデックスを対応付けられた他の画素から所定距離より離隔しているか否かを判定する処理である。
最小距離Δy>所定閾値lm_yである場合(S64でYES)、インデックス生成部321は、処理を図15に示すS44へ移す。
That is, the determination process of S64 is a process of determining whether or not the target pixel (xcnt, ycnt) is separated from the other pixel associated with the same index by a predetermined distance.
If the minimum distance Δy> the predetermined threshold lm_y (YES in S64), the
図20(b),(c)に示すように、第2の注目画素(10,16)を処理する直前の初期インデックスカウンタidxcntの値は“5”であるため、S44の処理で、初期インデックスカウンタidxcntの値は“6”になる。
従って、図20(a)に示すように、coladr=48である第2の注目画素(10,16)には、初期インデックス“2”ではなく、分離インデックス“6”が新規に付与される。
S45の処理を実行することによって、インデックス生成部321は、初期インデックステーブルのアドレス“48”に関連付けられている初期インデックス“2”を“6”に更新する。
As shown in FIGS. 20B and 20C, the value of the initial index counter idxcnt immediately before processing the second pixel of interest (10, 16) is “5”. The value of the counter idxcnt is “6”.
Therefore, as shown in FIG. 20A, the second target pixel (10, 16) with coladr = 48 is newly assigned with the separation index “6” instead of the initial index “2”.
By executing the process of S45, the
このため、S46の処理を実行することによって、図8に示すように分離インデックス画像における座標(10,16)の画素の画素値が“6”になる。座標(10,16)の画素に、画素値“2”が与えられることはない。
更に、S48の処理を実行することによって、図20(b)に示すように分離座標テーブルが更新される。この結果、分離座標テーブルでは、アドレス“6”に関連付けて、最小x座標値“10”、最小y座標値“16”、最大x座標値“10”、及び最大y座標値“16”が記憶される。
Therefore, by executing the processing of S46, the pixel value of the pixel at the coordinates (10, 16) in the separation index image becomes “6” as shown in FIG. The pixel value “2” is not given to the pixel at the coordinates (10, 16).
Furthermore, by executing the processing of S48, the separation coordinate table is updated as shown in FIG. As a result, in the separation coordinate table, the minimum x coordinate value “10”, the minimum y coordinate value “16”, the maximum x coordinate value “10”, and the maximum y coordinate value “16” are stored in association with the address “6”. Is done.
更にまた、S49の処理を実行することによって、図20(c)に示すように分離インデックスカラーテーブルが更新される。S49の処理の実行以前は、アドレス“6”に関連付けられた色情報はRGB値(0,0,0)であり、画素数は“0”であるため、S49の処理の結果、分離インデックスカラーテーブルでは、アドレス“6”に関連付けて、RGB値(0,0,255)と画素数“1”とが記憶される。
分離座標テーブル及び分離インデックスカラーテーブルにおいて、アドレス“2”に関連付けられている各種の数値は変更されない。
Furthermore, by executing the process of S49, the separation index color table is updated as shown in FIG. Prior to the execution of the process of S49, the color information associated with the address “6” is an RGB value (0, 0, 0) and the number of pixels is “0”. In the table, the RGB value (0, 0, 255) and the number of pixels “1” are stored in association with the address “6”.
In the separation coordinate table and the separation index color table, various numerical values associated with the address “2” are not changed.
以上のようにインデックスの分離が行なわれた後で、注目画素(xcnt,ycnt)に初期インデックス“2”が対応付けられることはない。何故ならば、第2の注目画素(10,16)以降に選択される注目画素(xcnt,ycnt)と、インデックス“2”が対応付けられている画素との最小距離Δyは、常に所定閾値lm_yよりも大きいからである。 After the index separation is performed as described above, the initial index “2” is not associated with the target pixel (xcnt, ycnt). This is because the minimum distance Δy between the target pixel (xcnt, ycnt) selected after the second target pixel (10, 16) and the pixel associated with the index “2” is always the predetermined threshold lm_y. It is because it is larger than.
図16に示すように、最小距離Δy≦所定閾値lm_yである場合(S64でNO)、インデックス生成部321は、分離インデックス画像を更新する(S65)。具体的には、インデックス生成部321は、分離インデックス画像における注目画素(xcnt,ycnt)の画素値に、初期インデックスtmpidx[coladr]を上書きする。
S65の処理の終了後、インデックス生成部321は、処理を図15に示すS48へ移す。
As shown in FIG. 16, when the minimum distance Δy ≦ the predetermined threshold lm_y (NO in S64), the
After the process of S65 is completed, the
ところで、分離インデックスカラーテーブルに記憶されている分離インデックスは、デフォルト値のままでよい。何故ならば、S13でNOの場合、即ち1枚分の画像データの入力が全て終了した場合に、分離インデックスカラーテーブル及び分離座標テーブル夫々のアドレスは、分離インデックスに等しいからである。 By the way, the separation index stored in the separation index color table may be a default value. This is because the addresses of the separation index color table and the separation coordinate table are equal to the separation index when NO in S13, that is, when all the input of image data for one sheet is completed.
図5に示すインデックス統合部322では、分離インデックス画像のデータ、分離インデックステーブル、分離インデックスカラーテーブル、及び分離座標テーブルに基づいて、インデックス統合処理が実行される。インデックス統合部322は、本発明における識別子統合手段として機能する。
In the
インデックス統合処理では、インデックス対応処理及びインデックス分離処理の実行によって異なるインデックスが対応付けられた画素の内、色同士が所定の範囲内で近似しているインデックスを統合することがなされる。
インデックス統合部322からは、図12及び図13に示す統合インデックステーブル、統合インデックスカラーテーブル、及び統合座標テーブルが出力される。
In the index integration process, among the pixels associated with different indexes by executing the index association process and the index separation process, indexes whose colors are approximated within a predetermined range are integrated.
The
一の分離インデックスに関連付けられた第1の色と、他の分離インデックスに関連付けられた第2の色とは、図10及び図11に示すような分離インデックステーブル及び分離インデックスカラーテーブルを参照すれば容易にわかる。また、一の分離インデックスが対応付けられた画素の画素数(以下、第1の画素数という)と、他の分離インデックスが対応付けられた画素の画素数(以下、第2の画素数という)も、分離インデックステーブル及び分離インデックスカラーテーブルを参照すれば容易にわかる。 For the first color associated with one separation index and the second color associated with another separation index, refer to the separation index table and separation index color table as shown in FIGS. Easy to understand. Also, the number of pixels associated with one separation index (hereinafter referred to as the first pixel number) and the number of pixels associated with other separation indexes (hereinafter referred to as the second pixel number). Is easily understood by referring to the separation index table and the separation index color table.
第1の色と第2の色とが近似している場合は、インデックスの統合が行なわれる。このとき、インデックスの統合による画質の劣化を抑制するために、第1の画素数と第2の画素数とを比較し、画素数が少ない方のインデックスが多い方のインデックスに統合されるようにする。
第1の色と第2の色とが近似していない場合、インデックスの統合は行なわれない。
When the first color and the second color are close to each other, index integration is performed. At this time, in order to suppress degradation of image quality due to the integration of the indexes, the first pixel number and the second pixel number are compared so that the index with the smaller number of pixels is integrated into the index with the larger number. To do.
If the first color and the second color are not approximate, the index is not integrated.
図23及び図24は、インデックス統合部322が行なう処理の手順を示すフローチャートである。
インデックス統合部322は、カウンタi に“1”をセットする(S71)。カウンタi は、第1のインデックス“i ”を示す。
次に、インデックス統合部322は、カウンタi が初期インデックスカウンタidxcnt以下であるかどうかを判定する(S72)。
初期インデックスカウンタidxcntの値は、分離インデックステーブルに記憶されている分離インデックスの個数である。従って、i >idxcntである場合(S72でNO)、全ての分離インデックスに対する処理が終わったため、インデックス統合部322は、本処理を終了する。
FIG. 23 and FIG. 24 are flowcharts showing a procedure of processing performed by the
The
Next, the
The value of the initial index counter idxcnt is the number of separation indexes stored in the separation index table. Therefore, if i> idxcnt (NO in S72), since the processing for all the separated indexes is completed, the
i ≦idxcntである場合(S72でYES)、インデックス統合部322は、下記の式(20)を用いて、カウンタj を演算する(S73)。カウンタj は、第1のインデックス“i ”と色情報同士を比較すべき第2のインデックス“j ”を示す。
j =i +1…(20)
If i ≦ idxcnt (YES in S72), the
j = i + 1 (20)
次に、インデックス統合部322は、カウンタj が初期インデックスカウンタidxcnt以下であるかどうかを判定する(S74)。
j >idxcntである場合(S74でNO)、第1のインデックス“i ”と全ての分離インデックスとの色情報同士の比較が終わったため、インデックス統合部322は、カウンタi をインクリメントして(S75)、処理をS72へ戻す。
Next, the
If j> idxcnt (NO in S74), since the comparison of the color information between the first index “i” and all the separation indexes is completed, the
j ≦idxcntである場合(S74でYES)、インデックス統合部322は、分離インデックステーブル及び分離インデックスカラーテーブルを参照して、第1のインデックス“i ”の色情報と第2のインデックス“j ”の色情報とを読み出す(S76)。具体的には、インデックス統合部322は、分離インデックスカラーテーブルを参照し、カウンタi をアドレスとしてRGB各色の色強度rcol[i ],gcol[i ],bcol[i ]を読み出し、カウンタj をアドレスとしてRGB各色の色強度rcol[j ],gcol[j ],bcol[j ]を読み出す。
When j ≦ idxcnt (YES in S74), the
次に、インデックス統合部322は、第1のインデックス“i ”の色情報と第2のインデックス“j ”の色情報とが所定範囲内で近似しているか否かを判定する。
このために、インデックス統合部322は、下記の式(21)を用いて、演算結果Δcol を演算する(S77)。演算結果Δcol とは、第1のインデックス“i ”及び第2のインデックス“j ”夫々のRGB各色の色強度の差の絶対値の加算結果である。
Next, the
For this purpose, the
Δcol =|rcol[i ]−rcol[j ]|
+|gcol[i ]−gcol[j ]|
+|bcol[i ]−bcol[j ]|…(21)
Δcol = | rcol [i] −rcol [j] |
+ | Gcol [i] -gcol [j] |
+ | Bcol [i] -bcol [j] | ... (21)
演算結果Δcol が所定範囲内である場合、インデックス統合部322は、第1のインデックス“i ”の色情報と第2のインデックス“j ”の色情報とが所定範囲内で近似していると判定する。また、演算結果Δcol が“0”である場合、インデックス統合部322は、第1のインデックス“i ”の色情報と第2のインデックス“j ”の色情報とが同色であると判定する。
このために、インデックス統合部322は、図24に示すように、S77の演算結果Δcol が閾値th_col以下であるか否かを判定する(S78)。本実施の形態では、閾値th_col=40とする。
When the calculation result Δcol is within the predetermined range, the
Therefore, as shown in FIG. 24, the
以下に具体例を述べる。図10(b)に示す分離インデックスカラーテーブルにおいて、カウンタ“5”をアドレスとして色情報を読み出した場合、色強度rcol[5]は“120”、gcol[5]は“240”、bcol[5]は“120”である。また、カウンタ“7”をアドレスとして色情報を読み出した場合、色強度rcol[7]は“135”、gcol[7]は“240”、bcol[7]は“135”である。従って、演算結果Δcol は式(22)のように演算される。 Specific examples are described below. In the separation index color table shown in FIG. 10B, when the color information is read with the counter “5” as an address, the color intensity rcol [5] is “120”, gcol [5] is “240”, and bcol [5 ] Is “120”. When the color information is read using the counter “7” as an address, the color intensity rcol [7] is “135”, gcol [7] is “240”, and bcol [7] is “135”. Accordingly, the calculation result Δcol is calculated as shown in Expression (22).
Δcol =|rcol[5]−rcol[7]|
+|gcol[5]−gcol[7]|
+|bcol[5]−bcol[7]|
=|120−135|+|240−240|+|120−135|
=30…(22)
演算結果Δcol は“30”、即ち閾値th_col=40以下であり、しかも“0”ではないため、インデックス統合部322は、第1のインデックス“5”の色情報と第2のインデックス“7”の色情報とが所定範囲内で近似しており、且つ、同色ではないと判定する。
Δcol = | rcol [5] −rcol [7] |
+ | Gcol [5] -gcol [7] |
+ | Bcol [5] -bcol [7] |
= | 120-135 | + | 240-240 | + | 120-135 |
= 30 ... (22)
Since the calculation result Δcol is “30”, that is, the threshold th_col = 40 or less and not “0”, the
また、図10(b)に示す分離インデックスカラーテーブルにおいて、カウンタ“2”をアドレスとして色情報を読み出した場合、色強度rcol[2]は“0”、gcol[2]は“0”、bcol[2]は“255”である。また、カウンタ“6”をアドレスとして色情報を読み出した場合、色強度rcol[6]は“0”、gcol[6]は“0”、bcol[6]は“255”である。従って、演算結果Δcol は式(23)のように演算される。 In the separation index color table shown in FIG. 10B, when the color information is read with the counter “2” as an address, the color intensity rcol [2] is “0”, gcol [2] is “0”, bcol. [2] is “255”. When color information is read using the counter “6” as an address, the color intensity rcol [6] is “0”, gcol [6] is “0”, and bcol [6] is “255”. Therefore, the calculation result Δcol is calculated as shown in Equation (23).
Δcol =|rcol[2]−rcol[6]|
+|gcol[2]−gcol[6]|
+|bcol[2]−bcol[6]|
=|0−0|+|0−0|+|255−255|
=0…(23)
演算結果Δcol は“0”であるため、インデックス統合部322は、第1のインデックス“2”の色情報と第2のインデックス“6”の色情報とが同色であると判定する。
Δcol = | rcol [2] −rcol [6] |
+ | Gcol [2] -gcol [6] |
+ | Bcol [2] -bcol [6] |
= | 0-0 | + | 0-0 | + | 255-255 |
= 0 (23)
Since the calculation result Δcol is “0”, the
Δcol ≦th_col以下である場合(S78でYES)、インデックス統合部322は、S77の演算結果Δcol が“0”であるか否かを判定する(S79)。
Δcol ≠0である場合(S79でNO)、インデックス統合部322は、第1のインデックス“i ”と第2のインデックス“j ”との統合を決定し、次に、第1のインデックス“i ”を第2のインデックス“j ”に統合するか、第2のインデックス“j ”を第1のインデックス“i ”に統合するかを判定する。
If Δcol ≦ th_col or less (YES in S78), the
When Δcol ≠ 0 (NO in S79), the
このために、インデックス統合部322は、分離インデックステーブル及び分離インデックスカラーテーブルを参照して、第1のインデックス“i ”が対応付けられている画素数cnt [i ]と第2のインデックス“j ”が対応付けられている画素数cnt [j ]とを読み出す(S80)。具体的には、インデックス統合部322は、分離インデックスカラーテーブルを参照し、カウンタi をアドレスとして画素数cnt [i ]を読み出し、カウンタj をアドレスとして画素数cnt [j ]を読み出す。
更に、インデックス統合部322は、第1のインデックス“i ”が対応付けられている画素数cnt [i ]が、第2のインデックス“j ”が対応付けられている画素数cnt [j ]以上であるか否かを判定する(S81)。
For this purpose, the
Furthermore, the
以下に具体例を述べる。図10(b)に示す分離インデックスカラーテーブルにおいて、カウンタ“5”をアドレスとして読み出される画素数cnt [5]は“11”であり、カウンタ“7”をアドレスとして読み出される画素数cnt [5]は“2”である。従って、cnt [5]≧cnt [7]であるため、インデックス統合部322は、第1のインデックス“5”に、第2のインデックス“7”を統合すると判定する。
Specific examples are described below. In the separation index color table shown in FIG. 10B, the number of pixels cnt [5] read using the counter “5” as an address is “11”, and the number of pixels cnt [5] read using the counter “7” as an address. Is “2”. Therefore, since cnt [5] ≧ cnt [7], the
cnt [i ]≧cnt [j ]である場合(S81でYES)、第1のインデックス“i ”に第2のインデックス“j ”を統合すべく、インデックス統合部322は、カウンタk1,k2にカウンタi ,j を代入して(S82)、各種テーブル更新処理のサブルーチン(後述する図25及び図26参照)を呼び出すことによって(S83)、インデックスを統合する。
cnt [i ]<cnt [j ]である場合(S81でNO)、第2のインデックス“j ”に第1のインデックス“i ”を統合すべく、インデックス統合部322は、カウンタk1,k2にカウンタj ,i を代入して(S84)、処理をS83へ移す。
When cnt [i] ≧ cnt [j] (YES in S81), the
When cnt [i] <cnt [j] (NO in S81), the
S83の処理完了後、インデックス統合部322は、後述するS85の処理を実行する。
また、Δcol >th_colである場合(S78でNO)、インデックス統合部322は、第1のインデックス“i ”と第2のインデックス“j ”とを統合せず、S85の処理を実行する。更にまた、Δcol =0である場合(S79でYES)、インデックス統合部322は、第1のインデックス“i ”と第2のインデックス“j ”とを統合せず、S85の処理を実行する。
インデックス統合部322は、カウンタj をインクリメントし(S85)、処理を図23に示すS74へ戻す。
After the process of S83 is completed, the
If Δcol> th_col (NO in S78), the
The
図25及び図26は、各種テーブル更新処理のサブルーチンの処理の手順を示すフローチャートである。
図25に示すように、インデックス統合部322は、分離インデックステーブルにおいて、カウンタk2をアドレスとするインデックスidx [k2]に、カウンタk1をアドレスとして読み出されるインデックスidx [k1]を代入する(S101)。S101の処理によって、分離インデックステーブルが更新される。
25 and 26 are flowcharts showing the procedure of the subroutine of the various table update processing.
As shown in FIG. 25, the
次に、インデックス統合部322は、分離インデックスカラーテーブルにおいて、カウンタk1,k2をアドレスとして画素数cnt [k1],cnt [k2]を読み出し(S102)、読み出された画素数cnt [k1]と画素数cnt [k2]とを加算した加算結果を、カウンタk1に関連付けられた画素数cnt [k1]に代入し(S103)、更に、カウンタk2に関連付けられた画素数cnt [k2]をデフォルト値“0”にリセットする(S104)。
次いで、インデックス統合部322は、分離インデックスカラーテーブルにおいて、カウンタk2に関連付けられたRGB各色の色強度rcol[k2],gcol[k2],bcol[k2]夫々をデフォルト値“0”にリセットする(S105)。S102〜S105の処理によって、分離インデックスカラーテーブルが更新される。
Next, the
Next, the
以下では、分離座標テーブルにおいて、アドレス“k1”に関連付けられている最小x座標値、最小y座標値、最大x座標値、及び最大y座標値を、最小x座標値xmin[k1]、最小y座標値ymin[k1]、最大x座標値xmax[k1]、及び最大y座標値ymax[k1]と記載する。同様に、アドレス“k2”に関連付けられている最小x座標値、最小y座標値、最大x座標値、及び最大y座標値を、最小x座標値xmin[k2]、最小y座標値ymin[k2]、最大x座標値xmax[k2]、及び最大y座標値ymax[k2]と記載する。 In the following, in the separation coordinate table, the minimum x coordinate value, the minimum y coordinate value, the maximum x coordinate value, and the maximum y coordinate value associated with the address “k1” are represented by the minimum x coordinate value xmin [k1] and the minimum y coordinate value. The coordinate value ymin [k1], the maximum x coordinate value xmax [k1], and the maximum y coordinate value ymax [k1] are described. Similarly, the minimum x coordinate value, the minimum y coordinate value, the maximum x coordinate value, and the maximum y coordinate value associated with the address “k2” are set as the minimum x coordinate value xmin [k2] and the minimum y coordinate value ymin [k2]. ], The maximum x coordinate value xmax [k2], and the maximum y coordinate value ymax [k2].
S105の処理終了後、図26に示すように、インデックス統合部322は、分離座標テーブルに記録された最小x座標値xmin[k1]が最小x座標値xmin[k2]より大きいか否かを判定する(S106)。
最小x座標値xmin[k1]が最小x座標値xmin[k2]より大きい場合(S106でYES)、インデックス統合部322は、アドレス“k1”に関連付けられた最小x座標値xmin[k1]に最小x座標値xmin[k2]を代入する(S107)。
After the process of S105, as shown in FIG. 26, the
When the minimum x coordinate value xmin [k1] is larger than the minimum x coordinate value xmin [k2] (YES in S106), the
S107が終了した場合、又はS106で最小x座標値xmin[k1]が最小x座標値xmin[k2]以下である場合(S106でNO)、インデックス統合部322は、分離座標テーブルに記録された最小y座標値ymin[k1]が最小y座標値ymin[k2]より大きいか否かを判定する(S108)。
最小y座標値ymin[k1]が最小y座標値ymin[k2]より大きい場合(S108でYES)、インデックス統合部322は、アドレス“k1”に関連付けられた最小y座標値ymin[k1]に最小y座標値ymin[k2]を代入する(S109)。
When S107 ends, or when the minimum x coordinate value xmin [k1] is equal to or smaller than the minimum x coordinate value xmin [k2] in S106 (NO in S106), the
When the minimum y coordinate value ymin [k1] is larger than the minimum y coordinate value ymin [k2] (YES in S108), the
S109が終了した場合、又はS108で最小y座標値ymin[k1]が最小y座標値ymin[k2]以下である場合(S108でNO)、インデックス統合部322は、分離座標テーブルに記録された最大x座標値xmax[k1]が最大x座標値xmax[k2]より小さいか否かを判定する(S110)。
最大x座標値xmax[k1]が最大x座標値xmax[k2]より小さい場合(S110でYES)、インデックス統合部322は、アドレス“k1”に関連付けられた最大x座標値xmax[k1]に最大x座標値xmax[k2]を代入する(S111)。
When S109 ends, or when the minimum y coordinate value ymin [k1] is equal to or smaller than the minimum y coordinate value ymin [k2] in S108 (NO in S108), the
When the maximum x-coordinate value xmax [k1] is smaller than the maximum x-coordinate value xmax [k2] (YES in S110), the
S111が終了した場合、又はS110で最大x座標値xmax[k1]が最大x座標値xmax[k2]以上である場合(S110でNO)、インデックス統合部322は、分離座標テーブルに記録された最大y座標値ymax[k1]が最大y座標値ymax[k2]より小さいか否かを判定する(S112)。
最大y座標値ymax[k1]が最大y座標値ymax[k2]より小さい場合(S112でYES)、インデックス統合部322は、アドレス“k1”に関連付けられた最大y座標値ymax[k1]に最大y座標値ymax[k2]を代入する(S113)。
When S111 ends, or when the maximum x-coordinate value xmax [k1] is greater than or equal to the maximum x-coordinate value xmax [k2] in S110 (NO in S110), the
When the maximum y coordinate value ymax [k1] is smaller than the maximum y coordinate value ymax [k2] (YES in S112), the
S113が終了した場合、又はS112で最大y座標値ymax[k1]が最大y座標値ymax[k2]以上である場合(S112でNO)、インデックス統合部322は、カウンタk2に関連付けられた最小x座標値xmin[k2]、最小y座標値ymin[k2]、最大x座標値xmax[k2]、及び最大y座標値ymax[k2]をデフォルト値にリセットする(S114)。S106〜S114の処理によって、分離座標テーブルが更新される。
S114の処理終了後、インデックス統合部322は、座標テーブル更新処理のサブルーチンの処理を終了し、処理をメインルーチンへ戻す。
When S113 ends, or when the maximum y-coordinate value ymax [k1] is greater than or equal to the maximum y-coordinate value ymax [k2] in S112 (NO in S112), the
After the process of S114 ends, the
以下に具体例を述べる。第1のインデックス“5”に、第2のインデックス“7”を統合する場合、S101の処理が実行されることによって、図10(a)に示す分離インデックステーブルにおいて、アドレス“7”に関連付けられたインデックス“7”が、カウンタ“5”をアドレスとして読み出されるインデックス“5”で上書きされる。
従って、カウンタ“7”をアドレスとして、図12(a)に示す統合インデックステーブルを参照した場合、分離インデックステーブルを参照した場合とは異なり、読み出されるインデックスは“5”である。
一方、カウンタ“5”をアドレスとして、統合インデックステーブルを参照した場合、分離インデックステーブルを参照した場合と同様に、読み出されるインデックスは“5”である。
Specific examples are described below. When the second index “7” is integrated with the first index “5”, the process of S101 is executed, so that it is associated with the address “7” in the separation index table shown in FIG. The index “7” is overwritten with the index “5” read with the counter “5” as an address.
Therefore, when the integrated index table shown in FIG. 12A is referenced using the counter “7” as an address, the read index is “5”, unlike the case where the separated index table is referenced.
On the other hand, when the integrated index table is referenced using the counter “5” as an address, the read index is “5”, as in the case of referring to the separated index table.
また、S103及びS104の処理が実行されることによって、図10(b)に示す分離インデックスカラーテーブルにおいて、アドレス“5”に関連付けられた画素数“11”が、カウンタ“7”をアドレスとして読み出される画素数“2”との加算結果“13”で上書きされる。アドレス“5”に係る上書きの終了後、カウンタ“7”に関連付けられた画素数“2”が、デフォルト値“0”で上書きされる。
従って、カウンタ“5”,“7”をアドレスとして、図12(b)に示す統合インデックスカラーテーブルを参照した場合、分離インデックステーブルを参照した場合とは異なり、読み出される画素数は“13”,“0”である。
In addition, by executing the processing of S103 and S104, the number of pixels “11” associated with the address “5” in the separation index color table shown in FIG. 10B is read using the counter “7” as the address. Overwritten with the addition result “13” with the number of pixels “2”. After the overwriting related to the address “5” is completed, the pixel number “2” associated with the counter “7” is overwritten with the default value “0”.
Therefore, when the integrated index color table shown in FIG. 12B is referenced using the counters “5” and “7” as addresses, the number of pixels to be read is “13”, unlike the case of referring to the separation index table. “0”.
更に、S105の処理が実行されることによって、図10(b)に示す分離インデックスカラーテーブルにおいて、カウンタ“7”に関連付けられたRGB値(135,240,135)が、デフォルトのRGB値(0,0,0)で上書きされる。
従って、カウンタ“7”をアドレスとして、図12(b)に示す統合インデックステーブルを参照した場合、分離インデックステーブルを参照した場合とは異なり、読み出されるRGB値はRGB値(0,0,0)である。
一方、カウンタ“5”をアドレスとして、統合インデックステーブルを参照した場合、分離インデックステーブルを参照した場合と同様に、読み出されるRGB値はRGB値(120,240,120)である。
Further, by executing the process of S105, the RGB values (135, 240, 135) associated with the counter “7” in the separation index color table shown in FIG. , 0, 0).
Therefore, when the integrated index table shown in FIG. 12B is referred to with the counter “7” as an address, the read RGB values are RGB values (0, 0, 0), unlike the case of referring to the separation index table. It is.
On the other hand, when the integrated index table is referenced using the counter “5” as an address, the read RGB values are RGB values (120, 240, 120), as in the case of referring to the separation index table.
更にまた、S106〜S114の処理によって、図11に示す分離座標テーブルにおいて、アドレス“5”に関連付けられた最大x座標値xmax[5]及び最大y座標値ymax[5]はアドレス“7”に関連付けられた最大x座標値xmax[7]及び最大y座標値ymax[7]に置き換えられ、アドレス“7”に関連付けられた最小x座標値xmin[7]、最小y座標値ymin[7]、最大x座標値xmax[7]、及び最大y座標値ymax[7]は夫々デフォルト値にリセットされる。 Furthermore, in the separation coordinate table shown in FIG. 11, the maximum x coordinate value xmax [5] and the maximum y coordinate value ymax [5] associated with the address “5” are set to the address “7” by the processing of S106 to S114. The minimum x-coordinate value xmin [7], the minimum y-coordinate value ymin [7] associated with the address “7” is replaced with the associated maximum x-coordinate value xmax [7] and maximum y-coordinate value ymax [7]. The maximum x coordinate value xmax [7] and the maximum y coordinate value ymax [7] are reset to default values, respectively.
従って、カウンタ“5”をアドレスとして、図13に示す統合座標テーブルを参照した場合、分離座標テーブルを参照した場合とは異なり、読み出される最小x座標値xmin[5]、最小y座標値ymin[5]、最大x座標値xmax[5]、及び最大y座標値ymax[5]は、“1”、“14”、“4”、及び“19”となる。
同様に、カウンタ“7”をアドレスとして、統合座標テーブルを参照した場合、分離座標テーブルを参照した場合とは異なり、読み出される最小x座標値xmin[7]、最小y座標値ymin[7]、最大x座標値xmax[7]、及び最大y座標値ymax[7]は、“4095”、“8191”、“0”、及び“0”となる。
Therefore, when the integrated coordinate table shown in FIG. 13 is referenced using the counter “5” as an address, unlike the case of referring to the separated coordinate table, the minimum x-coordinate value xmin [5] and the minimum y-coordinate value ymin [ 5], the maximum x-coordinate value xmax [5], and the maximum y-coordinate value ymax [5] are “1”, “14”, “4”, and “19”.
Similarly, when referring to the integrated coordinate table using the counter “7” as an address, unlike the case of referring to the separated coordinate table, the minimum x-coordinate value xmin [7], the minimum y-coordinate value ymin [7], The maximum x coordinate value xmax [7] and the maximum y coordinate value ymax [7] are “4095”, “8191”, “0”, and “0”.
図25に示すように、本実施の形態における各種テーブル更新処理では、カウンタk1に関連付けられたRGB各色の色強度rcol[k1],gcol[k1],bcol[k1]夫々は、元の値のまま維持される。しかしながら、インデックス統合部322が、S103〜S105の処理を実行する前に、色強度rcol[k1],gcol[k1],bcol[k1]を再計算して更新する構成でもよい。この場合、色強度rcol[k1],gcol[k1],bcol[k1]は、以下の式(24)〜(27)を用いて演算される。
As shown in FIG. 25, in the various table update processes in the present embodiment, the color intensities rcol [k1], gcol [k1], and bcol [k1] of each of the RGB colors associated with the counter k1 are the original values. Maintained. However, the
cnt12 =cnt [k1]+cnt [k2]…(24)
rcol[k1]={rcol[k1]×cnt [k1]+rcol[k2]×cnt [k2]}/cnt12 …(25)
gcol[k1]={gcol[k1]×cnt [k1]+gcol[k2]×cnt [k2]}/cnt12 …(26)
bcol[k1]={bcol[k1]×cnt [k1]+bcol[k2]×cnt [k2]}/cnt12 …(27)
cnt12 = cnt [k1] + cnt [k2] (24)
rcol [k1] = {rcol [k1] × cnt [k1] + rcol [k2] × cnt [k2]} / cnt12 (25)
gcol [k1] = {gcol [k1] × cnt [k1] + gcol [k2] × cnt [k2]} / cnt12 (26)
bcol [k1] = {bcol [k1] × cnt [k1] + bcol [k2] × cnt [k2]} / cnt12 (27)
以上のような式(24)〜(27)を用いて求められた新たな色強度rcol[k1],gcol[k1],bcol[k1]を求める場合、求められた新たな色強度rcol[k1],gcol[k1],bcol[k1]には、元の色強度rcol[k1],gcol[k1],bcol[k1]及び元の色強度rcol[k2],gcol[k2],bcol[k2]夫々が、元の画素数cnt [k1],cnt [k2]の多寡に応じて反映されている。
このため、インデックス統合部322は、画素数が少ないインデックスを、画素数が多いインデックスへ統合する構成(即ち、図24に示すS81と、S82及びS84のいずれか一方とを実行する構成)に限定されず、単に、アドレス“j ”のインデックスを、アドレス“i ”のインデックスに統合する構成(即ち、S81及びS84を実行せず、常にS82を実行する構成)であってもよい。
When the new color intensities rcol [k1], gcol [k1], and bcol [k1] obtained using the equations (24) to (27) as described above are obtained, the obtained new color intensities rcol [k1] ], Gcol [k1], bcol [k1] include the original color intensities rcol [k1], gcol [k1], bcol [k1] and the original color intensities rcol [k2], gcol [k2], bcol [k2]. ] Are reflected according to the number of original pixels cnt [k1] and cnt [k2].
For this reason, the
以上のような処理を実行することによって、図23に示すS72でNOの場合、即ち全ての分離インデックスに対する処理が終わった場合、図10(a)に示す分離インデックステーブル、図10(b)に示す分離インデックスカラーテーブル、及び図11に示す分離座標テーブルは、図12(a)に示す統合インデックステーブル、図12(b)に示す統合インデックスカラーテーブル、及び図13に示す統合座標テーブルになっている。 By executing the processing as described above, in the case of NO in S72 shown in FIG. 23, that is, when the processing for all the separation indexes is completed, the separation index table shown in FIG. 10 (a) is shown in FIG. 10 (b). The separated index color table shown in FIG. 11 and the separated coordinate table shown in FIG. 11 are the integrated index table shown in FIG. 12A, the integrated index color table shown in FIG. 12B, and the integrated coordinate table shown in FIG. Yes.
インデックスの統合後、統合インデックステーブルに記憶されているインデックスの個数が、予め定められているインデックスの上限数よりも多い場合は、統合インデックステーブル、統合インデックスカラーテーブル、及び統合座標テーブルを分離インデックステーブル、分離インデックスカラーテーブル、及び分離座標テーブルと看做し、また、閾値th_colを適宜に増加させて(即ち統合の条件を緩和して)、インデックス統合部322が、再び図23及び図24に示す処理を実行すればよい。このとき、各種データを、前段の処理(インデックス生成部321で実行される処理)へ戻す必要はない。
After index integration, if the number of indexes stored in the integrated index table is greater than a predetermined upper limit number of indexes, the integrated index table, the integrated index color table, and the integrated coordinate table are separated as index tables. The
しかしながら、閾値th_colを過剰に増加させた場合、画質が大幅に劣化する虞がある。何故ならば、薄い赤色の画素が赤色の画素に変化するのみならず、紫色の画素が赤色の画素に変化するような、大幅な変色が起きる虞があるからである。このような不都合を解消するためには、統合の条件を緩和するのではなく、分離の条件を緩和することが考えられる。しかしながら、この場合も、各種データを、前段の処理(インデックス生成部321で実行される処理)へ戻す必要はない。 However, when the threshold th_col is excessively increased, the image quality may be significantly degraded. This is because not only the light red pixel changes to a red pixel, but also a significant color change may occur such that a purple pixel changes to a red pixel. In order to eliminate such an inconvenience, it is conceivable to relax the separation conditions instead of relaxing the integration conditions. However, in this case as well, there is no need to return various data to the previous process (the process executed by the index generation unit 321).
まず、インデックス統合部322は、最小距離Δyを適宜に増加させる(即ち分離の条件を緩和する)。次いで、インデックス統合部322は、統合インデックスカラーテーブルを参照して、同色のインデックスを抽出する。更に、インデックス統合部322は、統合座標テーブルを参照して、各インデックスを対応付けられている画素間の距離を求め、求めた距離が最小距離Δy以下であれば、同色のインデックス同士を統合し、統合結果に応じて、統合インデックステーブル、統合インデックスカラーテーブル、及び統合座標テーブルを修正する。
First, the
図5に示すインデックス補正部323では、分離インデックス画像のデータ、統合インデックステーブル、統合インデックスカラーテーブル、及び統合座標テーブルに基づいて、インデックス補正処理が実行される。
インデックス補正処理では、統合インデックス画像(即ち前景レイヤ)のデータが生成される。
In the
In the index correction process, data of an integrated index image (ie, foreground layer) is generated.
具体的には、インデックス補正部323は、例えば図14に示すS12〜S16と同様の処理を実行して、分離インデックス画像における注目画素(xcnt,ycnt)を順に選択する。次いで、インデックス補正部323は、分離インデックス画像のデータに基づき、注目画素(xcnt,ycnt)の画素値(即ち分離インデックス)を読み出す。更に、インデックス補正部323は、統合インデックステーブルを参照し、読み出した分離インデックスをアドレスとして、統合インデックスを読み出す。最後に、インデックス補正部323は、読み出した統合インデックスを、注目画素(xcnt,ycnt)の画素値に上書きする。
以上の処理の結果、図8に示す分離インデックス画像は、図9に示す統合インデックス画像になる。
Specifically, the
As a result of the above processing, the separation index image shown in FIG. 8 becomes the integrated index image shown in FIG.
なお、インデックス補正部323が行なう処理を、インデックス統合部322が、図23に示すS72でNOの場合(即ち全ての分離インデックスに対する処理が終わった場合)に実行する構成でもよい。この場合、前景色インデックス化処理部32に、インデックス補正部323を設ける必要はない。
In addition, the structure which the index correction |
また、前景色インデックス化処理部32が、インデックス生成部321の代わりに、インデックス対応処理を実行するインデックス対応部と、インデックス分離処理を実行するインデックス分離部とを備える構成でもよい。
しかしながら、仮に、このように構成した場合、初期インデックスと分離インデックスとの関係、及び分離インデックスと統合インデックスとの関係の両方を記憶しておく必要がある。従って、前景色インデックス化処理部32は、記憶容量が大きなメモリを備えておかなければならない。また、インデックス同士の関連を管理する処理が煩雑である。
In addition, the foreground color
However, if configured in this way, it is necessary to store both the relationship between the initial index and the separation index and the relationship between the separation index and the integrated index. Therefore, the foreground color
一方、本実施の形態の構成では、インデックス生成部321内で、インデックスの対応付け処理の直後にインデックスの分離処理が連続的に実行される。換言すれば、全画素に対して初期インデックスを対応付け終える前に、各画素に分離インデックスを対応付けることができる。このため、前景色インデックス化処理部32は、分離インデックスと統合インデックスとの関係を記憶することが可能な記憶容量を有するメモリを備えておけばよい。また、インデックス同士の関連を管理する処理が簡易である。
On the other hand, in the configuration of the present embodiment, index separation processing is continuously executed immediately after the index association processing in the
ところで、本実施の形態では、前景色インデックス化処理部32が、各画素に対するインデックスの対応付けと、画素間の距離に基づくインデックスの分離と、近似色同士のインデックスの統合とをこの順で実行する。
仮に、前景色インデックス化処理部32が、各画素に対するインデックスの対応付けと、近似色同士のインデックスの統合と、画素間の距離に基づくインデックスの分離とをこの順で実行する場合、以下のような不都合が生じる虞がある。
By the way, in the present embodiment, the foreground color
If the foreground color
画質の劣化を防止するためには、最も近似している色同士を統合する必要がある。このため、一旦、全画素に対して初期インデックスを対応付ける必要がある。つまり、インデックスの対応付け処理と統合処理とを連続的に実行することができない。
また、統合処理の後で分離処理を行なうため、分離後にインデックスの個数が過剰に増加する虞がある。この場合、再び統合処理を行なって(即ち、各種データを前段の処理へ戻して)インデックスの個数を減少させる必要があるため、各種データの管理が煩雑になる。
In order to prevent the deterioration of the image quality, it is necessary to integrate the colors that are closest to each other. For this reason, it is necessary to once associate an initial index with respect to all pixels. That is, the index association process and the integration process cannot be executed continuously.
In addition, since the separation process is performed after the integration process, the number of indexes may increase excessively after the separation. In this case, since it is necessary to reduce the number of indexes by performing integration processing again (that is, returning various data to the previous processing), management of various data becomes complicated.
図27は、注目画素(xcnt,ycnt)と主走査方向の最小距離Δxとの関係を示す模式図である。図28は、図27に示す画像を90°右回転させた画像における注目画素(xcnt,ycnt)と副走査方向の最小距離Δxとの関係を示す模式図である。
また、図29は、注目画素(xcnt,ycnt)と主走査方向の最小距離Δx及び副走査方向の最小距離Δyとの関係を示す模式図である。
図27〜図29夫々に示す画像は、図22に示す画像に対応する。
FIG. 27 is a schematic diagram illustrating the relationship between the pixel of interest (xcnt, ycnt) and the minimum distance Δx in the main scanning direction. FIG. 28 is a schematic diagram showing the relationship between the pixel of interest (xcnt, ycnt) and the minimum distance Δx in the sub-scanning direction in an image obtained by rotating the image shown in FIG. 27 rightward by 90 °.
FIG. 29 is a schematic diagram showing the relationship between the target pixel (xcnt, ycnt), the minimum distance Δx in the main scanning direction, and the minimum distance Δy in the sub-scanning direction.
The images shown in FIGS. 27 to 29 correspond to the images shown in FIG.
インデックス生成部321は、図14〜図16に示す処理を実行する場合に、図22に示す最小距離Δyを用いる代わりに、図27に示す最小距離Δxを用いる構成でもよい。このとき、インデックス生成部321は、図16に示すS62の処理で、分離座標テーブルを参照して、アドレスaddrに関連付けられている最大x座標値xmax[addr]を読み出し、S63の処理で、主走査カウンタxcntから最大x座標値xmax[addr]を減算した結果を最小距離Δxに代入し、S64の処理で、最小距離Δxが所定閾値lm_xより大きいか否かを判定する。
The
最小距離Δx>所定閾値lm_xである場合(即ちS64でYES)、インデックス生成部321は、インデックスを分離すべく、処理をS44へ移す。最小距離Δx≦所定閾値lm_xである場合(即ちS64でNO)、インデックス生成部321は、インデックスを分離せずに、処理をS65へ移す。
When the minimum distance Δx> the predetermined threshold value lm_x (that is, YES in S64), the
また、インデックス生成部321は、図14〜図16に示す処理を実行する場合に、最小距離Δy及び最小距離Δyのいずれか一方を用いる代わりに、図29に示す最小距離Δx及び最小距離Δyの両方を用いる構成でもよい。このとき、インデックス生成部321は、図16に示すS62の処理で、分離座標テーブルを参照して、最大x座標値xmax[addr]及び最大y座標値ymax[addr]夫々を読み出し、S63の処理で、最小距離Δx及び最小距離Δy夫々を演算し、S64の処理で、最小距離Δxが所定閾値lm_xより大きく、且つ、最小距離Δyが所定閾値lm_yより大きいか否かを判定する。
ここで、所定閾値lm_xは所定閾値lm_yと同値であってもよく、異なる値であってもよい。
In addition, when executing the processes shown in FIGS. 14 to 16, the
Here, the predetermined threshold value lm_x may be the same value as the predetermined threshold value lm_y, or may be a different value.
最小距離Δx>所定閾値lm_x且つ最小距離Δy>所定閾値lm_yである場合(即ちS64でYES)、インデックス生成部321は、インデックスを分離すべく、処理をS44へ移す。最小距離Δy≦所定閾値lm_y又は最小距離Δx≦所定閾値lm_xである場合(即ちS64でNO)、インデックス生成部321は、インデックスを分離せずに、処理をS65へ移す。
When the minimum distance Δx> the predetermined threshold lm_x and the minimum distance Δy> the predetermined threshold lm_y (that is, YES in S64), the
ところで、図27に示した如き、主走査方向の最小距離Δxを用いて画素間の距離を判定する処理は、カラー画像入力装置11が読み取った画像を画像処理によって90°右回転させる処理を、前景色インデックス化処理部32での処理以降に行なう際に有用である。
図28に示す画像の場合、副走査方向の最小距離Δxは、図27に示す主走査方向の最小距離Δxと同値になる。
画像を90°右回転させる処理は、カラー画像入力装置11が読み取った画像の上下を自動で判定した場合、又は使用者が操作パネル12を操作することによって画像を90°右回転させる指示を受け付けた場合に行なわれる。
Incidentally, as shown in FIG. 27, the process of determining the distance between the pixels using the minimum distance Δx in the main scanning direction is a process of rotating the image read by the color
In the case of the image shown in FIG. 28, the minimum distance Δx in the sub-scanning direction has the same value as the minimum distance Δx in the main scanning direction shown in FIG.
The process of rotating the image 90 ° to the right accepts an instruction to rotate the image 90 ° to the right when the color
図30は、主走査方向の最小距離Δx及び副走査方向の最小距離Δyを用いて画素間の距離を判定するその他の条件を用いた処理の手順の一部を示すフローチャートである。
インデックス生成部321が、図14〜図16に示す処理を実行する場合に、図29に示す最小距離Δx及び最小距離Δyの両方を用いる構成であるとき、S64の処理を実行する代わりに、図30に示すS121〜S126の処理を実行する構成でもよい。
上述したように、インデックス生成部321は、図16に示すS63の処理で、最小距離Δx及び最小距離Δy夫々を演算する。
FIG. 30 is a flowchart showing a part of a processing procedure using other conditions for determining the distance between pixels using the minimum distance Δx in the main scanning direction and the minimum distance Δy in the sub-scanning direction.
When the
As described above, the
次に、インデックス生成部321は、副走査方向の最小距離Δyの値が所定閾値lm_yより大きいか否かを判定する(S121)。
最小距離Δyが所定閾値lm_yより大きい場合(S121でYES)、インデックス生成部321は、主走査カウンタxcntが最小x座標値xmin[addr]より小さいか否かを判定する(S122)。
主走査カウンタxcntが最小x座標値xmin[addr]より小さい場合(S122でYES)、インデックス生成部321は、インデックスを分離すべく、処理をS44へ移す。
Next, the
When the minimum distance Δy is larger than the predetermined threshold lm_y (YES in S121), the
When the main scanning counter xcnt is smaller than the minimum x coordinate value xmin [addr] (YES in S122), the
主走査カウンタxcntが最小x座標値xmin[addr]以上である場合(S122でNO)、インデックス生成部321は、主走査カウンタxcntが最大x座標値xmax[addr]より大きいか否かを判定する(S123)。
主走査カウンタxcntが最大x座標値xmax[addr]より大きい場合(S123でYES)、インデックス生成部321は、処理をS44へ移す。
When the main scanning counter xcnt is greater than or equal to the minimum x coordinate value xmin [addr] (NO in S122), the
When the main scanning counter xcnt is larger than the maximum x coordinate value xmax [addr] (YES in S123), the
最小距離Δyが所定閾値lm_y以下である場合(S121でNO)、又は、主走査カウンタxcntが最大x座標値xmax[addr]以下である場合(S123でNO)、インデックス生成部321は、主走査方向の最小距離Δxの値が所定閾値lm_xより大きいか否かを判定する(S124)。
最小距離Δxが所定閾値lm_xより大きい場合(S124でYES)、インデックス生成部321は、副走査カウンタycntが最小y座標値ymin[addr]より小さいか否かを判定する(S125)。
副走査カウンタycntが最小y座標値ymin[addr]より小さい場合(S125でYES)、インデックス生成部321は、処理をS44へ移す。
When the minimum distance Δy is equal to or smaller than the predetermined threshold lm_y (NO in S121), or when the main scanning counter xcnt is equal to or smaller than the maximum x coordinate value xmax [addr] (NO in S123), the
When the minimum distance Δx is larger than the predetermined threshold lm_x (YES in S124), the
If the sub-scanning counter ycnt is smaller than the minimum y coordinate value ymin [addr] (YES in S125), the
副走査カウンタycntが最小y座標値ymin[addr]以上である場合(S125でNO)、インデックス生成部321は、副走査カウンタycntが最大y座標値ymax[addr]より大きいか否かを判定する(S126)。
副走査カウンタycntが最大y座標値ymax[addr]より大きい場合(S126でYES)、インデックス生成部321は、処理をS44へ移す。
最小距離Δxが所定閾値lm_x以下である場合(S124でNO)、又は、副走査カウンタycntが最大y座標値ymax[addr]以下である場合(S126でNO)、インデックス生成部321は、インデックスを分離せずに、処理をステップS65へ移す。
When the sub-scanning counter ycnt is greater than or equal to the minimum y-coordinate value ymin [addr] (NO in S125), the
When the sub-scanning counter ycnt is larger than the maximum y coordinate value ymax [addr] (YES in S126), the
When the minimum distance Δx is equal to or smaller than the predetermined threshold lm_x (NO in S124), or when the sub-scanning counter ycnt is equal to or smaller than the maximum y coordinate value ymax [addr] (NO in S126), the
図31は、図30に示すS121〜S126の処理によってインデックスが分離される画素の範囲を示す模式図である。
図31中に右上がりのハッチングで示した領域は、特定のインデックスが対応付けられた画素が占める領域(以下、特定領域という)である。図中に示すD1又はD2で示す範囲内に、特定領域内の画素と同一のインデックスが対応付けられた画素がある場合に、インデックスが分離され、新たなインデックスが画素に対応付けられる。
図中にD3で示す範囲内の画素は、特定領域内の画素よりも先に走査されるので、特定領域内の画素と同一のインデックスが対応付けられた画素は無い。
FIG. 31 is a schematic diagram illustrating a range of pixels in which indexes are separated by the processing of S121 to S126 illustrated in FIG.
In FIG. 31, the area indicated by hatching rising to the right is an area occupied by a pixel associated with a specific index (hereinafter referred to as a specific area). In the range indicated by D1 or D2 in the figure, when there is a pixel associated with the same index as the pixel in the specific area, the index is separated and a new index is associated with the pixel.
Since the pixels within the range indicated by D3 in the figure are scanned before the pixels within the specific area, there is no pixel associated with the same index as the pixels within the specific area.
以上のように、画素間の距離として主走査方向及び副走査方向の両方の距離を用いる処理を実行することによっても、インデックス生成部321は、画像上で所定の距離より離れた画素間には夫々別のインデックスを対応付け直しながら前景レイヤを作成することができる。画素間の距離として主走査方向及び副走査方向の両方の距離を用いる処理は、カラー画像入力装置11が読み取った画像を画像処理によって回転させる処理を行なう場合でも、画像を回転させない場合でも、同様の効果を奏する。
As described above, the
インデックス生成部321は、使用者からの操作によって切り換えの指示を操作パネル12が受け付けた場合に、画素間の距離として副走査方向の距離を用いる処理と、主走査方向の距離を用いる処理と、主走査方向及び副走査方向の両方の距離を用いる処理とのいずれかを切り換える機能を備える。
When the
ところで、本実施の形態では、所定閾値lm_y及び所定閾値lm_x夫々が予め“3”に設定されている場合を例示しているが、実際には、カラー画像入力装置11が読み取った画像に適した閾値を用いればよい。
By the way, in this embodiment, the case where each of the predetermined threshold value lm_y and the predetermined threshold value lm_x is set to “3” in advance is exemplified, but in practice, it is suitable for an image read by the color
例えば、副走査方向の所定閾値lm_y及び主走査方向の所定閾値lm_xとして、副走査方向の画素数及び主走査方向の画素数の30%の値がインデックス生成部321に設定されるようにする。カラー画像入力装置11が、600dpiでA3サイズの画像を読み込んだ場合、副走査方向の画素数が“10000”、主走査方向の画素数が“7000”となるため、所定閾値lm_y=3000及び所定閾値lm_x=2100がインデックス生成部321に設定される。また、カラー画像入力装置11が、600dpiでA4サイズの画像を読み込んだ場合は、副走査方向の画素数が“7000”、主走査方向の画素数が“5000”となるため、所定閾値lm_y=2100及び所定閾値lm_x=1500となる。
For example, as the predetermined threshold value lm_y in the sub-scanning direction and the predetermined threshold value lm_x in the main scanning direction, values of 30% of the number of pixels in the sub-scanning direction and the number of pixels in the main scanning direction are set in the
更にまた、設定された所定閾値lm_y及び所定閾値lm_xが、分離インデックステーブルに記憶されているインデックスの個数に応じて加減される構成でもよい。 Furthermore, the predetermined threshold value lm_y and the predetermined threshold value lm_x that have been set may be adjusted according to the number of indexes stored in the separation index table.
前述した処理の終了後、前景色インデックス化処理部32は、統合インデックス画像(即ち前景レイヤ)のデータ、統合インデックスカラーテーブル、統合座標テーブル、及び画像データを、背景レイヤ生成処理部33へ出力する。以下では、統合インデックス、統合インデックスカラーテーブル及び統合座標テーブルを、単にインデックス、インデックスカラーテーブル及び座標テーブルという。
After the above-described processing ends, the foreground color
背景レイヤ生成処理部33は、入力された画像データ及び前景レイヤから、図2に示す如き背景レイヤを生成する処理を行なう。背景レイヤ生成処理部33は、本発明における背景レイヤ生成手段として機能する。
具体的には、画像データに含まれる前景画素の色情報を、前景画素周辺の背景画素の色情報の平均値で置き換えることにより、背景レイヤを作成する。ただし、周辺に背景画素が存在しない前景画素については、背景レイヤ生成処理部33は、背景画素の平均値で色情報が置き換えられた他の前景画素の色情報の値又は平均値で色情報を置き換える処理を行なう。
The background layer
Specifically, the background layer is created by replacing the color information of the foreground pixels included in the image data with the average value of the color information of the background pixels around the foreground pixels. However, for the foreground pixel in which no background pixel exists in the vicinity, the background layer
ここで、背景画素は、前景レイヤ中でインデックス“0”を対応付けられている画素であり、前景画素はその他のインデックスを対応付けられている画素である。
なお、背景レイヤ生成処理部33は、前景マスク生成処理部31が生成した前景マスクを用いて前景画素と背景画素とを区別する処理を行なってもよい。
Here, the background pixel is a pixel associated with the index “0” in the foreground layer, and the foreground pixel is a pixel associated with another index.
The background layer
次いで、背景レイヤ生成処理部33は、生成した背景レイヤのデータと、前景レイヤのデータ、インデックスカラーテーブル及び座標テーブルとを、2値画像生成処理部34へ出力する。
Next, the background layer
2値画像生成処理部34は、入力された前景レイヤのデータ及び座標テーブルに基づき、前景レイヤに含まれる“0”以外のインデックスの夫々について2値画像を生成する。具体的には、特定のインデックスが対応付けられた画素の画素値を“1”とし、他の画素の画素値を“0”とした2値画像を生成し、“0”以外の全てのインデックスについて2値画像の生成を繰り返す。
The binary image
図32は、生成した2値画像の例を示す概念図である。
図32(a)に示す例は、図9に示す前景レイヤで“5”のインデックスを対応付けられた画素(図8に示す分離インデックス画像で“5”,“7”のインデックスを対応付けられた画素)の画素値を“1”とし、他の画素の画素値を“0”とした2値画像である。
また、図32(b)に示す例は、図9に示す前景レイヤで“2”のインデックスを対応付けられた画素(図7に示す初期インデックス画像で“2”のインデックスを対応付けられた画素の一部。残部は図8に示す分離インデックス画像で“6”のインデックスを対応付けられた画素)の画素値を“1”とし、他の画素の画素値を“0”とした2値画像である。
FIG. 32 is a conceptual diagram illustrating an example of a generated binary image.
In the example shown in FIG. 32A, the pixels associated with the index “5” in the foreground layer shown in FIG. 9 (the indexes “5” and “7” in the separated index image shown in FIG. 8 can be associated). This is a binary image in which the pixel value of each pixel is “1” and the pixel values of other pixels are “0”.
Also, the example shown in FIG. 32B is a pixel associated with an index “2” in the foreground layer shown in FIG. 9 (a pixel associated with an index “2” in the initial index image shown in FIG. 7). The remainder is a binary image in which the pixel value of the separated index image shown in Fig. 8 that is associated with the index "6" is "1" and the pixel values of the other pixels are "0". It is.
図9に示す前景レイヤにおけるインデックス“1”,“3”,“4”,“6”夫々に付いても、同様に2値画像が生成される。
結果として、前景レイヤに含まれる“0”以外のインデックスの個数と同数枚の2値画像が生成される(図9に示す前景レイヤの場合は6枚)。
生成された各2値画像には、各インデックスが関連付けられている。2値画像生成処理部34は、生成された2値画像、背景レイヤ、インデックスカラーテーブル及び座標テーブルを画像圧縮処理部35へ出力する。2値画像生成処理部34は、本発明における2値画像生成手段として機能する。
A binary image is similarly generated even if the indexes “1”, “3”, “4”, and “6” in the foreground layer shown in FIG.
As a result, the same number of binary images as the number of indexes other than “0” included in the foreground layer are generated (six for the foreground layer shown in FIG. 9).
Each generated binary image is associated with each index. The binary image
画像圧縮処理部35は、各2値画像、背景レイヤ、インデックスカラーテーブル及び座標テーブルを圧縮することにより、圧縮画像データを生成する。
具体的には、画像圧縮処理部35は、各インデックスについて座標テーブルに記録されている最小x座標値、最小y座標値、最大x座標値及び最大y座標値で画素の範囲が限定された矩形領域を各2値画像から抽出し、各2値画像から抽出した矩形領域をMMR等の可逆圧縮技術を用いて夫々圧縮する。
The image
Specifically, the image
更に、画像圧縮処理部35は、JPEG等の非可逆圧縮技術を用いて背景レイヤを圧縮し、圧縮後の各矩形領域に、各インデックスが示す色を表わす色情報及び各インデックスの画素が画像上で占める座標の範囲(即ち各インデックスに係る矩形領域の画像上の位置)を付加し、圧縮後の全てのデータを一つのデータファイルに統合することにより、圧縮画像データを生成する。
画像圧縮処理部35は、本発明における圧縮手段として機能する。
Further, the image
The image
なお、画像圧縮処理部35は、操作パネル12で受け付けた所定の指示に従って、データの圧縮形式を変更する機能を備えた構成であってもよい。
また、画像圧縮処理部35が矩形領域を抽出するのではなく、前景色インデックス化処理部32又は2値画像生成処理部34が矩形領域を抽出し、抽出した矩形領域を後段へ出力する構成でもよい。
The image
In addition, the image
圧縮処理部3は、以上の処理により、カラー画像入力装置11から入力された画像を圧縮した圧縮画像データを生成し、記憶部29又は送信装置14へ出力する。
記憶部29は、圧縮画像データを記憶し、操作パネル12で受け付けた所定の指示に従って、記憶している圧縮画像データを読み出して送信装置14へ出力する。
送信装置14は、操作パネル12で受け付けた所定の指示に従って、外部へ圧縮画像データを送信する。
The
The
The
以上詳述した如く、本発明の実施の形態に係る画像処理装置は、画像から文字に対応する画素を抽出し、文字に対応する各画素に、画素の色を数値で示したインデックスを対応付けた前景レイヤを生成し、画像から文字を省いた背景レイヤを生成し、前景レイヤから、インデックス毎に、各インデックスが対応付けられた画素とその他の画素とを区別した2値画像を生成し、全ての2値画像及び背景レイヤを夫々圧縮することによって圧縮画像データを生成する。 As described above in detail, the image processing apparatus according to the embodiment of the present invention extracts pixels corresponding to characters from an image, and associates each pixel corresponding to the character with an index indicating the color of the pixel as a numerical value. Generating a foreground layer, generating a background layer in which characters are omitted from the image, generating a binary image in which for each index, a pixel associated with each index and other pixels are distinguished from the foreground layer, Compressed image data is generated by compressing all binary images and background layers.
画像処理装置は、前景レイヤを生成する際に、色に応じたインデックスを各画素に対応付け、注目画素と同一のインデックスが対応付けられた画素が既に存在する場合には、それらのインデックスが所定の距離以上離れているかを判定する。更に画像処理装置は、それらのインデックスが所定の距離以上離れていれば、注目画素のインデックスとして、同一の色を示しながらも数値が互いに異なるインデックスを対応付け、所定距離以上離れていなければ、同一のインデックスを対応付ける。
更に、画像処理装置は、各インデックスの中で互いに近似した色を示すインデックスを統合し、互いに同じ色を示すインデックス同士は統合しない。
When generating the foreground layer, the image processing apparatus associates an index corresponding to the color with each pixel, and if there is already a pixel associated with the same index as the target pixel, the index is determined in advance. It is determined whether the distance is more than. Further, the image processing apparatus associates indexes having different values while indicating the same color as the index of the target pixel if the indexes are separated by a predetermined distance or more, and the same if the indices are not separated by a predetermined distance or more. Associate the index of.
Further, the image processing apparatus integrates indexes indicating colors that are similar to each other in each index, and does not integrate indexes that indicate the same color.
前景レイヤから2値画像を生成した際には、色が同一でありながら異なるインデックスが対応付けられた画素は、互いに異なる2値画像に含まれることとなり、個々の2値画像内では、画素値“1”の画素は、従来技術に比べてより狭い領域に集中することとなる。従って、各2値画像から抽出した各インデックスに係る画素が含まれる矩形領域には、各インデックスを対応付けられた画素の割合が従来技術よりも高くなり、圧縮後のデータに含まれる不要なデータを削減することができる。 When a binary image is generated from the foreground layer, pixels that have the same color but are associated with different indexes are included in different binary images, and in each binary image, the pixel value The “1” pixels are concentrated in a narrower region than in the conventional technique. Therefore, in the rectangular area including the pixels related to each index extracted from each binary image, the ratio of the pixels associated with each index is higher than that of the related art, and unnecessary data included in the compressed data Can be reduced.
例えば、画像上で離隔した二つの領域の色が同一である場合、従来技術では、二つの領域を含んだ矩形領域を抽出するので、領域間の画素を含む圧縮データを作成するのに対し、本発明では、二つの領域に互いに別のインデックスを対応付け、各領域を含む矩形領域を個別に抽出して個別に圧縮するので、圧縮データには領域間の画素が含まれない。 For example, when the colors of two regions separated on the image are the same, the conventional technique extracts a rectangular region including the two regions, whereas creating compressed data including pixels between the regions, In the present invention, different indexes are associated with the two regions, and rectangular regions including each region are individually extracted and compressed individually, so that the compressed data does not include pixels between the regions.
これにより、矩形領域にインデックスが効率よく含まれる(インデックスでない画素が最小限になる)ため、後段処理を行なう際に、2つのインデックス領域間の必要でない画像領域のデータを転送する必要がなくなり、データ転送量を下げ、処理速度を向上することができる。また、夫々の矩形領域も小さくなるため、矩形領域同士が重なる可能性が低くなり、圧縮データを展開し、プリントする際の速度を向上することができる。 As a result, since the index is efficiently included in the rectangular area (pixels that are not the index are minimized), it is not necessary to transfer unnecessary image area data between the two index areas when performing subsequent processing. The data transfer amount can be reduced and the processing speed can be improved. In addition, since the respective rectangular areas are also reduced, the possibility that the rectangular areas overlap each other is reduced, and the speed at which the compressed data is expanded and printed can be improved.
以上のように、本発明においては、圧縮後のデータに含まれる不要なデータを削減することができるので、カラー画像を圧縮した圧縮画像データのデータ量を削減し、カラー画像の圧縮効率を向上させることができる。従って、カラー画像を圧縮するために必要な処理時間を短縮することが可能となる。また、圧縮画像データを送受信する際には、送受信すべきデータ量を削減し、送受信に必要な時間を短縮することが可能となる。 As described above, in the present invention, unnecessary data included in the compressed data can be reduced, so the amount of compressed image data obtained by compressing a color image is reduced, and the compression efficiency of the color image is improved. Can be made. Therefore, it is possible to shorten the processing time required for compressing the color image. Further, when transmitting / receiving compressed image data, the amount of data to be transmitted / received can be reduced, and the time required for transmission / reception can be shortened.
実施の形態 2.
実施の形態1では、本発明の画像形成装置がカラー画像を形成する装置である形態を示したが、実施の形態2では、本発明の画像形成装置がモノクロ画像を形成する装置である形態を示す。
図33は、実施の形態2に係る画像形成装置の内部の機能構成を示すブロック図である。
画像形成装置は、画像をモノクロのグレースケールで光学的に読み取るグレー画像入力装置15を備えており、グレー画像入力装置15には、本発明の実施の形態に係る画像処理装置であるモノクロ画像処理装置4が接続されている。
In the first embodiment, the image forming apparatus of the present invention is an apparatus that forms a color image. In the second embodiment, the image forming apparatus of the present invention is an apparatus that forms a monochrome image. Show.
FIG. 33 is a block diagram illustrating an internal functional configuration of the image forming apparatus according to the second embodiment.
The image forming apparatus includes a gray
モノクロ画像処理装置4には、モノクロ画像処理装置4が生成した画像データに基づいてモノクロ画像を出力するモノクロ画像出力装置16、及び送信装置14が接続されている。
グレー画像入力装置15、モノクロ画像処理装置4、モノクロ画像出力装置16、及び送信装置14には、操作パネル12が接続されている。
グレー画像入力装置15は、CCD光センサを備えたスキャナにて構成されており、紙等の記録担体上に記録された画像からの反射光像をCCDで読み取り、グリーン(G)単色でグレースケールのアナログ信号に変換してモノクロ画像処理装置4へ入力する構成となっている。
The monochrome
An
The gray
モノクロ画像処理装置4は、グレー画像入力装置15から入力されたG単色のアナログ信号に対して画像処理を行なってデジタルの画像データを生成する。また、モノクロ画像処理装置4は、デジタルのK信号からなる画像データを生成してモノクロ画像出力装置16へ出力する。更に、モノクロ画像処理装置4は、生成したデジタルの画像データを圧縮処理により圧縮した圧縮画像データを生成し、圧縮画像データを送信装置14へ出力する。
モノクロ画像出力装置16は、モノクロ画像処理装置4から入力された画像データに基づいて、モノクロ画像を出力する。
操作パネル12及び送信装置14の構成は、実施の形態1と同様である。
The monochrome
The monochrome
The configurations of the
モノクロ画像処理装置4は、グレー画像入力装置15から入力されたアナログ信号をA/D変換部40でデジタル信号に変換し、シェーディング補正部41、入力階調補正部42、領域分離処理部43、空間フィルタ処理部46、出力階調補正部47、階調再現処理部48の順に送り、デジタルのK信号からなる画像データをモノクロ画像出力装置16へ出力する構成となっている。また、モノクロ画像処理装置4は、デジタル信号を領域分離処理部43から圧縮処理部45へ送り、圧縮画像データを送信装置14へ出力する構成となっている。
The monochrome
A/D変換部40は、グレー画像入力装置15から入力されたアナログ信号を受け付け、アナログのG信号をデジタルのG信号へ変換し、シェーディング補正部41へ出力する。
シェーディング補正部41は、A/D変換部40から入力されたG信号に対して、各種の歪みを取り除く処理を行ない、歪みを取り除いたG信号を入力階調補正部42へ出力する。
入力階調補正部42は、シェーディング補正部41から入力されたG信号の強度のバランスを調整し、更に、G信号をモノクロ画像処理装置4で処理しやすい濃度信号等の信号へ変換し、処理後のG信号を領域分離処理部43へ出力する。
The A /
The
The input
領域分離処理部43は、入力階調補正部42から入力されたG信号が表わす画像中の各画素を、文字領域、網点領域、又は写真領域のいずれかに分離し、各画素がいずれの領域に属しているかを示す領域識別信号を、空間フィルタ処理部46及び階調再現処理部48へ夫々出力し、G信号を空間フィルタ処理部46及び圧縮処理部45へ夫々出力する。
空間フィルタ処理部46は、入力されたG信号が表わす画像に対して、領域識別信号に基づいて空間フィルタ処理を行ない、処理後のG信号を出力階調補正部47へ出力する。
出力階調補正部47は、空間フィルタ処理部46から入力されたG信号に対して、モノクロ画像出力装置16の特性に基づく出力階調補正処理を行ない、処理後のG信号を階調再現処理部48へ出力する。
The region
The spatial
The output
階調再現処理部48は、出力階調補正部47から入力されたG信号に対して、領域識別信号に基づいて、領域に応じた中間調処理を行ない、処理後のG信号を変換したK信号でなる画像データをモノクロ画像出力装置16へ出力する。
圧縮処理部45は、領域分離処理部43からG信号でなる画像データを入力され、本発明の実施の形態に係る画像処理方法を用いて圧縮画像データを生成する処理を実行し、圧縮画像データを記憶部29に記憶させ、また、圧縮画像データを送信装置14へ出力する。圧縮処理部45が実行する画像処理方法は、色情報がRGB各色の色強度を示す情報ではなくG単色の強度を示す情報であることを除けば、実施の形態1の圧縮処理部3が実行する画像処理方法と同等である。
The gradation
The
図34は、実施の形態2に係る圧縮処理部45が利用するインデックスカラーテーブルの例を示す図表である。
各アドレスには、色情報として、G単色の強度を示す情報が関連付けられており、アドレスの値はインデックスの値に等しい。また、背景画素に対応するインデックス“0”には、白色を示す色情報である“0”が関連付けられている。
圧縮処理部45は、図34に示す如きインデックスカラーテーブルを用いて、実施の形態1の圧縮処理部3が実行する画像処理方法と同様の画像処理方法を実行することにより、圧縮画像データを生成する。
FIG. 34 is a table showing an example of an index color table used by the
Each address is associated with information indicating the intensity of the G single color as color information, and the address value is equal to the index value. In addition, “0”, which is color information indicating white, is associated with the index “0” corresponding to the background pixel.
The
以上詳述した如く、本実施の形態に係る画像処理装置は、画素の色情報が単色の色強度を示すモノクロ画像に対して、実施の形態1と同様の画像処理を行なうことにより、モノクロ画像を圧縮した圧縮画像データを生成する。
本実施の形態においても、画像処理装置は、前景レイヤを生成する際に、色に応じたインデックスを各画素に対応付け、注目画素と同一のインデックスが対応付けられた画素が既に存在する場合には、それらのインデックスが所定の距離以上離れているかを判定する。更に画像処理装置は、それらのインデックスが所定の距離以上離れていれば、注目画素のインデックスとして、同一の色を示しながらも数値が互いに異なるインデックスを対応付け、所定距離以上離れていなければ、同一のインデックスを対応付ける。
As described above in detail, the image processing apparatus according to the present embodiment performs monochrome image processing by performing image processing similar to that of
Also in the present embodiment, when the foreground layer is generated, the image processing apparatus associates an index corresponding to the color with each pixel, and there is already a pixel associated with the same index as the target pixel. Determines whether these indexes are more than a predetermined distance apart. Further, the image processing apparatus associates indexes having different values while indicating the same color as the index of the target pixel if the indexes are separated by a predetermined distance or more, and the same if the indices are not separated by a predetermined distance or more. Associate the index of.
更に、画像処理装置は、各インデックスの中で互いに近似した色を示すインデックスを統合し、互いに同じ色を示すインデックス同士は統合しない。
この結果、圧縮後のデータに含まれる不要なデータを削減することができる。従って、モノクロ画像を圧縮した圧縮画像データのデータ量を削減し、モノクロ画像の圧縮効率を向上させることが可能となる。
Further, the image processing apparatus integrates indexes indicating colors that are similar to each other in each index, and does not integrate indexes that indicate the same color.
As a result, unnecessary data included in the compressed data can be reduced. Therefore, it is possible to reduce the data amount of the compressed image data obtained by compressing the monochrome image and improve the compression efficiency of the monochrome image.
実施の形態 3.
実施の形態2では、本発明の画像形成装置がモノクロ画像を受け付けてモノクロ画像を形成する装置である形態を示したが、実施の形態3では、本発明の画像形成装置がカラー画像を受け付けてモノクロ画像を形成する装置である形態を示す。
In the second embodiment, the image forming apparatus of the present invention is an apparatus that receives a monochrome image and forms a monochrome image. However, in the third embodiment, the image forming apparatus of the present invention receives a color image. The form which is an apparatus which forms a monochrome image is shown.
図35は、実施の形態3に係る画像形成装置の内部の機能構成を示すブロック図である。
画像形成装置は、カラー画像を光学的に読み取るカラー画像入力装置11を備えており、カラー画像入力装置11には、本発明の実施の形態に係る画像処理装置である画像処理装置5が接続されている。画像処理装置5には、モノクロ画像出力装置16、及び送信装置14が接続されている。カラー画像入力装置11、画像処理装置5、モノクロ画像出力装置16及び送信装置14には、操作パネル12が接続されている。
カラー画像入力装置11は、実施の形態1と同様の処理を行ない、カラー画像を読み取ったRGBのアナログ信号を画像処理装置5へ出力する。
FIG. 35 is a block diagram illustrating an internal functional configuration of the image forming apparatus according to the third embodiment.
The image forming apparatus includes a color
The color
画像処理装置5は、カラー画像入力装置11から入力されたRGBのアナログ信号に対して画像処理を行なって、デジタルの単色のK信号からなる画像データを生成してモノクロ画像出力装置16へ出力する。また、画像処理装置5は、デジタルのRGB信号でなる画像データを圧縮した圧縮画像データを生成し、生成した圧縮画像データを、記憶部29に記憶させるか、又は送信装置14へ出力する。記憶部29が記憶する圧縮画像データ及び送信装置14が送信する圧縮画像データが表わす画像は、カラー画像となる。
モノクロ画像出力装置16は、画像処理装置5から入力された画像データに基づいて、モノクロ画像を出力する。
操作パネル12及び送信装置14の構成は、実施の形態1と同様である。
The
The monochrome
The configurations of the
画像処理装置5は、カラー画像入力装置11から入力されたアナログ信号をA/D変換部20でデジタル信号に変換し、シェーディング補正部21、入力階調補正部22、領域分離処理部53、色補正部54、黒生成下色除去部55、空間フィルタ処理部46、出力階調補正部47、階調再現処理部48の順に送り、デジタルのK信号からなる画像データをモノクロ画像出力装置16へ出力する構成となっている。また、画像処理装置5は、デジタル信号を領域分離処理部53から圧縮処理部3へ送り、圧縮画像データを送信装置14へ出力する構成となっている。
The
A/D変換部20、シェーディング補正部21、及び入力階調補正部22の構成は、実施の形態1と同様である。
領域分離処理部53は、入力階調補正部22から入力されたRGB信号が表わす画像中の各画素を、文字領域、網点領域、又は写真領域のいずれかに分離し、各画素がいずれの領域に属しているかを示す領域識別信号を、黒生成下色除去部55、空間フィルタ処理部46、及び階調再現処理部48へ夫々出力する。
また、領域分離処理部53は、入力階調補正部22から入力されたRGB信号を色補正部54及び圧縮処理部3へ夫々出力する。
The configurations of the A /
The region
Further, the region
色補正部54は、領域分離処理部53から入力されたRGB信号からG信号を抽出し、抽出したG信号を黒生成下色除去部55へ出力する。
黒生成下色除去部55は、色補正部54からのG信号を空間フィルタ処理部46へ出力する。
空間フィルタ処理部46、出力階調補正部47及び階調再現処理部48の構成は、実施の形態2と同様である。
圧縮処理部3の構成は実施の形態1と同様であり、圧縮処理部3は、領域分離処理部53からRGB信号でなる画像データを入力され、実施の形態1と同様に本発明の実施の形態に係る画像処理方法を実行することにより、圧縮画像データを生成する。
The
The black generation and under
The configurations of the spatial
The configuration of the
なお、色補正部54は、RGB信号からG信号を抽出するのではなく、RGB信号から輝度信号を生成する処理を行なう形態であってもよい。例えば、色補正部54は、RGB各色の色強度RGBから輝度値Yを、Y=0.30R+0.59G+0.11Bと計算することによって、輝度信号を生成する。この形態の場合は、黒生成下色除去部55、空間フィルタ処理部46、出力階調補正部47及び階調再現処理部48は、輝度信号を色情報とした処理を実行する。
The
以上詳述した如く、本実施の形態に係る画像処理装置は、モノクロ画像の形成とカラーの圧縮画像データの生成とを可能とする。
本実施の形態においても、画像処理装置は、前景レイヤを生成する際に、色に応じたインデックスを各画素に対応付け、注目画素と同一のインデックスが対応付けられた画素が既に存在する場合には、それらのインデックスが所定の距離以上離れているかを判定する。更に画像処理装置は、それらのインデックスが所定の距離以上離れていれば、注目画素のインデックスとして、同一の色を示しながらも数値が互いに異なるインデックスを対応付け、所定距離以上離れていなければ、同一のインデックスを対応付ける。
As described above in detail, the image processing apparatus according to the present embodiment can form a monochrome image and generate color compressed image data.
Also in the present embodiment, when the foreground layer is generated, the image processing apparatus associates an index corresponding to the color with each pixel, and there is already a pixel associated with the same index as the target pixel. Determines whether these indexes are more than a predetermined distance apart. Further, the image processing apparatus associates indexes having different values while indicating the same color as the index of the target pixel if the indexes are separated by a predetermined distance or more, and the same if the indices are not separated by a predetermined distance or more. Associate the index of.
更に、画像処理装置は、各インデックスの中で互いに近似した色を示すインデックスを統合し、互いに同じ色を示すインデックス同士は統合しない。
この結果、圧縮後のデータに含まれる不要なデータを削減することができる。従って、カラー画像を圧縮した圧縮画像データのデータ量を削減し、カラー画像の圧縮効率を向上させることが可能となる。
Further, the image processing apparatus integrates indexes indicating colors that are similar to each other in each index, and does not integrate indexes that indicate the same color.
As a result, unnecessary data included in the compressed data can be reduced. Therefore, it is possible to reduce the data amount of the compressed image data obtained by compressing the color image and improve the compression efficiency of the color image.
実施の形態 4.
実施の形態1〜3では、本発明の画像処理装置が画像形成装置の一部をなす形態を示したが、実施の形態4においては、本発明の画像処理装置がスキャナ装置の一部をなす形態を示す。
In the first to third embodiments, the image processing apparatus of the present invention forms part of the image forming apparatus. However, in the fourth embodiment, the image processing apparatus of the present invention forms part of the scanner apparatus. The form is shown.
図36は、実施の形態4に係る画像処理装置を含むスキャナ装置の内部の機能構成を示すブロック図である。
スキャナ装置は、カラー画像を光学的に読み取るカラー画像入力装置11を備えており、カラー画像入力装置11には、本発明の実施の形態に係る画像処理装置6が接続されている。
画像処理装置6には、通信ケーブル又は通信ネットワークを介してパーソナルコンピュータ(PC)等の図示しないホスト装置が接続されている。
カラー画像入力装置11及び画像処理装置6には、操作パネル12が接続されている。
FIG. 36 is a block diagram illustrating an internal functional configuration of a scanner apparatus including the image processing apparatus according to the fourth embodiment.
The scanner device includes a color
A host device (not shown) such as a personal computer (PC) is connected to the
An
カラー画像入力装置11は、実施の形態1と同様の処理を行ない、カラー画像を読み取ったRGBのアナログ信号を画像処理装置6へ出力する。
画像処理装置6は、カラー画像入力装置11から入力されたアナログ信号をA/D変換部20でデジタル信号に変換し、シェーディング補正部21、入力階調補正部22、領域分離処理部63、圧縮処理部3の順に送る構成となっている。
A/D変換部20、シェーディング補正部21、及び入力階調補正部22の構成は、実施の形態1と同様である。
領域分離処理部63は、入力階調補正部22から入力されたRGB信号を圧縮処理部3へ出力する。
The color
The
The configurations of the A /
The region
圧縮処理部3の構成は実施の形態1と同様であり、圧縮処理部3は、領域分離処理部63からRGB信号でなる画像データを入力され、実施の形態1と同様に本発明の実施の形態に係る画像処理方法を実行することにより、入力された画像を圧縮した圧縮画像データを生成する。また、圧縮処理部3は、生成した圧縮画像データを図示しないホスト装置へ出力する。
ホスト装置は、画像処理装置6が出力した圧縮画像データを受け付け、圧縮画像データの記憶、圧縮画像データの外部への送信、又は圧縮画像データに基づいた画像出力等の処理を実行する。
The configuration of the
The host device receives the compressed image data output from the
以上のように、本実施の形態においても、実施の形態1〜3と同様に、画像処理装置は、前景レイヤを生成する際に、色に応じたインデックスを各画素に対応付け、注目画素と同一のインデックスが対応付けられた画素が既に存在する場合には、それらのインデックスが所定の距離以上離れているかを判定する。更に画像処理装置は、それらのインデックスが所定の距離以上離れていれば、注目画素のインデックスとして、同一の色を示しながらも数値が互いに異なるインデックスを対応付け、所定距離以上離れていなければ、同一のインデックスを対応付ける。
更に、画像処理装置は、各インデックスの中で互いに近似した色を示すインデックスを統合し、互いに同じ色を示すインデックス同士は統合しない。
As described above, also in the present embodiment, as in the first to third embodiments, when generating the foreground layer, the image processing apparatus associates an index corresponding to a color with each pixel, If pixels that are associated with the same index already exist, it is determined whether those indexes are separated by a predetermined distance or more. Further, the image processing apparatus associates indexes having different values while indicating the same color as the index of the target pixel if the indexes are separated by a predetermined distance or more, and the same if the indices are not separated by a predetermined distance or more. Associate the index of.
Further, the image processing apparatus integrates indexes indicating colors that are similar to each other in each index, and does not integrate indexes that indicate the same color.
この結果、圧縮後のデータに含まれる不要なデータを削減することができる。従って、カラー画像を圧縮した圧縮画像データのデータ量を削減し、画像の圧縮効率を向上させることができるようになり、圧縮画像データを送受信する際には、送受信すべきデータ量を削減し、送受信に必要な時間を短縮することが可能となる。 As a result, unnecessary data included in the compressed data can be reduced. Accordingly, the amount of compressed image data obtained by compressing a color image can be reduced, and the compression efficiency of the image can be improved. When transmitting / receiving compressed image data, the amount of data to be transmitted / received is reduced, It is possible to reduce the time required for transmission / reception.
実施の形態 5.
実施の形態5では、汎用のコンピュータを用いて本発明の画像処理装置を実現した形態を示す。
図37は、実施の形態5に係る画像処理装置7の内部構成を示すブロック図である。
本実施の形態に係る画像処理装置7は、PC等の汎用コンピュータを用いて構成されており、演算を行なうCPU71と、演算に伴って発生する一時的な情報を記憶するRAM72と、光ディスク等の記録媒体から情報を読み取るCD−ROMドライブ等のドライブ部73と、ハードディスク等の記憶部74とを備えている。
In the fifth embodiment, an embodiment in which the image processing apparatus of the present invention is realized using a general-purpose computer will be described.
FIG. 37 is a block diagram showing an internal configuration of the
The
CPU71は、本発明の実施の形態に係る記録媒体8から、本発明の実施の形態に係るコンピュータプログラム81をドライブ部73に読み取らせ、読み取ったコンピュータプログラム81を記憶部74に記憶させる。コンピュータプログラム81は必要に応じて記憶部74からRAM72へロードされ、ロードされたコンピュータプログラム81に基づいて、CPU71は画像処理装置7に必要な処理を実行する。
The
また、画像処理装置7は、使用者が操作することによる各種の処理指示等の情報が入力されるキーボード又はポインティングデバイス等の入力部75と、各種の情報を表示する液晶ディスプレイ等の表示部76とを備えている。更に、画像処理装置7は、図示しない外部の通信ネットワークに接続可能な送信部77と、画像データを入力するスキャナ装置等の外部の入力装置82に接続された受信部78とを備えている。
入力装置82は、画像を光学的に読み取って画像データを生成し、生成した画像データを画像処理装置7へ送信する。受信部78は、入力装置82から送信された画像データを受信する。受信部78は、本発明における受付手段として機能する。送信部77は、図示しない通信ネットワークを介して、ファクシミリ又は電子メール等の通信方法により外部へデータを送信することができる。
In addition, the
The
CPU71は、コンピュータプログラム81をRAM72にロードし、ロードしたコンピュータプログラム81に従って、本発明の実施の形態に係る画像処理方法を実行する。即ち、受信部78で入力装置82から画像データが入力された場合に、CPU71は、実施の形態1における前景マスク生成処理部31、前景色インデックス化処理部32、背景レイヤ生成処理部33、2値画像生成処理部34及び画像圧縮処理部35が行なう処理と同様の、前景マスク生成処理、前景色インデックス化処理、背景レイヤ生成処理、2値画像生成処理及び画像圧縮処理を実行する。これにより、CPU71は、受け付けた画像データを圧縮した圧縮画像データを生成する処理を行なう。
The
CPU71は、生成した圧縮画像データを記憶部74に記憶させる。また、CPU71は、ロードしたコンピュータプログラム81に従って、生成した圧縮画像データ、又は記憶部74から読み出した圧縮画像データを送信部77に外部へ送信させる処理を行なう。
なお、CPU71は、使用者が入力部75を用いて作成した画像データを受け付け、受け付けた画像データを圧縮した圧縮画像データを生成する処理を行なう構成でもよい。この場合、CPU71は、本発明における受付手段として機能する。
The
Note that the
以上のように、本実施の形態においても、実施の形態1〜4と同様に、画像処理装置は、前景レイヤを生成する際に、色に応じたインデックスを各画素に対応付け、注目画素と同一のインデックスが対応付けられた画素が既に存在する場合には、それらのインデックスが所定の距離以上離れているかを判定する。更に画像処理装置は、それらのインデックスが所定の距離以上離れていれば、注目画素のインデックスとして、同一の色を示しながらも数値が互いに異なるインデックスを対応付け、所定距離以上離れていなければ、同一のインデックスを対応付ける。
更に、画像処理装置は、各インデックスの中で互いに近似した色を示すインデックスを統合し、互いに同じ色を示すインデックス同士は統合しない。
As described above, also in the present embodiment, as in the first to fourth embodiments, when generating the foreground layer, the image processing apparatus associates an index corresponding to the color with each pixel, If pixels that are associated with the same index already exist, it is determined whether the indexes are separated by a predetermined distance or more. Further, the image processing apparatus associates indexes having different values while indicating the same color as the index of the target pixel if the indexes are separated by a predetermined distance or more, and the same if the indices are not separated by a predetermined distance or more. Associate the index of.
Further, the image processing apparatus integrates indexes indicating colors that are similar to each other in each index, and does not integrate indexes that indicate the same color.
この結果、圧縮後のデータに含まれる不要なデータを削減することができる。従って、カラー画像を圧縮した圧縮画像データのデータ量を削減し、画像の圧縮効率を向上させることが可能となる。 As a result, unnecessary data included in the compressed data can be reduced. Therefore, it is possible to reduce the data amount of the compressed image data obtained by compressing the color image and improve the compression efficiency of the image.
なお、コンピュータプログラム81を記録してある記録媒体8は、磁気テープ、磁気ディスク、可搬型のハードディスク、CD−ROM/MO/MD/DVD等の光ディスク、又はICカード(メモリカードを含む)/光カード等のカード型記録媒体のいずれの形態であってもよい。また、本発明の記録媒体8は、画像処理装置7に装着され、記録媒体8の記録内容をCPU71が読み出すことが可能な半導体メモリ、即ちマスクROM、EPROM(Erasable Programmable Read Only Memory)、EEPROM(Electrically Erasable Programmable Read Only Memory)、フラッシュROM等であってもよい。
The
更に、本発明のコンピュータプログラム81は、インターネット又はLAN等の通信ネットワークを介して画像処理装置7に接続された図示しない外部のサーバ装置から画像処理装置7へダウンロードされて記憶部74に記憶される形態であってもよい。この形態の場合は、コンピュータプログラム81をダウンロードするために必要なプログラムは、予め記憶部74に記憶されてあるか、又は所定の記録媒体からドライブ部73を用いて読み出されて記憶部74に記憶され、必要に応じてRAM72にロードされるものであればよい。
Furthermore, the
以上の実施の形態1〜5においては、前景レイヤに含まれる画素として文字に対応する画素を抽出する処理を行なう形態を示したが、これに限るものではなく、本発明は、前景レイヤに含まれる画素として線画に対応する画素を抽出する処理を行なう形態であってもよい。また、本発明は、前景レイヤに含まれる画素として文字及び線画に対応する画素を抽出する処理を行なう形態であってもよい。
In
11 カラー画像入力装置
12 操作パネル
13 カラー画像出力装置
14 送信装置
15 グレー画像入力装置
16 モノクロ画像出力装置
2 カラー画像処理装置
3,45 圧縮処理部
31 前景マスク生成処理部
32 前景色インデックス化処理部
321 インデックス生成部
322 インデックス統合部
323 インデックス補正部
33 背景レイヤ生成処理部
34 2値画像生成処理部
35 画像圧縮処理部
4 モノクロ画像処理装置
5,6,7 画像処理装置
71 CPU
8 記録媒体
81 コンピュータプログラム
DESCRIPTION OF
8 Recording
Claims (10)
該受付手段が受け付けた画像を構成する画素の内、文字及び/又は線画に対応する画素を抽出する抽出手段と、
該抽出手段が抽出した各画素の色を複数の識別子のいずれかで表わした前景レイヤを生成する前景レイヤ生成手段と、
前記受付手段が受け付けた画像から文字及び/又は線画を省いた背景レイヤを生成する背景レイヤ生成手段と、
前記前景レイヤ生成手段が生成した前景レイヤに含まれる識別子毎に、特定の識別子で表わされる画素とその他の画素とからなる2値画像を生成する2値画像生成手段と、
該2値画像生成手段が生成した2値画像、及び前記背景レイヤ生成手段が生成した背景レイヤを夫々圧縮する圧縮手段と
を備え、
画像を圧縮する処理を行なう画像処理装置において、
前記前景レイヤ生成手段は、
各画素の色に応じて、特定の色に関連付けられた識別子を各画素に対応付ける識別子対応手段と、
該識別子対応手段による対応付けによって同一の識別子が対応付けられた画素の内、画像上で所定距離より離隔している画素間で異なる識別子を対応付けることによって識別子を分離する識別子分離手段と、
前記識別子対応手段による対応付け及び前記識別子分離手段による分離の後、異なる識別子の内、該識別子に対応付けられている色同士が所定の範囲内で近似している識別子を統合する識別子統合手段と
を有することを特徴とする画像処理装置。 Receiving means for receiving an image composed of a plurality of pixels;
Extraction means for extracting pixels corresponding to characters and / or line drawings out of the pixels constituting the image received by the reception means;
Foreground layer generation means for generating a foreground layer representing the color of each pixel extracted by the extraction means by any of a plurality of identifiers;
Background layer generation means for generating a background layer from which characters and / or line drawings are omitted from the image received by the reception means;
Binary image generating means for generating a binary image composed of a pixel represented by a specific identifier and other pixels for each identifier included in the foreground layer generated by the foreground layer generating means;
Compression means for compressing the binary image generated by the binary image generation means and the background layer generated by the background layer generation means,
In an image processing apparatus that performs processing for compressing an image,
The foreground layer generation means includes
An identifier corresponding means for associating an identifier associated with a specific color with each pixel according to the color of each pixel;
An identifier separating unit that separates identifiers by associating different identifiers between pixels that are separated from a predetermined distance on the image among pixels associated with the same identifier by association by the identifier association unit;
An identifier integration unit that integrates, among different identifiers, identifiers whose colors associated with the identifiers are approximated within a predetermined range after association by the identifier association unit and separation by the identifier separation unit; An image processing apparatus comprising:
前記識別子対応手段による対応付け及び前記識別子分離手段による分離の後、対応付けられている色同士が同一である識別子を除いて、異なる識別子の内、該識別子に対応付けられている色同士が所定の範囲内で近似している識別子を統合するようにしてあることを特徴とする請求項1に記載の画像処理装置。 The identifier integrating means includes
After the association by the identifier correspondence unit and the separation by the identifier separation unit, the colors associated with the identifiers among the different identifiers are predetermined except for identifiers in which the associated colors are the same. The image processing apparatus according to claim 1, wherein identifiers that are approximated within the range are integrated.
所定の選択順に従って、画素を順次選択する選択手段と、
選択済みの画素の内で選択中の画素と同一の識別子が対応付けられた画素と、前記選択中の画素との間の最小距離を演算する最小演算手段と、
該最小演算手段が演算した最小距離が所定の閾値より大きい場合に、前記選択中の画素に対応付けられた識別子を、該識別子と同一の色に関連付けられた新たな識別子に変更する手段と
を有することを特徴とする請求項1又は2に記載の画像処理装置。 The identifier separating means includes
Selection means for sequentially selecting pixels according to a predetermined selection order;
A minimum calculation means for calculating a minimum distance between a pixel associated with the same identifier as the pixel being selected among the selected pixels and the pixel being selected;
Means for changing an identifier associated with the selected pixel to a new identifier associated with the same color as the identifier when the minimum distance calculated by the minimum operation means is greater than a predetermined threshold; The image processing apparatus according to claim 1, wherein the image processing apparatus is provided.
前記最小演算手段が演算する距離として、主走査方向の距離と、副走査方向の距離と、主走査方向及び副走査方向の両方の距離とを切り替える手段を更に備えることを特徴とする請求項3に記載の画像処理装置。 The selection means is configured to sequentially select pixels, with one direction on the image as a main scanning direction and a direction orthogonal to the one direction as a sub-scanning direction,
4. The apparatus according to claim 3, further comprising means for switching a distance in the main scanning direction, a distance in the sub scanning direction, and a distance in both the main scanning direction and the sub scanning direction as the distance calculated by the minimum calculating means. An image processing apparatus according to 1.
受け付けた画像を構成する画素の内、文字及び/又は線画に対応する画素を抽出するステップと、
抽出した各画素の色を複数の識別子のいずれかで表わした前景レイヤを生成する前景レイヤ生成ステップと、
受け付けた画像から文字及び/又は線画を省いた背景レイヤを生成するステップと、
前記前景レイヤに含まれる識別子毎に、特定の識別子で表わされる画素とその他の画素とからなる2値画像を生成するステップと、
生成した2値画像及び背景レイヤを夫々圧縮するステップと
を含む画像処理方法において、
前記前景レイヤ生成ステップは、
各画素の色に応じて、特定の色に関連付けられた識別子を各画素に対応付けるステップと、
同一の識別子が対応付けられた画素の内、画像上で所定距離より離隔している画素間で異なる識別子を対応付けることによって識別子を分離するステップと、
識別子の対応付け及び分離の後、異なる識別子の内、該識別子に対応付けられている色同士が所定の範囲内で近似している識別子を統合するステップと
を含むことを特徴とする画像処理方法。 Receiving an image composed of a plurality of pixels;
Extracting a pixel corresponding to a character and / or a line drawing from among pixels constituting the received image;
A foreground layer generation step of generating a foreground layer representing the color of each extracted pixel by any of a plurality of identifiers;
Generating a background layer without characters and / or line drawings from the received image;
Generating a binary image composed of a pixel represented by a specific identifier and other pixels for each identifier included in the foreground layer;
Compressing the generated binary image and the background layer, respectively,
The foreground layer generation step includes
Associating each pixel with an identifier associated with a particular color, depending on the color of each pixel;
Separating the identifiers by associating different identifiers between pixels that are separated from the predetermined distance on the image among pixels associated with the same identifier;
And after integrating and separating the identifiers, integrating the identifiers of the different identifiers whose colors associated with the identifiers are approximated within a predetermined range. .
画像を構成する画素の内、文字及び/又は線画に対応する画素を抽出する手順と、
抽出した各画素の色を複数の識別子のいずれかで表わした前景レイヤを生成する前景レイヤ生成手順と、
前記画像から文字及び/又は線画を省いた背景レイヤを生成する手順と、
前記前景レイヤに含まれる識別子毎に、特定の識別子で表わされる画素とその他の画素とからなる2値画像を生成する手順と、
生成した2値画像及び背景レイヤを夫々圧縮する手順と
を含む処理を実行させることによって、画像を圧縮する処理を実行させるためのコンピュータプログラムであって、
前記前景レイヤ生成手順は、
各画素の色に応じて、特定の色に関連付けられた識別子を各画素に対応付ける手順と、
同一の識別子が対応付けられた画素の内、画像上で所定距離より離隔している画素間で異なる識別子を対応付けることによって識別子を分離する手順と、
識別子の対応付け及び分離の後、異なる識別子の内、該識別子に対応付けられている色同士が所定の範囲内で近似している識別子を統合する手順と
を含むことを特徴とするコンピュータプログラム。 On the computer,
A procedure for extracting pixels corresponding to characters and / or line drawings from among pixels constituting the image;
A foreground layer generation procedure for generating a foreground layer representing the color of each extracted pixel by any of a plurality of identifiers;
Generating a background layer from which characters and / or line drawings are omitted from the image;
For each identifier included in the foreground layer, a procedure for generating a binary image composed of a pixel represented by a specific identifier and other pixels;
A computer program for executing a process of compressing an image by executing a process including a procedure of compressing a generated binary image and a background layer respectively.
The foreground layer generation procedure includes:
Depending on the color of each pixel, a procedure for associating an identifier associated with a specific color with each pixel;
A procedure of separating identifiers by associating different identifiers among pixels that are separated from a predetermined distance on the image among pixels associated with the same identifier;
And a step of integrating, after the association and separation of the identifiers, the identifiers of the different identifiers whose colors are similar to each other within a predetermined range.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009029633A JP2010187179A (en) | 2009-02-12 | 2009-02-12 | Image processing apparatus, image forming apparatus, image processing method, computer program, and recording medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009029633A JP2010187179A (en) | 2009-02-12 | 2009-02-12 | Image processing apparatus, image forming apparatus, image processing method, computer program, and recording medium |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2010187179A true JP2010187179A (en) | 2010-08-26 |
Family
ID=42767560
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009029633A Pending JP2010187179A (en) | 2009-02-12 | 2009-02-12 | Image processing apparatus, image forming apparatus, image processing method, computer program, and recording medium |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2010187179A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013106173A (en) * | 2011-11-14 | 2013-05-30 | Casio Comput Co Ltd | Image processor |
CN112073726A (en) * | 2020-09-11 | 2020-12-11 | Oppo广东移动通信有限公司 | Compression method and device, computer readable storage medium and electronic device |
-
2009
- 2009-02-12 JP JP2009029633A patent/JP2010187179A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013106173A (en) * | 2011-11-14 | 2013-05-30 | Casio Comput Co Ltd | Image processor |
CN112073726A (en) * | 2020-09-11 | 2020-12-11 | Oppo广东移动通信有限公司 | Compression method and device, computer readable storage medium and electronic device |
CN112073726B (en) * | 2020-09-11 | 2022-07-08 | Oppo广东移动通信有限公司 | Compression method and device, computer readable storage medium and electronic device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8280160B2 (en) | Image compressing method, image compressing apparatus and image forming apparatus | |
US8606014B2 (en) | Image Processing apparatus, extracting foreground pixels for extracted continuous variable density areas according to color information | |
US8463032B2 (en) | Image compressing apparatus, compressed image outputting apparatus, image compression method, and recording medium | |
JP4707751B2 (en) | Image compression method, image compression apparatus, image forming apparatus, computer program, and recording medium | |
US8254672B2 (en) | Image compressing method, image compressing apparatus and image forming apparatus | |
US8792735B2 (en) | Image compressing apparatus which extracts black text edge pixels from an image and compresses a layer with black text edge pixels extracted | |
JP4732488B2 (en) | Image processing apparatus, image forming apparatus, image reading apparatus, image processing method, image processing program, and computer-readable recording medium | |
US8390888B2 (en) | Image compressing method, image compressing apparatus and image forming apparatus | |
JP4528846B2 (en) | Image compression method, image compression apparatus, image processing apparatus, image forming apparatus, computer program, and recording medium | |
JP2010157899A (en) | Image processing device, image-forming device, image processing method, computer program, and recording medium | |
JP2010187179A (en) | Image processing apparatus, image forming apparatus, image processing method, computer program, and recording medium | |
JP2010187180A (en) | Image processing apparatus, image forming apparatus, image processing method, computer program, and recording medium | |
JP2010074300A (en) | Image processor, image reader and image forming apparatus | |
JP2010098611A (en) | Image processing apparatus, image forming apparatus, image processing method, computer program, and recording medium | |
JP2010045537A (en) | Image processor, image forming device, image processing method, computer program and recording medium | |
JP4176656B2 (en) | Image processing apparatus, image processing method, image forming apparatus, image processing program, and recording medium recording the program | |
JP4266002B2 (en) | Image processing apparatus, image forming apparatus, image processing method, image processing program, and recording medium | |
JP4990340B2 (en) | Image processing apparatus, image forming apparatus, image processing method, image processing program, and recording medium | |
JP2011249886A (en) | Image processing device, image forming device, image processing method, image processing program, and recording medium | |
JP4271644B2 (en) | Image processing apparatus, image processing method, image processing program, and recording medium recording image processing program | |
JP2009017317A (en) | Image processing method, image processing device, image forming apparatus, image processing program and recording medium with image processing program recorded thereon |