JP2008125020A - Image encoding device and control method thereof - Google Patents

Image encoding device and control method thereof Download PDF

Info

Publication number
JP2008125020A
JP2008125020A JP2006309627A JP2006309627A JP2008125020A JP 2008125020 A JP2008125020 A JP 2008125020A JP 2006309627 A JP2006309627 A JP 2006309627A JP 2006309627 A JP2006309627 A JP 2006309627A JP 2008125020 A JP2008125020 A JP 2008125020A
Authority
JP
Japan
Prior art keywords
encoding
color
character
position information
line drawing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2006309627A
Other languages
Japanese (ja)
Other versions
JP2008125020A5 (en
JP4757172B2 (en
Inventor
Fumitada Nagashima
史忠 長島
Takashi Ishikawa
尚 石川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2006309627A priority Critical patent/JP4757172B2/en
Publication of JP2008125020A publication Critical patent/JP2008125020A/en
Publication of JP2008125020A5 publication Critical patent/JP2008125020A5/ja
Application granted granted Critical
Publication of JP4757172B2 publication Critical patent/JP4757172B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To further reduce the amount of encoded data while keeping sharpness of a character/line drawing of a multi-value image including the character/line drawing and a natural image. <P>SOLUTION: A data separator 103 extracts color information of pixels of the character/line drawing in image data of an input block and generates position information for discriminating positions of pixels of the character/line drawing and a non-characters/line drawing in the target block. A code substituting unit 106 converts the color information into a color code. Further, a reversible encoding unit 107 reversibly encodes the generated position information. A substitute value calculator 104 calculates a substitute value to substitute for values of the pixels of the character/line drawing according to the generated position information. Then a selector 105 substitutes the calculated substitute value for the values of the pixels of the character/line drawing in the block according to the position information. An irreversible encoding unit 108 irreversibly encods the block after the substitution. A multiplexing unit 109 multiplexes and outputs the color code, encoded data of the position information, and encoded data of image data of the block. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、多値画像データを符号化する技術に関するものである。   The present invention relates to a technique for encoding multilevel image data.

従来、文字線画と自然画像とが混在した画像を効率よく符号化する方法として、特許文献1にその提案がなされている。この技術を簡単に説明すると次の通りである。   Conventionally, Japanese Patent Application Laid-Open No. H10-228707 has proposed a method for efficiently encoding an image in which a character line image and a natural image are mixed. This technique is briefly described as follows.

先ず、符号化対象の多値画像データを、直交変換の単位となるブロックに分割する。文字線画は、同一の色となるので、ブロック内での最頻度の画素を文字線画とし、その最頻度の色情報を抽出(以下、抽出色という)する。そして、注目ブロック内の抽出色と判定された画素と、非抽出色とを判定された画素とを区別するための2値の識別情報を生成する。そして、非抽出画素と判定された画素の平均値を求め、その平均値の画素値で、抽出色を判定された画素値を置換する。すなわち、注目ブロック内の全画素を、自然画を構成する画素とする。そして、抽出色を示す情報、識別情報については可逆符号化し、置換後の注目ブロックに含まれるの画素群については直交変換を行なう非可逆のJPEG符号化を行なう。この後、これら3つの符号化データを多重化し、1ブロック分の符号化データを生成する。上記の結果、JPEG符号化処理対象のブロックには、文字/線画の高周波成分やエッジ成分が少なくなり、その分だけ符号化効率が高くなる。
特開平4−326669号公報
First, multi-value image data to be encoded is divided into blocks that are units of orthogonal transformation. Since the character line drawing has the same color, the most frequent pixel in the block is used as the character line drawing, and the most frequent color information is extracted (hereinafter referred to as an extracted color). Then, binary identification information for distinguishing between the pixel determined as the extracted color in the block of interest and the pixel determined as the non-extracted color is generated. Then, an average value of pixels determined as non-extracted pixels is obtained, and the pixel value determined as the extracted color is replaced with the pixel value of the average value. That is, all the pixels in the block of interest are pixels that constitute a natural image. Then, the information indicating the extracted color and the identification information are losslessly encoded, and the irreversible JPEG encoding that performs orthogonal transformation is performed on the pixel group included in the target block after replacement. Thereafter, these three encoded data are multiplexed to generate encoded data for one block. As a result, the high-frequency component and edge component of the character / line drawing are reduced in the JPEG encoding processing target block, and the encoding efficiency is increased accordingly.
JP-A-4-326669

しかしながら、上記特許文献1では、抽出色情報をそのまま符号化しているため、まだまだ改善の余地がある。特に、ランダムアクセスを容易にするため、ブロック内の情報のみで復号化が完結する場合、他のブロックの情報を参照しないことになるので、抽出色に関しての圧縮率は小さいものとなる。   However, in the above-mentioned Patent Document 1, since the extracted color information is encoded as it is, there is still room for improvement. In particular, in order to facilitate random access, when decoding is completed with only information in a block, information on other blocks is not referred to, so the compression rate for the extracted color is small.

本発明はかかる問題点に鑑みなされたものであり、文字/線画と自然画とが混在する多値画像の文字/線画の先鋭度を保持しながらも、生成する符号化データ量を更に削減する技術を提供しようとするものである。   The present invention has been made in view of such a problem, and further reduces the amount of encoded data to be generated while maintaining the sharpness of a character / line image of a multi-valued image in which characters / line images and natural images are mixed. It is intended to provide technology.

この課題を解決するため、例えば本発明の画像符号化装置は以下の構成を備える。すなわち、
多値画像データを符号化する画像符号化装置であって、
符号化対象の多値画像データから、非可逆符号化の対象となるブロック単位の画像データを入力する入力手段と、
入力したブロックの画像データ中の、文字/線画の画素の色を示す色情報を抽出する抽出手段と、
該抽出手段で抽出した色情報を、予めメモリに格納された参照テーブルを用いて色コードに変換する色コード変換手段と、
前記抽出手段で抽出した色情報に従い、注目ブロック内の文字/線画の画素の位置と、非文字/線画の画素の位置とを識別するための位置情報を生成する位置情報生成手段と、
該位置情報生成手段で生成された位置情報を可逆符号する可逆符号化手段と、
前記位置情報生成手段で生成された位置情報に従って、文字/線画の画素の値を置換するための置換値を算出する置換値算出手段と、
注目ブロック内の文字/線画の画素の値を、前記置換値で置換する置換手段と、
置換後のブロックの画像データを非可逆符号化する非可逆符号化手段と、
前記色コード、前記可逆符号化手段により生成された位置情報の符号化データ、及び、前記非可逆符号化手段により生成された画像データの符号化データを多重化し、出力する多重化手段とを備える。
In order to solve this problem, for example, an image encoding device of the present invention has the following configuration. That is,
An image encoding device for encoding multi-value image data,
Input means for inputting image data in block units to be subjected to lossy encoding from multi-valued image data to be encoded;
Extraction means for extracting color information indicating the color of the pixel of the character / line drawing in the input block image data;
Color code conversion means for converting the color information extracted by the extraction means into a color code using a reference table stored in advance in memory;
Position information generating means for generating position information for identifying the position of the pixel of the character / line drawing and the position of the pixel of the non-character / line drawing in the target block according to the color information extracted by the extracting means;
Lossless encoding means for losslessly encoding the position information generated by the position information generating means;
A replacement value calculating means for calculating a replacement value for replacing the value of the pixel of the character / line drawing according to the position information generated by the position information generating means;
Replacement means for replacing the value of the pixel of the character / line drawing in the block of interest with the replacement value;
Irreversible encoding means for irreversibly encoding the image data of the replaced block;
And multiplexing means for multiplexing and outputting the color code, the encoded data of the position information generated by the lossless encoding means, and the encoded data of the image data generated by the lossy encoding means. .

本発明によれば、文字/線画と自然画とが混在する多値画像の文字/線画の先鋭度を保持しながらも、生成する符号化データ量を更に削減することが可能になる。   According to the present invention, it is possible to further reduce the amount of encoded data to be generated while maintaining the sharpness of a character / line image of a multi-value image in which a character / line image and a natural image are mixed.

以下、添付図面に従って本発明に係る実施形態を詳細に説明する。   Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings.

例えば、RGB色空間(他の色空間でも構わない)の各成分が8ビット(256階調)で表わされる画素の取り得る色数は224≒約1千6百万色となる。しかしながら、本発明者等は、自然画に混在させた文字/線画(例えばデジタルカメラにおいて、撮像日時や撮影者名等のテキストを、撮像画像に合成した画像)の場合、その文字/線画はせいぜい数色の範囲内に限られていることに着目した。そこで、文字/線画の画素については、比較的良く利用される色のコードテーブルを利用する。ただし、必ず文字/線画が、そのコードで表わせるとは限らないので、コードテーブルで表わすことができない色の文字/線画については、特別なコードを割り当て、後続してその色を表わす色情報を付加するものとした。 For example, the number of colors that can be taken by a pixel in which each component of the RGB color space (which may be another color space) is represented by 8 bits (256 gradations) is approximately 2 24 ≈16 million colors. However, the inventors of the present invention, in the case of a character / line drawing mixed with a natural image (for example, an image obtained by synthesizing text such as an image date / time and a photographer's name with a captured image in a digital camera), at best, the character / line drawing. We paid attention to the fact that it is limited to a range of several colors. Therefore, a color code table that is used relatively frequently is used for pixels of character / line drawing. However, since a character / line drawing cannot always be represented by the code, a special code is assigned to a color character / line drawing that cannot be represented by the code table, and color information representing the color is subsequently added. It was supposed to be added.

図1は、第1の実施形態の符号化装置のブロック構成図である。本装置は、入力端子101、バッファ102、データ分離部103、置換値算出部104、セレクタ105、コード置換部106、可逆符号化部107、非可逆符号化部108、及び、多重化部109で構成される。   FIG. 1 is a block configuration diagram of an encoding apparatus according to the first embodiment. This apparatus includes an input terminal 101, a buffer 102, a data separation unit 103, a replacement value calculation unit 104, a selector 105, a code replacement unit 106, a lossless encoding unit 107, an irreversible encoding unit 108, and a multiplexing unit 109. Composed.

かかる構成における実施形態の符号化装置の処理を以下に説明する。   Processing of the encoding apparatus according to the embodiment having such a configuration will be described below.

入力端子101を介して入力した符号化対象の多値画像データは、一旦、バッファ102に格納される。このバッファ102は、少なくとも8ライン分の容量を有し、8×8画素で構成されるブロックを単位の画像データをデータ分離部103、置換値算出部104、及び、セレクタ105に出力する。   The encoding target multi-value image data input via the input terminal 101 is temporarily stored in the buffer 102. The buffer 102 has a capacity of at least 8 lines, and outputs image data in units of blocks composed of 8 × 8 pixels to the data separation unit 103, the replacement value calculation unit 104, and the selector 105.

データ分離部103は、入力したブロック内の最頻度の色を文字/線画の色と判定する。そして、文字/線画の色情報を抽出色情報としてコード置換部106に出力する。また、データ分離部103は、8×8画素内の、抽出色(文字/線画の画素)と判定された画素については“1”、非抽出色(自然画の画素)と判定された画素については“0”の2値の位置情報を生成し、置換値算出部104、セレクタ105、可逆符号化部107に出力する。   The data separation unit 103 determines the most frequent color in the input block as the color of the character / line drawing. The character / line drawing color information is output to the code replacing unit 106 as extracted color information. In addition, the data separation unit 103 sets “1” for pixels determined to be an extracted color (character / line image pixel) within 8 × 8 pixels, and pixels determined to be a non-extracted color (natural image pixel). Generates binary position information of “0” and outputs it to the replacement value calculation unit 104, the selector 105, and the lossless encoding unit 107.

置換値算出部104は、1ブロックの画像データ中の、位置情報が“0”である自然画として判定された画素の各色成分の平均値を算出し、その平均値を置換値としてセレクタ105に出力する。   The replacement value calculation unit 104 calculates an average value of each color component of pixels determined as a natural image whose position information is “0” in one block of image data, and uses the average value as a replacement value to the selector 105. Output.

セレクタ105は、ブロック内の画素データ、置換値、及び、位置情報を入力する。そして、位置情報が“0”で示される画素位置では、ブロック内の画素データを選択出力する。また、セレクタ105は、位置情報が“1”で示される画素位置では、置換値を選択し、出力する。   The selector 105 inputs pixel data, replacement values, and position information in the block. Then, pixel data in the block is selectively output at the pixel position indicated by position information “0”. The selector 105 selects and outputs a replacement value at the pixel position indicated by position information “1”.

コード置換部106は、内部に、図3(a)に示すテーブルを格納しているメモリを有する。同図のテーブルの「黒」で示すフィールドには、実際は「R=G=B=0」のデータが格納されている。他の色も同様のRGBの各成分のデータが格納されている。このテーブルに格納されるデータ数は、せいぜい数色乃至数十で十分である。ただし、このテーブルに存在しない色が最頻であった場合に対処する必要がある。テーブルに存在しない色があり、且つ、テーブルへの登録が可能な場合には、当該色をテーブルに登録した後、その符号コードを出力する。従って、テーブルに存在しない色を特定する符号コードを含めて、64色を定義するのであれば、「符号コード」は6ビットあれば十分である。R、G、Bが8ビットで表わされる場合、24ビットの色情報が、1/4の6ビットに変換されることを意味する。   The code replacement unit 106 includes a memory that stores therein the table illustrated in FIG. In the field of “black” in the table in the figure, data “R = G = B = 0” is actually stored. Data of each RGB component similar to other colors is stored. The number of data stored in this table is at most several colors to several tens. However, it is necessary to cope with the case where the color that does not exist in this table is the most frequent. If there is a color that does not exist in the table and registration in the table is possible, the code is output after the color is registered in the table. Therefore, if 64 colors are defined including a code code for specifying a color that does not exist in the table, it is sufficient if the “code code” is 6 bits. When R, G, and B are represented by 8 bits, it means that 24-bit color information is converted to 1/4 6 bits.

一方、テーブルに登録できない場合には、図3(b)に示すように、テーブル外色を示す符号コード+入力した色情報(各成分が8ビット)を付加して出力する。図3(b)の場合、符号コードに後続して、実際の色を示すビットが付加される分だけ、符号化データ量は多くなるが、このようなケースはむしろ希である。   On the other hand, if registration to the table is not possible, as shown in FIG. 3B, the code code indicating the color outside the table + input color information (each component is 8 bits) is added and output. In the case of FIG. 3B, the amount of encoded data increases as much as the bit indicating the actual color is added after the code code, but such a case is rather rare.

いずれにしても、このコード置換部106は、入力した抽出色情報から、可逆の符号化データを生成して出力することになる。なお、上記テーブルを更新した場合は、符号化の開始前にテーブルを転送する。また、テーブルの転送ができない場合は、上記テーブルの登録と共に登録した符号コード+入力した色情報(各成分が8ビット)を付加して出力する。この場合、復号化部のテーブルには未登録を示すビットが符号毎についており、送られてきた符号コードのビットが未登録を示す場合(例えば1が未登録を示すとすると、未登録を示すビットが1の場合)、テーブルの符号コードに対応する部分に符号コードに連結されている色情報を登録することで、符号化側との同期をとる。   In any case, the code replacement unit 106 generates reversible encoded data from the input extracted color information and outputs it. When the table is updated, the table is transferred before the start of encoding. If the table cannot be transferred, the code code registered together with the registration of the table and the input color information (each component is 8 bits) are added and output. In this case, a bit indicating unregistration is included in the table of the decoding unit for each code, and a bit of the code code sent indicates unregistered (for example, 1 indicates unregistered indicates unregistered) When the bit is 1, the color information linked to the code code is registered in the portion corresponding to the code code of the table, thereby synchronizing with the encoding side.

また、可逆符号化部107は、データ分離部103から出力された位置情報を可逆符号化し、符号化データを生成し、多重化部109に出力する。1つのブロックの位置情報は8×8ビットである。実施形態における可逆符号化部107は、この8×8個の2値データをラスタースキャンし、ランレングス符号化を行なうものとした。なお、可逆であれば良いので、他の符号化方法を利用しても良いのは勿論である。   Further, the lossless encoding unit 107 performs lossless encoding on the position information output from the data separation unit 103, generates encoded data, and outputs the encoded data to the multiplexing unit 109. The position information of one block is 8 × 8 bits. The lossless encoding unit 107 in the embodiment performs raster scanning on the 8 × 8 binary data to perform run-length encoding. Of course, other encoding methods may be used as long as they are reversible.

一方、非可逆符号化部108は、入力した8×8個の階調画像データに対し、JPEG等の非可逆符号化処理する。すなわち、非可逆符号化部108は、DCT変換処理、量子化処理、エントロピー符号化処理を行ない、符号化データを生成し、多重化部110に出力する。   On the other hand, the irreversible encoding unit 108 performs irreversible encoding processing such as JPEG on the input 8 × 8 gradation image data. That is, the irreversible encoding unit 108 performs DCT conversion processing, quantization processing, and entropy encoding processing, generates encoded data, and outputs the encoded data to the multiplexing unit 110.

多重化部110は、コード置換部106、可逆符号化部107、及び、非可逆符号化部108から生成された各符号化データを、後段のメモリに格納しやすいようにパックし、1ブロック分の符号データとして出力端子110より出力する。   The multiplexing unit 110 packs each piece of encoded data generated from the code replacement unit 106, the lossless encoding unit 107, and the lossy encoding unit 108 so that the encoded data can be easily stored in the subsequent memory. Is output from the output terminal 110.

以上説明したように本実施形態によれば、自然画と混在する文字/線画の色は、自然画のそれと比較して、非常に少ない点を利用し、色と符号コードに置換するので、1ブロックに占める文字/線画の色情報の占めるデータ量を大幅に減らすことが可能になる。また、上記実施形態の如く、文字/線画が混在した自然画の場合であっても、文字/線画を構成する画素が、自然画と判定された平均値で置き換えられることで、非可逆符号化部108内の処理で生成される高周波成分の値も小さなものとすることができる。これは、非可逆符号化部108で生成される符号化データ量を削減できることを意味する。しかも、文字/線画は、その色、エッジが鮮明に復号することも約束されることになる。   As described above, according to the present embodiment, the color of a character / line drawing mixed with a natural image is replaced with a color and a code code by using very few points as compared with that of a natural image. The amount of data occupied by the color information of the characters / line drawings in the block can be greatly reduced. Further, as in the above-described embodiment, even in the case of a natural image in which characters / line drawings are mixed, the pixels constituting the character / line images are replaced with average values determined to be natural images, thereby irreversible encoding. The value of the high frequency component generated by the processing in the unit 108 can also be made small. This means that the amount of encoded data generated by the lossy encoding unit 108 can be reduced. In addition, it is also promised that the character / line drawing can be clearly decoded in its color and edge.

なお、上記実施形態では、図3(a)における「黒」をR=G=B=0として定義した。コンピュータ上でテキストや罫線を自然画に合成し、イメージスキャナ等を介在しないで、符号化する場合、黒は文字通りR=G=B=0である。しかしながら、イメージスキャナを介して原稿を読込んだ場合、黒の文字のRGBの各成分は小さな値となるものの、必ずR=G=B=0となるとは限らない。これは、イメージスキャナに搭載した撮像素子の精度やバラツキ、或いは、原稿を印刷した際のインクやトナーの量のバラツキに起因する。そこで、例えば、コード置換部106内のテーブルの色を定義するフィールドには、許容値範囲を設けるようにしても良い。例えば、許容値を「ε」とした場合、「黒」は、0≦R、G、B≦εと定義する。   In the above embodiment, “black” in FIG. 3A is defined as R = G = B = 0. When text and ruled lines are synthesized with a natural image on a computer and encoded without an image scanner or the like, black literally has R = G = B = 0. However, when a document is read through an image scanner, the RGB components of black characters are small values, but R = G = B = 0 is not always satisfied. This is due to the accuracy and variation of the image sensor mounted on the image scanner, or the variation in the amount of ink and toner when the document is printed. Therefore, for example, an allowable value range may be provided in the field that defines the color of the table in the code replacement unit 106. For example, when the allowable value is “ε”, “black” is defined as 0 ≦ R, G, and B ≦ ε.

このようにすると、テーブルに存在する色として判定された文字/線画の色は、100%原画像に忠実に再現することはできないが、それに近い色で再現できる。また、文字/線画のエッジは、理論上100%維持できる。   In this way, the color of the character / line drawing determined as the color existing in the table cannot be faithfully reproduced in the 100% original image, but can be reproduced in a color close to that. In addition, the edge of the character / line drawing can theoretically be maintained at 100%.

<第1の実施形態の変形例>
上記実施形態にかかる処理を、コンピュータが読込み実行するコンピュータプログラムで実現しても構わない。コンピュータの構成は、一般のパーソナルコンピュータが搭載するCPU、ROM、RAM、HDD、表示装置、キーボードやマウス等で構成されるので、その説明は省略する。ただし、符号化対象の画像データが、原稿画像であればイメージスキャナ等の画像入力装置が適当なインタフェースを介して接続されることになる。また、ネットワーク上の記憶装置に格納されている場合にはネットワーク通信するためのネットワークインタフェースを有する。更に、符号化対象の画像データを蓄積している記憶媒体をアクセスするのであれば、その媒体をアクセスするためのドライブ等が接続されていることになる。いずれにしても、符号化したデータは、HDD等の記憶装置にファイルとして格納されるものとする。
<Modification of First Embodiment>
You may implement | achieve the process concerning the said embodiment with the computer program which a computer reads and executes. Since the computer is composed of a CPU, ROM, RAM, HDD, display device, keyboard, mouse, and the like mounted on a general personal computer, the description thereof is omitted. However, if the image data to be encoded is a document image, an image input device such as an image scanner is connected via an appropriate interface. In addition, when it is stored in a storage device on a network, it has a network interface for network communication. Further, if a storage medium storing the image data to be encoded is accessed, a drive or the like for accessing the medium is connected. In any case, the encoded data is stored as a file in a storage device such as an HDD.

図4は、本変形例におけるアプリケーションプログラムを、CPUが実行した際の処理手順を示している。このアプリケーションプログラムは、HDDに格納されており、RAMにロードされた後、CPUが実行するものである。   FIG. 4 shows a processing procedure when the CPU executes the application program in this modification. This application program is stored in the HDD, and is executed by the CPU after being loaded into the RAM.

先ず、CPUはステップS1にて、符号化対象の画像データから1ブロック分の画像データを入力する。符号化対象の画像データの入力源は問わない。   First, in step S1, the CPU inputs image data for one block from the image data to be encoded. The input source of the image data to be encoded is not limited.

次いで、CPUはステップS2において、入力したブロック内の最頻の色を抽出色として検出する。そして、ステップS3において、図3(a)に示すテーブルを参照して、抽出色のコードを生成し、一時的にRAMに保存する。このテーブルは、プログラム自身が有するものでも良いし、HDD等に格納されていても構わない。   Next, in step S2, the CPU detects the most frequent color in the input block as an extracted color. In step S3, the extracted color code is generated with reference to the table shown in FIG. 3A and temporarily stored in the RAM. This table may be included in the program itself or may be stored in an HDD or the like.

ステップS4では、ブロック内の抽出色を持つ画素の位置を“1”、抽出色以外の色((抽出色)を持つ画素の位置を“0”とする位置情報を生成する。そして、ステップS5において、CPUは生成した位置情報を一次元に並べ、ランレングス符号化等の可逆符号化技術を用いて符号化し、その符号化データを一時的にRAMに保存する。   In step S4, position information is generated in which the position of the pixel having the extracted color in the block is “1” and the position of the pixel having a color other than the extracted color ((extracted color) is “0”. The CPU arranges the generated position information in one dimension, encodes it using a lossless encoding technique such as run-length encoding, and temporarily stores the encoded data in the RAM.

次に、CPUはステップS6において、置換値を算出する。置換値は、非抽出色を持つと判定された画素(位置情報が“0”となっている画素)の各色成分の平均値とする。そして、ステップS7では、ブロック内の位置情報が“1”となっている画素の色を、算出した置換値で置換する。そして、ステップS8に進み、置換後のブロックについて、JPEG等の非可逆符号化処理を行ない、符号化データを生成する。   Next, in step S6, the CPU calculates a replacement value. The replacement value is an average value of each color component of a pixel determined to have a non-extracted color (a pixel whose position information is “0”). In step S7, the color of the pixel whose position information in the block is “1” is replaced with the calculated replacement value. In step S8, lossy encoding processing such as JPEG is performed on the replaced block to generate encoded data.

ステップS9では、上記の抽出色コード、位置情報の可逆符号化データ、置換処理後のブロックの非可逆符号化データを多重化し、ファイルの一部として出力する。   In step S9, the extracted color code, the lossless encoded data of the position information, and the lossy encoded data of the block after the replacement process are multiplexed and output as a part of the file.

そして、ステップS10にて、全ブロック分の符号化処理が完了したと判断するまで、ステップS1以降の処理を繰り返す。   Then, in step S10, the processes in and after step S1 are repeated until it is determined that the encoding process for all blocks has been completed.

以上説明したように、コンピュータが読込み実行することで、第1の実施形態と同様の処理と作用効果を奏することが可能になる。   As described above, when the computer reads and executes, it is possible to achieve the same processing and operational effects as in the first embodiment.

<第2の実施形態>
図2に、第2の実施形態の画像符号化装置のブロック構成図を示す。図中、201はデータ分離部、202は抽出色テーブルメモリである。他の構成要素は図1の構成と同じであるため、同符号を付し、その説明は省略する。この抽出色テーブルメモリ202(書き換え可能なメモリとする)には、図3(a)に示すデータが格納されているものとする。
<Second Embodiment>
FIG. 2 shows a block configuration diagram of an image encoding device according to the second embodiment. In the figure, 201 is a data separator, and 202 is an extracted color table memory. The other components are the same as those shown in FIG. It is assumed that the extracted color table memory 202 (which is a rewritable memory) stores the data shown in FIG.

次に、図1の符号化装置と異なる部分の動作を説明する。   Next, operations of parts different from those of the encoding apparatus of FIG. 1 will be described.

データ分離部201では注目ブロック内に抽出色テーブルメモリ202に設定されている色を持つ画素を検索する。注目ブロック内に、抽出色テーブル202に設定されている色を持つ画素があった場合、その中で最も多く出現する色の符号コードを抽出色コードとして出力する。   The data separation unit 201 searches for a pixel having a color set in the extracted color table memory 202 in the target block. If there is a pixel having a color set in the extracted color table 202 in the target block, the code code of the color that appears most frequently is output as the extracted color code.

注目ブロック内の最頻の画素の色が、抽出色テーブル202に設定されている色でなかった場合、データ分離部201は、テーブル外を示す符号コードと、それに後続するようにその色情報を抽出色コードとして出力する。   If the color of the most frequent pixel in the block of interest is not the color set in the extraction color table 202, the data separation unit 201 displays the code code indicating the outside of the table and the color information subsequent thereto. Output as extracted color code.

これ以外は、第1の実施形態と同じである。また、多重化部109が生成する1ブロック分の符号化データも第1の実施形態と同じフォーマットで構わない。   The rest is the same as in the first embodiment. Also, the encoded data for one block generated by the multiplexing unit 109 may have the same format as that of the first embodiment.

次に抽出色テーブルメモリ202に格納するテーブルの生成方法について説明する。なお、以下の説明は、第1の実施形態における、コード置換部106内のメモリに格納するテーブルを生成する場合に適用しても良い。   Next, a method for generating a table stored in the extracted color table memory 202 will be described. The following description may be applied when generating a table to be stored in the memory in the code replacement unit 106 in the first embodiment.

本第2の実施形態では、圧縮したデータのランダムアクセスを容易にするため、ブロック内情報のみで復号化が完結するように、他のブロックの情報を用いずに符号化する構成を想定している。そこで、抽出色テーブルに色を登録してテーブルの符号コード(参照番号)のみを記憶することにより圧縮率を高める。ただし、抽出色テーブルにない色はそのままでは再現できなくなる。そこで、1個だけテーブル外を示す符号コードを設定し、このコードに抽出色を付加したものを符号化コードとする。   In the second embodiment, in order to facilitate random access of compressed data, a configuration is assumed in which encoding is performed without using information of other blocks so that decoding is completed with only intra-block information. Yes. Therefore, the compression rate is increased by registering colors in the extracted color table and storing only the code code (reference number) of the table. However, colors that are not in the extracted color table cannot be reproduced as they are. Therefore, only one code code indicating the outside of the table is set, and a code obtained by adding an extracted color to this code is used as an encoded code.

例えば、参照番号のビット数を6ビットとすると、抽出色として64色がテーブルに登録できる。このうちの1つを、テーブル外を示すものとするため、テーブルに登録可能な抽出色は63色となる。つまり、参照番号のビット数をnビットとすると、1つはテーブル外のコードとなり、残り2n−1色が抽出色テーブル登録可能となる。 For example, if the number of bits of the reference number is 6 bits, 64 colors can be registered in the table as extracted colors. Since one of them indicates the outside of the table, the extracted colors that can be registered in the table are 63 colors. That is, if the number of bits of the reference number is n bits, one becomes a code outside the table, and the remaining 2 n −1 colors can be registered in the extraction color table.

しかしながら、テーブル外の色の発生確率が多くなると、圧縮効率が急激に落ちてしまう。その為、抽出色テーブルを生成する時に、画像の中から頻度の高いものを登録していく必要がある。   However, if the probability of occurrence of colors outside the table increases, the compression efficiency will drop rapidly. Therefore, when generating the extracted color table, it is necessary to register frequently used images from the images.

そこで、符号化しようとする画像を、イメージスキャナ等で、プリスキャンによって入力画像の色のヒストグラムを作り、頻度の高い色を登録する。ただし、全ての画像を使ってヒストグラムを作ると時間がかかってしまうので、縮小した画像で高速にヒストグラムを作る。画像を縮小する方法としては、線形補間等、各種の縮小方法があるが、演算により画素値が変わってしまうため、抽出色として利用することができない。よって、本構成では単純間引きによって縮小する。このとき、上述したように1つはテーブル外のコードとするので、上記ヒストグラムの上位2−1色を上記抽出色テーブルに設定する。 Therefore, an image to be encoded is pre-scanned with an image scanner or the like to create a color histogram of the input image and register frequently used colors. However, since it takes time to create a histogram using all images, a histogram is generated at high speed with a reduced image. As a method for reducing an image, there are various reduction methods such as linear interpolation. However, since the pixel value is changed by calculation, it cannot be used as an extracted color. Therefore, in this structure, it reduces by simple thinning. At this time, as described above, since one is a code outside the table, the upper 2 n −1 colors of the histogram are set in the extracted color table.

なお、通常、頻繁に出現するる白、黒、赤等の色は、予め固定の抽出色としておいても良い。こうしておくことにより、書類などのスキャン画像においては、プリスキャン無しに圧縮することが可能となる。また、本第2の実施形態の場合、1つの画像データを符号化してファイルとして適当な記憶媒体に格納する際、そのファイルヘッダに、上記の処理で生成したテーブルの情報を格納することになる。従って、画像データのサイズ(水平、垂直方向の画素数)が大きければ大きいほど、本第2の実施形態による効果も大きくなる。   Normally, frequently appearing colors such as white, black, and red may be fixed extraction colors in advance. In this way, a scanned image such as a document can be compressed without pre-scanning. In the case of the second embodiment, when one image data is encoded and stored as a file in an appropriate storage medium, the information of the table generated by the above processing is stored in the file header. . Accordingly, the larger the image data size (number of pixels in the horizontal and vertical directions), the greater the effect of the second embodiment.

以上説明したように本第2の実施形態によれば、第1の実施形態と同様の作用効果を奏することが可能になる。   As described above, according to the second embodiment, it is possible to achieve the same functions and effects as those of the first embodiment.

なお、実施形態では、1ブロックを8×8画素として説明した。しかしながら、水平、垂直方向の画素数は8の整数倍の8n×8mにしても構わない。非可逆符号化部108は、8n×8m内に含まれるn×m個のブロックについて符号化すればよいからである。   In the embodiment, one block is described as 8 × 8 pixels. However, the number of pixels in the horizontal and vertical directions may be 8n × 8m, which is an integer multiple of 8. This is because the lossy encoding unit 108 may encode the n × m blocks included in 8n × 8m.

なお、本第2の実施形態の同様の処理を、コンピュータプログラムによって実現することができるのは、先に説明した第1の実施形態の変形例と同様に明らかである。   It is obvious that the same processing as in the second embodiment can be realized by a computer program, as in the modification of the first embodiment described above.

また、一般に、コンピュータプログラムは、CD−ROM等のコンピュータ可読記憶媒体に格納されて、その媒体をコンピュータが備える読取り装置(CD−ROMドライブ等)にセットし、システムにコピーもしくはインストールすることで実行可能になる。従って、かかるコンピュータ可読記憶媒体も本発明の範疇にあるのは明らかである。   In general, a computer program is stored in a computer-readable storage medium such as a CD-ROM, and the medium is set in a reading device (such as a CD-ROM drive) included in the computer and copied or installed in the system. It becomes possible. Therefore, it is clear that such a computer readable storage medium is also within the scope of the present invention.

第1の実施形態における画像符号化装置のブロック構成図である。It is a block block diagram of the image coding apparatus in 1st Embodiment. 第2の実施形態における画像符号化装置のブロック構成図である。It is a block block diagram of the image coding apparatus in 2nd Embodiment. 実施形態におけるテーブルメモリの内容と、抽出色の符号化データの構造を一例を示す図である。It is a figure which shows an example of the content of the table memory in embodiment, and the structure of the encoding data of an extraction color. 第1の実施形態をコンピュータプログラムで実現する場合の、処理手順を示すフローチャートである。It is a flowchart which shows the process sequence in the case of implement | achieving 1st Embodiment with a computer program.

Claims (8)

多値画像データを符号化する画像符号化装置であって、
符号化対象の多値画像データから、非可逆符号化の対象となるブロック単位の画像データを入力する入力手段と、
入力したブロックの画像データ中の、文字/線画の画素の色を示す色情報を抽出する抽出手段と、
該抽出手段で抽出した色情報を、予めメモリに格納された参照テーブルを用いて色コードに変換する色コード変換手段と、
前記抽出手段で抽出した色情報に従い、注目ブロック内の文字/線画の画素の位置と、非文字/線画の画素の位置とを識別するための位置情報を生成する位置情報生成手段と、
該位置情報生成手段で生成された位置情報を可逆符号する可逆符号化手段と、
前記位置情報生成手段で生成された位置情報に従って、文字/線画の画素の値を置換するための置換値を算出する置換値算出手段と、
注目ブロック内の文字/線画の画素の値を、前記置換値で置換する置換手段と、
置換後のブロックの画像データを非可逆符号化する非可逆符号化手段と、
前記色コード、前記可逆符号化手段により生成された位置情報の符号化データ、及び、前記非可逆符号化手段により生成された画像データの符号化データを多重化し、出力する多重化手段と
を備えることを特徴とする画像符号化装置。
An image encoding device for encoding multi-value image data,
Input means for inputting image data in block units to be subjected to lossy encoding from multi-valued image data to be encoded;
Extraction means for extracting color information indicating the color of the pixel of the character / line drawing in the input block image data;
Color code conversion means for converting the color information extracted by the extraction means into a color code using a reference table stored in advance in memory;
Position information generating means for generating position information for identifying the position of the pixel of the character / line drawing and the position of the pixel of the non-character / line drawing in the target block according to the color information extracted by the extracting means;
Lossless encoding means for losslessly encoding the position information generated by the position information generating means;
A replacement value calculating means for calculating a replacement value for replacing the value of the pixel of the character / line drawing according to the position information generated by the position information generating means;
Replacement means for replacing the value of the pixel of the character / line drawing in the block of interest with the replacement value;
Irreversible encoding means for irreversibly encoding the image data of the replaced block;
Multiplexing means for multiplexing and outputting the color code, the encoded data of the position information generated by the lossless encoding means, and the encoded data of the image data generated by the lossy encoding means. An image encoding apparatus characterized by that.
前記抽出手段は、ブロック内の最頻の色を文字/線画の画素の色として抽出することを特徴とする請求項1に記載の画像符号化装置。   2. The image encoding apparatus according to claim 1, wherein the extraction unit extracts the most frequent color in the block as the color of a pixel of a character / line drawing. 更に、符号化対象の画像データを解析し、出現頻度の高い順であって、予め設定された個数の色情報と色コードを前記メモリに前記参照テーブルとして格納する手段を備えることを特徴とする請求項1に記載の画像符号化装置。   Further, the image data to be encoded is analyzed, and a means for storing a preset number of color information and color codes as the reference table in the memory in order of appearance frequency is provided. The image encoding device according to claim 1. 前記置換値算出手段は、注目ブロック内の、非文字/線画と判定された画素の各成分の平均値を、置換値として算出することを特徴とする請求項1に記載の画像符号化装置。   2. The image encoding apparatus according to claim 1, wherein the replacement value calculating unit calculates an average value of each component of a pixel determined to be a non-character / line drawing in a target block as a replacement value. 前記可逆符号化手段はランレングス符号化に従って位置情報を符号化し、前記非可逆符号化手段はJPEG符号化に従ってブロックの画像データを符号化することを特徴とする請求項1に記載の画像符号化装置。   2. The image encoding according to claim 1, wherein the lossless encoding unit encodes position information according to run-length encoding, and the lossy encoding unit encodes block image data according to JPEG encoding. apparatus. 多値画像データを符号化する画像符号化装置の制御方法であって、
入力手段が、符号化対象の多値画像データから、非可逆符号化の対象となるブロック単位の画像データを入力する入力工程と、
抽出手段が、入力したブロックの画像データ中の、文字/線画の画素の色を示す色情報を抽出する抽出工程と、
色コード変換手段が、該抽出工程で抽出した色情報を、予めメモリに格納された参照テーブルを用いて色コードに変換する色コード変換工程と、
位置情報生成手段が、前記抽出工程で抽出した色情報に従い、注目ブロック内の文字/線画の画素の位置と、非文字/線画の画素の位置とを識別するための位置情報を生成する位置情報生成工程と、
可逆符号化手段が、該位置情報生成工程で生成された位置情報を可逆符号する可逆符号化工程と、
置換値算出手段が、前記位置情報生成工程で生成された位置情報に従って、文字/線画の画素の値を置換するための置換値を算出する置換値算出工程と、
置換手段が、注目ブロック内の文字/線画の画素の値を、前記置換値で置換する置換工程と、
非可逆符号化手段が、置換後のブロックの画像データを非可逆符号化する非可逆符号化工程と、
多重化手段が、前記色コード、前記可逆符号化工程により生成された位置情報の符号化データ、及び、前記非可逆符号化工程により生成された画像データの符号化データを多重化し、出力する多重化工程と
を備えることを特徴とする画像符号化装置の制御方法。
A control method for an image encoding device for encoding multi-value image data,
An input step in which input means inputs image data in units of blocks to be subjected to lossy encoding from multi-valued image data to be encoded;
An extracting step in which the extracting means extracts color information indicating the color of the pixel of the character / line image in the image data of the input block;
A color code conversion step in which the color code conversion means converts the color information extracted in the extraction step into a color code using a reference table stored in advance in a memory;
Position information for generating position information for identifying a position of a pixel of a character / line drawing and a position of a pixel of a non-character / line drawing in the target block according to the color information extracted in the extraction step Generation process;
A lossless encoding means for losslessly encoding the position information generated in the position information generating process;
A replacement value calculating unit that calculates a replacement value for replacing the value of the pixel of the character / line drawing according to the position information generated in the position information generating step;
A replacement step in which the replacement means replaces the value of the pixel of the character / line drawing in the block of interest with the replacement value;
An irreversible encoding means for irreversibly encoding the image data of the replaced block;
Multiplexing means for multiplexing and outputting the color code, the encoded data of the position information generated by the lossless encoding process, and the encoded data of the image data generated by the lossy encoding process A control method for an image encoding device, comprising:
コンピュータが読込み実行することで、請求項1乃至5のいずれか1項に記載の画像符号化装置の各手段として機能させることを特徴とするコンピュータプログラム。   A computer program that causes a computer to read and execute the program to function as each unit of the image encoding device according to any one of claims 1 to 5. 請求項7に記載のコンピュータプログラムを格納したことを特徴とするコンピュータ可読記憶媒体。   A computer-readable storage medium storing the computer program according to claim 7.
JP2006309627A 2006-11-15 2006-11-15 Image coding apparatus and control method thereof Expired - Fee Related JP4757172B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006309627A JP4757172B2 (en) 2006-11-15 2006-11-15 Image coding apparatus and control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006309627A JP4757172B2 (en) 2006-11-15 2006-11-15 Image coding apparatus and control method thereof

Publications (3)

Publication Number Publication Date
JP2008125020A true JP2008125020A (en) 2008-05-29
JP2008125020A5 JP2008125020A5 (en) 2009-10-15
JP4757172B2 JP4757172B2 (en) 2011-08-24

Family

ID=39509283

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006309627A Expired - Fee Related JP4757172B2 (en) 2006-11-15 2006-11-15 Image coding apparatus and control method thereof

Country Status (1)

Country Link
JP (1) JP4757172B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6545570B2 (en) 2015-08-18 2019-07-17 株式会社東芝 Encoding device, decoding device and image processing device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04326669A (en) * 1991-04-26 1992-11-16 Canon Inc Picture encoding device
JPH04337797A (en) * 1991-05-15 1992-11-25 Fujitsu Ltd Color image processor

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04326669A (en) * 1991-04-26 1992-11-16 Canon Inc Picture encoding device
JPH04337797A (en) * 1991-05-15 1992-11-25 Fujitsu Ltd Color image processor

Also Published As

Publication number Publication date
JP4757172B2 (en) 2011-08-24

Similar Documents

Publication Publication Date Title
Sneyers et al. FLIF: Free lossless image format based on MANIAC compression
US8660347B2 (en) Image processing apparatus and processing method therefor
JP5132530B2 (en) Image coding apparatus, image processing apparatus, and control method thereof
JP4176114B2 (en) Image compression apparatus, image reading apparatus including the same, image processing apparatus including the image compression apparatus, image forming apparatus including the same, and image compression processing method
US7013050B2 (en) Image encoding apparatus and method, program code, and storage medium
US8213727B2 (en) Image encoding apparatus and image decoding apparatus, and control method thereof
JP2003348360A (en) Document encoding system, document decoding system and methods therefor
JP4956304B2 (en) Image encoding apparatus, control method therefor, computer program, and computer-readable storage medium
JP2009200642A (en) Image encoding apparatus and method of controlling the same
JP2006180456A (en) Image compressor, image decoder, image converter and image processing method
US8406517B2 (en) Image processing apparatus and image processing method
JP3872217B2 (en) Dither image binary expression processing method, dither image compression binary expression decompression method, and dither image compression and decompression system
JP2000184183A (en) Electronic pasting method of compressed picture data and method for processing digital picture
JP3108133B2 (en) Adaptive coding of color document images
JP4757172B2 (en) Image coding apparatus and control method thereof
KR101454208B1 (en) Method and apparatus for encoding/decoding halftone image
JP5757904B2 (en) Image compression device
JP2010098743A (en) Image processing device, image reading device, and image processing method
US8494261B2 (en) Image processing apparatus, image processing method, and computer-readable medium
Triantaphillidou et al. Digital image file formats
JP2010028796A (en) Image forming apparatus, image converting device, and image forming method
JP7185451B2 (en) Image processing device, image processing method, and program
JP2010028819A (en) Image processing apparatus and method, and image reading apparatus
JP2005338902A (en) Document data structure, document conversion device, document restoration device, document conversion method, document restoration method, document conversion program, document restoration program and recording medium
KR100495001B1 (en) Image compression encoding method and system

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090901

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090901

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110314

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110506

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110523

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110531

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140610

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees