JP4956304B2 - Image encoding apparatus, control method therefor, computer program, and computer-readable storage medium - Google Patents

Image encoding apparatus, control method therefor, computer program, and computer-readable storage medium Download PDF

Info

Publication number
JP4956304B2
JP4956304B2 JP2007180157A JP2007180157A JP4956304B2 JP 4956304 B2 JP4956304 B2 JP 4956304B2 JP 2007180157 A JP2007180157 A JP 2007180157A JP 2007180157 A JP2007180157 A JP 2007180157A JP 4956304 B2 JP4956304 B2 JP 4956304B2
Authority
JP
Japan
Prior art keywords
value
pixel
group
block
identification information
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.)
Expired - Fee Related
Application number
JP2007180157A
Other languages
Japanese (ja)
Other versions
JP2009017502A5 (en
JP2009017502A (en
Inventor
隆之 堤
尚 石川
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 JP2007180157A priority Critical patent/JP4956304B2/en
Priority to US11/835,099 priority patent/US7903888B2/en
Publication of JP2009017502A publication Critical patent/JP2009017502A/en
Publication of JP2009017502A5 publication Critical patent/JP2009017502A5/ja
Application granted granted Critical
Publication of JP4956304B2 publication Critical patent/JP4956304B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Image Processing (AREA)

Description

本発明は画像データの符号化術に関するものである。
The present invention relates to encoding technology for image data.

特許文献1には、文字・線画と自然画が混在した多値画像を圧縮する技術を開示している。この文献では、入力画像を符号化の際の直交変換の単位となるブロックに分割した後、ブロック内で最も出現確率の高い最頻値を文字や線画であると仮定する。そして、その最頻値の色情報もしくは濃度情報の画素データを選択する。そしてブロックより、最頻となる画素データを抽出し、抽出された色及び抽出画素であるか否かを示す識別情報(以下、これら2つの情報を合わせて解像情報と称する)に対してランレングス符号化などの可逆符号化を行う。そして、文字や線画情報抽出した後の自然画の各画素の値を、文字線画として抽出された画素を除く、ブロックの平均値で置換する。そして、置換された自然画に対し、JPEG等の非可逆符号化を行うものである。   Patent Document 1 discloses a technique for compressing a multi-value image in which a character / line image and a natural image are mixed. In this document, after dividing an input image into blocks that are units of orthogonal transformation at the time of encoding, it is assumed that a mode value having the highest appearance probability in a block is a character or a line drawing. Then, the pixel data of the color information or density information of the mode value is selected. Then, the most frequent pixel data is extracted from the block, and the extracted color and the identification information indicating whether the pixel is the extracted pixel (hereinafter, these two pieces of information are collectively referred to as resolution information) are run. Lossless encoding such as length encoding is performed. Then, the value of each pixel of the natural image after extracting the character and line drawing information is replaced with the average value of the block excluding the pixels extracted as the character line drawing. Then, irreversible encoding such as JPEG is performed on the replaced natural image.

ここで、上記色情報の抽出について図12に示す4×4画素ブロックの画素データを例に説明する。図12のブロックの画素データは、平均レベルが“66”の自然画の一部に“240”というレベルの文字(の一部)が上書きされていたものと考えられる。通常、自然画においてはスキャナやデジタルカメラ等のアナログ入力機器を通して生成されるため、ノイズ等により画素値にはばらつきが発生する。これに対し、デジタル的に発生させた文字では、ノイズが入り込まないので、同一の値が連続するはずである。このような仮定から着目ブロックの最頻値を検出し、文字・線画としてブロックから抽出する。図12のブロックでは最頻値は“240”であるから、これが抽出色となる。よって、抽出画素の位置を示す識別情報は図13に示ようになる。上記文字・線画の抽出色及び上記識別情報を可逆符号化にて圧縮する。   Here, extraction of the color information will be described by taking pixel data of a 4 × 4 pixel block shown in FIG. 12 as an example. In the pixel data of the block in FIG. 12, it is considered that a part of a natural image having an average level of “66” is overwritten with (part of) a character having a level of “240”. Normally, a natural image is generated through an analog input device such as a scanner or a digital camera, so that pixel values vary due to noise or the like. On the other hand, in digitally generated characters, noise does not enter, so the same value should be continuous. From such an assumption, the mode value of the block of interest is detected and extracted from the block as a character / line drawing. In the block of FIG. 12, since the mode value is “240”, this is the extracted color. Therefore, the identification information indicating the position of the extracted pixel is as shown in FIG. The extracted color of the character / line drawing and the identification information are compressed by lossless encoding.

一方、上記識別情報が“0”となる画素データの平均値は“66”であるので、上記識別情報の“1”となる領域の画素データを上記平均値で置換する。この置換後の画素データ(階調情報)は図14に示される様になる。これを非可逆符号化にて圧縮する。   On the other hand, since the average value of the pixel data with the identification information “0” is “66”, the pixel data in the region with the identification information “1” is replaced with the average value. The pixel data (gradation information) after the replacement is as shown in FIG. This is compressed by lossy encoding.

その他にも、多値画像を複数の成分に分離して、別々に符号化する技術が知られている(例えば、特許文献2、特許文献3、特許文献4)。
特開平04-326669号公報 特開平03-254573号公報 特開平04-040074号公報 特開2002-077631号公報
In addition, a technique is known in which a multi-valued image is separated into a plurality of components and encoded separately (for example, Patent Document 2, Patent Document 3, and Patent Document 4).
Japanese Patent Laid-Open No. 04-326669 Japanese Patent Laid-Open No. 03-254573 Japanese Patent Laid-Open No. 04-040074 JP 2002-077631 A

上記の特許文献1は、図12に示すブロックのように上書きされた文字の色が同一値である場合、符号化効率を向上させるには有効な手法である。しかし、その反面、グラデーションがかかっている文字(以下、グラデーション文字と称する)が自然画に上書きされている場合には、文字・線画部の画素値もばらつきが発生する。また、スキャナやデジタルカメラ等のアナログ入力機器を通して、文字・線画を含む画像を撮像した場合も同様である。このように、文字・線画の画素値にバラツキが発生すると、圧縮率を高めることが困難になるという問題がある。   The above-mentioned Patent Document 1 is an effective method for improving the coding efficiency when the overwritten character color has the same value as in the block shown in FIG. However, on the other hand, when a character with gradation (hereinafter referred to as gradation character) is overwritten on a natural image, the pixel values of the character / line drawing part also vary. The same applies when an image including a character / line image is taken through an analog input device such as a scanner or a digital camera. As described above, there is a problem that it is difficult to increase the compression rate when the pixel values of the characters / line drawings are varied.

この様子を図15に示される4×4画素ブロックの画素データを例に説明する。   This situation will be described by taking pixel data of a 4 × 4 pixel block shown in FIG. 15 as an example.

図15に示される画素データは、平均レベルが“66”の自然画像の一部に、文字が上書きされ、その値“231”、“233”、“235”、“239”、“240”である例である。従来手法では、ブロック内で最も出現確率の高い最頻値が抽出色となるため、上記例での抽出色は“65”となり、この時の画素の位置を示す識別情報は図16に示される様になる。そして、上記識別情報が“0”となる画素データの平均値が“144”であるので、上記識別情報は“1”となる画素は上記平均値で置換され、図17に示すようになる(階調情報)。この階調情報は、図15に示される画素データのエッジ成分を殆ど削減できておらず、その結果、圧縮率を高めることができない。   In the pixel data shown in FIG. 15, characters are overwritten on a part of a natural image whose average level is “66”, and values “231”, “233”, “235”, “239”, and “240” are used. An example. In the conventional method, since the mode value having the highest appearance probability in the block is the extracted color, the extracted color in the above example is “65”, and the identification information indicating the pixel position at this time is shown in FIG. It becomes like. Since the average value of the pixel data with the identification information “0” is “144”, the pixels with the identification information “1” are replaced with the average value, as shown in FIG. Gradation information). This gradation information has hardly reduced the edge component of the pixel data shown in FIG. 15, and as a result, the compression rate cannot be increased.

また、ブロック内のヒストグラムを求め、ヒストグラムから閾値を生成して文字部を抽出するような場合においても、復号時には置換画素(上記識別情報の“1”となる画素)は抽出色で置き換えられてしまう。従って、グラデーション文字等の階調を持ったブロックでは階調性を再現することは困難になる。   Further, even when a histogram in a block is obtained and a character part is extracted by generating a threshold value from the histogram, a replacement pixel (a pixel that is “1” in the identification information) is replaced with an extraction color at the time of decoding. End up. Therefore, it is difficult to reproduce the gradation in a block having gradation such as gradation characters.

本発明は、上記課題に鑑みなされたものであり、複数種類の画像が混在した画像を高品位かつ高圧縮率で符号化する技術を提供するものであり、特に、ある程度ばらついた画素値で構成されるグラデーション文字・線画と、自然画とが混在した画像であっても、グラデーション文字・線画の階調も十分な品位で再現でき、且つ、符号化効率の高い技術を提供するものである。   The present invention has been made in view of the above problems, and provides a technique for encoding an image in which a plurality of types of images are mixed with high quality and a high compression rate. In particular, the present invention includes pixel values that vary to some extent. Even if the gradation character / line drawing is mixed with the natural image, the gradation of the gradation character / line drawing can be reproduced with sufficient quality, and a technique with high coding efficiency can be provided.

この課題を解決するため、例えば本発明の画像符号化装置は以下の構成を備える。すなわち、
多値画像データを、複数の画素で構成されるブロック単位に入力する入力手段と、
前記入力したブロック内の各画素を、該各画素の値に応じて第1及び第2のグループに分類すると共に、各画素がいずれのグループに属するかを識別する識別情報を生成する識別情報生成手段と、
前記第1のグループに属する画素の値の平均値、前記第2のグループに属する画素の値の平均値、及び、該2つの平均値の差分を算出する算出手段と、
前記第1のグループの平均値と前記第2のグループの平均値との差が小さくなるように、前記第1のグループに属する各画素の値に前記差分を加算、又は前記第1のグループに属する各画素の値から前記差分を減算することにより、前記第1のグループに属する画素値を置換する置換手段と、
置換後のブロック内の各画素値と、前記差分値と、前記識別情報とを符号化し、着目ブロックの符号化データを出力する符号化手段とを備える。
In order to solve this problem, for example, an image encoding device of the present invention has the following configuration. That is,
Input means for inputting multi-valued image data in units of blocks composed of a plurality of pixels;
Each pixel in the block which is the input, as well as classified into first and second groups according to the value of each of the pixels, generating identification information which each pixel for generating identification information for identifying belongs to any group Means,
The average value of the first value of the pixel belonging to the group, the average value of the values of the pixels belonging to the second group, and, calculating means for calculating a difference value between the two averages,
The difference value is added to the value of each pixel belonging to the first group so that the difference between the average value of the first group and the average value of the second group becomes small, or the first group and by subtracting the difference value from the value of each pixel replacement means for replacing the values of the pixels belonging to the first group belonging to,
Coding means for coding the value of each pixel in the block after replacement, the difference value, and the identification information and outputting coded data of the block of interest.

本発明によれば、複数種類の画像が混在した画像を高品位かつ高圧縮率で符号化することができる。特に、ある程度ばらついた画素値で構成されるグラデーション文字・線画と、自然画とが混在した画像であっても、グラデーション文字・線画の階調も十分な品位で再現でき、且つ、符号化効率の高い符号化データを生成することができる。   According to the present invention, an image in which a plurality of types of images are mixed can be encoded with high quality and a high compression rate. In particular, even gradation images and line drawings composed of pixel values that vary to some extent and natural images are mixed, gradations of gradation characters and line drawings can be reproduced with sufficient quality, and encoding efficiency can be improved. Highly encoded data can be generated.

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

<第1の実施形態>
図1は、第1の実施形態における符号化装置のブロック構成図である。
<First Embodiment>
FIG. 1 is a block configuration diagram of an encoding apparatus according to the first embodiment.

図中、251は多値画像を入力する入力端子であり、203は多値画像を、入力単位であるブロック化する際に画素データを一時的に記憶するためのバッファである。204はブロック内の多値画像から抽出する画素データ(以下、抽出色と記す)を決定すると共に、各画素が抽出する画素であるか、非抽出の画素であるのかを識別するための識別情報(1画素につき1ビットの判定情報)を生成するための抽出部である。言い換えると、この抽出部204は、入力したブロック内の各画素を、画素値の置換対象の第1のグループと、非置換対象の第2のグループのいずれかに分類すると共に、各画素がいずれのグループに属するのかを識別するための識別情報を生成する識別情報生成部として機能する。なお、この識別情報は各画素の値に応じて決定し、各画素位置に対応づけて生成される。この抽出部204の詳細については後述する。   In the figure, reference numeral 251 denotes an input terminal for inputting a multi-valued image, and 203 denotes a buffer for temporarily storing pixel data when the multi-valued image is blocked as an input unit. 204 is identification information for determining pixel data to be extracted from the multi-valued image in the block (hereinafter referred to as “extracted color”) and identifying whether each pixel is a pixel to be extracted or a non-extracted pixel. This is an extraction unit for generating (one-bit determination information per pixel). In other words, the extraction unit 204 classifies each pixel in the input block into one of a first group that is a pixel value replacement target and a second group that is a non-replacement target. It functions as an identification information generation unit that generates identification information for identifying whether it belongs to the group. This identification information is determined according to the value of each pixel and is generated in association with each pixel position. Details of the extraction unit 204 will be described later.

206は上記識別情報が示す領域毎に画素データの平均値を算出し、そこで得られた複数の平均値の差分値(以下、平均差分値と記す)を出力するための平均差分値生成部である。207は上記抽出対象となった画素の置換後の画素データ(以下、置換色と記す)を生成するための置換色生成部である。208は、入力した多値画像データ、置換色データのいずれか一方を選択し、出力するセレクタである。209は識別情報をランレングス等の符号化をするための第1の符号化部である。210は平均差分値を符号化するための第2の符号化部である。これら、符号化部209、210は可逆符号化データを生成する。211はセレクタ208の出力値(以下、階調情報と記す)を符号化する第3の符号化部である。この符号化部211は、可逆でも構わないが、実施形態では、JPEG等の自然画に好適な非可逆符号化部とする。212は夫々の符号化データを後段のメモリに格納しやすいようにパックして、符号化データとして出力するための多重化部であり、252は符号化データを出力するための出力端子である。   Reference numeral 206 denotes an average difference value generation unit for calculating an average value of pixel data for each region indicated by the identification information and outputting difference values (hereinafter referred to as average difference values) of a plurality of average values obtained there. is there. Reference numeral 207 denotes a replacement color generation unit for generating pixel data after replacement of the pixel to be extracted (hereinafter referred to as replacement color). Reference numeral 208 denotes a selector that selects and outputs one of the input multi-value image data and replacement color data. Reference numeral 209 denotes a first encoding unit for encoding the identification information such as run length. Reference numeral 210 denotes a second encoding unit for encoding the average difference value. These encoding units 209 and 210 generate lossless encoded data. Reference numeral 211 denotes a third encoding unit that encodes an output value of the selector 208 (hereinafter referred to as gradation information). The encoding unit 211 may be reversible, but is an irreversible encoding unit suitable for natural images such as JPEG in the embodiment. Reference numeral 212 denotes a multiplexing unit for packing each encoded data so as to be easily stored in a subsequent memory and outputting the encoded data as encoded data. Reference numeral 252 denotes an output terminal for outputting the encoded data.

図18は、多重化部212から出力される符号化データファイル1800のデータ構造を示している。図示の如く、符号化データファイル1800は、画像データのサイズ情報(水平、垂直方向の画素数)、色成分の数、各色のビット数等の復号に必要な情報を格納するファイルヘッダを備える。そして、そのファイルヘッダに後続して各ブロックの符号化データが格納されている。1つのブロックの符号化データは、図示のブロックデータ1801か、ブロックデータ1802のいずれかのタイプになる。ブロックデータ1801は、該当するタイプを示すブロックヘッダを有し、それに後続して、符号化部209で生成される識別情報の符号化データと、符号化部210で生成される平均差分値の符号化データ、及び、符号化部211で生成される階調情報符号化データが格納される。もう1つのブロックデータ1802は、該当するタイプであることを示すブロックヘッダを有し、それに後続して、入力した多値画像データを符号化部211で符号化したデータが格納される。かかる構造になる理由は以下の説明から明らかにする。   FIG. 18 shows the data structure of the encoded data file 1800 output from the multiplexing unit 212. As shown in the figure, the encoded data file 1800 includes a file header for storing information necessary for decoding such as image data size information (number of pixels in the horizontal and vertical directions), the number of color components, and the number of bits of each color. The encoded data of each block is stored following the file header. The encoded data of one block is either the block data 1801 or the block data 1802 shown in the figure. The block data 1801 has a block header indicating the corresponding type, and subsequently the encoded data of the identification information generated by the encoding unit 209 and the code of the average difference value generated by the encoding unit 210. Encoded data and gradation information encoded data generated by the encoding unit 211 are stored. Another block data 1802 has a block header indicating that it is of the corresponding type, and subsequently, data obtained by encoding the input multi-value image data by the encoding unit 211 is stored. The reason for this structure will be clarified from the following description.

次に、図1の符号化装置の動作を説明する。説明を簡単にするため、実施形態で符号化する対象の多値画像データはモノクロ多値画像であるものとし、1画素が8ビット(256階調)であり、その値は濃度を示すものとする。   Next, the operation of the encoding apparatus in FIG. 1 will be described. In order to simplify the description, it is assumed that the multi-value image data to be encoded in the embodiment is a monochrome multi-value image, and each pixel has 8 bits (256 gradations), and the value indicates the density. To do.

入力端子251から入力された多値画像は、一旦バッファ203に格納された後、ブロック単位に順次読み出され、抽出部204、及び平均差分値生成部206、及び置換色生成部207、及びセレクタ208へ送られる。   The multi-value image input from the input terminal 251 is temporarily stored in the buffer 203 and then sequentially read out in units of blocks, and the extraction unit 204, the average difference value generation unit 206, the replacement color generation unit 207, and the selector Sent to 208.

抽出部204では、抽出画素を決定し、ブロック内の各画素が抽出画素であるか、非抽出画素であるかを識別するための識別情報を生成する。具体的には、抽出部204は、ブロック単位に読み出された多値画像を閾値TH0によって2値化することで、識別情報をを生成する。ここで、上記識別情報の“1”は抽出対象画素であることを示し、“0”は非抽出対象画素を示すものとする。   The extraction unit 204 determines an extraction pixel and generates identification information for identifying whether each pixel in the block is an extraction pixel or a non-extraction pixel. Specifically, the extraction unit 204 generates identification information by binarizing the multi-valued image read in block units with a threshold value TH0. Here, “1” in the identification information indicates an extraction target pixel, and “0” indicates a non-extraction target pixel.

以下、抽出部204の動作を、入力される多値画像が図15に示される4×4画素として説明する。   Hereinafter, the operation of the extraction unit 204 will be described assuming that the input multi-valued image is 4 × 4 pixels shown in FIG. 15.

抽出対象を決定するための閾値TH0が“200”であるとすると、上記画素データのうち“200”以上の画素データは“1”に、それ未満の値を持つ画素は“0”に2値化される。この結果、ブロック内の各画素位置毎に、0、又は、1の2値化データデータが生成される。図2は、上記のようにして2値化した1ブロック(4×4画素)の識別情報を示している。ここで、閾値TH0は図示しないCPU等によって設定された値、あるいは、ブロック平均値やブロックのヒストグラムなどより求められるものとする。   Assuming that the threshold TH0 for determining the extraction target is “200”, pixel data of “200” or more among the above-mentioned pixel data is “1”, and pixels having a value less than that are binary “0”. It becomes. As a result, binary data data of 0 or 1 is generated for each pixel position in the block. FIG. 2 shows identification information of one block (4 × 4 pixels) binarized as described above. Here, the threshold value TH0 is obtained from a value set by a CPU or the like (not shown), or a block average value or a block histogram.

平均差分値生成部206では、抽出部204から出力された識別情報が“1”である画素群の平均値(AVE1)と、識別情報が“0”である画素群の平均値(AVE2)とを算出する。また、平均差分値生成部206は、算出した2つの平均値の差分値(差分情報)、すなわち平均差分値(D=AVE1−AVE2)を算出する。こうして、平均差分値生成部206は、算出した2つの平均値(AVE1,AVE2)と、平均差分値(D=AVE1−AVE2)を、置換色生成部207及び符号化部210に供給する。   In the average difference value generation unit 206, the average value (AVE1) of the pixel group whose identification information is “1” and the average value (AVE2) of the pixel group whose identification information is “0” are output from the extraction unit 204. Is calculated. The average difference value generation unit 206 calculates a difference value (difference information) between the two calculated average values, that is, an average difference value (D = AVE1-AVE2). Thus, the average difference value generation unit 206 supplies the calculated two average values (AVE1, AVE2) and the average difference value (D = AVE1-AVE2) to the replacement color generation unit 207 and the encoding unit 210.

なお、平均差分値(D)の絶対値が所定の閾値以下の場合は、抽出する必要がないと判断し、平均差分値、識別情報を共に0にクリアする。あるいは、平均差分値を0としても、後述する置換処理は実質的には動作しなくなるので、平均差分値のみを0にクリアするようにしても良い。この結果、平均差分値の絶対値が所定値以下の場合、そのブロックの符号化データは、図18のブロック符号化データ1802に示すように、階調情報の符号化データのみとなる。   If the absolute value of the average difference value (D) is equal to or smaller than a predetermined threshold value, it is determined that it is not necessary to extract, and both the average difference value and the identification information are cleared to zero. Alternatively, even if the average difference value is set to 0, a replacement process described later substantially does not operate, so that only the average difference value may be cleared to 0. As a result, when the absolute value of the average difference value is equal to or smaller than the predetermined value, the encoded data of the block is only the encoded data of the gradation information as indicated by the block encoded data 1802 in FIG.

以下、平均差分値生成部206の構成を示す図3を用いて動作を説明する。   Hereinafter, the operation will be described with reference to FIG. 3 showing the configuration of the average difference value generation unit 206.

入力端子451より入力された多値画像は「“1”領域平均値生成部401」及び「“0”領域平均値生成部402」に送られる。   The multi-value image input from the input terminal 451 is sent to the ““ 1 ”region average value generation unit 401” and the ““ 0 ”region average value generation unit 402”.

また、抽出部204から出力された識別情報も、入力端子452から入力されて、「“1”領域平均値生成部401」、及び反転回路404にて値が反転され、「“0”領域平均値生成部402」に送られる。   The identification information output from the extraction unit 204 is also input from the input terminal 452, and the value is inverted by the ““ 1 ”region average value generation unit 401” and the inversion circuit 404. Value generation unit 402 ".

「“1”領域平均値生成部401」は、上記識別情報の“1”に対応する画素データの平均値(AVE1)を算出する。   The ““ 1 ”region average value generation unit 401” calculates an average value (AVE1) of pixel data corresponding to “1” of the identification information.

図4は上記「“1”領域平均値生成部401」の構成例を示す図であり、以下、同図を参照して、その動作を説明する。   FIG. 4 is a diagram illustrating a configuration example of the ““ 1 ”region average value generation unit 401”. The operation will be described below with reference to FIG.

図4において、551は抽出部204から出力された識別情報を入力する入力端子である。入力端子551を介して入力した識別情報は、セレクタ501及びカウンタ502に供給される。   In FIG. 4, reference numeral 551 denotes an input terminal for inputting identification information output from the extraction unit 204. Identification information input via the input terminal 551 is supplied to the selector 501 and the counter 502.

セレクタ501は、入力端子552、553を備える。入力端子552には固定値“0”が予め設定されている。また、入力端子553には入力端子451から入力された多値画像の画素データが入力される。セレクタ501は、入力端子551に入力された識別情報(判定情報)が“1”の時は、入力端子553のデータ、すなわち、画素データを選択し、出力する。一方、識別情報が“0”の時、セレクタ501は、入力端子552にセットされた固定値“0”を選択し、出力する。   The selector 501 includes input terminals 552 and 553. A fixed value “0” is preset in the input terminal 552. In addition, pixel data of a multi-value image input from the input terminal 451 is input to the input terminal 553. When the identification information (determination information) input to the input terminal 551 is “1”, the selector 501 selects and outputs the data of the input terminal 553, that is, pixel data. On the other hand, when the identification information is “0”, the selector 501 selects and outputs the fixed value “0” set in the input terminal 552.

アキュムレータ503は、セレクタ501からの出力値を累積加算し、その累積加算結果を割り算器504に供給する。   The accumulator 503 cumulatively adds the output values from the selector 501 and supplies the cumulative addition result to the divider 504.

一方、カウンタ502では、1ブロック分の識別情報の“1”の個数をカウントし、そのカウント結果を割り算器504に供給する。なお、上述したように、上記識別情報は“1”または“0”で構成されている。   On the other hand, the counter 502 counts the number of identification information “1” for one block and supplies the count result to the divider 504. As described above, the identification information is composed of “1” or “0”.

1つのブロックの最終データが入力された直後のアキュムレータ503の出力値は、着目ブロック内の識別情報の“1”に対応する画素値の総和となる。また、カウンタ502の出力値は、識別情報の“1”の個数となる。従って、割り算器504は、アキュムレータ503の出力値をカウンタ502の出力値で除算することで、上記識別情報が“1”の領域の平均値、すなわち抽出画素データの平均値(AVE1)を求めることができる。この抽出画素の平均値(AVE1)は端子555より出力される。なお、カウンタ502の出力値が“0”の場合は、“0”が出力端子555より出力される。   The output value of the accumulator 503 immediately after the final data of one block is input is the sum of the pixel values corresponding to the identification information “1” in the block of interest. The output value of the counter 502 is the number of identification information “1”. Therefore, the divider 504 divides the output value of the accumulator 503 by the output value of the counter 502, thereby obtaining the average value of the area where the identification information is “1”, that is, the average value (AVE1) of the extracted pixel data. Can do. The average value (AVE1) of the extracted pixels is output from the terminal 555. When the output value of the counter 502 is “0”, “0” is output from the output terminal 555.

また、上記平均値(AVE1)の算出はブロックごとに行うので、各ブロックの先頭データの入力に先立って、上記カウンタ502及び、アキュムレータ503をクリアする必要がある。そのために、不図示の制御部は、ブロック内の抽出画素の平均値(AVE1)を算出を開始する際に、カウンタ502、アキュムレータ503を、初期化信号554を介してゼロクリア(リセット)する。   Further, since the average value (AVE1) is calculated for each block, it is necessary to clear the counter 502 and the accumulator 503 before inputting the head data of each block. For this purpose, the control unit (not shown) clears (resets) the counter 502 and the accumulator 503 via the initialization signal 554 when starting to calculate the average value (AVE1) of the extracted pixels in the block.

ここで、図3に戻り、「“1”領域平均値生成部401」の出力値である“1”領域平均値(AVE1)は、減算器403に送られる。   Returning to FIG. 3, the “1” area average value (AVE1) that is the output value of the “1” area average value generation unit 401 ”is sent to the subtractor 403.

「“0”領域平均値生成部402」では、上記図5を用いて説明した「“1”領域平均値生成部401」と同じ構成であり、且つ同じ動作を行う。ただし、入力端子551には反転回路404にて反転された識別情報が入力される。そのため、「“0”領域平均値生成部402」の出力値は、入力端子452から入力された識別情報が“0”の領域、すなわち抽出画素でない画素データの平均値である“0”領域平均値(AVE2)となる。そして上記“0”領域平均値(AVE2)は、減算器403に送られる。   The ““ 0 ”region average value generation unit 402” has the same configuration as the ““ 1 ”region average value generation unit 401” described with reference to FIG. 5 and performs the same operation. However, the identification information inverted by the inverting circuit 404 is input to the input terminal 551. Therefore, the output value of the ““ 0 ”region average value generation unit 402” is the region where the identification information input from the input terminal 452 is “0”, that is, the “0” region average that is the average value of pixel data that is not extracted pixels. Value (AVE2). The “0” area average value (AVE2) is sent to the subtractor 403.

減算器403では、上記“1”領域平均値(AVE1)から上記“0”領域平均値(AVE2)を減算した結果(D=AVE1−AVE2)を、出力端子453に出力する。   The subtractor 403 outputs the result (D = AVE1-AVE2) obtained by subtracting the “0” region average value (AVE2) from the “1” region average value (AVE1) to the output terminal 453.

以下、平均差分値生成部206の具体的な動作を、図15に示される4×4画素ブロックの多値画像データと、図2に示される識別情報が入力されたものとして説明する。   Hereinafter, a specific operation of the average difference value generation unit 206 will be described assuming that the 4 × 4 pixel block multi-value image data shown in FIG. 15 and the identification information shown in FIG. 2 are input.

上記識別情報の“1”に対応する上記多値画像の画素データは“235”、“239”、“240”、“233”、“235”、“231”である。従って、上記画素データの平均値“235”が「“1”領域平均値生成部」の出力値、つまり“1”領域平均値(AVE1)となる。   The pixel data of the multi-value image corresponding to the identification information “1” is “235”, “239”, “240”, “233”, “235”, “231”. Therefore, the average value “235” of the pixel data becomes the output value of the “1” area average value generation unit ”, that is, the“ 1 ”area average value (AVE1).

同様に上記識別情報の“0”に対応する上記多値画像の画素データは“65”、“68”、“64”、“66”、“65”、“65”、“64”、“66”、“68”、“67”である。従って、上記画素データの平均値“65”が「“0”領域平均値生成部」の出力値、つまり“0”領域平均値(AVE2)となる。よって平均差分値生成部206の出力値、すなわち平均差分値(D)は、減算器403にて上記“1”領域平均値から上記“0”領域平均値を減算した“170”となる。   Similarly, the pixel data of the multi-value image corresponding to the identification information “0” is “65”, “68”, “64”, “66”, “65”, “65”, “64”, “66”. "68" and "67". Therefore, the average value “65” of the pixel data becomes the output value of the “0” area average value generating unit, that is, the “0” area average value (AVE2). Therefore, the output value of the average difference value generation unit 206, that is, the average difference value (D) is “170” obtained by subtracting the “0” area average value from the “1” area average value by the subtractor 403.

図1に戻って、置換色生成部207は、上記バッファ203から出力されたブロック内の各多値画像の画素データから、上記平均差分値生成部206から出力された平均差分値(D)を減算する。そして、その結果は置換色として出力される。ただし、減算した結果が負となる場合は、置換色生成部207は着目画素の置換色を“0”(境界値)にクリップして出力する。   Returning to FIG. 1, the replacement color generation unit 207 calculates the average difference value (D) output from the average difference value generation unit 206 from the pixel data of each multilevel image in the block output from the buffer 203. Subtract. The result is output as a replacement color. However, if the result of subtraction is negative, the replacement color generation unit 207 clips the replacement color of the pixel of interest to “0” (boundary value) and outputs it.

置換色生成部207の動作例を、入力される多値画像が図15で示される4×4画素ブロックの画素データとし、入力される平均差分値(D)が平均差分値生成部206の動作例を示した時の平均差分値“170”として説明する。   As an example of the operation of the replacement color generation unit 207, the input multi-value image is the pixel data of the 4 × 4 pixel block shown in FIG. 15, and the input average difference value (D) is the operation of the average difference value generation unit 206. The explanation will be made assuming that the average difference value “170” when an example is shown.

置換色生成部207では、ブロック内のすべての画素データから平均差分値“170”を減算する。上述したように減算された値が負の場合には、置換色の値は0として出力する。この結果、置換色生成部は207は、図5に示される4×4の画素データを置換色として出力することになる。   The replacement color generation unit 207 subtracts the average difference value “170” from all the pixel data in the block. If the subtracted value is negative as described above, the replacement color value is output as 0. As a result, the replacement color generation unit 207 outputs the 4 × 4 pixel data shown in FIG. 5 as a replacement color.

セレクタ208では、入力される識別情報(判定情報)が“0”の時は識別情報の位置に対応する入力多値画像の画素データが選択される。一方、識別情報の“1” の時は識別情報の位置に対応する置換色生成部207にて出力された置換色の画素データが選択される。以上の処理をブロック終端画素まで繰り返すことで、着目ブロックの階調情報が得られる。   When the input identification information (determination information) is “0”, the selector 208 selects pixel data of the input multivalued image corresponding to the position of the identification information. On the other hand, when the identification information is “1”, the pixel data of the replacement color output by the replacement color generation unit 207 corresponding to the position of the identification information is selected. The gradation information of the block of interest can be obtained by repeating the above processing up to the block end pixel.

例えば、図15で示される4×4画素ブロックの多値画像と、図5で示される4×4画素ブロックの置換色がセレクタ208に入力され、且つ、図2で示される4×4画素ブロックの識別情報が制御信号としてセレクタ208に入力されたとする。本実施形態では、識別情報が“1”となっている画素群の平均値(AVE1)と、識別情報が“0”となっている画素群の平均値(AVE2)との差が小さくなるように、一方の画素群の値を置換する。具体的には、識別情報の“0”に対応する画素では多値画像の画素データが選択され、一方、上記識別情報の“1”に対応する画素では上記置換色の画素データが選択される。この結果、セレクタ208の出力値は図6で示される4×4画素ブロックの階調情報が出力されることになる。図示に示すように、文字・線画として判定された位置の画素値は、非文字・線画の画素値とほぼ同じ値になる。つまり、あたかも文字線画を含まない自然画を生成することになる。   For example, the 4 × 4 pixel block multi-valued image shown in FIG. 15 and the 4 × 4 pixel block replacement color shown in FIG. 5 are input to the selector 208 and the 4 × 4 pixel block shown in FIG. Is input to the selector 208 as a control signal. In the present embodiment, the difference between the average value (AVE1) of the pixel group whose identification information is “1” and the average value (AVE2) of the pixel group whose identification information is “0” is reduced. In addition, the value of one pixel group is replaced. Specifically, pixel data of a multi-value image is selected for a pixel corresponding to “0” in the identification information, while pixel data of the replacement color is selected for a pixel corresponding to “1” of the identification information. . As a result, the gradation value information of the 4 × 4 pixel block shown in FIG. 6 is output as the output value of the selector 208. As shown in the drawing, the pixel value at the position determined as the character / line drawing is almost the same as the pixel value of the non-character / line drawing. That is, a natural image that does not include a character line drawing is generated.

図6に示される階調情報は、符号化部211にて、例えばJPEG符号化を用いて圧縮(非可逆符号化)される。なお、この非可逆符号化方法は、JPEGに限らず、自然画に適した他の符号化を適用しても良い。   The gradation information shown in FIG. 6 is compressed (lossy encoding) by the encoding unit 211 using, for example, JPEG encoding. Note that this lossy encoding method is not limited to JPEG, and other encoding suitable for natural images may be applied.

一方、抽出部204から出力された識別情報は、符号化部209にて、ランレングス符号化を用いて圧縮(可逆符号化)される。なお、この可逆符号化は2値データの符号化に適した他の符号化を適用しても良い。同じく、平均差分値生成部206から出力された平均差分値(D)は、符号化部210にて、圧縮(可逆符号化)される。なお、符号化部209、符号化部210による符号化は、画質に大きく影響するので可逆符号化が望ましい。一方、符号化部211による符号化は、高い圧縮率が期待されるので、非可逆符号化が望ましいが、目標の圧縮率になるのであれば可逆符号化でも構わない。   On the other hand, the identification information output from the extraction unit 204 is compressed (losslessly encoded) by the encoding unit 209 using run-length encoding. This lossless encoding may be applied to other encoding suitable for encoding binary data. Similarly, the average difference value (D) output from the average difference value generation unit 206 is compressed (losslessly encoded) by the encoding unit 210. Note that the encoding by the encoding unit 209 and the encoding unit 210 greatly affects the image quality, so lossless encoding is desirable. On the other hand, since the encoding unit 211 is expected to have a high compression rate, lossy encoding is desirable, but lossless encoding may be used as long as the target compression rate is achieved.

多重化部212は、符号化部209からの符号化データ、符号化部210からの符号化データ、及び符号化部211からの符号化データを後段のメモリに格納しやすいように結合し、それを出力端子252より出力する。多重化部212は、予め、全識別情報が“0”の符号化データを示すパターンデータを記憶するメモリを有し、符号化部209から出力された識別情報の符号化データとパターンデータとが一致するか否かを判定する。そして、両者が不一致の場合、すなわち、符号化部209から出力された識別情報の符号化データが、少なくとも1つの識別情報“1”があることを示している場合、符号化部209、210、211からの符号化データを結合し、図18のブロックデータ1801のタイプの符号化データを生成し、出力する。一方、符号化部209から出力された識別情報の符号化データとパターンデータとが一致する場合、すなわち、符号化部209から出力された符号化データが、全識別情報“0”であることを示す場合、多重化部212は、符号化部209、210からの符号化データを破棄し、符号化部211からの符号化データを用いて、図18のブロックデータ1802のタイプの符号化データを生成し、出力する。このようにして、先に説明したように図18のブロック符号化データ1801、又は1802のデータで構成される符号化データファイルを生成する。   The multiplexing unit 212 combines the encoded data from the encoding unit 209, the encoded data from the encoding unit 210, and the encoded data from the encoding unit 211 so as to be easily stored in the subsequent memory, Is output from the output terminal 252. The multiplexing unit 212 has a memory that stores in advance pattern data indicating encoded data having all identification information “0”, and the encoded data and pattern data of the identification information output from the encoding unit 209 are stored in the memory. It is determined whether or not they match. If they do not match, that is, if the encoded data of the identification information output from the encoding unit 209 indicates that there is at least one identification information “1”, the encoding units 209, 210, The encoded data from 211 is combined to generate and output encoded data of the type of block data 1801 in FIG. On the other hand, if the encoded data of the identification information output from the encoding unit 209 matches the pattern data, that is, the encoded data output from the encoding unit 209 is all identification information “0”. In the case shown, the multiplexing unit 212 discards the encoded data from the encoding units 209 and 210, and uses the encoded data from the encoding unit 211 to convert the encoded data of the type of the block data 1802 in FIG. Generate and output. In this way, an encoded data file composed of the block encoded data 1801 or 1802 of FIG. 18 is generated as described above.

なお、上記では、多重化部212が符号化部209からの符号化データとパターンデータとを比較する例を示したが、これによって本発明が限定されるものではない。例えば、抽出部204が、1ブロック分の識別情報を生成した際、その全てが“0”であるか否かを示す信号を多重化部212に供給する。多重化部212は、抽出部204からのこの信号に従って、ブロックデータ1801、1802のいずれか一方を生成しても構わない。   In the above description, the multiplexing unit 212 compares the encoded data from the encoding unit 209 with the pattern data. However, the present invention is not limited thereto. For example, when the extraction unit 204 generates identification information for one block, the extraction unit 204 supplies a signal indicating whether or not all of the identification information is “0” to the multiplexing unit 212. The multiplexing unit 212 may generate one of the block data 1801 and 1802 in accordance with this signal from the extraction unit 204.

次に、本実施形態における画像復号処理を説明する。図7は、実施形態における画像復号装置のブロック構成図である。   Next, the image decoding process in this embodiment is demonstrated. FIG. 7 is a block configuration diagram of the image decoding apparatus in the embodiment.

図中、851は不図示のメモリから読み出した符号化データを入力する入力端子であり、801は符号化データを符号化された識別情報、符号化された平均差分値(D)、及び、符号化された階調情報に分離する分離部である。802は上記識別情報を復号化させるための第1の復号化部であり、803は上記平均差分値(D)を復号化させるための第2の復号化部であり、804は上記階調情報を復号化させるための第3の復号化部である。そして、805は多値画像を復元し、その復元結果を出力する画像復元部である。   In the figure, reference numeral 851 denotes an input terminal for inputting encoded data read from a memory (not shown), and reference numeral 801 denotes identification information obtained by encoding the encoded data, an encoded average difference value (D), and a code. The separation unit separates the converted gradation information. Reference numeral 802 denotes a first decoding unit for decoding the identification information, 803 denotes a second decoding unit for decoding the average difference value (D), and 804 denotes the gradation information. Is a third decryption unit for decrypting. Reference numeral 805 denotes an image restoration unit that restores a multi-valued image and outputs the restoration result.

上記構成における1ブロックの復号処理を以下に説明する。   One block decoding processing in the above configuration will be described below.

入力端子851から入力される1ブロック分の符号化データは、図1の出力端子251から出力された符号化データと等しい。   The encoded data for one block input from the input terminal 851 is equal to the encoded data output from the output terminal 251 in FIG.

そこで、分離部801は、入力した着目ブロック分の符号化データのブロックヘッダを解析し、着目ブロックの符号化データが、図18のブロックデータ1801、1802のいずれのタイプであるかを判定する。着目ブロックが、ブロックデータ1801のタイプであると判定した場合、ブロックヘッダに後続する識別情報の符号化データ、平均差分値の符号化データ、及び階調情報の符号化データを分離し、分離された各符号化データを各々に対応する復号化部802、803、804に供給する。   Therefore, the separation unit 801 analyzes the block header of the encoded data for the input target block, and determines whether the encoded data of the target block is the type of the block data 1801 or 1802 in FIG. When it is determined that the target block is the type of the block data 1801, the encoded data of the identification information, the encoded data of the average difference value, and the encoded data of the gradation information that follow the block header are separated and separated. Each encoded data is supplied to corresponding decoding sections 802, 803, and 804.

なお、分離部801は、予め、全識別情報が“0”の符号化データのパターンデータ、及び、平均差分値が“0”の符号化データのパターンデータを記憶するメモリを有する。そして、着目ブロックの符号化データがブロックデータ1802のタイプであると判定した場合、分離部801は、自身のメモリに予め記憶された全識別情報が“0”の符号化データのパターンデータを復号化部802に出力すると共に、自身のメモリに格納されている平均差分値が“0”の符号化データのパターンデータを復号化部803に出力する。そして、分離部801は、入力したブロックヘッダに後続する階調情報の符号化データを復号化部804に出力する。   The separating unit 801 has a memory that stores in advance the pattern data of encoded data having all identification information “0” and the pattern data of encoded data having an average difference value “0”. If it is determined that the encoded data of the block of interest is the type of the block data 1802, the separating unit 801 decodes the pattern data of the encoded data having all identification information “0” stored in advance in its own memory. Output to the encoding unit 802, and also outputs to the decoding unit 803 the pattern data of the encoded data having an average difference value “0” stored in its own memory. Then, the separation unit 801 outputs the encoded data of the gradation information subsequent to the input block header to the decoding unit 804.

復号部802は、入力した符号化識別情報を復号し、その結果を画像復元部805に出力する。復号部802は、図1の符号化部209に対応するものであり、可逆復号を行なう。それ故、復号化部802から出力された識別情報は、図1の抽出部204から出力された識別情報と完全に一致する。   The decoding unit 802 decodes the input coding identification information and outputs the result to the image restoration unit 805. The decoding unit 802 corresponds to the encoding unit 209 in FIG. 1 and performs lossless decoding. Therefore, the identification information output from the decoding unit 802 completely matches the identification information output from the extraction unit 204 in FIG.

復号部803は図1の符号化部210に対応するものであり、可逆復号を行なう。それ故、復号部803で復号した平均差分値は、図2の平均差分値生成部206から出力された符号化前の平均差分値(D)と完全に一致する。   The decoding unit 803 corresponds to the encoding unit 210 in FIG. 1 and performs lossless decoding. Therefore, the average difference value decoded by the decoding unit 803 completely coincides with the average difference value (D) before encoding output from the average difference value generation unit 206 of FIG.

復号化部804は、入力した1ブロック分の階調情報を復号する。実施形態における復号部804は非可逆符号化データを復号するものであるから、図1のセレクタ208から出力する階調データとは完全には一致しないが、適度に階調性を維持した階調情報を復元できる。   The decoding unit 804 decodes the input gradation information for one block. Since the decoding unit 804 in the embodiment decodes lossy encoded data, the gradation data output from the selector 208 in FIG. 1 is not completely the same, but the gradation with moderate gradation maintained. Information can be restored.

画像復元部805は、復号化部802から出力された識別情報の“0”の領域については、復号化部804から出力された階調情報をそのまま出力する。また、画像復元部805は、復号化部802から出力された識別情報(判定情報)の“1”の領域については、復号化部804から出力された階調情報に、復号化部803から出力された平均差分値(D)を加算し、出力する。   The image restoration unit 805 outputs the gradation information output from the decoding unit 804 as it is for the area of “0” in the identification information output from the decoding unit 802. Further, the image restoration unit 805 outputs, from the decoding unit 803, the gradation information output from the decoding unit 804 for the area “1” of the identification information (determination information) output from the decoding unit 802. The average difference value (D) is added and output.

例えば、画像復元部805への入力が、図2に示される4×4画素ブロックの識別情報(判定情報)、図1の平均差分値生成部206の動作例を示した際に算出された平均差分値“170”、図8に示される4×4画素ブロックの階調情報であるとする。この場合、画像復元部805は、識別情報の“1”の領域に対応する上記階調情報に平均差分値“170”を加算することになるので、画像復元部805から出力される1ブロックの画像データは、図9に示される4×4の多値画像が復元される。   For example, the input to the image restoration unit 805 is the average information calculated when the identification information (determination information) of the 4 × 4 pixel block shown in FIG. 2 and the operation example of the average difference value generation unit 206 shown in FIG. It is assumed that the difference value “170” is the gradation information of the 4 × 4 pixel block shown in FIG. In this case, the image restoration unit 805 adds the average difference value “170” to the gradation information corresponding to the region “1” of the identification information, and thus one block output from the image restoration unit 805. As the image data, a 4 × 4 multi-valued image shown in FIG. 9 is restored.

以上説明したように本実施形態によれば、図15に示すような画像ブロックを入力したとしても、非可逆符号化処理では図6に示されるように、ほとんどエッジのない4×4画素の階調情報となる。このため、階調情報符号化時のエントローピーが大幅に減少し、符号化効率が大幅に向上することになる。   As described above, according to the present embodiment, even if an image block as shown in FIG. 15 is input, in the lossy encoding process, as shown in FIG. Key information. For this reason, entropy at the time of gradation information encoding is greatly reduced, and encoding efficiency is greatly improved.

一方識別情報)と平均差分値(D)は可逆符号化されるため、文字や線画、自然画像が混在した多値画像でも画質劣化が起こりにくい。   On the other hand, since the identification information) and the average difference value (D) are losslessly encoded, even in a multi-value image in which characters, line drawings, and natural images are mixed, image quality deterioration hardly occurs.

さらに、抽出画素の階調性は階調情報によってほぼ復元されるため、グラデーション文字のように1つのレベルに収まらない文字と自然画像が混在した多値画像でも画質劣化が検知されにくい。   Furthermore, since the gradation of the extracted pixels is almost restored by the gradation information, image quality deterioration is hardly detected even in a multi-value image in which characters that do not fit in one level such as gradation characters and a natural image are mixed.

なお、上記実施形態では、分離部801は、着目ブロックの符号化データが、ブロックデータ1802のタイプであると判定した場合、ダミーの識別情報の符号化データ(パターンデータ)を復号化部802に出力し、ダミーの平均差分値の符号化データ(パターンデータ)を復号化部803に出力した。しかしながら、これによって本発明が限定されるものではない。例えば、次のようにしてもかまわない。   In the above embodiment, when the separating unit 801 determines that the encoded data of the block of interest is the type of the block data 1802, the separating unit 801 transmits the encoded data (pattern data) of dummy identification information to the decoding unit 802. The dummy average difference value encoded data (pattern data) is output to the decoding unit 803. However, this does not limit the present invention. For example, it may be as follows.

分離部801はブロックヘッダを解析して、着目ブロックの符号化データがブロックデータ1801、1802のいずれであるかを判定し、その判定結果を示す信号を画像復元部805に出力する。また、分離部801は、着目ブロックの符号化データがブロックデータ1802のタイプであると判断した場合には、ブロックヘッダに後続する階調情報の符号化データのみを復号化部804に出力する。画像復元部805は、着目ブロックがブロックデータ1801のタイプであることを示す信号を入力した場合には、上記処理を行なう。一方、着目ブロックがブロックデータ1802のタイプであることを示す信号を入力した場合には、復号化部804からの復号結果のみを選択し、出力する。以上のようにしても、上記実施形態と同様の結果を得ることができる。   The separation unit 801 analyzes the block header, determines whether the encoded data of the block of interest is the block data 1801 or 1802, and outputs a signal indicating the determination result to the image restoration unit 805. If the separating unit 801 determines that the encoded data of the block of interest is the type of the block data 1802, the separating unit 801 outputs only the encoded data of the gradation information subsequent to the block header to the decoding unit 804. The image restoration unit 805 performs the above process when a signal indicating that the block of interest is of the block data 1801 type is input. On the other hand, when a signal indicating that the block of interest is of the block data 1802 type is input, only the decoding result from the decoding unit 804 is selected and output. Even if it does as mentioned above, the result similar to the said embodiment can be obtained.

また、上記実施形態では識別情報が“1”の画素を抽出画素としたが、識別情報が“0”の画素を抽出画素としても良い。この場合、置換画素も識別情報が“0”の画素となり、平均差分値(D)の絶対値が所定値以下の場合の識別情報は全て1にクリアすることになる。また、平均差分値を0としても置換処理は実質的には動作しなくなるので、識別情報を全て“1”にクリアする代わりに平均差分値(D)を0にクリアするようにしても良い。   In the above embodiment, the pixel having the identification information “1” is the extraction pixel, but the pixel having the identification information “0” may be the extraction pixel. In this case, the replacement pixel is also a pixel whose identification information is “0”, and all the identification information when the absolute value of the average difference value (D) is equal to or smaller than a predetermined value is cleared to 1. Further, even if the average difference value is set to 0, the replacement process substantially does not operate. Therefore, instead of clearing all the identification information to “1”, the average difference value (D) may be cleared to 0.

また、上記実施形態では1ブロックを4×4画素サイズとした。しかしながら、符号化部211がJPEG符号化処理を行なうのであれば、8×8サイズか、その整数倍であることが望ましい。実施形態で示した4×4のサイズは、簡単に説明するための一例であることに注意されたい。   In the above embodiment, one block has a 4 × 4 pixel size. However, if the encoding unit 211 performs JPEG encoding processing, it is desirable that the size is 8 × 8 or an integer multiple thereof. It should be noted that the 4 × 4 size shown in the embodiment is an example for simple explanation.

また、本発明は文字部分とその他の部分を分離する場合に特に限定されない。本発明は、ある領域内にブロック内に高い値のグループと低い値のグループが存在し、これらを符号化する状況において、適宜用いることが可能である。   In addition, the present invention is not particularly limited to the case where the character portion and the other portion are separated. The present invention can be appropriately used in a situation where a high value group and a low value group exist within a block in a certain area and these are encoded.

<第1の実施形態の変形例>
上記第1の実施形態をコンピュータプログラムによって実現しても構わない。その例を以下に説明する。
<Modification of First Embodiment>
The first embodiment may be realized by a computer program. An example of this will be described below.

図19は本変形例で適用する情報処理装置(パーソナルコンピュータ等)のブロック構成図である。   FIG. 19 is a block diagram of an information processing apparatus (such as a personal computer) applied in the present modification.

図中、1901は装置全体の制御を司るCPUであり、1902はブートプログラム及びBIOSを記憶しているROMである。1903はCPU1901のワークエリアとして使用するRAMである。1904はハードディスク等の大容量の外部記憶装置であり、ここにOS(オペレーティングシステム)や、本変形例のアプリケーションプログラムをはじめ、各種データファイルが格納されている。1905はキーボード、1906はポインティングデバイスであるマウスである。1907は表示制御部であり、内部にはビデオメモリ、当該ビデオメモリへの描画処理とビデオメモリからの画像を映像信号として外部に出力するコントローラで構成される。1908は表示制御部1907からの映像信号を入力し表示する表示装置(CRTや液晶表示装置等)である。1909はネットワークインタ、1910はスキャナインタフェース、1911はイメージスキャナである。   In the figure, 1901 is a CPU that controls the entire apparatus, and 1902 is a ROM that stores a boot program and BIOS. Reference numeral 1903 denotes a RAM used as a work area for the CPU 1901. Reference numeral 1904 denotes a large-capacity external storage device such as a hard disk, which stores an OS (operating system) and various data files including the application program of this modification. Reference numeral 1905 denotes a keyboard, and 1906 denotes a mouse which is a pointing device. Reference numeral 1907 denotes a display control unit, which includes a video memory, a drawing process in the video memory, and a controller that outputs an image from the video memory as a video signal to the outside. Reference numeral 1908 denotes a display device (CRT, liquid crystal display device or the like) that receives and displays a video signal from the display control unit 1907. Reference numeral 1909 denotes a network interface, 1910 denotes a scanner interface, and 1911 denotes an image scanner.

上記構成において、本装置の電源がONになると、CPU1901はROM1902のブートプログラムに従って、外部記憶装置1904からOSをRAM1903にロードすることで、本装置が情報処理装置として機能するようになる。この後、キーボード1905やマウス1906によって、本変形例のアプリケーションの起動が指示されると、CPU1901は外部記憶装置1904から該当するアプリケーションをRAM1903にロードし、実行する。これにより、本装置が画像処理装置として機能するようになる。   In the above configuration, when the power of the apparatus is turned on, the CPU 1901 loads the OS from the external storage device 1904 to the RAM 1903 according to the boot program of the ROM 1902 so that the apparatus functions as an information processing apparatus. Thereafter, when the activation of the application of this modification is instructed by the keyboard 1905 or the mouse 1906, the CPU 1901 loads the corresponding application from the external storage device 1904 to the RAM 1903 and executes it. As a result, the apparatus functions as an image processing apparatus.

以下は、このアプリケーションが起動した後のCPU1901が実行する処理手順を示している。なお、ここでは、イメージスキャナ1911から原稿画像を読み取り、それを圧縮符号化して外部記憶装置1904にファイルとして保存する例を説明する。   The following shows the processing procedure executed by the CPU 1901 after this application is activated. Here, an example will be described in which a document image is read from the image scanner 1911, compressed and encoded, and saved as a file in the external storage device 1904.

また、アプリケーションが実行されると、RAM1903には、イメージスキャナ1911で読取った画像データを一時的に記憶するバッファ、及び、各種変数を格納するエリアが確保されるものとする。また、ここでも説明を簡単なものとするため、イメージスキャナ1911には、モノクロ多値モード(1画素8ビットとする)で原稿を読取るように設定するものとする。イメージスキャナ1911で読取った画像データは輝度値となる。これは上記第1の実施形態の濃度に対してちょうど逆の意味になり、二値化する際の0、1も逆の意味になる点に注意されたい。すなわち、輝度、濃度の違いは本質的な差とはならない。なぜなら、本発明では、文字・線画の画素と、非文字・線画とが分離できれば良いからである。   When the application is executed, a buffer for temporarily storing image data read by the image scanner 1911 and an area for storing various variables are secured in the RAM 1903. In order to simplify the description here, it is assumed that the image scanner 1911 is set to read a document in a monochrome multi-value mode (8 bits per pixel). Image data read by the image scanner 1911 is a luminance value. Note that this has the opposite meaning to the density of the first embodiment, and 0 and 1 when binarizing also have the opposite meaning. That is, the difference in brightness and density is not an essential difference. This is because, in the present invention, it is only necessary to separate pixels of character / line drawing and non-character / line drawing.

図20は、本変形例のアプリケーションの画像符号化処理手順を示すフローチャートである。以下の説明において、イメージスキャナ1911で読取った画像データはRAM1903内の入力バッファに格納されるものとして説明する。また、外部記憶装置1904に書き出すファイルのヘッダ情報は既に生成しているものとして説明する。   FIG. 20 is a flowchart illustrating an image encoding processing procedure of the application according to the present modification. In the following description, it is assumed that image data read by the image scanner 1911 is stored in an input buffer in the RAM 1903. Also, description will be made assuming that the header information of the file to be written to the external storage device 1904 has already been generated.

まず、ステップS1では、入力バッファより1ブロック分の画像データを読取る。1ブロックのサイズは、本変形例の場合、8×8画素とする。入力した1ブロック分の画像データをIM(i,j)として表現する(i,j=0、1、2、…7)。   First, in step S1, one block of image data is read from the input buffer. In this modification, the size of one block is 8 × 8 pixels. The input image data for one block is expressed as IM (i, j) (i, j = 0, 1, 2,... 7).

次いで、ステップS2において、入力した1ブロック内の各画素値を、予め設定された閾値TH0と比較し、2値化する。この2値化結果を、第1の実施形態と同様、識別情報と呼び、B(i,j)で表わす。   Next, in step S2, each input pixel value in one block is compared with a preset threshold value TH0 and binarized. Similar to the first embodiment, this binarization result is called identification information and is represented by B (i, j).

ステップS3では、B(i,j)=1となっている画素値IM(i,j)の総和を算出し、その平均値AVE1を算出する。演算式を示せば次式で表わすことができる。
AVE1={ΣB(i,j)×IM(i,j)}/ΣB(i,j)
ここでΣは、i,j=0、1、…7の合算関数である。また、ΣB(i,j)=0の場合、AVE=0とする。
In step S3, the sum of the pixel values IM (i, j) for which B (i, j) = 1 is calculated, and the average value AVE1 is calculated. If an arithmetic expression is shown, it can be expressed by the following expression.
AVE1 = {ΣB (i, j) × IM (i, j)} / ΣB (i, j)
Here, Σ is a summation function of i, j = 0, 1,. When ΣB (i, j) = 0, AVE = 0.

このステップS3の処理は、ちょうど、図3の“1”領域平均値生成部401の処理に相当するのは明らかであろう。   It will be apparent that the process of step S3 corresponds to the process of the “1” area average value generation unit 401 in FIG.

ステップS4では、B(i,j)=0となっている画素値IM(i,j)の総和を算出し、その平均値AVE2を算出する。
AVE2={Σ(1−B(i,j))×IM(i,j)}/Σ(1−B(i,j))
で算出できる。また、Σ(1−B(i,j))=0の場合、AVE2=0とする。
In step S4, the sum total of the pixel values IM (i, j) where B (i, j) = 0 is calculated, and the average value AVE2 is calculated.
AVE2 = {Σ (1-B (i, j)) × IM (i, j)} / Σ (1-B (i, j))
It can be calculated by When Σ (1-B (i, j)) = 0, AVE2 = 0.

このステップS4の処理は、ちょうど、図3の“0”領域平均値生成部401の処理に相当するのは明らかであろう。   It will be apparent that the process of step S4 corresponds to the process of the “0” area average value generation unit 401 in FIG.

ステップS5では、AVE1からAVE2を減じることで、差分値Dを求める。つまり、図3の減算器403の処理に相当する。   In step S5, the difference value D is obtained by subtracting AVE2 from AVE1. That is, it corresponds to the processing of the subtracter 403 in FIG.

ステップS6では、差分値Dの絶対値が予め設定された閾値TH1以下であるか否かを判断する。このステップS6の判断がYesの場合、着目ブロックに存在するすべての画素値は、ほぼ等しい値と持つことになる。そこで、着目ブロックについては、ステップS7に進んで、JPEG符号化(非可逆符号化)を行なう。つまり、着目ブロックの符号化データは、図18のブロック符号化データ1802となる。   In step S6, it is determined whether or not the absolute value of the difference value D is equal to or less than a preset threshold value TH1. When the determination in step S6 is Yes, all pixel values existing in the block of interest have substantially the same value. Therefore, for the block of interest, the process proceeds to step S7, and JPEG encoding (lossy encoding) is performed. That is, the encoded data of the block of interest is the block encoded data 1802 in FIG.

一方、ステップS6の判定がNoの場合、すなわち、差分値Dの絶対値が閾値を超えると判断した場合、処理はステップS8に進み、B(i,j)=1となった画素値から、差分値Dを減じることで、置換処理を行なう。置換後処理後の階調画素値をT(i,j)で表わすと、次の通りとなる。
・B(i,j)=1の場合、T(i,j)=IM(i,j)−D
ただし、T(i,j)<0の場合には、T(i,j)=0とする。
・B(i,j)=0の場合、T(i,j)=IM(i,j)
On the other hand, if the determination in step S6 is No, that is, if it is determined that the absolute value of the difference value D exceeds the threshold, the process proceeds to step S8, and from the pixel value for which B (i, j) = 1, Substitution processing is performed by subtracting the difference value D. The gradation pixel value after the post-replacement processing is expressed as T (i, j) as follows.
When B (i, j) = 1, T (i, j) = IM (i, j) −D
However, if T (i, j) <0, T (i, j) = 0.
When B (i, j) = 0, T (i, j) = IM (i, j)

ステップS9では、置換処理で得られた階調画素値T(i,j)をJPEG符号化(非可逆符号化)する。   In step S9, the gradation pixel value T (i, j) obtained by the replacement process is JPEG-encoded (lossy encoding).

次いで、ステップS10では、2値識別情報B(i,j)を可逆符号化し、ステップS11で差分値Dについても可逆符号化する。   Next, in step S10, the binary identification information B (i, j) is losslessly encoded, and in step S11, the difference value D is also losslessly encoded.

この後、ステップS12に進み、生成された符号化データをファイルの一部として出力する。因に、ステップS8乃至S11の処理を経た場合の着目ブロックの符号化データは、図18のブロック符号化データ1801の形式になる。   Thereafter, the process proceeds to step S12, and the generated encoded data is output as a part of the file. Incidentally, the encoded data of the block of interest after the processes of steps S8 to S11 are in the format of the block encoded data 1801 in FIG.

この後、ステップS13にて、全ブロックについての符号化処理が完了したか否か判断し、否の場合にはステップS1以降の処理を繰り返すことになる。   Thereafter, in step S13, it is determined whether or not the encoding process has been completed for all the blocks. If not, the processes in and after step S1 are repeated.

以上の結果、第1の実施形態と同様な符号化データを生成することが可能になる。   As a result, encoded data similar to that in the first embodiment can be generated.

次に、本変形例の復号処理手順を図21のフローチャートに従って説明する。復号対象の符号化データファイルは、適当なGUI画面を表示装置1908に表示し、ユーザがマウス1906を操作して選択するものとする。   Next, the decoding processing procedure of this modification will be described with reference to the flowchart of FIG. It is assumed that the encoded data file to be decoded is displayed by displaying an appropriate GUI screen on the display device 1908 and the user operates the mouse 1906 to select it.

まず、ステップS21では、選択したファイルから1ブロックの符号化データを入力する。そして、ステップS22にて、ブロックヘッダを解析し、図18のブロック1801、1802のいずれの形式のデータであるかを判断する。   First, in step S21, one block of encoded data is input from the selected file. In step S22, the block header is analyzed, and it is determined which format is the data of blocks 1801 and 1802 in FIG.

入力した符号化データが、ブロックデータ1802の形式、すなわち、階調情報の符号化データのみで構成されると判断した場合には、ステップS23に進んで、JPEG復号処理を行なう。   If it is determined that the input encoded data is composed only of the block data 1802 format, that is, encoded data of gradation information, the process proceeds to step S23 to perform JPEG decoding processing.

一方、入力した符号化データが、ブロックデータ1801の形式、すなわち、識別情報の符号化データ、差分値の符号化データ、及び、階調情報の符号化データで構成されると判断した場合には、ステップS24に進む。   On the other hand, when it is determined that the input encoded data is composed of the block data 1801 format, that is, encoded data of identification information, encoded data of difference values, and encoded data of gradation information The process proceeds to step S24.

ステップS24では2値識別情報B(i,j)を復号し、ステップS25では差分値Dを復号する。そして、ステップS26では階調情報T(i,j)を復号する。この後、ステップS27にて逆置換処理を行なう。この逆置換処理後の画像データをIM’(i,j)とするなら、次の通りである。
・B(i,j)=1の場合、IM’(i,j)=T(i,j)+D
・B(i,j)=0の場合、IM’(i,j)=T(i,j)
In step S24, the binary identification information B (i, j) is decoded, and in step S25, the difference value D is decoded. In step S26, the gradation information T (i, j) is decoded. Thereafter, reverse replacement processing is performed in step S27. If the image data after the reverse replacement processing is IM ′ (i, j), it is as follows.
When B (i, j) = 1, IM ′ (i, j) = T (i, j) + D
When B (i, j) = 0, IM ′ (i, j) = T (i, j)

ステップS28では、ステップS23又はステップS27で復号して得られた1ブロック分の画像データを出力する。出力先が表示装置であれば、表示制御部1907に出力すればよいし、復号画像データをファイルとして保存するのであれば外部記憶装置1904で良い。   In step S28, the image data for one block obtained by decoding in step S23 or step S27 is output. If the output destination is a display device, it may be output to the display control unit 1907. If the decoded image data is stored as a file, the external storage device 1904 may be used.

この後、ステップS29に進み、全ブロック分の復号処理が完了したか否かを判断し、否の場合にはステップS21以降の処理を繰り返す。   Thereafter, the process proceeds to step S29, where it is determined whether or not the decoding process for all blocks has been completed. If not, the processes in and after step S21 are repeated.

以上説明したように本変形例の如く、コンピュータプログラムによっても先に説明した第1の実施形態と同様の作用効果を奏することができる。   As described above, like the present modification, the same operational effects as those of the first embodiment described above can be obtained by a computer program.

<第2の実施形態>
本第2の実施形態は、上述した第1の実施形態から更なる効果を得るために機能を追加するものである。
<Second Embodiment>
In the second embodiment, functions are added in order to obtain further effects from the first embodiment described above.

図10に、第2の実施形態における符号化装置のブロック構成図を示す。   FIG. 10 shows a block configuration diagram of an encoding apparatus according to the second embodiment.

図10の構成は、第1の実施形態である図1の構成に対し、ローパスフィルタ部1101を加えた点が異なり、それ以外は同じである。   The configuration in FIG. 10 is the same as the configuration in FIG. 1 according to the first embodiment except that a low-pass filter unit 1101 is added.

第1の実施形態では、図1のセレクタ208の出力値、つまり階調情報を符号化部211がダイレクトに符号化した。これに対し、第2の実施形態では図10で示されるように、セレクタ208の出力値、つまり階調情報の高周波成分をローパスフィルタ部1101を用いて抑制する。そして、符号化部211は、このローパスフィルタ処理後の高周波成分が抑制された画像データ(階調情報)を符号化する。ローパスフィルタ処理(以下、LPFと記す)を行うことのメリットは、ノイズ成分を除去するだけでなく、抽出画素(識別情報が“1”となる画素)と、非抽出画素の境界も滑らかになるため、更なる圧縮効率の向上が期待できる。また、上述したように、先の平均差分値(D)を用いた減算処理によって、ブロック内のエッジは既に抽出されて殆どなくなっているのでローパスフィルタをかけたとしても復元した画像のエッジは損なわれない。逆に、入力時に損なわれているエッジは、抽出(置換)処理後の階調情報にエッジとなって残るので、このローパスフィルタ処理により、損なわれたエッジが除去され、復元時に急峻なエッジとなる効果もある。   In the first embodiment, the encoding unit 211 directly encodes the output value of the selector 208 in FIG. On the other hand, in the second embodiment, as shown in FIG. 10, the output value of the selector 208, that is, the high frequency component of the gradation information is suppressed using the low-pass filter unit 1101. Then, the encoding unit 211 encodes the image data (gradation information) in which the high-frequency component after the low-pass filter processing is suppressed. The merit of performing the low-pass filter processing (hereinafter referred to as LPF) is not only removing the noise component, but also smoothing the boundary between the extracted pixel (the pixel whose identification information is “1”) and the non-extracted pixel. Therefore, further improvement in compression efficiency can be expected. In addition, as described above, the edge in the block has already been extracted by the subtraction process using the average difference value (D), and the edge of the restored image is lost even if a low-pass filter is applied. I can't. On the contrary, since the edge damaged at the time of input remains as an edge in the gradation information after the extraction (replacement) processing, the damaged edge is removed by this low-pass filter processing, and the sharp edge at the time of restoration is removed. There is also an effect.

以下、エッジが改善される具体的な例を示して説明する。   Hereinafter, a specific example in which the edge is improved will be described.

図11(A)乃至(F)は第2の実施形態の動作を示す波形の例である。   FIGS. 11A to 11F are waveform examples showing the operation of the second embodiment.

図11(A)は入力波形で、ここでは8×1の1次元のブロックであるとする。この波形(ブロック)を所定の閾値(ここではブロック平均値)にて領域分割し、同図(B)に示すように識別情報が抽出される。この識別情報を用いて領域毎の平均値を求め(同図(C))、平均差分値が得られる。   FIG. 11A shows an input waveform, which is an 8 × 1 one-dimensional block here. This waveform (block) is divided into regions by a predetermined threshold (here, block average value), and identification information is extracted as shown in FIG. Using this identification information, an average value for each region is obtained ((C) in the figure), and an average difference value is obtained.

この平均差分値を入力波形(図11(A)の“1”領域(識別情報が“1”となる画素)から減じて、図11(D)の階調情報が得られる。なお、このとき、減算した結果が負となる場合は、上述したように0にクリップする。この階調情報にLPFをかけ、圧縮伸長した結果、図11(E)に示す波形が得られる。この波形(同図(E))の“1”領域(識別情報が“1”となる画素)に平均差分値を加算することで、元の波形(ブロック)が図11(F)のように復元される。図11(F)の矢印で示したように、“1”領域の境界部のエッジが急峻になっていることがわかる。   11D is obtained by subtracting this average difference value from the input waveform (“1” region (pixels whose identification information is “1”) in FIG. 11A). If the result of subtraction is negative, it is clipped to 0 as described above, and this tone information is subjected to LPF and compressed and decompressed, resulting in the waveform shown in FIG. The original waveform (block) is restored as shown in FIG. 11F by adding the average difference value to the “1” region (the pixel whose identification information is “1”) in FIG. As shown by the arrow in FIG. 11F, it can be seen that the edge of the boundary portion of the “1” region is steep.

以上説明したように本第2の実施形態によれば、第1の実施形態(及びその変形例)の作用効果に加えて、ノイズ成分を除去と、復元時に急峻なエッジとすることが可能になる。   As described above, according to the second embodiment, in addition to the operational effects of the first embodiment (and its modifications), the noise component can be removed and a sharp edge can be obtained during restoration. Become.

なお、本第2の実施形態に対応する処理を、コンピュータプログラムでもって実現できることは明らかである。   Obviously, the processing corresponding to the second embodiment can be realized by a computer program.

また、上記第1及び第2の実施形態では、識別情報が“1”となっている画素群を抽出対象とし、識別情報が“0”となっている画素群を非抽出対象とした。そして、抽出対象画素群に含まれる各画素の値から差分平均値を減じた。しかし、この逆でも構わない。すなわち、識別情報が“0”の画素群を抽出対象とし、その画素群に含まれる各画素の値に差分平均値を加算しても良い。この場合、平均差分の加算により、入力画素の取り得る範囲を超えた場合に上限値(境界値)にクリップすることになる。要するに、抽出対象画素群と非抽出画素群それぞれの平均値が小さくなるように、差分平均値を加算又は減算しても、構わない。   In the first and second embodiments, the pixel group with the identification information “1” is the extraction target, and the pixel group with the identification information “0” is the non-extraction target. Then, the difference average value is subtracted from the value of each pixel included in the extraction target pixel group. However, this may be reversed. That is, a pixel group having identification information “0” may be extracted, and the average difference value may be added to the value of each pixel included in the pixel group. In this case, when the range that the input pixel can take is exceeded due to addition of the average difference, clipping is performed to the upper limit value (boundary value). In short, the difference average value may be added or subtracted so that the average value of each of the extraction target pixel group and the non-extraction pixel group becomes small.

<第3の実施形態>
第1の実施形態では、置換色を生成する際、ブロック内の各多値画像データから平均差分値を減算し、もしその結果が負であれば置換色を”0”(下限値)にクリップして出力している。これは符号化部211がJPEGエンコーダのような正の値を入力としなければならない場合に対しての最も単純で効果的な対策である。これは置換色にクリップされた画素があったとしてもその数が少なく、クリップ幅が小さいものであれば、復元後の画質には大きく影響することはないことに基づいている(参考例:図11)。
<Third Embodiment>
In the first embodiment, when generating a replacement color, the average difference value is subtracted from each multi-valued image data in the block, and if the result is negative, the replacement color is clipped to “0” (lower limit value). And output. This is the simplest and most effective countermeasure for the case where the encoding unit 211 has to input a positive value as in the JPEG encoder. This is based on the fact that even if there are pixels clipped in the replacement color, if the number of pixels is small and the clip width is small, the image quality after restoration will not be greatly affected (reference example: figure). 11).

しかし、ごく稀だが入力画像によっては、または抽出部204での識別情報を生成するために使用した閾値によっては、復元後の画質劣化に影響してしましまう場合がある。以下、図22を用いて具体的な例を示して説明する。図22(A)は入力波形で、ここでは8×1画素の1次元のブロックであるとする。この波形(ブロック)を所定の閾値にて領域分解することで、識別情報が生成される(同図(B))。そして識別情報を用いて領域毎の平均値を求め(同図(C))、得られた平均差分値を”1”領域の画素データから減算する。閾値や入力波形によっては、その減算結果が負となる場合がある。通常は第1の実施形態で説明したように画素値を”0”へクリップしたとしても、画質に大きく影響をすることはない。しかし、同図(D)に示すように、負となる画素が多い、もしくはそれが連続してしまう可能性もある。この場合、圧縮・伸張後(同図(E))に平均差分を加算し、復元した出力波形(図(F))に示すように入力波形(図(A))で階調があった部分が失われてしまう。   However, although it is extremely rare, depending on the input image or depending on the threshold value used to generate the identification information in the extraction unit 204, the image quality after restoration may be affected. Hereinafter, a specific example will be described with reference to FIG. FIG. 22A shows an input waveform, which is a one-dimensional block of 8 × 1 pixels here. Identification information is generated by performing region decomposition on the waveform (block) with a predetermined threshold ((B) in the figure). Then, an average value for each region is obtained using the identification information ((C) in the figure), and the obtained average difference value is subtracted from the pixel data of the “1” region. Depending on the threshold and the input waveform, the subtraction result may be negative. Normally, even if the pixel value is clipped to “0” as described in the first embodiment, the image quality is not greatly affected. However, as shown in FIG. 4D, there are many negative pixels, or they may continue. In this case, after the compression / expansion (FIG. (E)), the average difference is added, and as shown in the restored output waveform (FIG. (F)), there is a gradation in the input waveform (FIG. (A)). Will be lost.

本第3の実施形態は、このような問題点を解消するために機能を追加するものである。   In the third embodiment, functions are added in order to solve such problems.

図23に第3の実施形態における符号化装置のブロック構成図を示す。   FIG. 23 shows a block configuration diagram of an encoding apparatus according to the third embodiment.

図23の構成は、第1の実施形態である図1の構成に対し、置換色生成部207の代わりとして置換色生成部2301を備える点、及び、置換色生成部2302、比較部2303及びセレクタ2304を追加した点が異なる。それ以外の部分については前記第1の実施形態と同様である。   The configuration of FIG. 23 is different from the configuration of FIG. 1 according to the first embodiment in that a replacement color generation unit 2301 is provided instead of the replacement color generation unit 207, and a replacement color generation unit 2302, a comparison unit 2303, and a selector. The difference is that 2304 is added. Other parts are the same as those in the first embodiment.

置換色生成部2301は、第1の実施形態で説明した図1の置換色生成部207に、後述する第1のカウント手段として機能するクリップカウンタを更に備えるものである。上記クリップカウンタは、識別情報が”1”で、且つ、バッファ203から出力されたブロック内の各多値画像の画素データから平均差分値(D)を減算した結果が負の場合にインクリメントされる。上記置換色生成部2301は、上記置換色生成部207と同じ手法にて置換色(a)を出力し、またクリップカウンタの値をクリップカウント値(a)として出力する。そして参照ブロックの上記置換色(a)及びクリップカウント値(a)が出力された後、上記クリップカウンタは”0”クリアされる。   The replacement color generation unit 2301 further includes a clip counter that functions as a first counting unit described later, in addition to the replacement color generation unit 207 of FIG. 1 described in the first embodiment. The clip counter is incremented when the identification information is “1” and the result obtained by subtracting the average difference value (D) from the pixel data of each multi-valued image in the block output from the buffer 203 is negative. . The replacement color generation unit 2301 outputs the replacement color (a) by the same method as the replacement color generation unit 207, and outputs the value of the clip counter as the clip count value (a). After the replacement color (a) and the clip count value (a) of the reference block are output, the clip counter is cleared to “0”.

上記クリップカウント値(a)はブロック内の識別情報が”1”に対応する置換色の画素のうち、”0”(下限値)にクリップされた画素の数を表している。   The clip count value (a) represents the number of pixels clipped to “0” (lower limit value) among the replacement color pixels whose identification information in the block corresponds to “1”.

セレクタ208は、入力される識別情報(判定情報)が”0”の時は、識別情報の位置に対応する入力多値画像の画素データを選択し、出力する。一方、識別情報が”1”の時は、セレクタ部208は、識別情報の位置に対応する置換色生成部2302にて出力された置換色(a)の画素データを選択し、出力する。以上の処理をブロック終端画素まで繰り返すことで、着目ブロックの階調情報(a)が得られる。   When the input identification information (determination information) is “0”, the selector 208 selects and outputs pixel data of the input multivalued image corresponding to the position of the identification information. On the other hand, when the identification information is “1”, the selector unit 208 selects and outputs the pixel data of the replacement color (a) output from the replacement color generation unit 2302 corresponding to the position of the identification information. By repeating the above processing up to the block end pixel, the gradation information (a) of the block of interest can be obtained.

置換色生成部2301とセレクタ208の具体的な動作を図24に示される4×4画素ブロックの多値画素データが入力されたものとして説明する。   A specific operation of the replacement color generation unit 2301 and the selector 208 will be described on the assumption that multi-value pixel data of a 4 × 4 pixel block shown in FIG. 24 is input.

図示の場合、ブロック平均値は“76”となるので、識別情報は図25に示されるようになる。また、図24、図25より平均差分値(D)は”200”となる。   In the illustrated case, since the block average value is “76”, the identification information is as shown in FIG. 24 and 25, the average difference value (D) is “200”.

置換色生成部2301では、ブロック内のすべての画素データから平均差分値”200”を減算する。置換色生成部2301は、第1の実施形態で説明した置換色生成部207と同じように、減算された値が負の場合には、置換色の値を0にクリップして出力する。その時の識別情報が抽出画素を示す”1”であれば、クリップカウンタをインクリメントする。本動作例で、これに該当する画素は2箇所あるので、クリップカウンタは”2”を示す。この結果、置換色生成部2301は、4×4の画素データを図26に示される置換色(a)として出力し、また、クリップカウンタの値”2”をクリップカウント値(a)として出力する。   The replacement color generation unit 2301 subtracts the average difference value “200” from all the pixel data in the block. Similar to the replacement color generation unit 207 described in the first embodiment, the replacement color generation unit 2301 clips and outputs the replacement color value to 0 when the subtracted value is negative. If the identification information at that time is “1” indicating the extracted pixel, the clip counter is incremented. In this operation example, since there are two pixels corresponding to this, the clip counter indicates “2”. As a result, the replacement color generation unit 2301 outputs 4 × 4 pixel data as the replacement color (a) shown in FIG. 26, and outputs the clip counter value “2” as the clip count value (a). .

セレクタ208では、図26で示される置換色(a)の画素のうち、図25に示される識別情報の”1”に対応する画素、及び、図24で示される多値画像の画素のうち、上記識別情報が”0”に対応する画素を選択し、出力する。この結果、セレクタ208は、図27に示される階調情報(a)を出力する。図示に示すように、文字・線画として判定された位置の画素値は、非文字・線画の画素値とほぼ同じ値になる。   In the selector 208, among the pixels of the replacement color (a) shown in FIG. 26, among the pixels corresponding to “1” of the identification information shown in FIG. 25, and among the pixels of the multivalued image shown in FIG. A pixel corresponding to the identification information “0” is selected and output. As a result, the selector 208 outputs the gradation information (a) shown in FIG. As shown in the drawing, the pixel value at the position determined as the character / line drawing is almost the same as the pixel value of the non-character / line drawing.

置換色生成部2302は、バッファ203から出力されたブロック内の各多値画像の画素データから、平均差分値生成部206から出力された平均差分値(D)を加算する。そして、その結果は置換色(b)として出力される。ただし、加算結果が画素データの取り得る範囲を超えた場合には、上限値(境界値)にクリップする。   The replacement color generation unit 2302 adds the average difference value (D) output from the average difference value generation unit 206 from the pixel data of each multi-valued image in the block output from the buffer 203. The result is output as a replacement color (b). However, if the addition result exceeds the range that can be taken by the pixel data, it is clipped to the upper limit value (boundary value).

また、置換色生成部2302は、上記置換色生成部2301と同じように第2のカウント手段として機能するクリップカウンタを備える。ただし、上記置換色生成部2302のクリップカウンタは上記置換色生成部2301のクリップカウンタとは異なる。すなわち、置換色生成部2302のクリップカウンタは、識別情報が”0”で、且つ、バッファ203から出力されたブロック内の各多値画像の画素データに平均差分値(D)を加算した結果が画素データの取り得る範囲の上限値(境界値)を超えた場合にインクリメントされる。上記クリップカウンタの値はクリップカウント値(b)として出力される。そして参照ブロックの上記置換色(b)及び、クリップカウント値(b)が出力された後、上記クリップカウンタは”0”クリアされる。   Further, the replacement color generation unit 2302 includes a clip counter that functions as a second counting unit, like the replacement color generation unit 2301. However, the clip counter of the replacement color generation unit 2302 is different from the clip counter of the replacement color generation unit 2301. That is, the clip counter of the replacement color generation unit 2302 has the identification information “0” and the result of adding the average difference value (D) to the pixel data of each multi-valued image in the block output from the buffer 203. It is incremented when the upper limit (boundary value) of the range that pixel data can take is exceeded. The value of the clip counter is output as a clip count value (b). After the replacement color (b) of the reference block and the clip count value (b) are output, the clip counter is cleared to “0”.

上記クリップカウント値(b)はブロック内の識別情報が”0”の置換色の中で、上限値(境界値)にクリップされた画素の数を表している。   The clip count value (b) represents the number of pixels clipped to the upper limit value (boundary value) among the replacement colors whose identification information in the block is “0”.

セレクタ2304はセレクタ208と同じ機能を持つ。ただし、識別情報(判定情報)は反転して上記セレクタ2304へ入力されるので、識別情報(判定情報)が”1”の時は識別情報の位置に対応する入力多値画像の画素データを選択し、出力する。一方、識別情報が”0”の時は、セレクタ2304は、識別情報の位置に対応する置換色生成部2302にて出力された置換色(b)の画素データを選択し、出力する。以上の処理をブロック終端画素まで繰り返すことで、着目ブロックの階調情報(b)が得られる。   The selector 2304 has the same function as the selector 208. However, since the identification information (determination information) is inverted and input to the selector 2304, when the identification information (determination information) is “1”, the pixel data of the input multivalued image corresponding to the position of the identification information is selected. And output. On the other hand, when the identification information is “0”, the selector 2304 selects and outputs the pixel data of the replacement color (b) output by the replacement color generation unit 2302 corresponding to the position of the identification information. By repeating the above processing up to the block end pixel, the gradation information (b) of the block of interest can be obtained.

