JP4057610B2 - Encoding / decoding system and encoding / decoding method - Google Patents

Encoding / decoding system and encoding / decoding method Download PDF

Info

Publication number
JP4057610B2
JP4057610B2 JP2005308749A JP2005308749A JP4057610B2 JP 4057610 B2 JP4057610 B2 JP 4057610B2 JP 2005308749 A JP2005308749 A JP 2005308749A JP 2005308749 A JP2005308749 A JP 2005308749A JP 4057610 B2 JP4057610 B2 JP 4057610B2
Authority
JP
Japan
Prior art keywords
pixel block
pixel
value
image
decoding
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 - Lifetime
Application number
JP2005308749A
Other languages
Japanese (ja)
Other versions
JP2006121712A (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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2005308749A priority Critical patent/JP4057610B2/en
Publication of JP2006121712A publication Critical patent/JP2006121712A/en
Application granted granted Critical
Publication of JP4057610B2 publication Critical patent/JP4057610B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

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

Description

本発明は、符号化・復号化システム及び符号化・復号化方法に関する。 The present invention relates to an encoding / decoding system and an encoding / decoding method .

画像の高解像度化、多階調化は、ディジタル式の画像形成装置(以下、単に画像形成装置と記す)において高画質な画像を形成するために有効な手段である。ただし、画像の高解像度化、多階調化は、情報量の増加を伴う。例えば、白黒256階調で表される画像は、白黒2階調で表された画像の8倍の情報量を持つことになる。   Increasing the resolution and multi-gradation of an image is an effective means for forming a high-quality image in a digital image forming apparatus (hereinafter simply referred to as an image forming apparatus). However, increasing the resolution and multi-gradation of an image accompanies an increase in the amount of information. For example, an image represented by 256 gradations of black and white has an information amount eight times that of an image represented by two gradations of monochrome.

高画質化に伴って情報量が増大すると、処理時間が長くなり、情報の蓄積用により大きな容量のメモリが必要になる。このため、画像形成装置は、画像を表現する情報を符号化し、圧縮している。符号化には可逆符号化と非可逆符号化があり、可逆符号化は、符号化の前後で情報量が変化しない点で高画質化に有利である。一方、非可逆符号化は、符号化の前後で情報量の損失が起こるものの可逆符号化よりも高い圧縮率を得ることができる。   As the amount of information increases with the increase in image quality, the processing time becomes longer, and a larger capacity memory is required for storing information. For this reason, the image forming apparatus encodes and compresses information representing an image. There are two types of encoding, lossless encoding and lossy encoding. Lossless encoding is advantageous for improving image quality in that the amount of information does not change before and after encoding. On the other hand, lossy encoding can obtain a higher compression rate than lossless encoding although loss of information amount occurs before and after encoding.

現在一般的に利用されているJPEG(Joint Photographic Expert Group)方式による符号化、圧縮は、離散コサイン変換とハフマン符号化とを組み合わせた非可逆符号化の一種であって、比較的画質の劣化が少なく高い圧縮率を得ることができる。離散コサイン変換にあっては、画像を構成する各画素の値と画素の値の平均値との差が一様であるほど高い圧縮率を得ることができることが知られている。   Coding and compression using the JPEG (Joint Photographic Expert Group) method, which is generally used at present, is a type of lossy coding that combines discrete cosine transform and Huffman coding, with relatively poor image quality degradation. A small and high compression ratio can be obtained. In the discrete cosine transform, it is known that a higher compression ratio can be obtained as the difference between the value of each pixel constituting the image and the average value of the pixel values is uniform.

しかしながら、画像形成装置には近年ますます画像の高品質化が要求されており、このためには情報をいっそう高圧縮化することが必要になる。ただし、非可逆符号化にあっては、情報の圧縮率を高めることが画質を劣下(原画像の情報が失われることによる画質の変化)させることになり、JPEG方式による圧縮によっても情報の圧縮率をある範囲以上高めた場合には画質の劣化が顕著になる。   However, in recent years, image forming apparatuses are increasingly required to improve image quality, and for this purpose, it is necessary to further compress information. However, in irreversible encoding, increasing the compression rate of information degrades image quality (change in image quality due to loss of original image information). When the compression rate is increased over a certain range, the image quality is significantly deteriorated.

また、画像形成装置における情報の符号化には、画像を所定の小領域(ブロック)に分割し、符号化をブロックごとに行うものが知られている。画像をブロックごとに符号化する場合、ブロックの大きさが大きい方が符号化の処理効率が高まって短時間で符号化を完了することができる。また、ブロックの大きさが小さい方が原画像に近い高画質の画像を形成することができる。このため、符号化を行う場合に最適なブロックの大きさを決定する技術が望まれている。   In addition, information encoding in an image forming apparatus is known in which an image is divided into predetermined small areas (blocks) and encoding is performed for each block. When an image is encoded for each block, the larger the block size, the higher the encoding processing efficiency, and the encoding can be completed in a short time. In addition, it is possible to form a high-quality image closer to the original image when the block size is smaller. For this reason, there is a demand for a technique for determining an optimum block size when encoding is performed.

さらに、ブロックごとに符号化された画像を復号する場合、再生された画像におけるブロックの境界に画像の濃度差が発生する可能性がある。ブロック境界に発生する画像の濃度差は、ブロック歪みとも呼ばれ、画像の品質を低下させる要素の一つである。   Furthermore, when an image encoded for each block is decoded, there is a possibility that an image density difference occurs at a block boundary in the reproduced image. The density difference of the image generated at the block boundary is also referred to as block distortion, and is one of the factors that degrade the image quality.

本発明は上述の問題点を解決するために成されたものであり、その第1の目的は、ブロックごとに符号化された画像を再生した際にブロック歪みのない高品質の画像を得ることができる符号化・復号化システム及び符号化・復号化方法を提供することである。 The present invention has been made to solve the above-mentioned problems, and its first object is to obtain a high-quality image free from block distortion when an image encoded for each block is reproduced. It is to provide an encoding / decoding system and an encoding / decoding method capable of performing the above.

上述した課題を解決し、目的を達成するために、請求項1にかかる発明は、符号装置と復号装置とを備える符号化・復号化システムにおいて、前記符号装置は、画像を所定の領域ごとに分割し、複数の画素で構成される画素ブロックを作成する画素ブロック作成手段と、前記画素ブロック作成手段により作成された前記画素ブロックに含まれる画素の最大値と最小値との差分を示した差分値と、所定の値との大小関係を判断する判断手段と、前記判断手段により前記差分値が前記所定の値より大きいと判断された画素ブロックが所定の設定回数以上連続して発生している場合に前記画素ブロック作成手段により分割された画素ブロックの領域を縮小変更し、前記判断手段により前記差分値が前記所定の値より小さいと判断された画素ブロックが所定の設定回数以上連続して発生している場合に前記画素ブロック作成手段により分割された前記画素ブロックの領域を拡大変更する画素ブロックサイズ変更手段と、前記画素ブロックサイズ変更手段により変更された画素ブロックに含まれる画素の値に基づいて基準値を設定する基準値設定手段と、前記基準値設定手段により設定された前記基準値に応じて前記画素ブロックにおける画素グループを設定する画素グループ設定手段と、前記画素ブロックに含まれる画素に対し、前記画素グループ設定手段により設定された画素グループごとに当該画素グループにおける画素の平均値を割り当てる割り当て手段と、を有し、前記復号装置は、前記符号装置によって符号化された前記画像を前記画素ブロック単位で復号する復号手段と、前記復号手段による復号の際、前記画素ブロック単位の画像に乱数に基づいて発生する雑音成分を選択的に加える雑音成分付加手段と、を有すること、を特徴とするものである。 In order to solve the above-described problems and achieve the object, an invention according to claim 1 is an encoding / decoding system including an encoding device and a decoding device, wherein the encoding device is configured to display an image for each predetermined region. A pixel block creating unit that divides and creates a pixel block composed of a plurality of pixels, and a difference indicating a difference between a maximum value and a minimum value of pixels included in the pixel block created by the pixel block creating unit A determination unit that determines a magnitude relationship between a value and a predetermined value, and pixel blocks for which the determination unit determines that the difference value is greater than the predetermined value are continuously generated a predetermined number of times or more. In this case, the pixel block area divided by the pixel block creating means is reduced and changed, and the difference block is judged to be smaller than the predetermined value by the judging means A pixel block size changing means for enlarging and changing the area of the pixel block divided by the pixel block creating means when the pixel block has been continuously generated a predetermined number of times or more, and a pixel changed by the pixel block size changing means Reference value setting means for setting a reference value based on the value of a pixel included in the block; pixel group setting means for setting a pixel group in the pixel block according to the reference value set by the reference value setting means; Allocating means for allocating an average value of pixels in the pixel group for each pixel group set by the pixel group setting means to the pixels included in the pixel block, and the decoding apparatus includes the encoding apparatus decoding means for decoding the image encoded by the pixel block by, the The decoding by No. means, having a noise component adding means for selectively adding a noise component generated based on a random number on the image of the pixel block, and is characterized in.

この請求項1に記載の発明によれば、圧縮率が高く、画質劣化が少ない画像を符号化すると共に、画素ブロック単位で符号化された画像の復号に際し、復号された画像に雑音成分を付加することができる。 According to the first aspect of the present invention, an image having a high compression rate and little image quality deterioration is encoded, and a noise component is added to the decoded image when decoding an image encoded in units of pixel blocks. can do.

また、請求項2にかかる発明は、画像を所定の領域ごとに分割し、複数の画素で構成される画素ブロックを作成する画素ブロック作成工程と、前記画素ブロック作成工程により作成された前記画素ブロックに含まれる画素の最大値と最小値との差分を示した差分値と、所定の値との大小関係を判断する判断工程と、前記判断工程により前記差分値が前記所定の値より大きいと判断された画素ブロックが所定の設定回数以上連続して発生している場合に前記画素ブロック作成工程により分割された画素ブロックの領域を縮小変更し、前記判断手段により前記差分値が前記所定の値より小さいと判断された画素ブロックが所定の設定回数以上連続して発生している場合に前記画素ブロック作成工程により分割された前記画素ブロックの領域を拡大変更する画素ブロックサイズ変更工程と、前記画素ブロックサイズ変更工程により変更された画素ブロックに含まれる画素の値に基づいて基準値を設定する基準値設定工程と、前記基準値設定工程により設定された前記基準値に応じて前記画素ブロックにおける画素グループを設定する画素グループ設定工程と、前記画素ブロックに含まれる画素に対し、前記画素グループ設定工程により設定された画素グループごとに当該画素グループにおける画素の平均値を割り当てる割り当て工程と、前記符号化された画像に対して、前記割り当て工程により画素の平均値が割り当てられた前記画素ブロック単位で復号する復号工程と、前記復号工程における復号の際、前記画素ブロック単位の画像に乱数に基づいて発生する雑音成分を選択的に加える雑音成分付加工程と、を含むことを特徴とするものである。 According to a second aspect of the present invention, there is provided a pixel block creating step for dividing an image into predetermined regions and creating a pixel block composed of a plurality of pixels, and the pixel block created by the pixel block creating step. Determining a difference between a predetermined value and a difference value indicating a difference between a maximum value and a minimum value of pixels included in the pixel, and determining that the difference value is greater than the predetermined value by the determining step When the generated pixel block is continuously generated for a predetermined number of times or more, the area of the pixel block divided by the pixel block creating step is reduced and the difference value is determined by the determination means from the predetermined value. When the pixel block determined to be small is continuously generated for a predetermined number of times or more, the area of the pixel block divided by the pixel block creation process is expanded. The pixel block size changing step to be further changed, the reference value setting step for setting a reference value based on the value of the pixel included in the pixel block changed by the pixel block size changing step, and the reference value setting step A pixel group setting step for setting a pixel group in the pixel block according to the reference value; and for each pixel group set in the pixel group setting step for each pixel included in the pixel block, An assigning step of assigning an average value , a decoding step of decoding the encoded image in units of pixel blocks to which an average value of pixels is assigned by the assigning step, and decoding in the decoding step, A noise component generated based on random numbers is selectively added to an image in pixel block units. A sound component addition step and is characterized in that it comprises a.

この請求項2に記載の発明によれば、圧縮率が高く、画質劣化が少ない画像を符号化すると共に、画素ブロック単位で符号化された画像の復号に際し、復号された画像に雑音成分を付加することができる。 According to the second aspect of the present invention, an image having a high compression rate and little image quality deterioration is encoded, and a noise component is added to the decoded image when the image encoded in pixel block units is decoded. can do.

請求項1にかかる発明によれば、画像の符号化で圧縮率が高く、画質劣化が少なくすると共に、復号された画像に雑音成分を付加することによって再生画像にブロック歪が発生することを防ぐことができるという効果を奏する。 According to the first aspect of the present invention, the image is encoded with a high compression ratio, the image quality is less deteriorated, and a noise component is added to the decoded image to prevent occurrence of block distortion in the reproduced image. There is an effect that can be.

また、請求項2にかかる発明によれば、画像の符号化で圧縮率が高く、画質劣化が少なくすると共に、復号された画像に雑音成分を付加することによって再生画像にブロック歪が発生することを防ぐことができるという効果を奏する。 According to the second aspect of the present invention , the compression rate is high in image encoding , image quality deterioration is reduced, and a noise component is added to the decoded image, thereby causing block distortion in the reproduced image. There is an effect that can be prevented.

以下に添付図面を参照して、この発明にかかる符号化・復号化システム及び符号化・復号化方法の好適な実施の形態1〜5を詳細に説明する。 Exemplary embodiments 1 to 5 of an encoding / decoding system and encoding / decoding method according to the present invention will be described below in detail with reference to the accompanying drawings.

(実施の形態1)
図1は、本発明の実施の形態1〜4に共通の図であって、本発明の符号化装置をファクシミリ装置に設けた例を示すブロック図である。図示したファクシミリ装置は、画像に基づいて作成されたデータ(画像データ)を他のファクシミリ装置に送信する送信側の機能(図中単に送信側と記す)と、他のファクシミリ装置が送信したデータを受信して画像として出力する受信側の機能(図中単に受信側と記す)とを備えている。
(Embodiment 1)
FIG. 1 is a diagram common to the first to fourth embodiments of the present invention, and is a block diagram showing an example in which the encoding apparatus of the present invention is provided in a facsimile apparatus. The illustrated facsimile apparatus includes a function on the transmission side (simply referred to as a transmission side in the figure) for transmitting data (image data) created based on an image to the other facsimile apparatus, and data transmitted by the other facsimile apparatus. It has a function on the receiving side for receiving and outputting as an image (simply referred to as the receiving side in the figure).

図1に示した構成において、例えばCCD(Charged Coupled Device)イメージセンサを用いて画像を読み取る画像読取部101、画像読取部101によって読み取られた画像に処理を施し、送信データにする画像処理部102、送信データを符号化する符号化装置103が送信側の機能を果たす構成である。また、他のファクシミリ装置が送信した画像データを復号する復号装置104、復号装置104によって復号された画像データに処理を施し、印字可能なデータにする画像処理部105、印字可能なデータを出力するプリンタなどの画像出力部106が受信側の機能を果たす構成である。なお、図1のファクシミリ装置と他のファクシミリ装置との通信は、伝送路107を介して行われる。   In the configuration illustrated in FIG. 1, for example, an image reading unit 101 that reads an image using a CCD (Charged Coupled Device) image sensor, and an image processing unit 102 that performs processing on the image read by the image reading unit 101 to obtain transmission data. The encoding device 103 that encodes transmission data is configured to perform the function of the transmission side. Also, a decoding device 104 that decodes image data transmitted by another facsimile device, an image processing unit 105 that processes the image data decoded by the decoding device 104 to make printable data, and outputs printable data. The image output unit 106 such as a printer is configured to perform the function of the receiving side. Note that communication between the facsimile apparatus of FIG. 1 and other facsimile apparatuses is performed via a transmission path 107.

なお、画像処理部102、画像処理部105は、2値の画像データに対して解像度の変換、サイズ変換といった画像処理を施し、多値の画像データに対して色変換、解像度変換、サイズ変換といった画像処理を施す。また、復号装置104については、実施の形態5で説明するものとする。   The image processing unit 102 and the image processing unit 105 perform image processing such as resolution conversion and size conversion on binary image data, and perform color conversion, resolution conversion, size conversion, etc. on multi-value image data. Apply image processing. The decoding device 104 will be described in the fifth embodiment.

図2は、本発明の実施の形態1〜4に共通の図であって、本発明の符号化装置を説明するためのブロック図である。また、図3は、図2に示した符号化部を説明するためのブロック図である。   FIG. 2 is a diagram common to the first to fourth embodiments of the present invention, and is a block diagram for explaining the encoding device of the present invention. FIG. 3 is a block diagram for explaining the encoding unit shown in FIG.

本発明の符号化装置103は、多値の画素で表される画像を符号化する符号化装置であって、画像を所定の領域ごとに分割し、複数の画素で構成される画素ブロックを作成するブロック分割部201と、画素ブロックに含まれる画素を符号化する符号化部202と、を備えている。   The encoding device 103 of the present invention is an encoding device that encodes an image represented by multi-valued pixels, and divides the image into predetermined regions to create a pixel block composed of a plurality of pixels. A block dividing unit 201 that encodes pixels included in the pixel block, and an encoding unit 202 that encodes pixels included in the pixel block.

符号化部202は、図3に示したように、CPU301と、ROM(Read Only Memory)302と、RAM(Read Access Memory)303と、符号化・圧縮処理部304とを備えている。CPU301は、画素ブロックに含まれる画素の値(本実施の形態では、画素の濃度を表す電気信号とする)に基づいて基準値を設定し、また、設定された基準値に応じて画素ブロックにおける画素グループを設定する。そして、画素ブロックに含まれる画素に対し、設定された画素グループごとに等しい値を割り当てる。符号化・圧縮処理部304は、CPU301によって値が割り当てられた画素を周知のJPEG方式で圧縮する。ROM302は、CPU301で行われる処理のプログラムや必要な数値などを記憶する。RAM303は、CPU301で行われる処理のワーキングエリアとして使用される。   As shown in FIG. 3, the encoding unit 202 includes a CPU 301, a ROM (Read Only Memory) 302, a RAM (Read Access Memory) 303, and an encoding / compression processing unit 304. The CPU 301 sets a reference value based on the value of a pixel included in the pixel block (in this embodiment, it is an electric signal representing the density of the pixel), and the CPU 301 sets the reference value in the pixel block according to the set reference value. Set the pixel group. Then, equal values are assigned to the pixels included in the pixel block for each set pixel group. The encoding / compression processing unit 304 compresses the pixels assigned values by the CPU 301 by a well-known JPEG method. The ROM 302 stores a program for processing performed by the CPU 301 and necessary numerical values. The RAM 303 is used as a working area for processing performed by the CPU 301.

なお、符号化装置103に2値の画像データを入力した場合、2値の画像データは、CPU301の処理を受けずに符号化・圧縮処理部304に入力し、符号化・圧縮処理部304において例えば周知のMMR方式によって圧縮を受ける。   When binary image data is input to the encoding device 103, the binary image data is input to the encoding / compression processing unit 304 without being processed by the CPU 301. For example, compression is performed by a well-known MMR method.

次に、符号化装置の実施の形態1における動作について説明する。符号化装置103は、多値の画像データ(多値データ)が入力すると、ブロック分割部201で多値データを分割することによって例えば縦、横にそれぞれ画素を4個ずつ配置した画素ブロック(4×4ブロック)を作成する。   Next, the operation of the first embodiment of the encoding device will be described. When the multi-valued image data (multi-valued data) is input, the encoding device 103 divides the multi-valued data by the block dividing unit 201, thereby, for example, a pixel block (4 pixels arranged four by four vertically and horizontally). X4 blocks).

CPU301は、ブロック分割部201から画素を画素ブロックごとに入力し、画素ブロックに含まれる各画素の値を検出する。そして、各画素ブロックに含まれる画素の値の最大値と最小値とを求め、最大値、最小値に基づいてしきい値を決定する。また、CPU301は、しきい値によって画素ブロックに含まれる画素を選別し、しきい値以上の値を持つ画素グループ(G−high)と、しきい値以下の値を持つ画素グループ(G−low)との2つの画素グループを作成する。なお、本発明の実施の形態では、最大値と最小値とを加算し、加算した値を2で割った値をしきい値とするものとする。   CPU301 inputs a pixel for every pixel block from the block division part 201, and detects the value of each pixel contained in a pixel block. Then, the maximum value and the minimum value of the pixel values included in each pixel block are obtained, and the threshold value is determined based on the maximum value and the minimum value. Further, the CPU 301 selects pixels included in the pixel block based on the threshold value, and a pixel group (G-high) having a value equal to or higher than the threshold value and a pixel group (G-low) having a value equal to or lower than the threshold value. ) And two pixel groups are created. In the embodiment of the present invention, the maximum value and the minimum value are added, and a value obtained by dividing the added value by 2 is set as a threshold value.

さらに、CPU301は、G−high、G−lowごとにそれぞれの平均値を算出する。G−highに含まれる画素の平均値をA−high、G−lowに含まれる画素の平均値をA−lowとすると、CPU301は、G−highに分類された画素の全てにA−highを割り当てる。また、G−lowに分類された画素の全てにA−lowを割り当てる。A−highが割り当てられた画素を例えば1を付して示し、A−lowが割り当てられた画素を例えば0を付して示すことにより、図4に示す符号列が作成される。   Further, the CPU 301 calculates an average value for each of G-high and G-low. When the average value of pixels included in G-high is A-high and the average value of pixels included in G-low is A-low, the CPU 301 applies A-high to all of the pixels classified as G-high. assign. Also, A-low is assigned to all of the pixels classified as G-low. A pixel to which A-high is assigned is indicated by 1 for example, and a pixel to which A-low is assigned is indicated by 0 for example, thereby generating the code string shown in FIG.

図4に示した符号列は、先頭にA−high、A−lowの値を示し、以降に続く符号ビットに1または0を示している。なお、A−high、A−lowと1、0の関係は図4に示した関係に限定されるものでなく、逆であっても良い。また、符号列におけるA−high、A−lowの位置は、先頭に限定されるものでなく、符号列のどこにあっても良い。   The code string shown in FIG. 4 indicates A-high and A-low values at the beginning, and indicates 1 or 0 in the subsequent code bits. The relationship between A-high and A-low and 1 and 0 is not limited to the relationship shown in FIG. 4 and may be reversed. In addition, the positions of A-high and A-low in the code string are not limited to the top, and may be anywhere in the code string.

以上の動作によれば、各画素ブロックに含まれる画素がA−high、A−lowの2種類しか取り得ない。このため、画素ブロック内の全ての画素の値をA−high、A−lowの2つの平均値によって表すことができ、JPEG方式などによる圧縮時に高い圧縮率を得ることができる。   According to the above operation, the pixel included in each pixel block can take only two types of A-high and A-low. For this reason, the values of all the pixels in the pixel block can be represented by two average values of A-high and A-low, and a high compression rate can be obtained at the time of compression by the JPEG method or the like.

ところで、一般的に、比較的小さな領域に分割された画像の画素の値は1、2の代表値で近似できることが多い。例えば、画像が写真などの連続階調画像である場合、画素ブロック内で画素の値の差が比較的小さい。このため、画素ブロック内の画素の値は、画素全体の平均値でほぼ近似することができる。また、画像が文字を表す文字画像である場合、画素の値の値はエッジ部の値と背景部分の値とのいずれかに近似することができる。このことから、画素ブロック内の画素をA−high、A−lowの2つの平均値で近似する実施の形態1は、画質に与える影響をも少ないものということができる。   In general, pixel values of an image divided into relatively small areas can be approximated by representative values of 1 and 2. For example, when the image is a continuous tone image such as a photograph, the difference in pixel values within the pixel block is relatively small. For this reason, the value of the pixel in a pixel block can be approximated by the average value of the whole pixel. Further, when the image is a character image representing a character, the value of the pixel can be approximated to either the value of the edge portion or the value of the background portion. From this, it can be said that the first embodiment that approximates the pixels in the pixel block with two average values of A-high and A-low has little influence on the image quality.

また、実施の形態1は、各画素ブロックに含まれる画素の値についてそれぞれしきい値を設定し、画素ブロックを2つの値に近似することにより、各画素ブロックの画像に応じたしきい値を設定できる。そして、しきい値に応じて平均値(A−high、A−low)を決定することにより、画像を表すのに適切な平均値を各画素に割り当てることができる。   In the first embodiment, a threshold value is set for each pixel value included in each pixel block, and the threshold value corresponding to the image of each pixel block is set by approximating the pixel block to two values. Can be set. Then, by determining an average value (A-high, A-low) according to the threshold value, an average value appropriate for representing an image can be assigned to each pixel.

図5は、実施の形態1の符号化方法を説明するためのフローチャートである。なお、図5のフローチャートは、符号化部202のCPU301で行われる処理について示したものである。   FIG. 5 is a flowchart for explaining the encoding method according to the first embodiment. Note that the flowchart of FIG. 5 shows processing performed by the CPU 301 of the encoding unit 202.

CPU301は、画素ブロック(図中単にブロックと記す)を入力し、画素ブロックに含まれる画素の最大値(max)と最小値(min)とを求める(ステップS501)。そして、しきい値thを、
th=(max+min)/2
の式から算出する(ステップS502)。
The CPU 301 inputs a pixel block (simply referred to as a block in the figure), and obtains the maximum value (max) and the minimum value (min) of the pixels included in the pixel block (step S501). Then, the threshold th is
th = (max + min) / 2
(Step S502).

次に、CPU301は、画素ブロックに含まれる画素のうち、しきい値th以上の値を持つ画素の値の平均値A−highを算出する(ステップS503)。また、同様に、しきい値th以下の値を持つ画素の値の平均値A−lowを算出する(ステップS504)。   Next, the CPU 301 calculates an average value A-high of the values of pixels having a value equal to or greater than the threshold th among the pixels included in the pixel block (step S503). Similarly, an average value A-low of the values of pixels having a value equal to or smaller than the threshold th is calculated (step S504).

次に、CPU301は、画素ブロックに含まれる各画素についてしきい値th以上の値を持つか否か判断する(ステップS505)。そして、画素がしきい値th以上の値を持つと判断した場合には(ステップS505:Yes)、code=1を付す(ステップS506)。また、画素がしきい値th以下の値を持つと判断した場合には(ステップS505:No)、code=0を付す(ステップS507)。   Next, the CPU 301 determines whether each pixel included in the pixel block has a value greater than or equal to the threshold th (step S505). If it is determined that the pixel has a value equal to or greater than the threshold th (step S505: Yes), code = 1 is assigned (step S506). If it is determined that the pixel has a value equal to or smaller than the threshold th (step S505: No), code = 0 is assigned (step S507).

