JP2009212800A - Image compression apparatus - Google Patents
Image compression apparatus Download PDFInfo
- Publication number
- JP2009212800A JP2009212800A JP2008053565A JP2008053565A JP2009212800A JP 2009212800 A JP2009212800 A JP 2009212800A JP 2008053565 A JP2008053565 A JP 2008053565A JP 2008053565 A JP2008053565 A JP 2008053565A JP 2009212800 A JP2009212800 A JP 2009212800A
- Authority
- JP
- Japan
- Prior art keywords
- value
- gradation
- range
- image
- unit
- 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.)
- Withdrawn
Links
Images
Landscapes
- Compression Of Band Width Or Redundancy In Fax (AREA)
Abstract
Description
本発明は、画像データを圧縮する画像圧縮装置に係り、特に、圧縮対象の画像を所定画素数のブロック単位に圧縮する画像圧縮装置に関する。 The present invention relates to an image compression apparatus that compresses image data, and more particularly to an image compression apparatus that compresses an image to be compressed in blocks of a predetermined number of pixels.
デジタル複合機などの装置では、ビットマップ形式の画像データをメモリやハードディスク装置に保存する場合、必要な記憶容量を削減するために画像データを圧縮して保存することが行われる。 In an apparatus such as a digital multi-function peripheral, when image data in bitmap format is stored in a memory or a hard disk device, the image data is compressed and stored in order to reduce a necessary storage capacity.
静止画の圧縮方式の1つにBTC(Block Truncation Coding)圧縮方式がある。BTC圧縮では、圧縮対象の画像を所定の画素数(たとえば4画素×4画素)毎のブロックに分割する。そして、各ブロックを、そのブロックに属する画素の階調値の最大値と最小値(分布範囲を示す情報)と、該分布範囲内においてブロック内の各画素の階調値を元の画像データの階調数より少ない階調数で正規化(量子化)した符号データとによって表した圧縮データを生成する。 One of the still image compression methods is a BTC (Block Truncation Coding) compression method. In BTC compression, an image to be compressed is divided into blocks each having a predetermined number of pixels (for example, 4 pixels × 4 pixels). Then, for each block, the maximum and minimum values (information indicating the distribution range) of the gradation values of the pixels belonging to the block, and the gradation values of each pixel in the block within the distribution range are converted into the original image data. Compressed data represented by code data normalized (quantized) with a smaller number of gradations than the number of gradations is generated.
伸張時には、圧縮データに含まれる最大値と最小値が示す階調値の分布範囲から符号データの各値に対する代表値を決定し、圧縮データに含まれる各符号データをその対応する代表値の画像データに変換して画像を復元するようになっている。 At the time of decompression, a representative value for each value of the code data is determined from the distribution range of gradation values indicated by the maximum value and the minimum value included in the compressed data, and each code data included in the compressed data is an image of the corresponding representative value. It is designed to restore the image by converting it to data.
たとえば、図7は、各画素を8ビット256階調(図中では階調値を16進数で標記)で表した4画素×4画素の1ブロック分の元画像データ100を、1画素あたり2ビット(4階調)の符号データにBTC圧縮する場合を例示している。元画像データは1ブロックあたり16バイトのデータ量である。
For example, FIG. 7 shows the
圧縮時にはブロック内の階調値の最大値A0hと最小値40hとを両端とする分布範囲が4等分され、階調値Dが、最大値(A0h)≧D>閾値3(88h)の画素は符号データ「11」に、閾値3(88h)≧D>閾値2(70h)の画素は符号データ「10」に、閾値2(70h)≧D>閾値1(58h)の画素は符号データ「01」に、閾値1(58h)≧D≧最小値(40h)の画素は符号データ「00」に符号化される。圧縮データ101はこれら16画素分の符号データと最大値A0hと最小値40hとで構成され、そのデータ量は6バイトになる。
At the time of compression, the distribution range having the maximum value A0h and the minimum value 40h of the gradation value in the block as both ends is equally divided into four, and the gradation value D is a pixel whose maximum value (A0h) ≧ D> threshold value 3 (88h). Indicates code data “11”, pixels with threshold 3 (88h) ≧ D> threshold 2 (70h) indicate code data “10”, and pixels with threshold 2 (70h) ≧ D> threshold 1 (58h) indicate code data “11”. 01 ”, a pixel having a threshold value 1 (58h) ≧ D ≧ minimum value (40h) is encoded into code data“ 00 ”. The
伸張時には、圧縮データ101の示す最大値A0hを符号データ「11」に対応する代表値4に、最小値40hを符号データ「00」に対応する代表値1に、この最大値と最小値が示す範囲(A0h〜40h)を3つに等分割する2つの境界値のうち大きい方の80hを符号データ「10」に対応する代表値3に、小さい方の60hを符号データ「01」に対応する代表値2に設定する。そして、圧縮データ101に含まれる各符号データをその符号データの値に対応する代表値に変換することで1ブロック分の画像データ102に伸張するようになっている。
At the time of expansion, the maximum value A0h indicated by the
BTC圧縮では、ブロック内の階調値の分布範囲を符号データのビット数に応じた階調数に正規化するので、ブロック内の階調値の分布範囲が広くなるほど、各画素の元の階調値と圧縮・伸張した後の階調値との誤差が大きくなるおそれがある。 In the BTC compression, the gradation value distribution range in the block is normalized to the number of gradations corresponding to the number of bits of the code data. Therefore, as the gradation value distribution range in the block becomes wider, the original scale of each pixel is increased. There is a possibility that an error between the tone value and the gradation value after compression / expansion becomes large.
そこで、各ブロックが濃度変化のほとんどない平坦部と、2値的な濃度分布を持つ準平坦部と、濃度変化の激しいエッジ部のいずれかに該当するかを判別し、平坦部・準平坦部・エッジ部によって最適な符号化方法を選択する事で画像品質や圧縮率の向上を図るようにした画像処理装置がある(たとえば、特許文献1参照。)。 Therefore, it is determined whether each block corresponds to one of a flat part having almost no density change, a quasi-flat part having a binary density distribution, and an edge part having a strong density change, and a flat part or a quasi-flat part. There is an image processing apparatus that improves image quality and compression rate by selecting an optimal encoding method according to an edge portion (see, for example, Patent Document 1).
特許文献1に開示された装置のように、ブロックごとに符号化方法を最適化する技術では、1つのブロック内に濃度変化の激しい領域と濃度変化のほとんどない領域とが混在すると、濃度変化の激しい領域に適した符号化方法が選択され、濃度変化のほとんどない領域の濃淡がなくなってしまうという問題がある。
As in the device disclosed in
たとえば、同じブロック内に濃度変化のほとんどない中間色の多い写真や絵などの画像(中間色領域)と、コントラストの高いテキストなどの画像(線画領域)の両方が含まれる場合、圧縮後に中間色領域の濃淡がなくなってしまう。図8はその一例を示している。斜線を施した部分は中間色領域であり、斜線の施されていない部分はコントラストの高い線画領域である。このブロックの画像を1画素あたり2ビット(4階調)にBTC圧縮して伸張すると、元画像の中間色領域にあった微妙な濃度差が消えてしまう。たとえば、画素aと画素bは元画像データ110では階調値60hと階調値70hであるが、圧縮/伸張後の画像データ112においてはいずれも代表値55hに伸張されて濃度差が失われている。
For example, if the same block contains both images (intermediate color areas) such as photographs and pictures with many intermediate colors that have almost no density change and images (line drawing areas) such as high-contrast text, the density of the intermediate color areas after compression Will disappear. FIG. 8 shows an example. The shaded portion is a neutral color region, and the shaded portion is a high-contrast line drawing region. When this block image is decompressed by BTC compression to 2 bits (4 gradations) per pixel, the subtle density difference in the intermediate color area of the original image disappears. For example, the pixel a and the pixel b have the gradation value 60h and the gradation value 70h in the
この欠点を解消する為に、圧縮時の各画素の階調数を増やす(符号データのビット数をたとえば、1画素あたり3ビットに増やす)といった方法もあるが、中間色領域と線画領域の濃淡差が大きい場合には効果が小さい。図9に、図8と同じ元画像データ110を各画素3ビットの符号データに圧縮して伸張した場合の例を示す。伸張後の画像データ115において画素aと画素bはいずれも代表値6Chに伸張されて濃度差が失われている。
In order to eliminate this drawback, there is a method of increasing the number of gradations of each pixel at the time of compression (increasing the number of bits of code data to 3 bits per pixel, for example), but the density difference between the intermediate color area and the line drawing area When is large, the effect is small. FIG. 9 shows an example in which the same
本発明は、上記の問題を解決しようとするものであり、同一ブロック内に中間色領域とこれに対して濃度差の大きい線画領域の双方が含まれる場合でも、中間色領域の濃度差を損なわずに圧縮可能な画像圧縮装置を提供することを目的としている。 The present invention is intended to solve the above-described problem. Even when both the intermediate color area and the line drawing area having a large density difference are included in the same block, the density difference of the intermediate color area is not impaired. An object of the present invention is to provide a compressible image compression apparatus.
かかる目的を達成するための本発明の要旨とするところは、次の各項の発明に存する。 The gist of the present invention for achieving the object lies in the inventions of the following items.
[1]圧縮対象の画像を所定の画素数毎のブロックに分割する分割部と、
前記画像の取り得る階調範囲の一部をなす制限階調範囲が設定される設定部と、
前記分割部で分割して得たブロック毎に、そのブロックに属する画素の階調値の前記制限階調範囲内での最大値と最小値を検出する検出部と、
前記分割部で分割して得たブロック毎に、そのブロックについて前記検出部で検出された前記最大値と最小値とを両端とする第1範囲を複数の領域に区分する領域設定部と、
前記分割部で分割して得た各ブロックの各画素に対して、その画素の階調値が前記制限階調範囲の上端値より大きい場合は第1の符号データを割り当て、前記階調値が前記制限階調範囲の下端値より小さい場合は第2の符号データを割り当て、前記階調値が前記制限階調範囲内の場合はその階調値がその画素の属するブロックについて前記領域設定部で区分された前記複数の領域の中のいずれの領域に属するかを示す符号データを割り当てる符号化部と、
前記分割部で分割して得たブロック毎に、そのブロックに係る前記第1範囲を示す情報と前記ブロックに属する各画素に対して前記符号化部で割り当てた符号データとを含む圧縮データを生成する出力部と、
を有する
ことを特徴とする画像圧縮装置。
[1] a dividing unit that divides an image to be compressed into blocks each having a predetermined number of pixels;
A setting unit in which a limited gradation range that forms a part of a gradation range that the image can take is set;
For each block obtained by dividing by the dividing unit, a detecting unit for detecting the maximum value and the minimum value of the gradation values of the pixels belonging to the block within the limited gradation range;
For each block obtained by dividing by the dividing unit, a region setting unit that divides a first range having both ends of the maximum value and the minimum value detected by the detection unit for the block into a plurality of regions;
For each pixel of each block obtained by dividing by the dividing unit, when the gradation value of the pixel is larger than the upper limit value of the restricted gradation range, first code data is assigned, and the gradation value is If the lower limit value of the limit gradation range is smaller than the lower limit value, the second code data is allocated. If the gradation value is within the limit gradation range, the area setting unit sets the gradation value of the block to which the pixel belongs. An encoding unit that assigns code data indicating which of the plurality of divided areas belongs to; and
For each block obtained by the division by the division unit, compressed data including information indicating the first range related to the block and code data allocated by the encoding unit to each pixel belonging to the block is generated. An output unit to
An image compression apparatus comprising:
上記発明では、1つのブロックに属する画素のうち、階調値が制限階調範囲の上端値を超える画素には第1の符号データを、下端値未満の画素には第2の符号データを固定的に割り当てる。また、制限階調範囲内にある画素のみを対象として、その階調値の最大値と最小値を検出し、制限階調範囲内にある各画素は、この最大値と最小値を両端とする階調範囲(第1範囲)を所定の複数階調で表すように量子化され、第1、第2の符号データとは値の異なる符号データに符号化される。これにより、線画領域と中間色領域とが1ブロック内に混在した場合には、線画領域は制限階調範囲外と判定され、中間色領域に対して多く階調数を割り当て符号化することができ、中間色領域の階調差を損なうことなく圧縮することができる。 In the above invention, among the pixels belonging to one block, the first code data is fixed to pixels whose gradation value exceeds the upper limit value of the limited gradation range, and the second code data is fixed to pixels less than the lower limit value. To assign. Further, only the pixels within the limited gradation range are targeted, and the maximum and minimum values of the gradation value are detected, and each pixel within the limited gradation range has the maximum value and the minimum value as both ends. The gradation range (first range) is quantized so as to be expressed by a predetermined plurality of gradations, and is encoded into code data having a value different from that of the first and second code data. As a result, when the line drawing area and the intermediate color area are mixed in one block, the line drawing area is determined to be outside the limited gradation range, and a large number of gradations can be assigned to the intermediate color area for encoding. Compression can be performed without impairing the gradation difference in the intermediate color area.
[2]前記制限階調範囲の上端値は、前記画像の取り得る最大階調値より小さく、
前記制限階調範囲の下端値は、前記画像の取り得る最小階調値より大きい、
ことを特徴とする[1]に記載の画像圧縮装置。
[2] The upper limit value of the limited gradation range is smaller than the maximum gradation value that the image can take,
The lower limit value of the limited gradation range is larger than the minimum gradation value that the image can take,
The image compression apparatus according to [1], wherein
上記発明によれば、制限階調範囲は、画像の取り得る階調範囲の最大値近くと最小値近くを除く範囲に設定される。すなわち、制限階調範囲は濃度が非常に濃い領域と非常に薄い領域とを除く階調範囲にされる。これにより線画領域を除くことができ、線画を除く画像領域に対してより多くの階調数を与えて量子化することが可能になる。 According to the invention, the limited gradation range is set to a range excluding near the maximum value and the minimum value of the gradation range that can be taken by the image. That is, the limited gradation range is a gradation range excluding a very dark area and a very thin area. As a result, the line drawing area can be removed, and the image area excluding the line drawing can be quantized by giving a larger number of gradations.
[3]前記設定部は、前記圧縮対象の画像の濃淡レベルを示す濃淡情報を入力し、該入力された濃淡情報に応じて前記制限階調範囲を変更する
ことを特徴とする[1]または[2]に記載の画像圧縮装置。
[3] The setting unit inputs density information indicating a density level of the image to be compressed, and changes the limited gradation range according to the input density information [1] or The image compression apparatus according to [2].
上記発明では、圧縮対象の画像の濃淡レベルに応じて制限階調範囲を変更するので、その画像の特性に応じた適切な圧縮を行うことができる。 In the above invention, since the limited gradation range is changed according to the density level of the image to be compressed, it is possible to perform appropriate compression according to the characteristics of the image.
本発明に係る画像圧縮装置によれば、同一ブロック内に中間色領域とこれに対して濃度差の大きい線画領域の双方が含まれる場合でも、中間色領域の濃度差を損なわずに画像データを圧縮することができる。 The image compression apparatus according to the present invention compresses image data without losing the density difference between the intermediate color areas even when both the intermediate color area and the line drawing area with a large density difference are included in the same block. be able to.
以下、図面に基づき本発明の各種実施の形態を説明する。 Hereinafter, various embodiments of the present invention will be described with reference to the drawings.
図1は本発明の第1の実施の形態に係る画像圧縮装置10の構成を示している。画像圧縮装置10は、圧縮対象の画像(画像データ)を入力し、この画像を所定の画素数毎のブロックに分割し、ブロック毎に圧縮した圧縮データを出力する機能を果たす。
FIG. 1 shows the configuration of an
画像圧縮装置10は、たとえば、原稿のコピー機能やプリント機能などを備えた複合機において、入力される原稿の画像データをハードディスク装置などに圧縮して保存する際の圧縮処理に使用される。
The
画像圧縮装置10はマイクロプログラムを内蔵したシーケンサや論理回路などのハードウェア回路で構成される。なお、CPU(Central Processing Unit)、ROM(Read Only Memory)、RAM(Random Access Memory)などを備えたコンピュータ装置において所定のプログラムを実行することで実現されてもよい。
The
画像圧縮装置10で使用される圧縮方式は、BTC圧縮を基本としたものである。画像圧縮装置10に入力される圧縮対象の画像データは、1画素を深さ8ビットの256階調で表したビットマップ形式の画像データである。画像圧縮装置10は、各画素の階調をNビット(Nは3以上の整数で、ここでは「3」とする)の符号データに正規化して表した圧縮データを生成する。
The compression method used in the
画像圧縮装置10は、入力部11と、分割部12と、設定部13と、最大値最小値検出部14と、閾値生成部15と、判定部16と、符号化部17と、出力部18とを備えて構成される。
The
入力部11は、圧縮対象の画像データの入力を受ける。分割部12は、入力部11から入力された圧縮対象の画像データを所定の画素数毎のブロックに分割する。ここでは、図2に示すように、画像Gの左上を基点として4画素×4画素のブロックBLに分割する。分割部12は1ブロックを分割する毎にそのブロックの画像データを最大値最小値検出部14と、判定部16と、符号化部17に送出する。
The
設定部13は、入力部11から入力される画像データの取り得る階調範囲(ここでは、0〜255階調)の一部をなす制限階調範囲の設定を、図示省略のCPU(Central Processing Unit)などから受け付け、その設定された制限階調範囲を記憶する機能を果たす。ここでは制限階調範囲の上端値Aと下端値Bの設定を受けてこれらを記憶する。設定部13は設定された制限階調範囲の上端値Aと下端値Bを、最大値最小値検出部14および判定部16に送る。
The setting
制限階調範囲は、非常に濃い領域と非常に薄い領域を除外した階調範囲に設定される。すなわち、線画の領域と中間色領域とが混在し、中間色領域の濃度と線画領域の濃度との間の大きな濃度差があるような場合に、中間色領域と線画領域とを制限階調範囲の内外として分離できるように、制限階調範囲は設定される。たとえば、画像の取り得る階調範囲の最大階調側の1割と最小階調側の1割とを除く中間の8割部分を制限階調範囲に設定する。 The limited gradation range is set to a gradation range excluding a very dark area and a very thin area. In other words, when the line drawing area and the intermediate color area are mixed and there is a large density difference between the density of the intermediate color area and the density of the line drawing area, the intermediate color area and the line drawing area are set to be inside and outside the restricted gradation range. The limited gradation range is set so that it can be separated. For example, an intermediate 80% portion excluding 10% on the maximum gradation side and 10% on the minimum gradation side of the gradation range that the image can take is set as the limited gradation range.
このほか、圧縮対象の画像データGの取り得る階調範囲を、1画素あたりの符号データのデータ量であるNビット(3ビット)で表現可能な種類数M(「8」)で除して得たサイズQの(M−2)倍以下に設定すれば、制限階調範囲内を(M−2)階調で表す場合の1階調あたりの量子化対象範囲を、画像の取り得る階調範囲全体をM階調で表す場合の1階調あたりの量子化対象範囲以下にすることができる。 In addition, the gradation range that can be taken by the image data G to be compressed is divided by the number of types M (“8”) that can be expressed by N bits (3 bits), which is the data amount of code data per pixel. If the obtained size Q is set to (M−2) times or less, the quantization target range per gradation when the restricted gradation range is expressed by (M−2) gradations can be obtained. When the entire gradation range is expressed by M gradations, the quantization target range per gradation can be made equal to or less.
最大値最小値検出部14は、分割部12で分割して得たブロック毎に、そのブロック(分割部12から入力された処理対象のブロック)に属する画素の階調値の制限階調範囲内での最大値と最小値を検出する。たとえば、処理対象のブロックの各画素の階調値Dと設定部13から入力される上端値Aおよび下端値Bとを比較し、上端値A≧D≧下端値Bとなる画素を抽出し、それら抽出した画素の階調値D同士を順次比較して、該抽出した画素の中の階調値の最大値と最小値を検出する。検出結果21は閾値生成部15および出力部18に送られる。
For each block obtained by dividing by the dividing
閾値生成部15は、最大値最小値検出部14から入力された最大値と最小値とを両端とする範囲(第1範囲)を、(M−2)個の領域に分割するための閾値を生成する。ここでは、第1範囲を6等分するための5個の閾値1〜閾値5が生成される。小さい方の閾値から順に閾値1、閾値2、閾値3…とする。生成された各閾値は符号化部17に送られる。
The threshold
判定部16は、分割部12で分割して得た各ブロックの各画素に対して、その画素の階調値が制限階調範囲内か否かを判定する。具体的には、分割部12から処理対象のブロックの各画素の階調値Dが予め定めた順序(たとえば、図2のブロックBL内の各画素に付した番号順)で順次入力され、その入力順に、その画素の階調値Dと設定部13から入力されている制限階調範囲の上端値Aおよび下端値Bとを比較する。そして、上端値A≧D≧下端値Bの場合は制限階調範囲内を示す第1信号を、D>上端値Aのときは上端値超えを示す第2信号を、D<下端値Bの場合は下端値未満を示す第3信号を符号化部17に対して出力する。
The
符号化部17は、分割部12で分割して得た各ブロックの各画素に対して、その画素の階調値Dが制限階調範囲の上端値Aより大きい場合は第1の値の符号データを割り当て、階調値Dが制限階調範囲の下端値Bより小さい場合は第2の値の符号データを割り当てる。また、階調値Dが制限階調範囲内の場合は、その画素の階調値Dが、その画素の属するブロックについて最大値最小値検出部14で検出された最大値と最小値とを両端とする第1範囲を同ブロックについて閾値生成部15で生成された複数の閾値で区分して得られる(M−2)個の領域の中のいずれの領域に属するかを判断し、その領域を一意に示す値の符号データをその画素に割り当てる。
For each pixel of each block obtained by dividing by the dividing
符号化部17には、分割部12から判定部16へ入力される画素と同じ画素の階調値(画像データ)Dが順次入力される。符号化部17はその入力された画素に対して順次、符号データを割り当てる。
The gradation value (image data) D of the same pixel as the pixel input from the dividing
詳細には、符号化部17に分割部12から処理対象の画素の階調値D(画像データ)が入力されたとき、その同じ画素に対する判定部16での判定結果が判定部16から入力される。符号化部17は判定部16から第2信号が入力されている場合は、その処理対象の画素に対して3ビットの符号データ「111」を割り当てる。分割部12から処理対象の画素の階調値D(画像データ)が入力された際に同時に判定部16から第3信号が入力されている場合は、その処理対象の画素に対して符号データ「000」を割り当てる。
Specifically, when the gradation value D (image data) of the pixel to be processed is input from the dividing
なお、判定部16にて第2信号と第3信号を区別せずに、制限階調範囲内か制限階調範囲外であるかを示す信号を符号化部17へ出力するようにし、制限階調範囲外を示す信号を受けた場合に符号化部17側でその対応する画像の階調値が上端値A超えであるか下端値B未満であるかを閾値生成部15から入力される任意の閾値とその画素の階調値Dとを比較して判断してもよい。すなわち、制限階調範囲外でかつ画素の階調値がいずれかの閾値超えの場合は上端値A超え、閾値未満の場合は下端値B未満と判断することができる。
The
分割部12から処理対象の画素の階調値D(画像データ)が入力された際に同時に判定部16から第1信号(制限階調範囲内を示す信号)が入力されている場合は、その画素の階調値Dと、閾値生成部15から入力されている閾値1〜5とを比較し、その比較結果に応じてその処理対象の画素に対して以下のように符号データを割り当てる。
When the gradation value D (image data) of the pixel to be processed is input from the dividing
・D>閾値5ならば符号データ「110」
・閾値5≧D>閾値4ならば符号データ「101」
・閾値4≧D>閾値3ならば符号データ「100」
・閾値3≧D>閾値2ならば符号データ「011」
・閾値2≧D>閾値1ならば符号データ「010」
・閾値1≧Dならば符号データ「001」
このように割り当てた符号データを符号化部17は逐次、出力部18へ出力する。
If D>
If
If
If
If
If the
The
出力部18は、分割部12で分割して得たブロック毎に、そのブロックに係る第1範囲を示す情報とそのブロックに属する各画素に対して符号化部17で割り当てた符号データとを含む圧縮データを生成して出力する。すなわち、最大値最小値検出部14から入力される処理対象のブロックに係る最大値と最小値(第1範囲を示す情報)と、符号化部17から順次入力されるそのブロックの各画素に割り当てられた16画素分の符号データとから構成される圧縮データをブロック毎に生成し出力する。
The
図3は、画像圧縮装置10による圧縮処理の流れを示している。圧縮対象の画像データを入力部11から入力し(ステップS101)、分割部12はこの入力された画像を所定画素数毎(4×4画素など)のブロックに順次分割する(ステップS102)。
FIG. 3 shows the flow of compression processing by the
最大値最小値検出部14は、分割部12から与えられる処理対象のブロックに属する画素の中で、設定部13から与えられた制限階調範囲内での最大の階調値(最大値)と最小の階調値(最小値)とを検出する(ステップS103)。
The maximum value / minimum
閾値生成部15は最大値最小値検出部14の検出した最大値と最小値を両端とする階調の分布範囲(第1範囲)を(M−2)等分(ここでは6等分)するための閾値を生成する(ステップS104)。また判定部16は、処理対象のブロックに属する各画素の階調値が制限階調範囲外か否かを判別する(ステップS105)。
The threshold
符号化部17は、判定部16の判別結果と閾値生成部15の生成した閾値とから各画素に符号データを割り当てて符号化する(ステップS106)。すなわち、処理対象の画素の階調値が、制限階調範囲の上端値Aより大きい場合は第1の符号データ(3ビットの符号データ「111」)を割り当て、階調値が制限階調範囲の下端値Bより小さい場合は第2の符号データ(3ビットの符号データ「000」)を割り当て、階調値が制限階調範囲内の場合は該階調値と閾値生成部15の生成した各閾値1〜5と比較し、この階調値がそれらの閾値1〜5で区分けされた複数の領域の中のどの領域に属するかを判別し、その領域に対応した符号データ(「001」〜「110」のいずれか)を割り当てる。
The
出力部18は、符号化部17によって割り当てられた画素毎の符号データと最大値最小値検出部14から与えられる最大値と最小値とから、処理対象のブロックに係る圧縮データを生成して出力する(ステップS107)。
The
次に、画像圧縮装置10による画像の圧縮例について説明する。図4は、図9と同じブロックの元画像データ110を画像圧縮装置10にて圧縮した例を示している。この例では制限階調範囲は20h〜DFhに設定されている。斜線を施した領域の各画素はその階調値が制限階調範囲内にある画素である。制限階調範囲内にある画素の階調値の中の最大値は90h、最小値は60hなので、この最大値と最小値を両端とする60h〜90hの範囲(第1範囲)を6等分するための閾値1(68h)、閾値2(70h)、閾値3(78h)、閾値4(80h)、閾値5(88h)が閾値生成部15によって生成される。
Next, an example of image compression by the
符号化部17は、処理対象の画素の階調値Dが、
・E0h〜FFhにあれば符号データ「111」
・88h〜90hにあれば符号データ「110」
・80h〜87hにあれば符号データ「101」
・78h〜7Fhにあれば符号データ「100」
・70h〜77hにあれば符号データ「011」
・68h〜6Fhにあれば符号データ「010」
・60h〜67hにあれば符号データ「001」
・00h〜1Fhにあれば符号データ「000」
をその画素に対して割り当て、出力部18はこれらの16画素分の符号データと最大値と最小値とから構成された圧縮データ51を生成する。
The
-If E0h to FFh, code data "111"
-Code data "110" if in 88h to 90h
-Code data "101" if in 80h to 87h
-Code data "100" if in 78h-7Fh
-Code data “011” in the range from 70h to 77h
-Code data "010" in 68h-6Fh
-If it is in 60h to 67h, code data "001"
-Code data "000" if in 00h to 1Fh
Is assigned to the pixel, and the
画像圧縮装置10で生成された圧縮データ51は次のようにして伸張される。
The
画像の取り得る階調範囲(0〜255階調)の中の最大値であるFFhを符号データ「111」に対する代表値8に設定し、画像の取り得る階調範囲の中の最小値である00hを符号データ「000」に対する代表値1に設定する。また圧縮データに含まれている最大値(90h)を符号データ「110」に対する代表値7に設定し、最小値(60h)を符号データ「001」に対する代表値2に設定する。
The maximum value FFh in the gradation range that the image can take (0 to 255 gradations) is set to the
さらに、この最大値(90h)と最小値(60h)を両端とする範囲を5個(すなわち、(M−2)−1)に等分するための4つの境界値(69h、72h、7Bh、84h)を求め、その中の最も小さい境界値69hを符号データ「010」に対する代表値3に、次に小さい境界値72hを符号データ「011」に対する代表値4に、次に小さい境界値7Bhを符号データ「100」に対する代表値5に、最も大きい境界値84hを符号データ「101」に対する代表値6に設定する。そして、圧縮データ51に含まれる各画素の符号データをその値に対応する代表値1〜8に変換することで、画像データ55に伸張される。
Furthermore, four boundary values (69h, 72h, 7Bh, and so on) for equally dividing the range having the maximum value (90h) and the minimum value (60h) at both ends into five (ie, (M-2) -1). 84h), the smallest boundary value 69h among them is the
図4に示す伸張後の画像データ55では画素aと画素bに階調差があり、圧縮前の画像データ110の中間色領域にあった階調差が再現されている。このように画像圧縮装置10では、同一ブロック内に中間色領域とこれに対して濃度差の大きい線画領域の双方が含まれる場合でも、中間色領域の濃度差を損なわずに圧縮でき、伸張時の画質の向上が図られる。
In the decompressed
次に、本発明の第2の実施の形態について説明する。 Next, a second embodiment of the present invention will be described.
図5は、第2の実施の形態に係る画像圧縮装置10Bの構成を示している。第2の実施の形態の画像圧縮装置10Bは、設定部13に代えて設定部19を備えている点で第1の実施の形態の画像圧縮装置10と相違する。その他の構成は第1の実施の形態の画像圧縮装置10と同一であり、それらの説明は省略する。
FIG. 5 shows a configuration of an
設定部19は、圧縮対象の画像の濃淡レベルを示す濃淡情報を外部から入力し、該入力された濃淡情報に応じて制限階調範囲を変更する。たとえば、画像圧縮装置10Bは、図5に示すように、原稿を光学的に読み取るスキャナ装置60を備えた装置(たとえば、複写機)に設けられ、このスキャナ装置60が備えるEEセンサ61から原稿の濃度レベルを示す濃度情報を受け取るように構成される。スキャナ装置60は、光源の発する光を原稿に照射し、その反射光をイメージセンサで受光することで原稿画像を読み取るように構成されており、EEセンサ61はその反射光の通過経路に沿って設けられて光の強さを検知するセンサである。
The setting
スキャナ装置60で原稿を読み取って得た画像データを画像圧縮装置10Bで圧縮する際に、設定部19は、EEセンサ61から入力される濃度情報に基づいて、スキャナ装置60で読み取った原稿(もしくは原稿の背景)が濃いか、淡いか、標準的かを判断する。濃いと判断した場合は、制限階調範囲を階調値の標準(初期の設定値)より小さい方へ片寄るように変更する。これにより、符号化する際に濃い色の階調範囲における濃淡がつぶれ難くなる。
When image data obtained by reading a document with the
階調値の小さい方へ片寄るように制限階調範囲を変更する方法には、
(1)制限階調範囲の下端値を下げて制限階調範囲を最小値側へ広げる、
(2)制限階調範囲のサイズは変えずに全体を最小値側へシフトさせる、
(3)制限階調範囲のサイズ縮小と下端値を下げることの双方を行う、
などがある。なお、濃度と階調値の関係は、濃度が濃いほど階調値は小さくなり、真っ黒(最大濃度)の階調値は00hであるものとする。
To change the limited gradation range so that the gradation value is smaller,
(1) Lower the lower limit value of the limited gradation range to widen the limited gradation range to the minimum value side.
(2) Shift the whole to the minimum value side without changing the size of the limited gradation range,
(3) Both the size reduction of the limited gradation range and the lower end value are reduced.
and so on. Note that the relationship between the density and the gradation value is such that the higher the density, the smaller the gradation value, and the gradation value of black (maximum density) is 00h.
設定部19は、EEセンサ61から入力される濃度情報から、スキャナ装置60で読み取った原稿(もしくは原稿の背景)が淡い(薄い)と判断した場合は、制限階調範囲を階調値の大きい方へ片寄るように変更する。これにより、符号化する際に淡い色の階調範囲における濃淡がつぶれ難くなる。
If the
階調値の大きい方へ片寄るように制限階調範囲を変更する方法には、
(1)制限階調範囲の上端値を高めて制限階調範囲を最大値側へ広げる、
(2)制限階調範囲のサイズは変えずに全体を最大値側へシフトさせる、
(3)制限階調範囲のサイズ縮小と上端値を高めることの双方を行う、
などがある。
To change the limit gradation range so that it is offset toward the larger gradation value,
(1) Increasing the upper limit value of the limited gradation range to widen the limited gradation range to the maximum value side.
(2) Shift the whole to the maximum value side without changing the size of the limit gradation range,
(3) Both the size reduction of the limited gradation range and the upper end value are increased.
and so on.
図6は、第2の実施の形態の画像圧縮装置10Bにおける圧縮処理の流れを示している。図3の流れ図と同じ処理内容のステップには同一のステップ番号を付してある。図6の処理は図3の処理に比べてS102とS103の間にS102Bが挿入さている点で相違する。すなわち、EEセンサ61からの濃度情報に基づいて制限階調範囲を設定変更し(ステップS102B)、その設定変更後の制限階調範囲に基づいてS103以後の処理が行われる。制限階調範囲の設定変更はページ単位に行われる。
FIG. 6 shows the flow of compression processing in the
EEセンサ61の出力する濃度情報は00h〜FFhの範囲で濃度レベルを示し、これに対して設定部19は以下のように制限階調範囲を設定する。
a.濃度情報が00h〜4Fhの場合、制限階調範囲を10h〜CFhに設定する。
b.濃度情報が50h〜AFhの場合、制限階調範囲を20h〜DFhに設定する。
c.濃度情報がB0h〜FFhの場合、制限階調範囲を30h〜EFhに設定する。
The density information output from the
a. When the density information is 00h to 4Fh, the limited gradation range is set to 10h to CFh.
b. When the density information is 50h to AFh, the limited gradation range is set to 20h to DFh.
c. When the density information is B0h to FFh, the limited gradation range is set to 30h to EFh.
このように、EEセンサ61などで検知された原稿や原稿背景の濃度レベルに応じて、制限階調範囲のサイズと中心位置のいずれかもしくは双方を変更することで、原稿全体の濃淡や用紙の特性を加味することができ、より一層、画質劣化の少ない圧縮が実現される。
As described above, by changing either or both of the size of the limited gradation range and the center position according to the density level of the original or the background of the original detected by the
以上、本発明の実施の形態を図面によって説明してきたが、具体的な構成は実施の形態に示したものに限られるものではなく、本発明の要旨を逸脱しない範囲における変更や追加があっても本発明に含まれる。 The embodiment of the present invention has been described with reference to the drawings. However, the specific configuration is not limited to that shown in the embodiment, and there are changes and additions within the scope of the present invention. Are also included in the present invention.
たとえば、圧縮時に各画素を3ビットの符号データに変換する例を示したが、1画素あたりの符号データは3ビット以上であってもかまわない。ただし、圧縮するのであるから元の画像データの階調数(ビット数)より少ないビット数にされる。 For example, an example is shown in which each pixel is converted into 3-bit code data at the time of compression, but the code data per pixel may be 3 bits or more. However, since compression is performed, the number of bits is smaller than the number of gradations (bits) of the original image data.
また、第2の実施の形態では、EEセンサ61の出力する濃度情報に基づいて制限階調範囲を設定変更するようにしたが、たとえば、1枚の画像データにおける階調値のヒストグラムを作成し、階調値の分布状態に応じて制限階調範囲を設定変更するようにされてもよい。要するに、濃度情報は、圧縮対象の画像が全体として濃い原稿か淡い原稿かを判断可能な情報であればよい。
In the second embodiment, the limit gradation range is set and changed based on the density information output from the
圧縮対象の画像データはスキャナ装置60などで読み取ったものに限定されず、パーソナルコンピュータなどの情報処理装置で作成された画像データなど任意の画像データでかまわない。
The image data to be compressed is not limited to that read by the
このほか、1ブロックのサイズは実施の形態で例示したものに限定されない。 In addition, the size of one block is not limited to that exemplified in the embodiment.
10、10B…画像圧縮装置
11…入力部
12…分割部
13…設定部
14…最大値最小値検出部
15…閾値生成部
16…判定部
17…符号化部
18…出力部
19…設定部
21…検出結果
60…スキャナ装置
61…EEセンサ
DESCRIPTION OF
Claims (3)
前記画像の取り得る階調範囲の一部をなす制限階調範囲が設定される設定部と、
前記分割部で分割して得たブロック毎に、そのブロックに属する画素の階調値の前記制限階調範囲内での最大値と最小値を検出する検出部と、
前記分割部で分割して得たブロック毎に、そのブロックについて前記検出部で検出された前記最大値と最小値とを両端とする第1範囲を複数の領域に区分する領域設定部と、
前記分割部で分割して得た各ブロックの各画素に対して、その画素の階調値が前記制限階調範囲の上端値より大きい場合は第1の符号データを割り当て、前記階調値が前記制限階調範囲の下端値より小さい場合は第2の符号データを割り当て、前記階調値が前記制限階調範囲内の場合はその階調値がその画素の属するブロックについて前記領域設定部で区分された前記複数の領域の中のいずれの領域に属するかを示す符号データを割り当てる符号化部と、
前記分割部で分割して得たブロック毎に、そのブロックに係る前記第1範囲を示す情報と前記ブロックに属する各画素に対して前記符号化部で割り当てた符号データとを含む圧縮データを生成する出力部と、
を有する
ことを特徴とする画像圧縮装置。 A dividing unit that divides an image to be compressed into blocks each having a predetermined number of pixels;
A setting unit in which a limited gradation range that forms a part of a gradation range that the image can take is set;
For each block obtained by dividing by the dividing unit, a detecting unit for detecting the maximum value and the minimum value of the gradation values of the pixels belonging to the block within the limited gradation range;
For each block obtained by dividing by the dividing unit, a region setting unit that divides a first range having both ends of the maximum value and the minimum value detected by the detection unit for the block into a plurality of regions;
For each pixel of each block obtained by dividing by the dividing unit, when the gradation value of the pixel is larger than the upper limit value of the restricted gradation range, first code data is assigned, and the gradation value is If the lower limit value of the limit gradation range is smaller than the lower limit value, the second code data is allocated. If the gradation value is within the limit gradation range, the area setting unit sets the gradation value of the block to which the pixel belongs. An encoding unit that assigns code data indicating which of the plurality of divided areas belongs to; and
For each block obtained by the division by the division unit, compressed data including information indicating the first range related to the block and code data allocated by the encoding unit to each pixel belonging to the block is generated. An output unit to
An image compression apparatus comprising:
前記制限階調範囲の下端値は、前記画像の取り得る最小階調値より大きい、
ことを特徴とする請求項1に記載の画像圧縮装置。 The upper limit value of the limited gradation range is smaller than the maximum gradation value that the image can take,
The lower limit value of the limited gradation range is larger than the minimum gradation value that the image can take,
The image compression apparatus according to claim 1.
ことを特徴とする請求項1または2に記載の画像圧縮装置。 The said setting part inputs the shading information which shows the shading level of the said image to be compressed, and changes the said limitation gradation range according to the inputted shading information. Image compression device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008053565A JP2009212800A (en) | 2008-03-04 | 2008-03-04 | Image compression apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008053565A JP2009212800A (en) | 2008-03-04 | 2008-03-04 | Image compression apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009212800A true JP2009212800A (en) | 2009-09-17 |
Family
ID=41185530
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008053565A Withdrawn JP2009212800A (en) | 2008-03-04 | 2008-03-04 | Image compression apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009212800A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2012128241A1 (en) * | 2011-03-18 | 2012-09-27 | ソニー株式会社 | Image-processing device, image-processing method, and program |
US9571844B2 (en) | 2013-12-26 | 2017-02-14 | Megachips Corporation | Image processor |
CN108881904A (en) * | 2018-06-25 | 2018-11-23 | 中山大学 | Quick decision method, device and storage medium in frame based on Sobel operator |
CN117395380A (en) * | 2023-12-12 | 2024-01-12 | 上海伯镭智能科技有限公司 | Intelligent management method for dispatching data of unmanned mine car in large mining area |
-
2008
- 2008-03-04 JP JP2008053565A patent/JP2009212800A/en not_active Withdrawn
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2012128241A1 (en) * | 2011-03-18 | 2012-09-27 | ソニー株式会社 | Image-processing device, image-processing method, and program |
US9571844B2 (en) | 2013-12-26 | 2017-02-14 | Megachips Corporation | Image processor |
CN108881904A (en) * | 2018-06-25 | 2018-11-23 | 中山大学 | Quick decision method, device and storage medium in frame based on Sobel operator |
CN117395380A (en) * | 2023-12-12 | 2024-01-12 | 上海伯镭智能科技有限公司 | Intelligent management method for dispatching data of unmanned mine car in large mining area |
CN117395380B (en) * | 2023-12-12 | 2024-02-23 | 上海伯镭智能科技有限公司 | Intelligent management method for dispatching data of unmanned mine car in large mining area |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5132517B2 (en) | Image processing apparatus and image processing method | |
JP4236659B2 (en) | Image encoding apparatus, image encoding method, image encoding program, and recording medium | |
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 | |
US20090141048A1 (en) | Method, apparatus, and computer program product for processing image | |
JP4829836B2 (en) | Image encoding apparatus, control method for image encoding apparatus, computer program, decoding apparatus, and computer-readable storage medium | |
JP2009212800A (en) | Image compression apparatus | |
US8107743B2 (en) | Image processing device, image processing method, and storage medium | |
JP2006197178A (en) | Image processor, image processing method, program, and storage medium | |
JP3872217B2 (en) | Dither image binary expression processing method, dither image compression binary expression decompression method, and dither image compression and decompression system | |
US8254703B2 (en) | Image compression apparatus and image compression method | |
JP2007306513A (en) | Method and device for image data compression | |
JP2006100977A (en) | Printing system and printer | |
JP4462360B2 (en) | Image compression apparatus and image expansion apparatus | |
JP2008278462A (en) | Image processing device, image processing method, and storage medium | |
JP2010028796A (en) | Image forming apparatus, image converting device, and image forming method | |
JP4031442B2 (en) | Image processing apparatus and image forming apparatus having the same | |
JP7185451B2 (en) | Image processing device, image processing method, and program | |
JP2003189108A (en) | Image compression method | |
JP2009130467A (en) | Image encoding apparatus and method of controlling the same | |
JPH0918877A (en) | Fractal image compression device | |
JP5434799B2 (en) | Image coding apparatus, image coding method, and image coding program | |
JP4057610B2 (en) | Encoding / decoding system and encoding / decoding method | |
JP4382828B2 (en) | Line image separation method, image compression method, and image processing apparatus using the same | |
JP2009005018A (en) | Device for encoding image and device for decoding image and control method therefor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20110510 |