以上のように、セレクタ208は第1の置換部、セレクタ2304は第2の置換部として機能することになる。   As described above, the selector 208 functions as a first replacement unit, and the selector 2304 functions as a second replacement unit.

置換色生成部2302とセレクタ2305の具体的な動作を図24に示される4×4画素ブロックの多値画素データが入力されたものとして説明する。   Specific operations of the replacement color generation unit 2302 and the selector 2305 will be described on the assumption that multi-value pixel data of a 4 × 4 pixel block shown in FIG. 24 is input.

この時、ブロック平均値は“77”となるので、識別情報は図25に示されるようになる。また、図24、図25より平均差分値(D)は”200”となる。ただし、置換色生成部2302には反転された識別情報が入力されるので、識別情報の”1”の画素が非抽出画素、”0”が抽出画素となる。   At this time, since the block average value is “77”, the identification information is as shown in FIG. 24 and 25, the average difference value (D) is “200”. However, since the inverted identification information is input to the replacement color generation unit 2302, a pixel “1” in the identification information is a non-extracted pixel and “0” is an extracted pixel.

置換色生成部2302では、ブロック内のすべての画素データに平均差分値”200”を加算する。置換色生成部2302は加算された値が上限値(ここでは255)の時、置換色の値を”255”にクリップして出力する。その時の識別情報が抽出画素を示す”0”であれば、クリップカウンタをインクリメントする。本動作例では、これに該当する画素はなく、クリップカウンタは”0”を示す。この結果、置換色生成部2302は、図28に示される4×4の画素データを置換色(b)として出力し、また、クリップカウンタの値”0”をクリップカウント値(b)として出力する。   The replacement color generation unit 2302 adds the average difference value “200” to all the pixel data in the block. When the added value is the upper limit value (255 in this case), the replacement color generation unit 2302 clips the replacement color value to “255” and outputs it. If the identification information at that time is “0” indicating the extracted pixel, the clip counter is incremented. In this operation example, there is no corresponding pixel, and the clip counter indicates “0”. As a result, the replacement color generation unit 2302 outputs the 4 × 4 pixel data shown in FIG. 28 as the replacement color (b), and outputs the clip counter value “0” as the clip count value (b). .

セレクタ2304では図28で示される置換色(b)の画素のうち、図25に示される識別情報の”0”に対応する画素、及び、図24で示される多値画像の画素のうち、上記識別情報が”1”に対応する画素を選択し、出力する。この結果、セレクタ2302から出力される階調情報(b)は図29に示されるようになる。図示に示すように、非文字・線画として判定された位置の画素値は、文字・線画の画素値とほぼ同じ値になる。   In the selector 2304, among the pixels of the replacement color (b) shown in FIG. 28, among the pixels corresponding to the identification information “0” shown in FIG. 25 and the pixels of the multivalued image shown in FIG. A pixel corresponding to identification information “1” is selected and output. As a result, the gradation information (b) output from the selector 2302 is as shown in FIG. As shown in the drawing, the pixel value at the position determined as a non-character / line drawing is almost the same as the pixel value of the character / line drawing.

比較部2303は1ブロックの処理画終了した時点で上記置換色生成部2301から出力されたクリップカウント値(a)と、上記置換色生成部2302から出力されたクリップカウント値(b)を比較する。そして、比較部2303はクリップカウント値(a)がクリップカウント値(b)と同じ、もしくは小さい場合は”0”を、それ以外は”1”を、判定信号SELとして出力する。   The comparison unit 2303 compares the clip count value (a) output from the replacement color generation unit 2301 with the clip count value (b) output from the replacement color generation unit 2302 at the end of processing of one block. . Then, the comparison unit 2303 outputs “0” as the determination signal SEL when the clip count value (a) is the same as or smaller than the clip count value (b), and “1” otherwise.

そして、セレクタ2305は、図示していないブロックバッファを有し、上記比較部2303の判定信号に同期して上記SEL信号が”0”の時はセレクタ208から入力された階調情報(a)を選択し、出力する。一方、セレクタ2305は、上記SEL信号が”1”の時はセレクタ2304から入力された階調情報(b)を選択し、出力する。つまり、セレクタ2305では、クリップした画素数の少ない方の階調情報を選択するのである。   The selector 2305 has a block buffer (not shown). When the SEL signal is “0” in synchronization with the determination signal of the comparator 2303, the gradation information (a) input from the selector 208 is received. Select and output. On the other hand, the selector 2305 selects and outputs the gradation information (b) input from the selector 2304 when the SEL signal is “1”. That is, the selector 2305 selects the gradation information with the smaller number of clipped pixels.

セレクタ2305から出力された上記階調情報は、符号化部211にて、第1の実施形態と同様の圧縮方法で圧縮(非可逆符号化)される。また、抽出部204から出力される識別情報と平均差分値生成部206から出力される平均差分値は、それぞれ、符号化部209、符号化部210にて、第1の実施形態と同様の圧縮方法で圧縮(可逆符号化)される。   The gradation information output from the selector 2305 is compressed (lossy encoded) by the encoding unit 211 using the same compression method as in the first embodiment. Further, the identification information output from the extraction unit 204 and the average difference value output from the average difference value generation unit 206 are compressed by the encoding unit 209 and the encoding unit 210, respectively, in the same manner as in the first embodiment. It is compressed (lossless encoding) by the method.

多重化部2306は、上記符号化部209、符号化部210、符号化部211で圧縮された符号化データと、上記符号化部211で符号化された階調情報のタイプ(階調情報(a)または階調情報(b))を複合部に知らせるための上記SEL信号(選択情報)を後段のメモリに格納しやすいように結合し、それを出力端子252より出力する。   The multiplexing unit 2306 includes the encoded data compressed by the encoding unit 209, the encoding unit 210, and the encoding unit 211, and the type of gradation information encoded by the encoding unit 211 (gradation information ( The above SEL signal (selection information) for notifying the composite unit of a) or gradation information (b)) is combined so as to be easily stored in the subsequent memory, and is output from the output terminal 252.

なお、上記SEL信号の代わりに平均差分値にサインビットを追加し、上記SEL信号が”1”のときに上記平均差分値を負の値としてメモリに格納するようにしても良い。この場合、復号時には上記SEL信号によって復号方法を切り替えるのではなく、識別情報が”1”となっている画素に上記平均差分値を加算することで、画像の復元ができる。なお、上記場合においては、必ずしも、
識別情報“1”の画素値>識別情報”0”の画素値
となるとは限らないことに注意されたい(上記平均差分値を負の場合は上記関係が逆になる)。
A sign bit may be added to the average difference value instead of the SEL signal, and the average difference value may be stored in the memory as a negative value when the SEL signal is “1”. In this case, at the time of decoding, the decoding method is not switched by the SEL signal, but the image can be restored by adding the average difference value to the pixels whose identification information is “1”. In the above case, it is not always necessary
Note that the pixel value of the identification information “1” is not necessarily greater than the pixel value of the identification information “0” (the relationship is reversed when the average difference value is negative).

以上、説明したように本第3の実施形態によれば、置換操作によるクリップの発生が殆どなくなるので、階調つぶれのない画像を復元することができる。   As described above, according to the third embodiment, since the occurrence of clipping due to the replacement operation is almost eliminated, it is possible to restore an image with no gradation collapse.

なお、本第3の実施形態に対応する処理を、コンピュータプログラムでもって実現できることは明らかである。   Obviously, the processing corresponding to the third embodiment can be realized by a computer program.

また、第3の実施形態に第2の実施形態で示したローパスフィルタを適用しても同様の効果が得られることは言うまでもない。   It goes without saying that the same effect can be obtained even if the low-pass filter shown in the second embodiment is applied to the third embodiment.

<第4の実施形態>
第3の実施形態においては差分値の識別(選択)信号が必要であった。本第4の実施形態では差分値の設定を工夫する(領域1の最小値が負にならないようにする)ことにより、上記識別(選択)信号なしに前記置換後の画素値が負になってしまう問題点を解消する。
<Fourth Embodiment>
In the third embodiment, a difference value identification (selection) signal is required. In the fourth embodiment, the pixel value after the replacement becomes negative without the identification (selection) signal by devising the setting of the difference value (so that the minimum value of the region 1 does not become negative). To solve the problem.

図30に第4の実施形態における符号化装置のブロック構成図を示す。   FIG. 30 shows a block configuration diagram of an encoding apparatus according to the fourth embodiment.

図30の第4の実施形態の構成は、第1の実施形態である図1の構成に対し、平均差分値置換部2301を追加した点が異なり、それ以外の部分については前記第1の実施形態と同様である。以下、前記第1の実施形態と異なる部分のみ説明する。   The configuration of the fourth embodiment in FIG. 30 is different from the configuration of FIG. 1 in the first embodiment in that an average difference value replacement unit 2301 is added, and the other portions are the same as those in the first embodiment. It is the same as the form. Only the parts different from the first embodiment will be described below.

平均差分値置換部2301は、バッファ203から出力されたブロック内の、抽出部204から出力された識別情報の”1”に対応する画素の最小値と、平均差分値生成部206から出力された差分値とを比較し、いずれか小さい方の値を選択し、出力する。以下、この平均差分値置換部2301で選択出力する値を補正値という。   The average difference value replacement unit 2301 outputs the minimum value of the pixel corresponding to “1” of the identification information output from the extraction unit 204 in the block output from the buffer 203 and the average difference value generation unit 206. The difference value is compared, and the smaller value is selected and output. Hereinafter, the value selected and output by the average difference value replacement unit 2301 is referred to as a correction value.

以下、上記平均差分値置換部2301の詳細を説明する。   Details of the average difference value replacement unit 2301 will be described below.

図31は上記平均差分値置換部2301のブロック構成図である。   FIG. 31 is a block diagram of the average difference value replacement unit 2301.

最小値検出部2401は、バッファ203から出力されたブロック内の各多値画像の画素データを入力し、抽出部204から出力された識別情報の”1”に対応する上記画素データの最小値を出力する。そして比較部2402では、上記最小値と平均差分値生成部206から出力された差分値とを比較して、上記差分値が上記最小値よりも小さい場合は”0”を、それ以外の場合には”1”を、選択信号として出力する。そして、選択部2403は上記選択信号に基づき、上記多値画像の最小画素値と上記差分値のいずれか小さい方を選択し、その選択した値を補正値として出力する。   The minimum value detection unit 2401 receives the pixel data of each multi-value image in the block output from the buffer 203, and determines the minimum value of the pixel data corresponding to “1” of the identification information output from the extraction unit 204. Output. The comparison unit 2402 compares the minimum value with the difference value output from the average difference value generation unit 206. If the difference value is smaller than the minimum value, the comparison unit 2402 sets “0”, otherwise Outputs “1” as a selection signal. Based on the selection signal, the selection unit 2403 selects a smaller one of the minimum pixel value and the difference value of the multi-valued image, and outputs the selected value as a correction value.

次に平均差分値置換部2301の動作を説明する。入力される多値画像が図24で示される4×4画素ブロックの画素データとした場合、差分値(D)は“200”、識別情報は図25で示されるようになる。   Next, the operation of the average difference value replacement unit 2301 will be described. When the input multi-value image is the pixel data of the 4 × 4 pixel block shown in FIG. 24, the difference value (D) is “200” and the identification information is as shown in FIG.

この時、上記識別情報が“1”に対応する画素データの最小値は“104”であり、上記最小値と、差分値(D)とを比較すると上記最小値の方が小さい。従って、平均差分値置換部2301は、比較結果の小さい上記最小値“104”を補正値として出力する。   At this time, the minimum value of the pixel data corresponding to the identification information “1” is “104”, and the minimum value is smaller when the minimum value is compared with the difference value (D). Therefore, the average difference value replacement unit 2301 outputs the minimum value “104” having a small comparison result as a correction value.

これ以降は、第1の実施形態と同様に処理する。但し、置換色生成部207は、上記バッファ203から出力されたブロック内の各多値画像の画素データから、上記平均差分値生成部206から出力された置換値を減算する。このとき、減算した結果が負となっても構わない。なぜなら、負となった場合、セレクタ208はその値を選択しないからである。   Subsequent processing is the same as in the first embodiment. However, the replacement color generation unit 207 subtracts the replacement value output from the average difference value generation unit 206 from the pixel data of each multi-valued image in the block output from the buffer 203. At this time, the result of subtraction may be negative. This is because when it becomes negative, the selector 208 does not select the value.

図32は第4の実施形態の効果を説明する図である。   FIG. 32 is a diagram for explaining the effect of the fourth embodiment.

図32(A)は入力波形で、ここでは8×1の1次元のブロックであるとする。この波形(ブロック)を閾値(例えばブロック平均値)にて領域分解され識別情報が生成される(同図(B))。そして識別情報を用いて領域毎の平均値を求めて(同図(C))、得られた仮平均差分値と、”1”領域の最小値となる画素データとを比較して、値が小さい方を平均差分値として(同図(D))、上記入力波形から減算する。減算結果は、同図(E)に示すように、負となる画素が存在しない。そのため、圧縮・伸張後(同図(F))に平均差分を加算し、復元した出力波形(図(G))のように、階調性が失われてしまうことがない。   FIG. 32A shows an input waveform, which is an 8 × 1 one-dimensional block here. The waveform (block) is subjected to region decomposition with a threshold value (for example, block average value) to generate identification information ((B) in the figure). Then, the average value for each area is obtained using the identification information ((C) in the figure), and the obtained temporary average difference value is compared with the pixel data that is the minimum value of the “1” area. The smaller one is used as an average difference value ((D) in the figure) and subtracted from the input waveform. As a result of the subtraction, there is no negative pixel as shown in FIG. Therefore, the gradation is not lost as in the output waveform (FIG. (G)) restored by adding the average difference after compression / expansion (FIG. (F)).

以上の説明では、識別情報の”1”の画素値から補正値を減じる例を説明したが、識別情報が“0”の画素値に補正値を加算するようにしても構わない。後者の場合、平均差分値置換部2301は、バッファ203から出力されたブロック内の、抽出部204から出力された識別情報の“0”に対応する画素の最大画素値を求める。そして、平均差分値置換部2301は、その最大画素値と画素値の取り得る上限値(実施形態では“255”)の差分と、平均差分値生成部206から出力された平均差分値とを比較し、いずれか小さい方を、補正値として出力する。置換色生成部207は、上記バッファ203から出力されたブロック内の各多値画像の画素データに、上記平均差分値生成部206から出力された置換値を加算する。このとき、加算した値が上限値を超えても構わない。なぜなら、上限値を超えた場合、セレクタ208はその値を選択しないからである。   In the above description, the correction value is subtracted from the pixel value “1” of the identification information. However, the correction value may be added to the pixel value of the identification information “0”. In the latter case, the average difference value replacement unit 2301 obtains the maximum pixel value of the pixel corresponding to “0” of the identification information output from the extraction unit 204 in the block output from the buffer 203. Then, the average difference value replacement unit 2301 compares the difference between the maximum pixel value and the upper limit value (“255” in the embodiment) that the pixel value can take with the average difference value output from the average difference value generation unit 206. Then, the smaller one is output as a correction value. The replacement color generation unit 207 adds the replacement value output from the average difference value generation unit 206 to the pixel data of each multi-valued image in the block output from the buffer 203. At this time, the added value may exceed the upper limit value. This is because when the upper limit value is exceeded, the selector 208 does not select that value.

以上、説明したように本第4の実施形態によれば、置換操作によるクリップが発生しないので、階調つぶれのない画像を復元することができる。   As described above, according to the fourth embodiment, no clip is generated due to the replacement operation, so that an image without gradation collapse can be restored.

なお、本第4の実施形態に対応する処理を、コンピュータプログラムでもって実現できることは明らかである。   Obviously, the processing corresponding to the fourth embodiment can be realized by a computer program.

また、第4の実施形態に第2の実施形態で示したローパスフィルタを適用しても同様の効果が得られることは言うまでもない。   It goes without saying that the same effect can be obtained even if the low-pass filter shown in the second embodiment is applied to the fourth embodiment.

なお、上記各実施形態では説明を容易にするためブロックのサイズを4×4(または8×1)で説明していたが、通常は階調情報を圧縮する符号化(例えば直交変換のサイズ)に合わせるほうが望ましい。例えば、JPEGを用いる場合は、DCTのブロックサイズ(8×8)の整数倍が良い。例えば、8×16画素を1ブロックとするなら、このブロックには8×8画素が2つ存在することになる。従って、符号化部211はDCT変換、量子化、エントロピー符号化処理を2つの8×8画素ブロックに対して行なえば良い。   In each of the above embodiments, the block size is described as 4 × 4 (or 8 × 1) for ease of explanation, but normally encoding for compressing gradation information (eg, orthogonal transform size). It is more desirable to match. For example, when JPEG is used, an integer multiple of the DCT block size (8 × 8) is preferable. For example, if 8 × 16 pixels are one block, there are two 8 × 8 pixels in this block. Therefore, the encoding unit 211 may perform DCT transform, quantization, and entropy encoding processing on two 8 × 8 pixel blocks.