ステップS503、ステップS504の処理により、1つの画素ブロックについて図4に示した符号列の符号ビットが記録できる。さらに、ステップS503で算出されたA−highの値、ステップS504で算出されたA−lowの値を付し、図4に示した符号列が作成される。   By the processing in steps S503 and S504, the code bits of the code string shown in FIG. 4 can be recorded for one pixel block. Further, the A-high value calculated in step S503 and the A-low value calculated in step S504 are attached, and the code string shown in FIG. 4 is created.

次に、CPU301は、処理すべきデータの入力が終了したか、つまりブロック分割部201で作成された画素ブロックの入力が全て終了したか否か判断する(ステップS508)。そして、データ入力が終了したと判断すると(ステップS508:Yes)、処理を終了する。また、ステップS508の判断でデータ入力が終了していないと判断された場合には(ステップS508:No)、次に入力した画素ブロックの最大値、最小値を求める(ステップS501)。   Next, the CPU 301 determines whether or not the input of data to be processed has been completed, that is, whether or not the input of all pixel blocks created by the block dividing unit 201 has been completed (step S508). If it is determined that the data input has been completed (step S508: Yes), the process is terminated. If it is determined in step S508 that data input has not ended (step S508: No), the maximum value and minimum value of the next input pixel block are obtained (step S501).

以上説明した実施の形態1は、画素ブロックに含まれる画素をグループ化して画素グループを設定し、各画素グループに含まれる画素に等しい値を割り当てたことによって画素ブロック内の画素の値を一様にすることができる。このため、符号化・圧縮処理部304における符号化の際の圧縮率を高めることができる。   In the first embodiment described above, the pixels included in the pixel block are grouped to set a pixel group, and by assigning an equal value to the pixels included in each pixel group, the values of the pixels in the pixel block are uniform. Can be. For this reason, the compression rate at the time of encoding in the encoding / compression processing unit 304 can be increased.

また、グループ分けの基準となるしきい値を画素ブロックに含まれる画素の最大値、最小値に基づいて決定するため、画素ブロックごとに適切なしきい値を設定することができる。さらに、しきい値によってグループ分けされた画素に画素グループごとの平均値を割り当てることにより、画素グループ、ひいては画素ブロックごとに適切な値を画素に割り当てることができる。このため、実施の形態1は、画質の劣化を少なくすることができる。   Further, since the threshold value used as the grouping criterion is determined based on the maximum value and the minimum value of the pixels included in the pixel block, an appropriate threshold value can be set for each pixel block. Furthermore, by assigning an average value for each pixel group to the pixels grouped by the threshold value, an appropriate value can be assigned to the pixel for each pixel group, and thus for each pixel block. For this reason, Embodiment 1 can reduce deterioration of image quality.

(実施の形態2)
実施の形態2の符号化装置は、先に図2、図3で示した実施の形態1の符号化装置と同様の構成を備えている。このため、実施の形態2の符号化装置の構成の図示および説明の一部を略すものとする。
(Embodiment 2)
The encoding apparatus according to the second embodiment has a configuration similar to that of the encoding apparatus according to the first embodiment shown in FIGS. For this reason, a part of illustration and description of the configuration of the encoding apparatus according to the second embodiment is omitted.

実施の形態2の符号化装置は、CPU301がさらに画素ブロックに含まれる画素の値の最大値と最小値との差分(最大差分値)が所定の値よりも小さいか否かを判定する。そして、最大差分値が所定の値よりも小さいと判断された場合、画素ブロック全体を1つの画素グループに設定し、画素ブロックに含まれる画素に対して画素ブロックに含まれる画素の値の平均値を割り当てる。   In the encoding apparatus according to the second embodiment, the CPU 301 further determines whether or not the difference (maximum difference value) between the maximum value and the minimum value of the pixels included in the pixel block is smaller than a predetermined value. When it is determined that the maximum difference value is smaller than a predetermined value, the entire pixel block is set to one pixel group, and the average value of the values of the pixels included in the pixel block with respect to the pixels included in the pixel block Assign.

次に、実施の形態2の符号化装置の動作について説明する。符号化装置103は、多値データが入力すると、ブロック分割部201で実施の形態1と同様に多値データを分割して4×4ブロックを作成する。   Next, the operation of the coding apparatus according to the second embodiment will be described. When the multi-value data is input, the encoding device 103 divides the multi-value data by the block dividing unit 201 in the same manner as in the first embodiment to create a 4 × 4 block.

CPU301は、各ブロックに含まれる画素の値の最大差分値を求め、最大差分値を予め例えばROM302に記憶されている所定の値(設定値)と比較する。そして、最大差分値が設定値よりも小さい場合、CPU301は、画素ブロックに含まれる画素の値全ての平均値を算出し、算出した平均値を画素ブロックに含まれる画素のすべてに割り当てる。   The CPU 301 obtains the maximum difference value of the pixel values included in each block, and compares the maximum difference value with a predetermined value (set value) stored in advance in the ROM 302, for example. When the maximum difference value is smaller than the set value, the CPU 301 calculates an average value of all the pixel values included in the pixel block, and assigns the calculated average value to all the pixels included in the pixel block.

実施の形態2の符号化装置は、画素ブロックに含まれる画素の全てに平均値という1つの値を割り当てることによって画素ブロック内の画素の値を同じにすることができる。また、画素ブロックの最大差分値が小さい、つまり画素ブロックに含まれる画素の濃度の差異が小さい画素ブロックのみを処理することにより、符号化による画質の劣化をも少なくすることができる。   The encoding apparatus according to the second embodiment can make the values of the pixels in the pixel block the same by assigning one value called an average value to all of the pixels included in the pixel block. Further, by processing only the pixel block having a small maximum difference value of the pixel block, that is, a small difference in density of pixels included in the pixel block, it is possible to reduce image quality degradation due to encoding.

図6は、実施の形態2の符号化方法を説明するためのフローチャートである。CPU301は、画素ブロックを入力し、画素ブロックに含まれる画素の最大値(max)と最小値(min)とを求める(ステップS601)。そして、maxとminとの差、つまり最大差分値が設定値以上であるか否か判断する(ステップS602)。この判断の結果、最大差分値が設定値以上でない場合(ステップS602:No)、画素ブロック内の画素の全ての平均値を算出して画素ブロックに含まれる画素の全てに割り当てる(ステップS610)。   FIG. 6 is a flowchart for explaining the encoding method according to the second embodiment. The CPU 301 inputs the pixel block and obtains the maximum value (max) and the minimum value (min) of the pixels included in the pixel block (step S601). Then, it is determined whether or not the difference between max and min, that is, the maximum difference value is greater than or equal to a set value (step S602). If the result of this determination is that the maximum difference value is not greater than or equal to the set value (step S602: No), the average value of all the pixels in the pixel block is calculated and assigned to all of the pixels included in the pixel block (step S610).

一方、ステップS602の判断の結果、最大差分値が設定値以上であった場合(ステップS602:Yes)、実施の形態2の符号化装置は実施の形態1と同様に動作するものとする。すなわち、CPU301は、しきい値thを算出する(ステップS603)。そして、画素ブロックに含まれる画素のうち、しきい値th以上の値を持つ画素の値の平均値A−high(ステップS604)、しきい値th以下の値を持つ画素の値の平均値A−lowを算出する(ステップS605)。   On the other hand, if the result of determination in step S602 shows that the maximum difference value is greater than or equal to the set value (step S602: Yes), the encoding apparatus of the second embodiment is assumed to operate in the same manner as in the first embodiment. That is, the CPU 301 calculates the threshold value th (step S603). Then, among the pixels included in the pixel block, the average value A-high of the pixels having a value equal to or greater than the threshold th (step S604), and the average value A of the pixels having a value equal to or smaller than the threshold th. -Low is calculated (step S605).

次に、CPU301は、画素ブロックに含まれる各画素についてしきい値th以上の値を持つか否か判断する(ステップS606)。そして、しきい値th以上の値を画素にはcode=1を付し(ステップS607)、しきい値th以下の値を持つ画素にはcode=0を付す(ステップS608)。なお、ステップS603〜608の処理をサブルーチンSとし、後に説明する実施の形態に示すものとする。   Next, the CPU 301 determines whether each pixel included in the pixel block has a value equal to or greater than the threshold th (step S606). Then, code = 1 is assigned to a pixel having a value equal to or greater than the threshold th (step S607), and code = 0 is assigned to a pixel having a value equal to or less than the threshold th (step S608). Note that the processing in steps S603 to S608 is referred to as a subroutine S, which will be described in an embodiment described later.

そして、CPU301は、処理すべきデータの入力が終了したか否か判断する(ステップS609)。そして、データ入力が終了したと判断すると(ステップS609:Yes)、処理を終了する。また、ステップS609の判断でデータ入力が終了していないと判断された場合には(ステップS609:No)、次に入力した画素ブロックの最大値、最小値を求める(ステップS601)。   Then, the CPU 301 determines whether or not input of data to be processed has been completed (step S609). If it is determined that the data input has been completed (step S609: Yes), the process is terminated. If it is determined in step S609 that the data input has not ended (step S609: No), the maximum value and the minimum value of the next input pixel block are obtained (step S601).

以上説明した実施の形態2によれば、画素ブロックに含まれる画素に1つの平均値を割り当てることによって画素ブロック内の画素を1つにすることができる。このため、符号化の際の圧縮率をいっそう高めることができる。   According to the second embodiment described above, it is possible to make one pixel in the pixel block by assigning one average value to the pixels included in the pixel block. For this reason, the compression rate at the time of encoding can be raised further.

また、実施の形態2は、最大差分値が所定の値よりも小さい画素ブロックに限って画素ブロックに含まれる画素に画素ブロック全体の平均値を割り当てている。このため、濃度変化が比較的大きい画素ブロックに含まれる画素に画素全体の平均値を割り当てることを防ぎ、符号化による画質の劣化を少なくすることができる。   In the second embodiment, the average value of the entire pixel block is assigned to the pixels included in the pixel block only in the pixel block whose maximum difference value is smaller than a predetermined value. For this reason, it is possible to prevent assignment of the average value of the entire pixels to the pixels included in the pixel block whose density change is relatively large, and to reduce deterioration in image quality due to encoding.

(実施の形態3)
実施の形態3の符号化装置は、先に図2、図3で示した実施の形態1の符号化装置と同様の構成を備えている。このため、実施の形態3の符号化装置の構成の図示および説明の一部を略すものとする。
(Embodiment 3)
The encoding apparatus according to Embodiment 3 has the same configuration as that of the encoding apparatus according to Embodiment 1 previously shown in FIGS. For this reason, a part of illustration and description of the configuration of the encoding apparatus according to the third embodiment is omitted.

実施の形態3の符号化装置は、CPU301が最大差分値が所定の値よりも小さいか否かを判定する。そして、最大差分値が所定の値よりも小さいと判断された場合、画素ブロックを再分割することにより画素グループ(実施の形態3の画素グループを小ブロックと記す)を設定し、小ブロックに含まれる画素の値の平均値を割り当てるものである。   In the encoding apparatus according to Embodiment 3, the CPU 301 determines whether or not the maximum difference value is smaller than a predetermined value. When it is determined that the maximum difference value is smaller than a predetermined value, the pixel block is subdivided to set a pixel group (the pixel group of Embodiment 3 is referred to as a small block) and is included in the small block An average value of assigned pixel values is assigned.

次に、実施の形態3の符号化装置の動作について説明する。符号化装置103は、多値データが入力すると、ブロック分割部201で実施の形態1と同様に多値データを分割して4×4ブロックを作成する。CPU301は、各ブロックに含まれる画素の値の最大差分値を求め、最大差分値を予め例えばROM302に記憶されている設定値と比較する。   Next, the operation of the coding apparatus according to Embodiment 3 will be described. When the multi-value data is input, the encoding device 103 divides the multi-value data by the block dividing unit 201 in the same manner as in the first embodiment to create a 4 × 4 block. The CPU 301 obtains the maximum difference value of the pixel values included in each block, and compares the maximum difference value with a set value stored in advance in the ROM 302, for example.

比較の結果、最大差分値が所定の値よりも小さい場合、CPU301は、図7のように、図7(a)に示した4×4ブロックを再分割し、例えば図7(b)に示す4つの2×2ブロックを設定する。そして、各2×2ブロックごとに画素の値全ての平均値を算出し、算出した平均値を各2×2ブロックに含まれる画素のすべてに割り当てる。   As a result of the comparison, when the maximum difference value is smaller than a predetermined value, the CPU 301 re-divides the 4 × 4 block shown in FIG. 7A as shown in FIG. 7, for example, as shown in FIG. 7B. Four 2 × 2 blocks are set. Then, an average value of all the pixel values is calculated for each 2 × 2 block, and the calculated average value is assigned to all of the pixels included in each 2 × 2 block.

以上の動作により、実施の形態3の符号化装置は、画素ブロック内の画素の濃度を一様にすることができ、圧縮効率を高めることができる。また、画素ブロックをさらに小ブロックとしてグループ化し、各小ブロックの平均値を小ブロックの画素に割り当てたことによって画質の劣化をいっそう防ぐことができる。   With the above operation, the encoding apparatus of Embodiment 3 can make the density of the pixels in the pixel block uniform, and can increase the compression efficiency. Further, the pixel blocks are further grouped as small blocks, and the average value of each small block is assigned to the pixels of the small blocks, thereby further preventing image quality deterioration.

図8は、実施の形態3の符号化方法を説明するためのフローチャートである。CPU301は、4×4ブロックの画素ブロックを入力し、画素ブロックに含まれる画素の最大値(max)と最小値(min)とを求める(ステップS801)。そして、maxとminとの差、つまり最大差分値が設定値以上であるか否か判断する(ステップS802)。   FIG. 8 is a flowchart for explaining the encoding method of the third embodiment. The CPU 301 inputs a pixel block of 4 × 4 blocks, and obtains the maximum value (max) and the minimum value (min) of the pixels included in the pixel block (step S801). Then, it is determined whether or not the difference between max and min, that is, the maximum difference value is greater than or equal to a set value (step S802).

ステップS802の判断の結果、最大差分値が設定値以上でない場合(ステップS802:No)、4×4ブロックの画素ブロックを再分割して2×2ブロックの小ブロックを設定する(ステップS804)。そして、設定された各小ブロック内にある画素全部に各小ブロックに含まれる画素の平均値を割り当てる(ステップS805)。   If the result of determination in step S802 is that the maximum difference value is not greater than or equal to the set value (step S802: No), the pixel block of 4 × 4 blocks is subdivided to set a small block of 2 × 2 blocks (step S804). Then, the average value of the pixels included in each small block is assigned to all the pixels in each set small block (step S805).

一方、ステップS802の判断の結果、最大差分値が設定値以上であった場合(ステップS802:Yes)、実施の形態3の符号化装置は、実施の形態1および2と同様にサブルーチンSを実行する(ステップS803)。その後、CPU301は、処理すべきデータの入力が終了したか否か判断する(ステップS806)。そして、データ入力が終了したと判断すると(ステップS806:Yes)、処理を終了する。また、ステップS806の判断でデータ入力が終了していないと判断された場合には(ステップS806:No)、次に入力した画素ブロックの最大値、最小値を求める(ステップS801)。   On the other hand, if the result of determination in step S802 is that the maximum difference value is greater than or equal to the set value (step S802: Yes), the encoding apparatus of the third embodiment executes the subroutine S as in the first and second embodiments. (Step S803). Thereafter, the CPU 301 determines whether or not input of data to be processed has been completed (step S806). If it is determined that the data input has been completed (step S806: Yes), the process is terminated. If it is determined in step S806 that the data input has not ended (step S806: No), the maximum value and the minimum value of the next input pixel block are obtained (step S801).

以上説明した実施の形態3によれば、画素ブロックを小ブロックに再分割し、各小ブロックの平均値を小ブロックに含まれる画素に割り当てることができる。このため、より小さい画素ブロックにおける平均値を画素に割り当てることができ、高品質な画像を形成することができる。   According to Embodiment 3 described above, the pixel block can be subdivided into small blocks, and the average value of each small block can be assigned to the pixels included in the small block. For this reason, an average value in a smaller pixel block can be assigned to the pixels, and a high-quality image can be formed.

また、実施の形態3は、最大差分値が所定の値よりも小さい画素ブロックに限って小ブロックに含まれる画素に小ブロック全体の平均値を割り当てている。このため、濃度変化が比較的大きい画素ブロックに含まれる画素に小ブロック全体の平均値を割り当てることを防ぎ、符号化による画質の劣化を少なくすることができる。   In the third embodiment, the average value of the entire small block is assigned to the pixels included in the small block only in the pixel block whose maximum difference value is smaller than a predetermined value. For this reason, it is possible to prevent the average value of the entire small block from being assigned to the pixels included in the pixel block whose density change is relatively large, and to reduce deterioration in image quality due to encoding.

(実施の形態4)
実施の形態4の符号化装置は、先に図2、図3で示した実施の形態1の符号化装置と同様の構成を備えている。このため、実施の形態4の符号化装置の構成の図示および説明の一部を略すものとする。
(Embodiment 4)
The encoding apparatus according to the fourth embodiment has the same configuration as that of the encoding apparatus according to the first embodiment shown in FIGS. For this reason, a part of illustration and description of the configuration of the encoding apparatus according to the fourth embodiment is omitted.

実施の形態4の符号化装置は、CPU301が、さらに、各画素ブロックについて最大差分値と所定の値との大小を判定する。そして、最大差分値が所定の値よりも大きいと判断された画素ブロックが所定の数以上連続して発生した場合、ブロック分割部201に指示して画像を分割する領域を縮小変更する。一方、最大差分値が所定の値よりも小さいと判断された画素ブロックが所定の数以上連続して発生した場合、ブロック分割部201に指示して画像を分割する領域を拡大変更するものである。   In the encoding apparatus according to the fourth embodiment, the CPU 301 further determines the magnitude of the maximum difference value and the predetermined value for each pixel block. Then, when a predetermined number or more of pixel blocks whose maximum difference value is determined to be larger than the predetermined value are continuously generated, the block dividing unit 201 is instructed to reduce and change the area into which the image is divided. On the other hand, when a predetermined number or more of pixel blocks whose maximum difference value is determined to be smaller than a predetermined value are continuously generated, the block dividing unit 201 is instructed to enlarge and change the area into which the image is divided. .

次に、実施の形態4の符号化装置の動作について説明する。符号化装置103は、多値データが入力すると、ブロック分割部201で実施の形態1と同様に多値データを分割して4×4ブロックを作成する。CPU301は、各ブロックに含まれる画素の値の最大差分値を求め、最大差分値を予め例えばROM302に記憶されている設定値と比較する。   Next, the operation of the coding apparatus according to Embodiment 4 will be described. When the multi-value data is input, the encoding device 103 divides the multi-value data by the block dividing unit 201 in the same manner as in the first embodiment to create a 4 × 4 block. The CPU 301 obtains the maximum difference value of the pixel values included in each block, and compares the maximum difference value with a set value stored in advance in the ROM 302, for example.

CPU301は、最大差分値が設定値よりも大きいと判断された回数、最大差分値が設定値よりも小さいと判断された回数をそれぞれ例えばRAM303に記憶しておく。そして、記憶された回数を、例えばROM302に予め記憶されている設定回数と比較する。比較の結果、最大差分値が設定値よりも大きいと判断された回数が設定回数を超えた場合、CPU301は、ブロック分割部201に指示して画像を分割する領域を小さくして画素ブロックを縮小変更する。また、最大差分値が設定値よりも小さいと判断された回数が設定回数を超えた場合、CPU301は、ブロック分割部201に指示して画像を分割する領域を大きくして画素ブロックを拡大変更する。   The CPU 301 stores the number of times that the maximum difference value is determined to be larger than the set value and the number of times that the maximum difference value is determined to be smaller than the set value, for example, in the RAM 303. Then, the stored number of times is compared with a set number of times stored in advance in the ROM 302, for example. If the number of times that the maximum difference value is determined to be larger than the set value exceeds the set number as a result of the comparison, the CPU 301 instructs the block dividing unit 201 to reduce the area for dividing the image and reduce the pixel block. change. Further, when the number of times that the maximum difference value is determined to be smaller than the set value exceeds the set number, the CPU 301 instructs the block dividing unit 201 to enlarge the area to divide the image to enlarge and change the pixel block. .

最大差分値が小さい画素ブロックが連続することは、符号化装置が画像の濃度変化の小さい領域(例えば背景の領域)を処理していることを意味している。濃度変化の小さい画素ブロックが連続する領域は、一度により広い領域を画素ブロックとして符号化された場合にも画質の劣化が少ない。このことから、実施の形態4の符号化装置は、画像の濃度変化の小さい領域については画素ブロックを拡大変更して符号化時の圧縮率を高めている。   Consecutive pixel blocks having a small maximum difference value means that the encoding apparatus is processing an area where the density change of the image is small (for example, a background area). A region where pixel blocks having a small change in density are continuous has little deterioration in image quality even when a larger region is encoded as a pixel block at one time. For this reason, the encoding apparatus according to the fourth embodiment increases the compression rate at the time of encoding by enlarging and changing the pixel block in an area where the density change of the image is small.

一方、最大差分値が大きい画素ブロックが連続することは、符号化装置が画像の濃度変化の大きい領域(例えば文字や線画が存在する領域)を処理していることを意味している。濃度変化が大きい画素ブロックが連続する領域は、一度に広い領域を画素ブロックとして符号化すると情報の欠落が大きく画質の劣化が懸念される。このことから、実施の形態4の符号化装置は、画像の濃度変化の小さい領域については画素ブロックを縮小変更して符号化処理による画質の劣化を抑えている。   On the other hand, the continuous pixel blocks having a large maximum difference value means that the encoding apparatus is processing an area where the density change of the image is large (for example, an area where characters and line drawings are present). In a region where pixel blocks having a large density change are continuous, if a large region is encoded as a pixel block at a time, a lack of information is large and there is a concern about deterioration of image quality. For this reason, the encoding apparatus according to the fourth embodiment suppresses deterioration in image quality due to the encoding process by reducing and changing the pixel block in an area where the density change of the image is small.

なお、拡大変更あるいは縮小変更される画素ブロックの大きさには予め下限および上限が設定されている。画素ブロックの下限および上限は、画素ブロックが大きすぎることによる画質の劣化や画素ブロックが小さすぎることによる符号量の増加を考慮して設定されている。   Note that a lower limit and an upper limit are set in advance for the size of the pixel block to be enlarged or reduced. The lower limit and the upper limit of the pixel block are set in consideration of image quality deterioration due to the pixel block being too large and code amount increase due to the pixel block being too small.

図9は、実施の形態4の符号化方法を説明するためのフローチャートである。CPU301は、4×4ブロックの画素ブロックを入力し、画素ブロックに含まれる画素の最大値(max)と最小値(min)とを求める(ステップS901)。そして、maxとminとの差、つまり最大差分値が設定値以上であるか否か判断する(ステップS902)。   FIG. 9 is a flowchart for explaining an encoding method according to the fourth embodiment. The CPU 301 inputs a pixel block of 4 × 4 blocks, and obtains the maximum value (max) and the minimum value (min) of the pixels included in the pixel block (step S901). Then, it is determined whether or not the difference between max and min, that is, the maximum difference value is greater than or equal to a set value (step S902).

ステップS902の判断の結果、最大差分値が設定値以上でない場合(ステップS902:No)、CPU301は、設定値以下の最大差分値を持つ画素ブロックを計数するカウンタBを1つカウントアップする(ステップS908)。そして、カウンタBが設定回数以上であるか否か判断し(ステップS909)、カウンタBが設定回数以上である場合には(ステップS909:Yes)、ブロック分割部201に指示して画素ブロックを拡大変更する(ステップS910)。そして、拡大変更された画素ブロックをブロック分割部201から入力してサブルーチンSにより処理する(ステップS906)。   If the result of determination in step S902 is that the maximum difference value is not greater than or equal to the set value (step S902: No), the CPU 301 counts up one counter B that counts pixel blocks having the maximum difference value that is less than or equal to the set value (step S902). S908). Then, it is determined whether or not the counter B is equal to or greater than the set number of times (step S909). If the counter B is equal to or greater than the set number of times (step S909: Yes), the block dividing unit 201 is instructed to enlarge the pixel block. Change (step S910). Then, the enlarged and changed pixel block is input from the block dividing unit 201 and processed by the subroutine S (step S906).

一方、ステップS902の判断の結果、最大差分値が設定値以上であった場合(ステップS902:Yes)、CPU301は、設定値以上の最大差分値を持つ画素ブロックを計数するカウンタAを1つカウントアップする(ステップS903)。そして、カウンタAが設定回数以上であるか否か判断し(ステップS904)、カウンタAが設定回数以上である場合には(ステップS904:Yes)、ブロック分割部201に指示して画素ブロックを縮小変更する(ステップS905)。そして、縮小変更された画素ブロックをブロック分割部201から入力してサブルーチンSにより処理する(ステップS906)。   On the other hand, if the result of determination in step S902 is that the maximum difference value is greater than or equal to the set value (step S902: Yes), the CPU 301 counts one counter A that counts pixel blocks having the maximum difference value greater than or equal to the set value. Up (step S903). Then, it is determined whether or not the counter A is equal to or greater than the set number of times (step S904). If the counter A is equal to or greater than the set number of times (step S904: Yes), the block dividing unit 201 is instructed to reduce the pixel block. Change (step S905). Then, the reduced and changed pixel block is input from the block dividing unit 201 and processed by the subroutine S (step S906).

次に、CPU301は、処理すべきデータの入力が終了したか否か判断する(ステップS907)。そして、データ入力が終了したと判断すると(ステップS907:Yes)、カウンタA、カウンタBをリセットして処理を終了する(ステップS911)。また、ステップS907の判断でデータ入力が終了していないと判断された場合には(ステップS907:No)、次に入力した画素ブロックの最大値、最小値を求める(ステップS901)。   Next, the CPU 301 determines whether or not input of data to be processed has been completed (step S907). If it is determined that the data input has been completed (step S907: Yes), the counter A and the counter B are reset and the process is terminated (step S911). If it is determined in step S907 that data input has not ended (step S907: No), the maximum value and minimum value of the next input pixel block are obtained (step S901).

以上説明した実施の形態4によれば、最大差分値が所定の値よりも大きい画素ブロックが所定の数以上連続して発生することによって濃度変化が大きい画像部分であることを認識することができる。そして、このとき、画素ブロックを縮小することによって画像部分の情報が失われることを防ぐことができる。   According to the fourth embodiment described above, it is possible to recognize that the image portion has a large density change by continuously generating a predetermined number or more of pixel blocks having a maximum difference value larger than the predetermined value. . At this time, the information of the image portion can be prevented from being lost by reducing the pixel block.

また、実施の形態4によれば、最大差分値が所定の値よりも小さい画素ブロックが所定の数以上連続して発生することによって画像部分の濃度変化が小さいことを認識することができる。そして、このとき、画素ブロックを拡大することによって画素の値が一様になる範囲を拡大し、符号化時の圧縮率を高めると共に符号化の処理効率を高めることができる。   Further, according to the fourth embodiment, it is possible to recognize that the density change of the image portion is small by continuously generating a predetermined number or more of pixel blocks having a maximum difference value smaller than the predetermined value. At this time, by enlarging the pixel block, the range in which the pixel values become uniform can be expanded, and the compression rate at the time of encoding can be increased and the processing efficiency of encoding can be increased.

また、実施の形態1〜4で説明した符号化方法は、予め用意されたプログラムをパーソナル・コンピューターやワークステーション等のコンピュータで実行することにより実現することができる。このプログラムは、ハードディスク、フロッピーディスク、CD−ROM、MO、DVD等のコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。またこのプログラムは、伝送媒体としてまたは上記記録媒体を介して、インターネット等のネットワークを介して配布することができる。   The encoding methods described in Embodiments 1 to 4 can be realized by executing a program prepared in advance on a computer such as a personal computer or a workstation. This program is recorded on a computer-readable recording medium such as a hard disk, floppy disk, CD-ROM, MO, and DVD, and is executed by being read from the recording medium by the computer. The program can be distributed as a transmission medium or via the recording medium via a network such as the Internet.

(実施の形態5)
図10は、復号装置104を説明するためのブロック図である。実施の形態5の復号装置104は、符号化装置103によって符号化された画像を復号する復号装置であって、符号化された画像を前記画素ブロック単位で復号する復号部1001と、復号部1001による復号の際、画素ブロック単位の画像に乱数に基づいて発生する雑音成分を選択的に加える雑音成分付加部1002と、を備えるものである。
(Embodiment 5)
FIG. 10 is a block diagram for explaining the decoding device 104. A decoding device 104 according to Embodiment 5 is a decoding device that decodes an image encoded by the encoding device 103, and includes a decoding unit 1001 that decodes the encoded image in units of pixel blocks, and a decoding unit 1001. And a noise component adding unit 1002 that selectively adds a noise component generated based on a random number to an image in pixel blocks.

符号化装置103によって符号化された画像データは、復号装置1003の復号部1001に入力する。復号部1001は、符号化されたデータを復号して雑音成分付加部1002に出力する。雑音成分付加部1002は、復号された画像データに対して雑音成分を必要に応じて付加し、画像処理部105に出力する。なお、雑音成分付加部1002自身は周知のものであるから、その具体的な構成や雑音成分の付加方法については説明を略すものとする。   The image data encoded by the encoding device 103 is input to the decoding unit 1001 of the decoding device 1003. The decoding unit 1001 decodes the encoded data and outputs the decoded data to the noise component addition unit 1002. The noise component adding unit 1002 adds a noise component to the decoded image data as necessary, and outputs it to the image processing unit 105. Note that since the noise component adding unit 1002 itself is well-known, a description of its specific configuration and noise component adding method will be omitted.

図11は、以上述べた実施の形態5の復号装置104で行われる復号方法を説明するためのフローチャートである。図11のフローチャートによれば、復号装置104は、符号化装置103で符号化された画像データ(符号化データ)が入力したか否か判断する(ステップS1101)。そして、符号化データが入力したと判断した場合(ステップS1101:Yes)、入力した符号化データを符号化とは逆の工程を通して復号する(ステップS1102)。   FIG. 11 is a flowchart for explaining a decoding method performed by decoding apparatus 104 of the fifth embodiment described above. According to the flowchart of FIG. 11, the decoding apparatus 104 determines whether or not the image data (encoded data) encoded by the encoding apparatus 103 has been input (step S1101). If it is determined that encoded data has been input (step S1101: Yes), the input encoded data is decoded through the reverse process of encoding (step S1102).

さらに、復号装置104は、例えば画像データに付加されている制御信号に基づいて、あるいは画像データの特徴量を抽出することによって復号された画像データに雑音成分を付加するか否か判断する(ステップS1103)。この判断の結果、雑音成分を付加する場合には(ステップS1103:Yes)、雑音成分を付加した後(ステップS1104)、復号された画像を画像処理部105に出力する(ステップS1105)。また、雑音成分を付加しないと判断した場合には(ステップS1103:No)、雑音成分を付加することなく復号された画像を画像処理部105に出力する(ステップS1105)。   Further, the decoding device 104 determines whether or not to add a noise component to the decoded image data based on, for example, a control signal added to the image data or by extracting a feature amount of the image data (step). S1103). If a noise component is added as a result of this determination (step S1103: Yes), after adding the noise component (step S1104), the decoded image is output to the image processing unit 105 (step S1105). If it is determined that no noise component is to be added (step S1103: No), the decoded image is output to the image processing unit 105 without adding the noise component (step S1105).

以上説明した実施の形態5は、ブロックごとに符号化された画像を復号する際、必要に応じて復号された画像に雑音成分を加えている。このため、再生された画像におけるブロック歪をなくし、高画質の画像を形成することができる。   Embodiment 5 demonstrated above adds a noise component to the decoded image as needed, when decoding the image encoded for every block. For this reason, block distortion in the reproduced image can be eliminated and a high-quality image can be formed.

また、実施の形態5で説明した復号方法は、予め用意されたプログラムをパーソナル・コンピューターやワークステーション等のコンピュータで実行することにより実現することができる。このプログラムは、ハードディスク、フロッピーディスク、CD−ROM、MO、DVD等のコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。またこのプログラムは、伝送媒体としてまたは上記記録媒体を介して、インターネット等のネットワークを介して配布することができる。   Further, the decoding method described in the fifth embodiment can be realized by executing a program prepared in advance on a computer such as a personal computer or a workstation. This program is recorded on a computer-readable recording medium such as a hard disk, floppy disk, CD-ROM, MO, and DVD, and is executed by being read from the recording medium by the computer. The program can be distributed as a transmission medium or via the recording medium via a network such as the Internet.

本発明の実施の形態1〜4の符号化装置をファクシミリ装置に設けた例を示すブロック図である。It is a block diagram which shows the example which provided the encoding apparatus of Embodiment 1-4 of this invention in the facsimile apparatus. 本発明の実施の形態1〜4の符号化装置を説明するためのブロック図である。It is a block diagram for demonstrating the encoding apparatus of Embodiment 1-4 of this invention. 図2に示した符号化部を説明するためのブロック図である。FIG. 3 is a block diagram for explaining an encoding unit shown in FIG. 2. 本発明の実施の形態1で作成される符号列を説明するための図である。It is a figure for demonstrating the code sequence produced in Embodiment 1 of this invention. 本発明の実施の形態1の符号化方法を説明するためのフローチャートである。It is a flowchart for demonstrating the encoding method of Embodiment 1 of this invention. 本発明の実施の形態2の符号化方法を説明するためのフローチャートである。It is a flowchart for demonstrating the encoding method of Embodiment 2 of this invention. 画素ブロックを再分割する処理を説明するための図である。It is a figure for demonstrating the process which subdivides a pixel block. 本発明の実施の形態3の符号化方法を説明するためのフローチャートである。It is a flowchart for demonstrating the encoding method of Embodiment 3 of this invention. 本発明の実施の形態4の符号化方法を説明するためのフローチャートである。It is a flowchart for demonstrating the encoding method of Embodiment 4 of this invention. 本発明の実施の形態5の復号装置を説明するためのブロック図である。It is a block diagram for demonstrating the decoding apparatus of Embodiment 5 of this invention. 本発明の実施の形態5の復号方法を説明するためのフローチャートである。It is a flowchart for demonstrating the decoding method of Embodiment 5 of this invention.

符号の説明Explanation of symbols

101 画像読取部
102 画像処理部
103 符号化装置
104 復号装置
105 画像処理部
106 画像出力部
107 伝送路
201 ブロック分割部
202 符号化部
301 CPU
302 ROM
303 RAM
304 符号化・圧縮処理部
1001 復号部
1002 雑音成分付加部
DESCRIPTION OF SYMBOLS 101 Image reading part 102 Image processing part 103 Coding apparatus 104 Decoding apparatus 105 Image processing part 106 Image output part 107 Transmission path 201 Block division part 202 Coding part 301 CPU
302 ROM
303 RAM
304 Coding / compression processing unit 1001 Decoding unit 1002 Noise component adding unit

Claims (2)

符号装置と復号装置とを備える符号化・復号化システムにおいて、
前記符号装置は、
画像を所定の領域ごとに分割し、複数の画素で構成される画素ブロックを作成する画素ブロック作成手段と、
前記画素ブロック作成手段により作成された前記画素ブロックに含まれる画素の最大値と最小値との差分を示した差分値と、所定の値との大小関係を判断する判断手段と、
前記判断手段により前記差分値が前記所定の値より大きいと判断された画素ブロックが所定の設定回数以上連続して発生している場合に前記画素ブロック作成手段により分割された画素ブロックの領域を縮小変更し、前記判断手段により前記差分値が前記所定の値より小さいと判断された画素ブロックが所定の設定回数以上連続して発生している場合に前記画素ブロック作成手段により分割された前記画素ブロックの領域を拡大変更する画素ブロックサイズ変更手段と、
前記画素ブロックサイズ変更手段により変更された画素ブロックに含まれる画素の値に基づいて基準値を設定する基準値設定手段と、
前記基準値設定手段により設定された前記基準値に応じて前記画素ブロックにおける画素グループを設定する画素グループ設定手段と、
前記画素ブロックに含まれる画素に対し、前記画素グループ設定手段により設定された画素グループごとに当該画素グループにおける画素の平均値を割り当てる割り当て手段と、を有し、
前記復号装置は、
前記符号装置によって符号化された前記画像を前記画素ブロック単位で復号する復号手段と、
前記復号手段による復号の際、前記画素ブロック単位の画像に乱数に基づいて発生する雑音成分を選択的に加える雑音成分付加手段と、を有すること、
を特徴とする符号化・復号化システム。
In an encoding / decoding system including an encoding device and a decoding device,
The encoding device includes:
Pixel block creating means for dividing an image into predetermined areas and creating a pixel block composed of a plurality of pixels;
Determination means for determining a magnitude relationship between a difference value indicating a difference between a maximum value and a minimum value of pixels included in the pixel block created by the pixel block creation means and a predetermined value;
When the pixel block for which the difference value is determined to be larger than the predetermined value by the determination means is continuously generated for a predetermined number of times, the area of the pixel block divided by the pixel block creation means is reduced. The pixel block divided by the pixel block creating means when the pixel block that has been changed and the difference value is determined to be smaller than the predetermined value is continuously generated for a predetermined number of times or more. Pixel block size changing means for enlarging and changing the area of
Reference value setting means for setting a reference value based on a value of a pixel included in the pixel block changed by the pixel block size changing means;
Pixel group setting means for setting a pixel group in the pixel block according to the reference value set by the reference value setting means;
Assigning means for assigning an average value of pixels in the pixel group for each pixel group set by the pixel group setting means to the pixels included in the pixel block;
The decoding device
Decoding means for decoding the image encoded by the encoding device in units of pixel blocks;
Noise component adding means for selectively adding a noise component generated based on a random number to the image in units of pixel blocks at the time of decoding by the decoding means ;
An encoding / decoding system characterized by the above.
画像を所定の領域ごとに分割し、複数の画素で構成される画素ブロックを作成する画素ブロック作成工程と、
前記画素ブロック作成工程により作成された前記画素ブロックに含まれる画素の最大値と最小値との差分を示した差分値と、所定の値との大小関係を判断する判断工程と、
前記判断工程により前記差分値が前記所定の値より大きいと判断された画素ブロックが所定の設定回数以上連続して発生している場合に前記画素ブロック作成工程により分割された画素ブロックの領域を縮小変更し、前記判断手段により前記差分値が前記所定の値より小さいと判断された画素ブロックが所定の設定回数以上連続して発生している場合に前記画素ブロック作成工程により分割された前記画素ブロックの領域を拡大変更する画素ブロックサイズ変更工程と、
前記画素ブロックサイズ変更工程により変更された画素ブロックに含まれる画素の値に基づいて基準値を設定する基準値設定工程と、
前記基準値設定工程により設定された前記基準値に応じて前記画素ブロックにおける画素グループを設定する画素グループ設定工程と、
前記画素ブロックに含まれる画素に対し、前記画素グループ設定工程により設定された画素グループごとに当該画素グループにおける画素の平均値を割り当てる割り当て工程と、
前記符号化された画像に対して、前記割り当て工程により画素の平均値が割り当てられた前記画素ブロック単位で復号する復号工程と、
前記復号工程における復号の際、前記画素ブロック単位の画像に乱数に基づいて発生する雑音成分を選択的に加える雑音成分付加工程と、
を含むことを特徴とする符号化・復号化方法。
A pixel block creating step of dividing an image into predetermined regions and creating a pixel block composed of a plurality of pixels;
A determination step of determining a magnitude relationship between a difference value indicating a difference between a maximum value and a minimum value of pixels included in the pixel block created by the pixel block creation step, and a predetermined value;
When the pixel block for which the difference value is determined to be larger than the predetermined value by the determination step is continuously generated for a predetermined number of times or more, the area of the pixel block divided by the pixel block creation step is reduced. The pixel block divided by the pixel block creation step when the pixel block that has been changed and the difference value determined to be smaller than the predetermined value is continuously generated for a predetermined number of times or more A pixel block size changing step for enlarging and changing the area of
A reference value setting step for setting a reference value based on a value of a pixel included in the pixel block changed by the pixel block size changing step;
A pixel group setting step for setting a pixel group in the pixel block according to the reference value set by the reference value setting step;
An assigning step of assigning an average value of pixels in the pixel group for each pixel group set by the pixel group setting step to the pixels included in the pixel block;
A decoding step of decoding the encoded image in units of the pixel blocks to which an average value of pixels is assigned by the assignment step;
A noise component adding step of selectively adding a noise component generated based on a random number to the image of the pixel block unit at the time of decoding in the decoding step;
The encoding / decoding method characterized by including this.
JP2005308749A 2005-10-24 2005-10-24 Encoding / decoding system and encoding / decoding method Expired - Lifetime JP4057610B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005308749A JP4057610B2 (en) 2005-10-24 2005-10-24 Encoding / decoding system and encoding / decoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005308749A JP4057610B2 (en) 2005-10-24 2005-10-24 Encoding / decoding system and encoding / decoding method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2000188244A Division JP3788895B2 (en) 2000-06-22 2000-06-22 Encoding apparatus, encoding method, and computer-readable recording medium recording a program for causing a computer to execute the encoding method

Publications (2)

Publication Number Publication Date
JP2006121712A JP2006121712A (en) 2006-05-11
JP4057610B2 true JP4057610B2 (en) 2008-03-05

Family

ID=36539093

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005308749A Expired - Lifetime JP4057610B2 (en) 2005-10-24 2005-10-24 Encoding / decoding system and encoding / decoding method

Country Status (1)

Country Link
JP (1) JP4057610B2 (en)

Also Published As

Publication number Publication date
JP2006121712A (en) 2006-05-11

Similar Documents

Publication Publication Date Title
US8849021B2 (en) Image processing apparatus, method, and storage medium for high speed compression processing
JP4979323B2 (en) Image processing apparatus and control method thereof
JP4033836B2 (en) Compression of paletted color images using variable-length color codes
JP3237582B2 (en) Image processing apparatus and image processing method
JP3843581B2 (en) Image encoding device, image decoding device, image processing device, image encoding method, image decoding method, and image processing method
KR20120065394A (en) Image processing apparatus and processing method therefor
JP2006121645A (en) Image compression apparatus and image compression program
JP4687918B2 (en) Image processing apparatus and program
JP3788895B2 (en) Encoding apparatus, encoding method, and computer-readable recording medium recording a program for causing a computer to execute the encoding method
JP4918026B2 (en) Image coding apparatus, image coding method, computer program, and information recording medium
JP4057610B2 (en) Encoding / decoding system and encoding / decoding method
KR101454208B1 (en) Method and apparatus for encoding/decoding halftone image
JP5529571B2 (en) Image coding apparatus and control method thereof
JP2009212800A (en) Image compression apparatus
JP4462360B2 (en) Image compression apparatus and image expansion apparatus
JP3320282B2 (en) Multi-value image processing device
JP4957572B2 (en) Image processing apparatus, image processing system, image processing method, and image processing program
JP4696738B2 (en) Image data compression method and apparatus, and pseudo gradation image restoration method
JP4741317B2 (en) Data compression apparatus and data compression program
JPH11355575A (en) Image processor
JP4860558B2 (en) Encoding apparatus and encoding method
JP5595142B2 (en) Image processing apparatus and image processing method
JP4382828B2 (en) Line image separation method, image compression method, and image processing apparatus using the same
JP2000244751A (en) Binary coding method for multilevel image and binary encoder for multilevel image
JP2012109880A (en) Image encoding method, image encoding device, image decoding method, and image decoding device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070830

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070911

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071105

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071213

R150 Certificate of patent or registration of utility model

Ref document number: 4057610

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20101221

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20101221

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20111221

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20111221

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20121221

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20131221

Year of fee payment: 6

EXPY Cancellation because of completion of term