また、第1の実施形態の変形例の如く、本発明はコンピュータプログラムによっても実現できる。通常、コンピュータプログラムは、CD−ROM等のコンピュータ可読記憶媒体に格納されている。そして、その媒体を、コンピュータの読取り装置(CD−ROMドライブ等)にセットし、システムにコピーもしくはインストールすることで、実行可能になる。従って、かかるコンピュータ可読記憶媒体も本発明の範疇に入るのは明らかである。   Further, as in the modification of the first embodiment, the present invention can be realized by a computer program. Usually, the computer program is stored in a computer-readable storage medium such as a CD-ROM. The medium can be executed by setting it in a computer reader (CD-ROM drive or the like) and copying or installing it in the system. Therefore, it is obvious that such a computer readable storage medium falls within the scope of the present invention.

第1の実施形態における符号化装置のブロック構成図である。It is a block block diagram of the encoding apparatus in 1st Embodiment. 第1の実施形態における閾値TH0を“200”とした場合の、4×4画素ブロックの識別情報を示す図である。It is a figure which shows the identification information of a 4x4 pixel block when threshold value TH0 in 1st Embodiment is set to "200". 図1の平均差分値生成部のブロック構成図である。It is a block block diagram of the average difference value production | generation part of FIG. 図3の“1”領域平均値生成部のブロック構成図である。It is a block block diagram of the "1" area average value generation part of FIG. 図1の置換色生成部の出力値例を示す図である。It is a figure which shows the example of an output value of the replacement color production | generation part of FIG. 図1のセレクタの出力例を示す図である。It is a figure which shows the example of an output of the selector of FIG. 第1の実施形態における画像復元装置のブロック構成図である。It is a block block diagram of the image restoration apparatus in 1st Embodiment. 図7の画像復元部に入力される4×4画素ブロックの階調情報の例を示す図である。It is a figure which shows the example of the gradation information of the 4x4 pixel block input into the image restoration part of FIG. 図7の画像復元装置で復元された4×4画素ブロックの画素データの例を示す図である。FIG. 8 is a diagram illustrating an example of pixel data of a 4 × 4 pixel block restored by the image restoration apparatus in FIG. 7. 第2の実施形態における符号化装置のブロック構成図である。It is a block block diagram of the encoding apparatus in 2nd Embodiment. 第2の実施形態の動作を説明するための波形例である。It is an example of a waveform for explaining operation of a 2nd embodiment. 従来技術における符号化対象の画素ブロックの例を示す図である。It is a figure which shows the example of the pixel block of the encoding target in a prior art. 図12の従来技術における識別情報を示す図である。It is a figure which shows the identification information in the prior art of FIG. 従来技術における画素置換後の階調情報の例を示す図である。It is a figure which shows the example of the gradation information after the pixel replacement in a prior art. 実施形態における符号化対象の画素ブロックの例を示す図である。It is a figure which shows the example of the pixel block of the encoding object in embodiment. 従来技術の問題点を説明するための図である。It is a figure for demonstrating the problem of a prior art. 従来技術の問題点を説明するための図である。It is a figure for demonstrating the problem of a prior art. 実施形態における符号化装置で生成される符号化データのデータ構造を示す図である。It is a figure which shows the data structure of the encoding data produced | generated with the encoding apparatus in embodiment. 第1の実施形態の変形例における装置のブロック構成図である。It is a block block diagram of the apparatus in the modification of 1st Embodiment. 図19の装置の符号化処理手順を示すフローチャートである。It is a flowchart which shows the encoding process sequence of the apparatus of FIG. 図19の装置の復号処理手順を示すフローチャートである。It is a flowchart which shows the decoding processing procedure of the apparatus of FIG. 置換処理による不具合を説明するための図である。It is a figure for demonstrating the malfunction by a replacement process. 第3の実施形態における符号化装置のブロック図である。It is a block diagram of the encoding apparatus in 3rd Embodiment. 図23の置換色生成部に入力される4×4画素ブロックの画素データの例を示す図である。It is a figure which shows the example of the pixel data of a 4x4 pixel block input into the replacement color production | generation part of FIG. 図23の置換色生成部に入力される4×4画素ブロックの識別情報の例を示す図である。It is a figure which shows the example of the identification information of a 4x4 pixel block input into the replacement color production | generation part of FIG. 図23の第1の置換色生成部から出力される4×4画素ブロックの置換色の例を示す図である。It is a figure which shows the example of the replacement color of a 4x4 pixel block output from the 1st replacement color production | generation part of FIG. 図23の第1のセレクタから出力される4×4画素ブロックの階調情報の例を示す図である。FIG. 24 is a diagram illustrating an example of gradation information of a 4 × 4 pixel block output from the first selector of FIG. 23. 図23の第2の置換色生成部から出力される4×4画素ブロックの置換色の例を示す図である。It is a figure which shows the example of the replacement color of a 4x4 pixel block output from the 2nd replacement color production | generation part of FIG. 図23の第2のセレクタから出力される4×4画素ブロックの階調情報の例を示す図である。It is a figure which shows the example of the gradation information of the 4x4 pixel block output from the 2nd selector of FIG. 第4の実施形態における符号化装置のブロック図である。It is a block diagram of the encoding apparatus in 4th Embodiment. 図30の平均差分値置換部の例を示すブロック図である。It is a block diagram which shows the example of the average difference value replacement part of FIG. 第4の実施形態における符号化装置の効果を示す図である。It is a figure which shows the effect of the encoding apparatus in 4th Embodiment.

Claims (20)

多値画像データを、複数の画素で構成されるブロック単位に入力する入力手段と、
前記入力したブロック内の各画素を、該各画素の値に応じて第1及び第2のグループに分類すると共に、各画素がいずれのグループに属するかを識別する識別情報を生成する識別情報生成手段と、
前記第1のグループに属する画素の値の平均値、前記第2のグループに属する画素の値の平均値、及び、該2つの平均値の差分値を算出する算出手段と、
前記第1のグループの平均値と前記第2のグループの平均値との差が小さくなるように、前記第1のグループに属する各画素の値に前記差分値を加算、又は前記第1のグループに属する各画素の値から前記差分値を減算することにより、前記第1のグループに属する画素の値を置換する置換手段と、
置換後のブロック内の各画素の値と、前記差分値と、前記識別情報とを符号化し、着目ブロックの符号化データを出力する符号化手段と
を備えることを特徴とする画像符号化装置。
Input means for inputting multi-valued image data in units of blocks composed of a plurality of pixels;
Identification information generation for classifying each pixel in the input block into first and second groups according to the value of each pixel and generating identification information identifying which group each pixel belongs to Means,
Calculating means for calculating an average value of the pixels belonging to the first group, an average value of the pixels belonging to the second group, and a difference value between the two average values;
The difference value is added to the value of each pixel belonging to the first group so that the difference between the average value of the first group and the average value of the second group becomes small, or the first group Substituting means for substituting the value of pixels belonging to the first group by subtracting the difference value from the value of each pixel belonging to
An image encoding apparatus comprising: encoding means for encoding the value of each pixel in the block after replacement, the difference value, and the identification information, and outputting encoded data of the block of interest.
前記置換手段は、置換後の着目画素の値が、当該画素の取り得る範囲の上限値を上回る場合には前記上限値、前記画素の取り得る範囲の下限値を下回る場合には前記下限値に設定することを特徴とする請求項1に記載の画像符号化装置。   The replacement means sets the upper limit value when the value of the pixel of interest after replacement exceeds the upper limit value of the range that the pixel can take, and sets the lower limit value when the value is lower than the lower limit value of the range that the pixel can take. The image encoding device according to claim 1, wherein the image encoding device is set. 更に、前記置換手段で置換したブロックに対し、ローパスフィルタ処理を実行するローパスフィルタ処理手段を備え、
前記符号化手段は、前記ローパスフィルタ処理後のブロック内の画素値を符号化することを特徴とする請求項1又は2に記載の画像符号化装置。
Furthermore, it comprises low pass filter processing means for executing low pass filter processing on the block replaced by the replacement means,
The image encoding apparatus according to claim 1, wherein the encoding unit encodes a pixel value in the block after the low-pass filter processing.
前記符号化手段は、前記差分値、及び、前記識別情報については可逆符号化することを特徴とする請求項1乃至3のいずれか1項に記載の画像符号化装置。   The image encoding apparatus according to claim 1, wherein the encoding unit performs lossless encoding on the difference value and the identification information. 前記符号化手段は、前記置換手段で置換した後のブロック内の各画素の値を、非可逆符号化することを特徴とする請求項4に記載の画像符号化装置。   5. The image encoding apparatus according to claim 4, wherein the encoding unit performs lossy encoding on the value of each pixel in the block after being replaced by the replacement unit. 前記入力手段の入力単位のブロックのサイズが、前記符号化手段で非可逆符号化するブロックのサイズの整数倍であることを特徴とする請求項5に記載の画像符号化装置。   6. The image encoding apparatus according to claim 5, wherein the size of the input unit block of the input unit is an integral multiple of the size of the block to be lossy encoded by the encoding unit. 更に、前記算出手段で算出される差分値の絶対値が、予め設定された閾値以下であるか否かを判断する判断手段と、
該判断手段で前記差分値の絶対値が前記閾値以下であると判断した場合、前記置換手段による置換を行なわず、前記符号化手段に代わって、前記入力手段で入力したブロック内の画素を符号化し出力する第2の符号化手段とを備えることを特徴とする請求項1乃至6のいずれか1項に記載の画像符号化装置。
A determination unit that determines whether an absolute value of the difference value calculated by the calculation unit is equal to or less than a preset threshold value;
When the determination means determines that the absolute value of the difference value is equal to or less than the threshold value, the replacement means is not replaced, and the pixels in the block input by the input means are encoded instead of the encoding means. 7. The image encoding apparatus according to claim 1, further comprising: a second encoding unit configured to generate and output.
コンピュータが読み込み実行することで、前記コンピュータを、請求項1乃至7のいずれか1項に記載の画像符号化装置の各手段として機能させることを特徴とするコンピュータプログラム。   A computer program that causes a computer to function as each unit of the image encoding device according to any one of claims 1 to 7 when the computer reads and executes the computer program. 請求項8に記載のコンピュータプログラムを格納したことを特徴とするコンピュータ可読記憶媒体。   A computer-readable storage medium storing the computer program according to claim 8. 画像符号化装置の制御方法であって、
入力手段が、多値画像データを、複数の画素で構成されるブロック単位に入力する入力工程と、
識別情報生成手段が、前記入力したブロック内の各画素を、該各画素の値に応じて第1及び第2のグループに分類すると共に、各画素がいずれのグループに属するかを識別する識別情報を生成する識別情報生成工程と、
算出手段が、前記第1のグループに属する画素の値の平均値、前記第2のグループに属する画素の値の平均値、及び、該2つの平均値の差分値を算出する算出工程と、
置換手段が、前記第1のグループの平均値と前記第2のグループの平均値との差が小さくなるように、前記第1のグループに属する各画素の値に前記差分値を加算、又は前記第1のグループに属する各画素の値から前記差分値を減算することにより、前記第1のグループに属する画素の値を置換する置換工程と、
符号化手段が、置換後のブロック内の各画素の値と、前記差分値と、前記識別情報とを符号化し、着目ブロックの符号化データを出力する符号化工程と
を有することを特徴とする画像符号化装置の制御方法。
A control method for an image encoding device, comprising:
An input step in which the input means inputs multi-value image data in units of blocks composed of a plurality of pixels;
The identification information generating means classifies each pixel in the input block into the first and second groups according to the value of each pixel and identifies which group each pixel belongs to An identification information generation step for generating
A calculating step in which the calculating means calculates an average value of the values of the pixels belonging to the first group, an average value of the values of the pixels belonging to the second group, and a difference value between the two average values;
The replacement means adds the difference value to the value of each pixel belonging to the first group so that the difference between the average value of the first group and the average value of the second group becomes small, or A replacement step of substituting the value of the pixels belonging to the first group by subtracting the difference value from the value of each pixel belonging to the first group;
The encoding means includes an encoding step of encoding the value of each pixel in the replaced block, the difference value, and the identification information, and outputting encoded data of the block of interest. A control method of an image encoding device.
多値画像データを複数の画素で構成されるブロック単位に入力する入力手段と、
前記入力したブロック内の各画素を、該各画素の値に応じて第1及び第2のグループに分類すると共に、各画素がいずれのグループに属するかを識別する識別情報を生成する識別情報生成手段と、
前記第1のグループに属する画素の値の平均値、前記第2のグループに属する画素の値の平均値、及び、該2つの平均値の差分値を算出する算出手段と、
前記第1のグループの平均値と前記第2のグループの平均値との差が小さくなるように、前記第1のグループに属する各画素の値に前記差分値を加算し、前記第1のグループに属する各画素の値を置換したブロックを生成する第1の置換手段と、
前記第2のグループに属する各画素の値から前記差分値を減算し、前記第2のグループに属する各画素の値を置換したブロックを生成する第2の置換手段と、
前記第1の置換手段から出力されたブロックと前記第2の置換手段から出力されたブロックのいずれかを選択する選択手段と、
前記選択手段で選択されたブロック内に含まれる各画素の値と、前記差分値と、前記識別情報と、前記選択手段がいずれのブロックを選択したのかを示す選択情報とを符号化し、着目ブロックの符号化データを出力する符号化手段と
を備えることを特徴とする画像符号化装置。
Input means for inputting multi-value image data in units of blocks composed of a plurality of pixels;
Identification information generation for classifying each pixel in the input block into first and second groups according to the value of each pixel and generating identification information identifying which group each pixel belongs to Means,
Calculating means for calculating an average value of the pixels belonging to the first group, an average value of the pixels belonging to the second group, and a difference value between the two average values;
The difference value is added to the value of each pixel belonging to the first group so that the difference between the average value of the first group and the average value of the second group becomes small, and the first group First replacement means for generating a block in which the value of each pixel belonging to is replaced;
Second replacement means for generating a block by subtracting the difference value from the value of each pixel belonging to the second group and replacing the value of each pixel belonging to the second group;
Selecting means for selecting either the block output from the first replacement means or the block output from the second replacement means;
The block of interest is encoded by encoding a value of each pixel included in the block selected by the selection unit, the difference value, the identification information, and selection information indicating which block the selection unit has selected. An image encoding device comprising: encoding means for outputting the encoded data.
前記第1の置換手段、前記第2の置換手段それぞれは、置換後の着目画素の値が当該画素の取り得る範囲の上限値を上回る場合には前記上限値、置換後の着目画素の値が当該画素の取り得る範囲の下限値を下回る場合には前記下限値を、置換後の画素値として設定することを特徴とする請求項11に記載の画像符号化装置。 Each of the first replacement means and the second replacement means is configured such that the upper limit value and the value of the pixel of interest after replacement are set when the value of the pixel of interest after replacement exceeds the upper limit value of the range that the pixel can take. 12. The image encoding device according to claim 11 , wherein when the pixel value falls below a lower limit value of a possible range of the pixel, the lower limit value is set as a pixel value after replacement. 前記選択手段は、
前記着目ブロックの前記第1のグループに属する各画素の値を置換した後の画素の値が当該画素の取り得る範囲を超える画素数をカウントする第1のカウント手段と、
前記着目ブロックの前記第2のグループに属する各画素の値を置換した後の画素の値が当該画素の取り得る範囲を超える画素数をカウントする第2のカウント手段とを有し、
前記第1のカウント手段によるカウントした値が、前記第2のカウント手段によるカウントした値と等しいか、小さい場合には、前記第1の置換手段から出力されたブロックを選択し、それ以外の場合には、前記第2の置換手段から出力されたブロックを選択する
ことを特徴とする請求項12に記載の画像符号化装置。
The selection means includes
First counting means for counting the number of pixels in which the value of the pixel after replacing the value of each pixel belonging to the first group of the block of interest exceeds a possible range of the pixel;
Second counting means for counting the number of pixels in which the value of the pixel after replacing the value of each pixel belonging to the second group of the block of interest exceeds a possible range of the pixel;
If the value counted by the first counting means is equal to or smaller than the value counted by the second counting means, the block output from the first replacing means is selected, otherwise The image encoding apparatus according to claim 12 , wherein the block output from the second replacement unit is selected.
画像符号化装置の制御方法であって、
入力手段が、多値画像データを複数の画素で構成されるブロック単位に入力する入力工程と、
識別情報生成手段が、前記入力したブロック内の各画素を、該各画素の値に応じて第1及び第2のグループに分類すると共に、各画素がいずれのグループに属するかを識別する識別情報を生成する識別情報生成工程と、
算出手段が、前記第1のグループに属する画素の値の平均値、前記第2のグループに属する画素の値の平均値、及び、該2つの平均値の差分値を算出する算出工程と、
第1の置換手段が、前記第1のグループの平均値と前記第2のグループの平均値との差が小さくなるように、前記第1のグループに属する各画素の値に前記差分値を加算し、前記第1のグループに属する各画素の値を置換したブロックを生成する第1の置換工程と、
第2の置換手段が、前記第2のグループに属する各画素の値から前記差分値を減算し、前記第2のグループに属する各画素の値を置換したブロックを生成する第2の置換工程と、
選択手段が、前記第1の置換工程で出力されたブロックと前記第2の置換工程で出力されたブロックのいずれかを選択する選択工程と、
符号化手段が、前記選択工程で選択されたブロック内に含まれる各画素の値と、前記差分値と、前記識別情報と、前記選択工程でいずれのブロックを選択したのかを示す選択情報とを符号化し、着目ブロックの符号化データを出力する符号化工程と
を有することを特徴とする画像符号化装置の制御方法。
A control method for an image encoding device, comprising:
An input step in which the input means inputs multi-valued image data in units of blocks composed of a plurality of pixels;
The identification information generating means classifies each pixel in the input block into the first and second groups according to the value of each pixel and identifies which group each pixel belongs to An identification information generation step for generating
A calculating step in which the calculating means calculates an average value of the values of the pixels belonging to the first group, an average value of the values of the pixels belonging to the second group, and a difference value between the two average values;
The first replacement means adds the difference value to the value of each pixel belonging to the first group so that a difference between the average value of the first group and the average value of the second group becomes small. A first replacement step of generating a block in which the values of the pixels belonging to the first group are replaced;
A second replacement step in which a second replacement means subtracts the difference value from the value of each pixel belonging to the second group and generates a block in which the value of each pixel belonging to the second group is replaced; ,
A selection step in which the selection means selects either the block output in the first replacement step or the block output in the second replacement step;
The encoding means includes a value of each pixel included in the block selected in the selection step, the difference value, the identification information, and selection information indicating which block is selected in the selection step. And a coding process for coding and outputting the coded data of the block of interest.
多値画像データを、複数の画素で構成されるブロック単位に入力する入力手段と、
前記入力したブロック内の各画素を、該各画素の値に応じて、
第1のグループに属する画素の値 > 第2のグループに属する画素の値
となるように分類し、各画素がいずれのグループに属するかを識別する識別情報を生成する識別情報生成手段と、
前記第1のグループに属する画素の値の平均値、前記第2のグループに属する画素の値の平均値、及び、該2つの平均値の差分値を算出する算出手段と、
前記差分値と、前記第1のグループに属する画素の最小画素値とを比較し、小さい方を補正値として出力する比較手段と、
前記第1のグループの平均値と前記第2のグループの平均値との差が小さくなるように、前記第1のグループに属する各画素の値から、前記比較手段によって得られた前記補正値を減算し、前記第1のグループに属する画素の値を置換したブロックを生成する置換手段と、
置換後のブロック内の各画素の値と、前記補正値と、前記識別情報とを符号化し、着目ブロックの符号化データを出力する符号化手段と
を備えることを特徴とする画像符号化装置。
Input means for inputting multi-valued image data in units of blocks composed of a plurality of pixels;
According to the value of each pixel, each pixel in the input block is
Classification information generating means for generating identification information for classifying each pixel to belong to a group value of pixels belonging to the first group> a value of pixels belonging to the second group;
Calculating means for calculating an average value of the pixels belonging to the first group, an average value of the pixels belonging to the second group, and a difference value between the two average values;
Comparing means for comparing the difference value with a minimum pixel value of pixels belonging to the first group and outputting the smaller one as a correction value;
The correction value obtained by the comparing means is calculated from the value of each pixel belonging to the first group so that the difference between the average value of the first group and the average value of the second group becomes small. A substituting means for subtracting and generating a block in which the values of the pixels belonging to the first group are replaced;
An image encoding apparatus comprising: encoding means for encoding the value of each pixel in the block after replacement, the correction value, and the identification information, and outputting encoded data of the block of interest.
画像符号化装置の制御方法であって、
入力手段が、多値画像データを、複数の画素で構成されるブロック単位に入力する入力工程と、
識別情報生成手段が、前記入力したブロック内の各画素を、該各画素の値に応じて、
第1のグループに属する画素の値 > 第2のグループに属する画素の値
となるように分類し、各画素がいずれのグループに属するかを識別する識別情報を生成する識別情報生成工程と、
算出手段が、前記第1のグループに属する画素の値の平均値、前記第2のグループに属する画素の値の平均値、及び、該2つの平均値の差分値を算出する算出工程と、
比較手段が、前記差分値と、前記第1のグループに属する画素の最小画素値とを比較し、小さい方を補正値として出力する比較工程と、
置換手段が、前記第1のグループの平均値と前記第2のグループの平均値との差が小さくなるように、前記第1のグループに属する各画素の値から、前記比較工程によって得られた前記補正値を減算し、前記第1のグループに属する画素の値を置換したブロックを生成する置換工程と、
符号化手段が、置換後のブロック内の各画素の値と、前記補正値と、前記識別情報とを符号化し、着目ブロックの符号化データを出力する符号化工程と
を有することを特徴とする画像符号化装置の制御方法。
A control method for an image encoding device, comprising:
An input step in which the input means inputs multi-value image data in units of blocks composed of a plurality of pixels;
The identification information generating means determines each pixel in the input block according to the value of each pixel.
An identification information generating step for classifying the pixel values to belong to the first group> the values of the pixels belonging to the second group, and generating identification information for identifying which group each pixel belongs to;
A calculating step in which the calculating means calculates an average value of the values of the pixels belonging to the first group, an average value of the values of the pixels belonging to the second group, and a difference value between the two average values;
A comparison step in which a comparison unit compares the difference value with a minimum pixel value of pixels belonging to the first group, and outputs a smaller one as a correction value;
The replacement means is obtained by the comparison step from the value of each pixel belonging to the first group so that the difference between the average value of the first group and the average value of the second group becomes small. A replacement step of subtracting the correction value to generate a block in which the values of the pixels belonging to the first group are replaced;
The encoding means includes an encoding step of encoding the value of each pixel in the replaced block, the correction value, and the identification information, and outputting encoded data of the block of interest. A control method of an image encoding device.
多値画像データを、複数の画素で構成されるブロック単位に入力する入力手段と、
前記入力したブロック内の各画素を、該各画素の値に応じて、
第1のグループに属する画素の値 > 第2のグループに属する画素の値
となるように分類し、各画素がいずれのグループに属するかを識別する識別情報を生成する識別情報生成手段と、
前記第1のグループに属する画素の値の平均値、前記第2のグループに属する画素の値の平均値、及び、該2つの平均値の差分値を算出する算出手段と、
前記差分値と、前記第2のグループに属する画素の最大画素値と画素値の取り得る上限値との差分値とを比較し、小さい方を補正値として出力する比較手段と、
前記第1のグループの平均値と前記第2のグループの平均値との差が小さくなるように、前記第2のグループに属する各画素の値に、前記比較手段によって得られた前記補正値を加算し、前記第2のグループに属する画素の値を置換したブロックを生成する置換手段と、
置換後のブロック内の各画素の値と、前記補正値と、前記識別情報とを符号化し、着目ブロックの符号化データを出力する符号化手段と
を備えることを特徴とする画像符号化装置。
Input means for inputting multi-valued image data in units of blocks composed of a plurality of pixels;
According to the value of each pixel, each pixel in the input block is
Classification information generating means for generating identification information for classifying each pixel to belong to a group value of pixels belonging to the first group> a value of pixels belonging to the second group;
Calculating means for calculating an average value of the pixels belonging to the first group, an average value of the pixels belonging to the second group, and a difference value between the two average values;
Comparing means for comparing the difference value with a difference value between a maximum pixel value of pixels belonging to the second group and an upper limit value that the pixel value can take, and outputting a smaller one as a correction value;
The correction value obtained by the comparison unit is added to the value of each pixel belonging to the second group so that the difference between the average value of the first group and the average value of the second group becomes small. A replacement means for adding and generating a block in which the values of the pixels belonging to the second group are replaced;
An image encoding apparatus comprising: encoding means for encoding the value of each pixel in the block after replacement, the correction value, and the identification information, and outputting encoded data of the block of interest.
コンピュータが読み込み実行することで、前記コンピュータを、請求項11乃至131517のいずれか1項に記載の画像符号化装置の各手段として機能させることを特徴とするコンピュータプログラム。 By computer executes read, the computer claims 11 to 13, 15, 17 a computer program for causing to function as each unit of the image coding apparatus according to any one of. 請求項18に記載のコンピュータプログラムを格納したことを特徴とするコンピュータ可読記憶媒体。 A computer readable storage medium storing the computer program according to claim 18 . 画像符号化装置の制御方法であって、
入力手段が、多値画像データを、複数の画素で構成されるブロック単位に入力する入力工程と、
識別情報生成手段が、前記入力したブロック内の各画素を、該各画素の値に応じて、
第1のグループに属する画素の値 > 第2のグループに属する画素の値
となるように分類し、各画素がいずれのグループに属するかを識別する識別情報を生成する識別情報生成工程と、
算出手段が、前記第1のグループに属する画素の値の平均値、前記第2のグループに属する画素の値の平均値、及び、該2つの平均値の差分値を算出する算出工程と、
比較手段が、前記差分値と、前記第2のグループに属する画素の最大画素値と画素値の取り得る上限値との差分値とを比較し、小さい方を補正値として出力する比較工程と、
置換手段が、前記第1のグループの平均値と前記第2のグループの平均値との差が小さくなるように、前記第2のグループに属する各画素の値に、前記比較工程で得られた前記補正値を加算し、前記第2のグループに属する画素の値を置換したブロックを生成する置換工程と、
符号化手段が、置換後のブロック内の各画素の値と、前記補正値と、前記識別情報とを符号化し、着目ブロックの符号化データを出力する符号化工程と
を有することを特徴とする画像符号化装置の制御方法。
A control method for an image encoding device, comprising:
An input step in which the input means inputs multi-value image data in units of blocks composed of a plurality of pixels;
The identification information generating means determines each pixel in the input block according to the value of each pixel.
An identification information generating step for classifying the pixel values to belong to the first group> the values of the pixels belonging to the second group, and generating identification information for identifying which group each pixel belongs to;
A calculating step in which the calculating means calculates an average value of the values of the pixels belonging to the first group, an average value of the values of the pixels belonging to the second group, and a difference value between the two average values;
A comparison step in which the comparison unit compares the difference value with a difference value between a maximum pixel value of pixels belonging to the second group and an upper limit value that the pixel value can take, and outputs a smaller value as a correction value;
The replacement means obtains the value of each pixel belonging to the second group in the comparison step so that the difference between the average value of the first group and the average value of the second group becomes small. A replacement step of adding the correction values and generating a block in which the values of the pixels belonging to the second group are replaced;
The encoding means includes an encoding step of encoding the value of each pixel in the replaced block, the correction value, and the identification information, and outputting encoded data of the block of interest. A control method of an image encoding device.
JP2007180157A 2006-08-08 2007-07-09 Image encoding apparatus, control method therefor, computer program, and computer-readable storage medium Expired - Fee Related JP4956304B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2007180157A JP4956304B2 (en) 2006-08-08 2007-07-09 Image encoding apparatus, control method therefor, computer program, and computer-readable storage medium
US11/835,099 US7903888B2 (en) 2006-08-08 2007-08-07 Image encoding apparatus and image decoding apparatus

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
JP2006216260 2006-08-08
JP2006216260 2006-08-08
JP2007148627 2007-06-04
JP2007148627 2007-06-04
JP2007180157A JP4956304B2 (en) 2006-08-08 2007-07-09 Image encoding apparatus, control method therefor, computer program, and computer-readable storage medium

Publications (3)

Publication Number Publication Date
JP2009017502A JP2009017502A (en) 2009-01-22
JP2009017502A5 JP2009017502A5 (en) 2010-07-22
JP4956304B2 true JP4956304B2 (en) 2012-06-20

Family

ID=40357778

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007180157A Expired - Fee Related JP4956304B2 (en) 2006-08-08 2007-07-09 Image encoding apparatus, control method therefor, computer program, and computer-readable storage medium

Country Status (1)

Country Link
JP (1) JP4956304B2 (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3337171A1 (en) 2009-10-22 2018-06-20 Thomson Licensing Methods and apparatus for dc intra prediction mode for video encoding and decoding
KR101529992B1 (en) * 2010-04-05 2015-06-18 삼성전자주식회사 Method and apparatus for video encoding for compensating pixel value of pixel group, method and apparatus for video decoding for the same
EP2636218B1 (en) 2010-11-04 2021-06-30 GE Video Compression, LLC Picture coding supporting block merging and skip mode
KR102036175B1 (en) 2011-11-11 2019-10-24 지이 비디오 컴프레션, 엘엘씨 Adaptive partition coding
EP4161078A1 (en) 2011-11-11 2023-04-05 GE Video Compression, LLC Effective wedgelet partition coding using spatial prediction
BR112014011413B1 (en) 2011-11-11 2023-03-28 Ge Video Compression, Llc EFFECTIVE PREDICTION USING PARTITION CODING
EP2777286B1 (en) 2011-11-11 2017-01-04 GE Video Compression, LLC Effective wedgelet partition coding
EP2941891B1 (en) 2013-01-04 2020-09-16 GE Video Compression, LLC Efficient scalable coding concept
JP6158576B2 (en) * 2013-04-24 2017-07-05 株式会社ドクターネット Image compression apparatus, image decompression apparatus, image compression program, image decompression program, and data structure
CN116055722B (en) * 2023-03-06 2023-06-16 山东梁山酿酒总厂有限公司 Data storage method for automatic white spirit production system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03125570A (en) * 1989-10-11 1991-05-28 Yamaha Corp Coding method for picture data
JP3231800B2 (en) * 1991-04-26 2001-11-26 キヤノン株式会社 Image encoding apparatus and image encoding method
JPH0951441A (en) * 1995-08-04 1997-02-18 Canon Inc Image processing unit
JPH09326024A (en) * 1996-06-06 1997-12-16 Matsushita Electric Ind Co Ltd Picture coding and decoding method and its device
JP2942222B2 (en) * 1997-08-11 1999-08-30 株式会社つくばソフト研究所 Communication device for color images and grayscale images
JP4174157B2 (en) * 2000-01-06 2008-10-29 キヤノン株式会社 Image processing apparatus, image processing method, and storage medium

Also Published As

Publication number Publication date
JP2009017502A (en) 2009-01-22

Similar Documents

Publication Publication Date Title
JP4956304B2 (en) Image encoding apparatus, control method therefor, computer program, and computer-readable storage medium
US7903888B2 (en) Image encoding apparatus and image decoding apparatus
JP5179889B2 (en) Method and apparatus for effectively compressing and restoring binary video
US8270716B2 (en) Selectively compressing picture and text areas of an image to maintain highest quality and effective compaction
US8229238B2 (en) Image encoding apparatus, image processing apparatus and control method thereof
US8213727B2 (en) Image encoding apparatus and image decoding apparatus, and control method thereof
US20060262982A1 (en) Image encoding apparatus and method, computer program, and computer-readable storage medium
US8452112B2 (en) Image encoding apparatus and method of controlling the same
US8041135B2 (en) Image encoding apparatus and control method thereof
US8244033B2 (en) Image encoding apparatus, image decoding apparatus, and control method thereof
JP5101962B2 (en) Image coding apparatus, control method therefor, and computer program
US8023756B2 (en) Image encoding apparatus and method of controlling same
JP5086777B2 (en) Image encoding apparatus, control method therefor, computer program, and computer-readable storage medium
JP4971881B2 (en) Image encoding apparatus, image decoding apparatus, and control method thereof
JP2009260747A (en) Image encoding device, and control method thereof
JP4139657B2 (en) Video signal encoding apparatus and decoding apparatus
JP4743884B2 (en) Image coding apparatus and control method thereof
JP4757172B2 (en) Image coding apparatus and control method thereof
JP4743883B2 (en) Image coding apparatus and control method thereof
JP4944833B2 (en) Image coding apparatus and control method thereof
JP5597028B2 (en) Image decoding apparatus, control method therefor, program, and computer-readable storage medium
JP4971880B2 (en) Image encoding apparatus, image decoding apparatus, and control method thereof
JP2012239033A (en) Image processing device, decoding device, and image processing method
JP2002199227A (en) Image compression method and device, recording medium
JP2008228229A (en) Image encoding apparatus and control method thereof

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100604

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100604

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20111125

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20111209

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120130

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

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

R151 Written notification of patent or utility model registration

Ref document number: 4956304

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

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

Free format text: PAYMENT UNTIL: 20150323

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees