JPH11177828A - Image processing method and device therefor - Google Patents

Image processing method and device therefor

Info

Publication number
JPH11177828A
JPH11177828A JP9341673A JP34167397A JPH11177828A JP H11177828 A JPH11177828 A JP H11177828A JP 9341673 A JP9341673 A JP 9341673A JP 34167397 A JP34167397 A JP 34167397A JP H11177828 A JPH11177828 A JP H11177828A
Authority
JP
Japan
Prior art keywords
data
image
value
compression
difference
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
Application number
JP9341673A
Other languages
Japanese (ja)
Inventor
Nobuo Ogawa
信夫 小川
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP9341673A priority Critical patent/JPH11177828A/en
Publication of JPH11177828A publication Critical patent/JPH11177828A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

PROBLEM TO BE SOLVED: To compress the data of multilevel images by high compressibility without accompanying information loss. SOLUTION: This method is provided with a step for measuring the run length of the same data value from image data for indicating the multilevel images, the step for calculating the difference of the data values of a picture element under consideration and the adjacent picture element from the image data and the step for compressing the image data by using a single encoding table 12 for indicating the appearing frequency of the difference and the run length based on the measured run length and the calculated difference.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は画像処理方法及び装
置に係り、特に多値画像を示す画像データの圧縮及び伸
長に適した画像処理方法及び装置に関する。近年のマル
チメディア関連技術の進歩に伴い、数値や文字等のデー
タに加え、画像や音声等のデータが多く扱われるように
なってきた。これは、コンピュータ関連機器の進歩によ
るところが大きく、従来では扱いきれなかった画像等の
膨大なメモリ容量を必要とするデータも充分処理できる
ようになってきた。
The present invention relates to an image processing method and apparatus, and more particularly to an image processing method and apparatus suitable for compression and decompression of image data representing a multi-valued image. 2. Description of the Related Art With the advance of multimedia-related technology in recent years, data such as images and sounds have been increasingly handled in addition to data such as numerical values and characters. This is largely due to advances in computer-related equipment, and it has become possible to sufficiently process data that requires a huge memory capacity, such as images that could not be handled conventionally.

【0002】特に記憶装置の進歩は著しく、パーソナル
コンピュータ等でも32MB以上の記憶容量の主記憶装
置や1GB以上の記憶容量のハードディスクを備えるこ
とが不可能ではなくなってきた。画像データは、文字デ
ータ等に比べると非常にデータ量が多く、例えばA4サ
イズで300dpiのモノクロ多値画像の場合は約10
MB、カラー多値画像の場合は30MBにもなるが、こ
のようなカラー多値画像のデータも主記憶装置に記憶す
ることができる。
In particular, the progress of storage devices has been remarkable, and it has become impossible for personal computers and the like to have a main storage device having a storage capacity of 32 MB or more or a hard disk having a storage capacity of 1 GB or more. The image data has a much larger amount of data than character data and the like. For example, in the case of a monochrome multivalued image of 300 dpi in A4 size, about 10
In the case of the MB and the color multi-valued image, the size is as large as 30 MB. However, such data of the color multi-valued image can also be stored in the main storage device.

【0003】しかし、上記の如き画像データをハードデ
ィスクに記憶する場合、1GBのハードディスクではモ
ノクロ多値画像は約100枚、カラー多値画像は約30
枚程度しか記憶することができない。このため、多値画
像の電子ファイリングを行うには1GBのハードディス
クであっても記憶容量が不足してしまい、例えば100
0枚以上の多値画像の電子ファイリングを可能とするに
は多値画像のデータを圧縮する必要がある。
However, when storing the above image data on a hard disk, a 1 GB hard disk has about 100 monochrome multivalued images and about 30 color multivalued images.
You can only memorize about a sheet. For this reason, in order to perform electronic filing of a multivalued image, the storage capacity is insufficient even with a 1 GB hard disk.
To enable electronic filing of zero or more multivalued images, it is necessary to compress the data of the multivalued image.

【0004】[0004]

【従来の技術】従来の画像圧縮技術としては、画質より
圧縮率を重視するロッシー(Lossy)圧縮技術が主
流であった。Lossy圧縮技術は、視覚的に認識され
ない程度の画質劣化を許容する代わりに、高い圧縮率を
得ることができる。Lossy圧縮技術の代表的な例と
しては、JPEG圧縮方式がある。JPEG圧縮方式
は、8×8画素を周波数領域に変換し、画像の多くの部
分が低周波に集中することと、高周波には精度が求めら
れないこととに着目して画像圧縮を行う。
2. Description of the Related Art As a conventional image compression technique, a lossy compression technique in which a compression ratio is more important than an image quality has been mainly used. The Lossy compression technique can obtain a high compression rate instead of allowing image quality deterioration to such an extent that it cannot be visually recognized. A representative example of the lossy compression technique is a JPEG compression method. The JPEG compression method converts 8 × 8 pixels into a frequency domain, and performs image compression by focusing on the fact that many parts of an image are concentrated on low frequencies and that precision is not required for high frequencies.

【0005】しかし、JPEG圧縮方式等のLossy
圧縮技術によると、圧縮/伸長を繰り返すと画質が劣化
すると共に、ブロック毎に圧縮を行うためにブロック歪
みが発生してしまう。更に、JPEG圧縮方式では、圧
縮された画像を伸長した後に画像処理を施す場合に制限
があった。つまり、通常は知覚されない画質劣化でも、
より鮮明な画像を得るために伸長された画像に強調処理
等を施すと、強調処理後の表示画像に著しい画質劣化が
現われてしまった。又、伸長された画像に二値化処理を
施してプリンタで出力する場合にも、同様にして著しい
画質劣化が印刷された画像に現われてしまった。
However, Lossy such as JPEG compression method is used.
According to the compression technique, the image quality deteriorates when compression / expansion is repeated, and block distortion occurs because compression is performed for each block. Furthermore, in the JPEG compression method, there is a limitation in performing image processing after decompressing a compressed image. In other words, image quality degradation that is not normally perceived,
If the decompressed image is subjected to an enhancement process or the like in order to obtain a clearer image, remarkable image quality degradation appears in the display image after the enhancement process. Similarly, when a decompressed image is subjected to a binarization process and output by a printer, remarkable image quality degradation similarly appears in the printed image.

【0006】[0006]

【発明が解決しようとする課題】従って、Lossy圧
縮技術は、高い圧縮率を得ることができるものの、情報
の損失を伴い、伸長時に高品質の画像を復元することは
できないという問題があった。他方、情報損失を伴わな
い所謂ロスレス圧縮技術としては、LZW圧縮方式や算
術圧縮方式等を基本とするユニバーサル圧縮方式が知ら
れている。しかし、ユニバーサル圧縮方式はあらゆるデ
ータを対象としているため、画像データの圧縮という面
においては効率が悪く、画像データに対しては数%から
十数%程度の圧縮率しか得ることができなかった。
Therefore, the lossy compression technique has a problem that, although a high compression ratio can be obtained, a high-quality image cannot be restored at the time of decompression with loss of information. On the other hand, as a so-called lossless compression technique that does not involve information loss, a universal compression scheme based on an LZW compression scheme, an arithmetic compression scheme, or the like is known. However, since the universal compression method targets all types of data, the efficiency of image data compression is low, and only a compression ratio of about several percent to several tens of percent has been obtained for image data.

【0007】画像データは、規則性を持っていることが
多く、この規則性を利用すれば圧縮率を向上することが
できる。そこで、二値画像に対しては、ファクシミリ装
置で一般的に使用されているMH符号化方式、MR符号
化方式、MMR符号化方式等のランレングス圧縮方式が
存在する。これらのランレングス圧縮方式によれば、情
報損失を伴うことなく、二値画像データを元の約1/1
0以下の情報量に圧縮することができる。
Image data often has regularity, and by utilizing this regularity, the compression ratio can be improved. Therefore, for binary images, there are run-length compression schemes such as MH encoding scheme, MR encoding scheme, and MMR encoding scheme generally used in facsimile machines. According to these run-length compression methods, binary image data can be reduced to about 1/1
It can be compressed to an information amount of 0 or less.

【0008】ところが、多値画像の場合は、二値画像の
場合と異なり画像の階調が常に変化しているため、比較
的近い値のデータ値が連続していても同じデータ値では
ないため、ランレングスは長くならない。このため、上
記の如き二値画像に対するランレングス圧縮方式を多値
画像に適用しても、高い圧縮率を得ることはできないと
いう問題があった。
However, in the case of a multi-valued image, unlike the case of a binary image, since the gradation of the image is constantly changing, even if data values of relatively close values are continuous, they are not the same data value. , Run length does not become long. For this reason, there is a problem that a high compression ratio cannot be obtained even when the run-length compression method for a binary image as described above is applied to a multi-valued image.

【0009】そこで、本発明は、多値画像のデータを情
報損失を伴うことなく高い圧縮率で圧縮することが可能
な画像処理方法及び装置を提供することを目的とする。
Accordingly, an object of the present invention is to provide an image processing method and apparatus capable of compressing multi-valued image data at a high compression ratio without loss of information.

【0010】[0010]

【課題を解決するための手段】上記の課題は、請求項1
記載の、多値画像を示す画像データから同じデータ値の
ランレングスを計測するステップと、該画像データから
注目画素とその隣接画素とのデータ値の差分を算出する
ステップと、計測されたランレングス及び算出された差
分に基づき、ランレングス及び差分の出現頻度を表す単
一の符号化テーブルを用いて該画像データを圧縮するス
テップとを含む画像処理方法によって達成される。
The above object is attained by claim 1.
Measuring the run length of the same data value from the image data representing the multi-valued image, calculating the difference between the data value of the pixel of interest and its adjacent pixel from the image data, and measuring the run length. And compressing the image data using a single encoding table representing the run length and the frequency of occurrence of the difference based on the calculated difference.

【0011】請求項2記載の発明では、請求項1におい
て、前記圧縮するステップは、前記ランレングスが最大
ランレングスを越える場合にはランレングス例外コード
を出力する。請求項3記載の発明では、請求項1又は2
において、前記圧縮するステップは、前記差分が差分の
最大値を越える場合にはデータ値をそのまま符号化す
る。
In the invention described in claim 2, in the first aspect, the compressing step outputs a run-length exception code if the run-length exceeds a maximum run-length. In the invention according to claim 3, claim 1 or 2
In the compression step, when the difference exceeds the maximum value of the difference, the data value is encoded as it is.

【0012】請求項4記載の発明では、請求項1〜3の
いずれかにおいて、前記計測するステップは、データ値
の比較を行う前に、注目画素のデータ値を注目画素に隣
接する隣接画素から予測した予測値で置き換えることで
ランを生成する。請求項5記載の発明では、請求項1〜
4のいずれかにおいて、前記画像データから網点画像の
周期を検出し、前記網点画像の周期に基づいたデータ値
のオフセット値により該画像データのデータ値を修正す
るステップを更に含む。
[0012] In the invention described in claim 4, according to any one of claims 1 to 3, the measuring step includes, before comparing the data values, changing a data value of the target pixel from an adjacent pixel adjacent to the target pixel. A run is generated by replacing the predicted value with the predicted value. In the invention according to claim 5, claims 1 to
4. The method according to any one of 4), further comprising: detecting a period of the halftone image from the image data, and correcting a data value of the image data by an offset value of the data value based on the period of the halftone image.

【0013】請求項6記載の発明では、請求項1〜5の
いずれかにおいて、前記圧縮するステップは、前記多値
画像の2ライン目以降については、前のラインと現在の
ラインとのデータ値の差分を求めて二次元圧縮を行う。
請求項7記載の発明では、請求項1〜6のいずれかにお
いて、前記計測するステップ、前記算出するステップ及
び前記圧縮するステップは、前記画像データの所定上位
ビットに対して処理を行い、該画像データの残りの下位
ビットに対してユニバーサル圧縮を施すステップを更に
含む。
According to a sixth aspect of the present invention, in any one of the first to fifth aspects, the step of compressing includes, for the second and subsequent lines of the multi-valued image, a data value between a previous line and a current line. , And performs two-dimensional compression.
According to a seventh aspect of the present invention, in the method of any one of the first to sixth aspects, the measuring step, the calculating step, and the compressing step perform processing on predetermined high-order bits of the image data. And performing universal compression on the remaining lower bits of the data.

【0014】請求項8記載の発明では、請求項1〜7の
いずれかにおいて、圧縮された画像データをランレング
ス及び差分の出現頻度を表す単一の復号化テーブルを用
いて伸長するステップを更に含む。上記の課題は、請求
項9記載の、多値画像を示す画像データから同じデータ
値のランレングスを計測する計測手段と、該画像データ
から注目画素とその隣接画素とのデータ値の差分を算出
する算出手段と、計測されたランレングス及び算出され
た差分に基づき、ランレングス及び差分の出現頻度を表
す単一の符号化テーブルを用いて該画像データを圧縮す
る圧縮手段とを備えた画像処理装置によっても達成され
る。
In the invention according to claim 8, the step of decompressing the compressed image data by using a single decoding table representing the run length and the frequency of occurrence of the difference is further provided in any one of claims 1 to 7. Including. According to the present invention, there is provided a measuring means for measuring a run length of the same data value from image data representing a multi-valued image, and calculating a difference between a data value of a pixel of interest and an adjacent pixel from the image data. Image processing comprising: a calculating means for calculating the run length and the calculated difference, and a compressing means for compressing the image data using a single encoding table representing the appearance frequency of the run length and the difference. This is also achieved by the device.

【0015】請求項10記載の発明では、請求項9にお
いて、前記圧縮手段は、前記ランレングスが最大ランレ
ングスを越える場合にはランレングス例外コードを出力
する。請求項11記載の発明では、請求項9又は10に
おいて、前記圧縮手段は、前記差分が差分の最大値を越
える場合にはデータ値をそのまま符号化する。
According to a tenth aspect of the present invention, in the ninth aspect, the compression means outputs a run length exception code when the run length exceeds a maximum run length. According to an eleventh aspect of the present invention, in the ninth or tenth aspect, the compression means encodes the data value as it is when the difference exceeds a maximum value of the difference.

【0016】請求項12記載の発明では、請求項9〜1
1のいずれかにおいて、前記計測手段は、データ値の比
較を行う前に、注目画素のデータ値を注目画素に隣接す
る隣接画素から予測した予測値で置き換えることでラン
を生成する。請求項13記載の発明では、請求項9〜1
2のいずれかにおいて、前記画像データから網点画像の
周期を検出し、前記網点画像の周期に基づいたデータ値
のオフセット値により該画像データのデータ値を修正す
る修正手段を更に備える。
According to the twelfth aspect of the present invention, the ninth to the ninth aspect
In any one of the first to third aspects, before performing the data value comparison, the measurement unit generates a run by replacing the data value of the target pixel with a predicted value predicted from an adjacent pixel adjacent to the target pixel. According to the thirteenth aspect of the present invention,
2. In any one of the above items 2, further comprising a correction means for detecting a cycle of the halftone image from the image data, and correcting a data value of the image data by an offset value of the data value based on the cycle of the halftone image.

【0017】請求項14記載の発明では、請求項9〜1
3のいずれかにおいて、前記圧縮手段は、前記多値画像
の2ライン目以降については、前のラインと現在のライ
ンとのデータ値の差分を求めて二次元圧縮を行う。請求
項15記載の発明では、請求項9〜14のいずれかにお
いて、前記計測手段、前記算出手段及び前記圧縮手段
は、前記画像データの所定上位ビットに対して処理を行
い、該画像データの残りの下位ビットに対してユニバー
サル圧縮を施す手段を更に備える。
According to the fourteenth aspect of the present invention, in the ninth to the first aspects,
In any one of the third to third aspects, for the second and subsequent lines of the multi-valued image, the compression unit performs two-dimensional compression by obtaining a difference in data value between a previous line and a current line. According to a fifteenth aspect of the present invention, in any one of the ninth to fourteenth aspects, the measuring unit, the calculating unit, and the compression unit perform processing on a predetermined upper bit of the image data, and Means for performing universal compression on the lower bits of.

【0018】請求項16記載の発明では、請求項9〜1
5のいずれかにおいて、圧縮された画像データをランレ
ングス及び差分の出現頻度を表す単一の復号化テーブル
を用いて伸長する伸長手段を更に備える。請求項1及び
9記載の発明によれば、多値画像のデータを情報損失を
伴うことなく高い圧縮率で圧縮することができる。
According to the sixteenth aspect of the present invention, in the ninth to the first aspects,
In any one of the fifth to fifth aspects, the image processing apparatus further includes a decompression means for decompressing the compressed image data by using a single decoding table indicating a run length and a frequency of occurrence of a difference. According to the first and ninth aspects of the present invention, it is possible to compress data of a multilevel image at a high compression rate without information loss.

【0019】請求項2及び10記載の発明によれば、ラ
ンレングス例外コードの発生比率が許容範囲内となるよ
うに最大ランレングスを設定することにより、高い圧縮
率を実現できる。請求項3及び11記載の発明によれ
ば、多値画像の濃度が比較的少ないビット数で表される
場合に、高い圧縮率を実現できる。
According to the second and tenth aspects of the present invention, a high compression ratio can be realized by setting the maximum run length so that the occurrence ratio of the run length exception code is within an allowable range. According to the third and eleventh aspects of the present invention, a high compression ratio can be realized when the density of a multi-valued image is represented by a relatively small number of bits.

【0020】請求項4及び12記載の発明によれば、前
値予測を行うことにより、データ値のランを多く生成し
て圧縮率を更に向上することができる。請求項5及び1
3記載の発明によれば、網点周期の予測を行うことによ
り、網点画像に対しても対処することができる。請求項
6及び14記載の発明によれば、二次元圧縮を行うこと
により、圧縮率を更に向上することができる。
According to the fourth and twelfth aspects of the present invention, by performing the preceding value prediction, it is possible to generate more runs of data values and further improve the compression ratio. Claims 5 and 1
According to the invention described in the third aspect, it is possible to cope with a halftone image by predicting a halftone period. According to the sixth and fourteenth aspects of the present invention, the compression ratio can be further improved by performing the two-dimensional compression.

【0021】請求項7及び15記載の発明によれば、下
位ビットに対してはユニバーサル圧縮を施すことによ
り、ノイズを抑制して圧縮率を向上することができる。
請求項8及び16記載の発明によれば、伸長された画像
データに強調処理等を施しても、画質劣化を発生するこ
とがない。従って、本発明によれば、多値画像のデータ
を情報損失を伴うことなく高い圧縮率で圧縮することが
可能となる。
According to the seventh and fifteenth aspects of the present invention, by applying universal compression to lower bits, noise can be suppressed and the compression rate can be improved.
According to the inventions of claims 8 and 16, even if the decompressed image data is subjected to enhancement processing or the like, the image quality does not deteriorate. Therefore, according to the present invention, it is possible to compress data of a multivalued image at a high compression ratio without loss of information.

【0022】[0022]

【発明の実施の形態】先ず、本発明の動作原理を図1及
び図2と共に説明する。図1は、圧縮される多値画像を
構成する画素の配列を示す図である。又、図2は、多値
画像の第1ライン目の画素の濃度変化を示す図である。
図1において、多値画像は、左上の画素P0,0 から右下
の画素Pn-1,m-1 の、横方向にn画素、縦方向にm画素
からなるものとする。又、図2は、図1中、第1ライン
目の画素P0,0 〜Pn-1,0 の濃度変化を示し、縦軸に階
調レベル、横軸に第1ライン目の画素P0,0 〜Pn-1,0
を示す。図2では、説明の便宜上、各画素の濃度を8ビ
ットにより256の階調レベルで表示可能であるものと
する。図2に示すように、多値画像の場合でも、隣接画
素のデータ値は二値画像の場合程ではないが、同じデー
タ値が連続することが多く、又、データ値が隣接画素間
で変化している場合でも変化量が小さいことが多い。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS First, the principle of operation of the present invention will be described with reference to FIGS. FIG. 1 is a diagram showing an array of pixels constituting a multivalued image to be compressed. FIG. 2 is a diagram showing a density change of pixels on the first line of the multi-valued image.
In FIG. 1, it is assumed that the multivalued image is composed of n pixels in the horizontal direction and m pixels in the vertical direction from the upper left pixel P0,0 to the lower right pixel Pn-1, m-1. FIG. 2 shows the change in density of the pixels P0,0 to Pn-1,0 on the first line in FIG. 1, the vertical axis represents the gradation level, and the horizontal axis represents the pixels P0,0 on the first line. ~ Pn-1,0
Is shown. In FIG. 2, for convenience of explanation, it is assumed that the density of each pixel can be displayed at 256 gradation levels by 8 bits. As shown in FIG. 2, even in the case of a multi-valued image, the data value of adjacent pixels is not as large as that of a binary image, but the same data value is often continuous, and the data value changes between adjacent pixels. In many cases, the change amount is small.

【0023】そこで、本発明では、ランレングスが二値
画像の場合に短くなる反面、多値画像の場合には画像情
報の規則性が隣接画素のデータ値の小変化分に現われて
いると考える。つまり、二値画像に適用されたランレン
グス圧縮方式ではランレングスのみに着目していたが、
本発明では、隣接画素のデータ値のランレングスに加え
て隣接画素のデータ値の変化分も含めて新たなコードを
作成し、この新たなコードからなる符号化テーブルを使
用することで多値画像データの圧縮を行う。
Therefore, in the present invention, the run length is shortened in the case of a binary image, but in the case of a multi-valued image, it is considered that the regularity of image information appears in a small change in the data value of an adjacent pixel. . In other words, in the run-length compression method applied to the binary image, only the run-length was focused,
In the present invention, a new code is created including a change in the data value of the adjacent pixel in addition to the run length of the data value of the adjacent pixel, and a multi-valued image is generated by using an encoding table including the new code. Perform data compression.

【0024】例えばファクシミリ装置で使用されるMH
符号化方式の場合、最大ランレングスは1728に設定
されているが、本発明においても同様にして適切な最大
ランレングスLMAXを設定する。この最大ランレング
スLMAXを越える長いランの場合は、ランレングス例
外コードを出力し、これに続いてラン値を出力するよう
にしても良い。このランレングス例外コードが発生する
比率が高いと圧縮率が低下するので、ランレングス例外
コードの発生比率が許容範囲内となるように最大ランレ
ングスLMAXを設定すれば良い。尚、多値画像の場
合、二値画像の場合と異なり白のラン及び黒のランにつ
いて別々に統計を取ることはできないので、二値画像と
同様にしてMH符号化方式を適用することはできない。
For example, MH used in a facsimile machine
In the case of the encoding method, the maximum run length is set to 1728, but in the present invention, an appropriate maximum run length LMAX is similarly set. In the case of a long run exceeding the maximum run length LMAX, a run length exception code may be output, followed by a run value. If the ratio at which the run-length exception code occurs is high, the compression ratio is reduced. Therefore, the maximum run-length LMAX may be set so that the occurrence ratio of the run-length exception code is within an allowable range. In the case of a multi-valued image, unlike the case of a binary image, statistics cannot be separately obtained for a white run and a black run, so that the MH coding method cannot be applied in the same manner as for a binary image. .

【0025】又、隣接画素のデータ値の変化分について
も、同様にして注目画素cpのデータ値とその隣接画素
のデータ値との変化量の最大値、即ち、最大変化量DM
AXを設定する。従って、注目画素cpのデータ値とそ
の隣接画素のデータ値との変化量が最大変化量DMAX
を越える場合は、この変化量を例外として処理し、原多
値画像の値をそのまま符号化する。この様な例外処理を
行う時に、例外(又はエラー)コードを送出することも
可能であるが、多値画像の濃度が例えば8ビット程度で
表される場合には例外コードを送出するよりは、例えば
10ビット程度の比較的長い符号の中に含める方が望ま
しい。しかし、多値画像の濃度が例えば12ビット程度
で表される場合には、例外処理のテーブルだけで409
6個も必要となるため、例外コードを送出する方が望ま
しい。
Similarly, for the change in the data value of the adjacent pixel, the maximum value of the change between the data value of the target pixel cp and the data value of the adjacent pixel, that is, the maximum change DM
Set AX. Accordingly, the change amount between the data value of the target pixel cp and the data value of the adjacent pixel is the maximum change amount DMAX.
Is exceeded, this change is processed as an exception, and the value of the original multivalued image is encoded as it is. When performing such an exception process, it is possible to send an exception (or error) code. However, when the density of a multi-valued image is represented by, for example, about 8 bits, an exception code is sent. For example, it is desirable to include it in a relatively long code of about 10 bits. However, when the density of the multi-valued image is represented by, for example, about 12 bits, the exception processing table alone requires 409
Since as many as six are required, it is desirable to send an exception code.

【0026】符号化テーブルは、データ値のランと出現
頻度、データ値の変化量と出現頻度、そして例外コード
には仮想的に比較的低い出現頻度を与え、これらにハフ
マン符号等を割り当てる。先に多値画像全体を走査して
データ値の統計を取れば、最もデータ圧縮率の高い符号
化を実現できるが、この場合は符号化テーブルも比較的
大きくなってしまう。そこで、符号化テーブルを比較的
小さなものにするためには、圧縮系と伸長系とで既定の
符号化テーブル及び復号化テーブルを用意しておくこと
が望ましい。
In the coding table, the run and appearance frequency of data values, the change amount and appearance frequency of data values, and exceptional codes are virtually given relatively low appearance frequencies, and Huffman codes and the like are assigned to these. If the statistics of data values are obtained by scanning the entire multi-valued image first, encoding with the highest data compression rate can be realized, but in this case, the encoding table becomes relatively large. Therefore, in order to make the encoding table relatively small, it is desirable to prepare predetermined encoding tables and decoding tables for the compression system and the expansion system.

【0027】データ圧縮率を更に上げる方法としては、
上記の符号化に前値予測を組み合わせる方法もある。こ
の場合、データ値のランの比較の前に、注目画素のデー
タ値を注目画素に隣接する隣接画素から予測した予測値
で置き換えることで、完全に同じデータ値でなくてもラ
ンを生成することができる。従って、図3に示すよう
に、注目画素xのデータ値をx、注目画素xの予測値を
^x、注目画素xに隣接する隣接画素を含む周辺画素
a,b,c,d,eのデータ値をa,b,c,d,e、
予測誤差をx−^xとすると、予測関数は例えば前値予
測の場合は^x=b、行列予測の場合は^x=(a+
b)/2、平面予測の場合は^x=a+b−c、平均予
測の場合は^x=(a+d)/2、傾斜予測の場合は^
x=2b−eから注目画素xの予測値^xを求めること
ができる。
As a method of further increasing the data compression ratio,
There is also a method of combining the above-mentioned coding with previous value prediction. In this case, the run is generated even if the data values are not completely the same by replacing the data value of the target pixel with a prediction value predicted from an adjacent pixel adjacent to the target pixel before comparing the data value runs. Can be. Therefore, as shown in FIG. 3, the data value of the target pixel x is x, the predicted value of the target pixel x is ^ x, and the peripheral pixels a, b, c, d, and e including the adjacent pixels adjacent to the target pixel x are set. Data values are a, b, c, d, e,
Assuming that the prediction error is x- ^ x, the prediction function is, for example, ^ x = b in the case of previous value prediction, and ^ x = (a +
b) / 2, 平面 x = a + bc for plane prediction, ^ x = (a + d) / 2 for average prediction, ^ for slope prediction
The predicted value ^ x of the target pixel x can be obtained from x = 2be.

【0028】又、雑誌等のカラー写真は、厳密に言えば
網点画像である。網点画像の場合、データ値のランもあ
まりなく、データ値の変化量が比較的大きくなってしま
うが、図4に示すような網点周期予測を行うことによ
り、網点画像に対しても対処することができる。つま
り、網点画像の場合は、データ圧縮を行う前に、ライン
を少数画素W0 〜W4 の窓で走査し、窓内の最大データ
値Pmax の画素をマークする。このようにして、窓を次
々に移動させながら窓内の最大データ値の画素をマーク
すると同時に、窓内の画素のデータ値の平均値Wave を
計算してメモリに記憶しておく。これにより、網点の周
期を見つけるための準備が完了する。網点の周期は、マ
ークを付けた画素の周期を数えて、その最頻値から求め
ることができ、網点の周期に適合する画素と適合しない
画素との比率から、網点の周期のばらつきが異常に大き
いと判断されると網点画像ではないと判断する。例え
ば、網点の周期に適合する画素と適合しない画素との比
率が70%以上でなければ、上記の如き網点画像に対す
る処理を行わない。
Strictly speaking, a color photograph such as a magazine is a halftone image. In the case of a halftone dot image, the run of data values is not so large, and the change amount of the data value is relatively large. However, by performing the halftone period prediction as shown in FIG. I can deal with it. That is, in the case of a halftone image, before data compression, the line is scanned in a window of a small number of pixels W0 to W4, and the pixel having the maximum data value Pmax in the window is marked. In this manner, the pixel having the maximum data value in the window is marked while moving the window one after another, and at the same time, the average value Wave of the data values of the pixels in the window is calculated and stored in the memory. This completes the preparation for finding the period of the halftone dot. The period of a halftone dot can be obtained from the mode of counting the number of periods of the marked pixels, and the variation in the halftone period can be calculated from the ratio of pixels that conform to the halftone period and pixels that do not conform. Is determined to be an abnormally large dot image. For example, if the ratio of the pixels conforming to the period of the halftone dot to the pixels not conforming to the halftone period is not 70% or more, the processing for the halftone image as described above is not performed.

【0029】網点の周期を求めた後、この周期からオフ
セットする差分を計算する。網点周期毎に、網点周期分
の窓内の画素のデータ値の平均値A0 〜A4 を求め、こ
の平均値A0 〜A4 と、隣接画素のデータ値との差分を
パターンとして登録する。このパターンを、データ値の
ランと隣接画素のデータ値の変化分を求めるときの注目
画素のデータ値にオフセットとして加えることにより、
網点画像に対しても高い圧縮率を保つことができる。
After obtaining the period of the halftone dot, a difference offset from this period is calculated. For each dot period, the average value A0 to A4 of the pixel data values in the window for the dot period is determined, and the difference between the average value A0 to A4 and the data value of the adjacent pixel is registered as a pattern. By adding this pattern as an offset to the data value of the pixel of interest when calculating the run of the data value and the change in the data value of the adjacent pixel,
A high compression ratio can be maintained even for a halftone image.

【0030】尚、図4では、便宜上、網点画像の画素P
0,0 〜P15,0のみを示し、窓は簡略化のために5画素W
0 〜W4 からなるものとして図示しているが、窓の大き
さは一般的な網点周期より大きくする必要がある。つま
り、網点が完全に窓内に収まらないと、好ましくない局
所最大値が検出されてしまい、網点画像に対して高い圧
縮率を保つことができなくなる。窓の大きさは、例えば
16画素以上であることが望ましい。
In FIG. 4, for convenience, the pixel P of the halftone dot image is shown.
Only 0,0 to P15,0 are shown, and the window is 5 pixels W for simplicity.
Although shown as being composed of 0 to W4, the size of the window needs to be larger than a general halftone dot period. That is, if the halftone dot does not completely fall within the window, an undesired local maximum value is detected, and a high compression ratio cannot be maintained for the halftone image. The size of the window is desirably, for example, 16 pixels or more.

【0031】画像の2ライン目以降の処理については、
前のラインと現在のラインとのデータ値の差分を求めて
二次元圧縮を行っても良い。図5は、この場合の二次元
圧縮を説明する図であり、同図(a)は多値画像を構成
する画素データの配列、同図(b)は二次元圧縮された
画素データの配列を示す。同図中、画素P0 ,0 〜Pn-
1 ,m-1 の画素データは、P0 ,0 〜Pn-1 ,m-1 で示
す。現在のラインと前のラインとの間では、データ値の
相関性が高いことは、ファクシミリ装置で採用されてい
るMMR符号からも周知であり、前のラインと現在のラ
インとのデータ値の差分は略全ての画素について0とな
る。尚、注目画素のデータ値と隣接画素のデータ値との
変化量が最大変化量を越える場合は、上記の如くこの変
化量を例外として処理し、原多値画像の値をそのまま符
号化すれば良い。
For the processing of the second and subsequent lines of the image,
Two-dimensional compression may be performed by calculating the difference between the data values of the previous line and the current line. FIGS. 5A and 5B are diagrams for explaining two-dimensional compression in this case. FIG. 5A shows an array of pixel data forming a multi-valued image, and FIG. 5B shows an array of two-dimensionally compressed pixel data. Show. In the figure, pixels P0,0 to Pn-
The pixel data 1 and m-1 are represented by P0,0 to Pn-1, m-1. The high correlation between the current line and the previous line is also known from the MMR code used in the facsimile machine, and the difference between the data value between the previous line and the current line is also known. Is 0 for almost all pixels. If the change amount between the data value of the target pixel and the data value of the adjacent pixel exceeds the maximum change amount, the change amount is processed as an exception as described above, and the value of the original multi-valued image is directly encoded. good.

【0032】更に、画像を低品質のイメージスキャナで
読み取った場合には、仕様として例えば8ビットの出力
を規定していても実質的には例えば5ビット程度の出力
しか得られず、下位の3ビットはノイズになってしまう
こともある。この様な場合には、図6に示すように、本
発明を8ビット出力の例えば上位5ビットの信号成分の
みに対して適用し、下位3ビットのノイズ成分に対して
は独立してLZW方式等のユニバーサル圧縮方式を適用
することもできる。
Furthermore, when an image is read by a low-quality image scanner, an output of, for example, about 5 bits is practically obtained even if an 8-bit output is specified as a specification. Bits can become noise. In such a case, as shown in FIG. 6, the present invention is applied to, for example, only the upper 5 bits of the signal component of the 8-bit output, and independently applies the LZW method to the lower 3 bits of the noise component. And other universal compression methods can be applied.

【0033】[0033]

【実施例】図7は、本発明になる画像処理装置の第1実
施例の圧縮系を示すブロック図であり、図8は、画像処
理装置の第1実施例の伸長系を示すブロック図である。
画像処理装置の第1実施例は、本発明になる画像処理方
法の第1実施例を採用する。
FIG. 7 is a block diagram showing a compression system of a first embodiment of the image processing apparatus according to the present invention, and FIG. 8 is a block diagram showing a decompression system of the first embodiment of the image processing apparatus. is there.
The first embodiment of the image processing apparatus employs the first embodiment of the image processing method according to the present invention.

【0034】図7において、入力多値画像データは、ラ
ッチ回路1を介してシフトレジスタ2に入力される。シ
フトレジスタ2からは、先ず最初に入力多値画像データ
のうち、隣接画素データp-1,pが減算器3に入力され
る。減算器3は、隣接画素データp-1,pの差分を求
め、差分をラッチ回路4に入力する。ラッチ回路4の差
分出力は、比較器5に入力され、データ「0」と比較さ
れことで、同じデータ値のランが検出される。比較器5
は、差分出力が「0」であると同値であることを示す信
号をインクリメンタ6に入力し、インクリメンタ6を作
動する。ランカウンタ7は、作動されたインクリメンタ
6の出力に応答してランをカウントしてランレングスL
CNTを求める。ランカウンタ7の出力するランレング
スLCNTは、比較器8,9及びテーブル検索部10に
入力される。比較器8は、ランカウンタ7の出力するラ
ンレングスLCNTと、ランレングスの最大値LMAX
とを比較し、比較された値が同じであるとその旨を示す
信号をテーブル検索部10に入力する。比較器9は、ラ
ンカウンタ7の出力するランレングスLCNTと、値
「0」とを比較し、比較された値が同じでランカウンタ
7のランレングスLCNTが「0」であると、その旨を
示す信号をインバータ11を介してテーブル検索部10
に入力し、ランレングスLCNTによる符号化テーブル
12の参照を禁止する。
In FIG. 7, input multi-valued image data is input to a shift register 2 via a latch circuit 1. From the shift register 2, first, the adjacent pixel data p−1 and p of the input multi-valued image data are input to the subtractor 3. The subtracter 3 calculates the difference between the adjacent pixel data p−1 and p, and inputs the difference to the latch circuit 4. The difference output of the latch circuit 4 is input to the comparator 5 and is compared with the data “0” to detect a run of the same data value. Comparator 5
Inputs a signal indicating that the difference output is equal to “0” to the incrementer 6 and operates the incrementer 6. The run counter 7 counts the runs in response to the output of the operated incrementer 6 and counts the run length L.
Find CNT. The run length LCNT output from the run counter 7 is input to the comparators 8 and 9 and the table search unit 10. The comparator 8 includes a run length LCNT output from the run counter 7 and a maximum value LMAX of the run length.
Are compared, and if the compared values are the same, a signal indicating this is input to the table search unit 10. The comparator 9 compares the run length LCNT output from the run counter 7 with the value “0”, and if the compared values are the same and the run length LCNT of the run counter 7 is “0”, the effect is determined. The signal to be shown is sent to the table search unit 10 via the inverter 11.
To prohibit reference to the encoding table 12 by the run-length LCNT.

【0035】テーブル検索部10は、ランレングスLC
NTが「0」より大きく、且つ、最大値LMAX以下で
あると、符号化テーブル12を参照してランレングスL
CNTに対応する圧縮符号を読み出して、ラッチ回路1
3及び出力回路14を介して出力する。又、符号化テー
ブル12から圧縮符号が読み出されてラッチ回路13に
よりラッチされると、ラッチ回路13の出力によりラン
カウンタ7がクリアされる。尚、ランレングスLCNT
が最大値LMAXを越えた場合、テーブル検索部10は
符号化テーブル12を参照して対応するランレングス例
外コードを読み出して、これに続いてランレングスLC
NTをラッチ回路13及び出力回路14を会して出力し
ても良い。
The table search unit 10 executes a run length LC
If NT is greater than “0” and equal to or less than the maximum value LMAX, the run-length L
The compression code corresponding to the CNT is read out, and the latch circuit 1
3 and output via the output circuit 14. When the compressed code is read from the encoding table 12 and latched by the latch circuit 13, the output of the latch circuit 13 clears the run counter 7. In addition, run length LCNT
Exceeds the maximum value LMAX, the table search unit 10 reads the corresponding run-length exception code by referring to the encoding table 12, and subsequently reads the run-length exception code.
NT may be output through the latch circuit 13 and the output circuit 14.

【0036】他方、ラッチ回路4の差分出力は、ゲート
回路15にも入力される。このゲート回路15は、ラン
カウンタ7のランレングスLCNTが「0」であること
を示す比較器9の出力信号によりイネーブルされて差分
出力を比較器16及びテーブル検索部17に出力する。
比較器16は、差分出力が差分出力の最大値DMAX以
下で最小値−DMAX以上である許容範囲内であるか否
かを示す信号を、テーブル検索部17及び例外コード生
成部18に出力する。比較器16からの信号が差分出力
が許容範囲内であることを示す場合、テーブル検索部1
7はゲート回路15からの差分出力に対応する圧縮符号
を符号化テーブル12から読み出して、ラッチ回路13
及び出力回路14を介して出力する。又、比較器16か
らの信号が差分出力が許容範囲外であることを示す場
合、例外コード生成部18は例外コードとして元の画素
データpを出力回路14に出力する。
On the other hand, the difference output of the latch circuit 4 is also input to the gate circuit 15. The gate circuit 15 is enabled by an output signal of the comparator 9 indicating that the run length LCNT of the run counter 7 is “0”, and outputs a difference output to the comparator 16 and the table search unit 17.
The comparator 16 outputs to the table search unit 17 and the exception code generation unit 18 a signal indicating whether or not the difference output is within an allowable range of not more than the maximum value DMAX of the difference output and not less than the minimum value -DMAX. If the signal from the comparator 16 indicates that the difference output is within the allowable range, the table search unit 1
7 reads a compression code corresponding to the difference output from the gate circuit 15 from the encoding table 12 and
And output via the output circuit 14. If the signal from the comparator 16 indicates that the difference output is out of the allowable range, the exception code generator 18 outputs the original pixel data p to the output circuit 14 as an exception code.

【0037】ラッチ回路1が1つの画素データをラッチ
する度に、デクリメンタ21はラッチ回路1の出力によ
り作動される。画素カウンタ22には、多値画像の1ラ
イン分の画素数がセットされており、作動されたデクリ
メンタ21の出力に応答してカウントダウンを行う。画
素カウンタ22のカウント値が「0」になると、比較器
23の出力はオア回路25及びアンド回路26を介して
EOL回路27に出力され、1ラインの終わりを示すE
OL符号を出力回路14に出力する。又、画素カウンタ
22のカウント値が「0」になると、比較器23の出力
は画素カウンタ22をセットして多値画像の1ライン分
の画素数をカウント値としてセットする。尚、オア回路
25には、比較器5の出力がインバータ24を介して入
力されており、1ラインの終わりが検出されると比較器
9に強制的にランレングスが「0」であることを示す信
号を出力させる。従って、1ラインの終了時には、ラン
があっても一旦ランレングスのカウントがクリアされ
る。更に、アンド回路26にはラッチ回路13の出力が
入力されており、圧縮符号の出力とのタイミング合わせ
が行われる。
Each time the latch circuit 1 latches one pixel data, the decrementer 21 is activated by the output of the latch circuit 1. The number of pixels for one line of the multi-valued image is set in the pixel counter 22, and counts down in response to the output of the activated decrementer 21. When the count value of the pixel counter 22 becomes "0", the output of the comparator 23 is output to the EOL circuit 27 via the OR circuit 25 and the AND circuit 26, and E indicates the end of one line.
The OL code is output to the output circuit 14. When the count value of the pixel counter 22 becomes "0", the output of the comparator 23 sets the pixel counter 22 and sets the number of pixels for one line of the multi-valued image as the count value. Note that the output of the comparator 5 is input to the OR circuit 25 via the inverter 24, and when the end of one line is detected, the comparator 9 is forcibly notified that the run length is "0". Output the indicated signal. Therefore, at the end of one line, the run length count is once cleared even if there is a run. Further, the output of the latch circuit 13 is input to the AND circuit 26, and the timing is synchronized with the output of the compression code.

【0038】出力回路14は、ラッチ回路13からの圧
縮符号、又は、例外コード生成部18からの例外コー
ド、及びEOL回路27からのEOL符号を伝送媒体
(図示せず)に出力すると共に、圧縮符号の出力を示す
信号をラッチ回路1に入力する。これにより、ラッチ回
路1は、次の画素データp+1をラッチしてシフトレジス
タ2に入力し、以下、上記と同様の処理が行われる。伝
送媒体は特定のものに限定されず、圧縮画像データの伝
送路や各種記憶媒体であっても良い。
The output circuit 14 outputs the compression code from the latch circuit 13 or the exception code from the exception code generation unit 18 and the EOL code from the EOL circuit 27 to a transmission medium (not shown) and compresses the data. A signal indicating the sign output is input to the latch circuit 1. As a result, the latch circuit 1 latches the next pixel data p + 1 and inputs it to the shift register 2, and thereafter, the same processing as described above is performed. The transmission medium is not limited to a specific one, and may be a transmission path for compressed image data or various storage media.

【0039】図8において、伝送媒体(図示せず)から
得られる入力圧縮符号は、ラッチ回路31を介してテー
ブル検索部32及び例外コード復号回路34に入力され
る。入力圧縮符号に対応する例外コードがテーブル検索
部32内の復号化テーブル32aに存在すると、この例
外コードが読み出されて例外コード復号回路34に入力
される。この場合、例外コード復号回路34は、入力圧
縮符号をそのまま伸長画素データpとして出力回路35
に出力する。又、例外コード復号回路34からの伸長画
素データpは、前画素データ保持回路33に入力され、
保持される。
In FIG. 8, an input compression code obtained from a transmission medium (not shown) is input to a table search unit 32 and an exception code decoding circuit 34 via a latch circuit 31. If an exception code corresponding to the input compression code exists in the decoding table 32a in the table search unit 32, the exception code is read and input to the exception code decoding circuit 34. In this case, the exception code decoding circuit 34 outputs the input compression code as is to the output circuit 35 as decompressed pixel data p.
Output to The expanded pixel data p from the exception code decoding circuit 34 is input to the previous pixel data holding circuit 33,
Will be retained.

【0040】入力圧縮符号に対応する差分値dが復号化
テーブル32aに存在すると、この差分値dが読み出さ
れて画素データ復号回路36に入力される。この場合、
画素データ復号回路36は、前画素データ保持回路33
に保持された1画素前の伸長画素データp-1と、差分値
dとを加算して、加算結果を伸長画素データpとして出
力回路35に出力する。又、画素データ復号回路36か
らの伸長画素データpは、前画素データ保持回路33に
入力され、保持される。
When a difference value d corresponding to the input compression code exists in the decoding table 32a, the difference value d is read and input to the pixel data decoding circuit 36. in this case,
The pixel data decoding circuit 36 includes a previous pixel data holding circuit 33
Is added to the decompressed pixel data p-1 one pixel before and the difference value d, and the addition result is output to the output circuit 35 as decompressed pixel data p. The expanded pixel data p from the pixel data decoding circuit 36 is input to the previous pixel data holding circuit 33 and held.

【0041】入力圧縮符号に対応するランレングスが復
号化テーブル32aに存在すると、このランレングスが
読み出されてランカウンタ38に入力される。ランカウ
ンタ38は、読み出されたランレングスから順次デクリ
メンタ39の出力に応答してカウントダウンを行う。こ
の場合、ラッチ回路37は、前画素データ保持回路33
に保持された1画素前の伸長画素データp-1を、ランカ
ウンタ38が「0」までカウントダウンするまで出力回
路35に繰り返し出力する。
If a run length corresponding to the input compression code exists in the decoding table 32a, the run length is read and input to the run counter 38. The run counter 38 counts down in response to the output of the decrementer 39 sequentially from the read run length. In this case, the latch circuit 37 includes the previous pixel data holding circuit 33.
Is repeatedly output to the output circuit 35 until the run counter 38 counts down to "0".

【0042】又、入力圧縮符号に対応するEOL符号が
復号化テーブル32aに存在すると、このEOL符号が
読み出されて出力回路35に出力される。このEOL符
号は、前画素データ保持回路33にもリセット信号とし
て入力され、前画素データ保持回路33をリセットして
保持データをクリアする。これにより、出力回路35か
らは、伸長画素データがEOL符号と共に元の多値画像
データとして出力され、例えば表示装置等の出力装置
(図示せず)に出力される。
When an EOL code corresponding to the input compression code exists in the decoding table 32a, the EOL code is read and output to the output circuit 35. This EOL code is also input to the previous pixel data holding circuit 33 as a reset signal, and resets the previous pixel data holding circuit 33 to clear the held data. As a result, the output circuit 35 outputs the expanded pixel data together with the EOL code as the original multi-valued image data, and outputs it to an output device (not shown) such as a display device.

【0043】ところで、上記圧縮系及び伸長系の動作
は、ソフトウェアにより実現することも可能である。図
9は、圧縮系及び伸長系の動作をソフトウェアにより実
現する際に用いるコンピュータシステムを示すブロック
図である。同図中、コンピュータシステムは、中央処理
装置(CPU)41、ランダムアクセスメモリ(RA
M)42及びリードオンリメモリ(ROM)43がバス
44により接続された周知の構成を有する。CPU41
は、ROM43に格納されたプログラムを実行し、演算
の中間データ等がRAM42に格納される。又、符号化
テーブル12及び復号化テーブル32aは、例えばRO
M43に格納されている。
Incidentally, the operations of the compression system and the expansion system can be realized by software. FIG. 9 is a block diagram showing a computer system used when the operations of the compression system and the expansion system are realized by software. In the figure, a computer system includes a central processing unit (CPU) 41, a random access memory (RA).
M) 42 and a read-only memory (ROM) 43 have a known configuration connected by a bus 44. CPU 41
Executes a program stored in the ROM 43, and stores intermediate data and the like for calculation in the RAM 42. The encoding table 12 and the decoding table 32a are, for example, RO
It is stored in M43.

【0044】図10は、上記コンピュータシステムによ
り図7に示す圧縮系の動作を実現する場合のCPU41
の動作を示すフローチャートであり、図11は、上記コ
ンピュータシステムにより図8に示す伸長系の動作を実
現する場合のCPU41の動作を示すフローチャートで
ある。図10において、ステップS1は、多値画像デー
タの画素データを入力し、この場合、最初は画素データ
p-1が入力される。ステップS2は、画素データp-1が
エンド・オブ・ファイル(EOF)を示すか否かを判定
し、判定結果がYESであると処理は終了する。他方、
ステップS2の判定結果がNOであると、ステップS3
は、画素データp-1を圧縮符号として出力し、ステップ
S4は多値画像データの次の画素データを入力し、この
場合、画素データpが入力される。ステップS5は、画
素データpがEOLを示すか否かを判定し、判定結果が
NOであると、ステップS6は、2つの連続する画素デ
ータp-1,pの差分dを求める。ステップS7は、差分
dが「0」であるか否かを判定し、判定結果がYESで
あると、ステップS8は、ランのカウント値LCNTを
「1」だけインクリメントする。ステップS9は、ラン
のカウント値LCNTがランレングスの最大値LMAX
と等しいか否かを判定し、判定結果がNOであると、処
理はステップS4へ戻り、次の画素データが入力され
る。又、ステップS9の判定結果がYESの場合は、ス
テップS10でランのカウント値LCNTが示すランレ
ングスに対応する圧縮符号を符号化テーブルから読み出
して出力し、処理はステップS4へ戻り、次の画素デー
タが入力される。
FIG. 10 shows a CPU 41 for realizing the operation of the compression system shown in FIG. 7 by the computer system.
FIG. 11 is a flowchart showing the operation of the CPU 41 when the decompression operation shown in FIG. 8 is realized by the computer system. In FIG. 10, in step S1, pixel data of multi-valued image data is input. In this case, first, pixel data p-1 is input. A step S2 decides whether or not the pixel data p-1 indicates an end of file (EOF), and the process ends if the decision result in the step S2 is YES. On the other hand,
If the decision result in the step S2 is NO, a step S3 is executed.
Outputs the pixel data p-1 as a compression code. In step S4, the next pixel data of the multi-valued image data is input. In this case, the pixel data p is input. A step S5 decides whether or not the pixel data p indicates the EOL. If the decision result in the step S5 is NO, a step S6 finds the difference d between the two successive pixel data p-1, p. A step S7 decides whether or not the difference d is "0", and if the decision result is YES, a step S8 increments the run count value LCNT by "1". In step S9, the run count value LCNT is set to the maximum run length LMAX.
Is determined, and if the determination result is NO, the process returns to step S4, and the next pixel data is input. If the decision result in the step S9 is YES, in a step S10, a compression code corresponding to the run length indicated by the run count value LCNT is read out from the encoding table and output, and the process returns to the step S4 to execute the next pixel. The data is entered.

【0045】他方、ステップS5の判定結果がYESで
あると、ステップS11は、ランのカウント値LCNT
が「0」であるか否かを判定し、判定結果がNOの場合
は、ステップS12でランのカウント値LCNTが示す
ランレングスに対応する圧縮符号を符号化テーブルから
読み出して出力する。又、ステップS13は、ランのカ
ウント値LCNTを「0」にリセットして、処理はステ
ップS1へ戻り、次のラインの最初の画素データが入力
される。ステップS11の判定結果がYESの場合は、
処理はステップS1へ戻り、次のラインの最初の画素デ
ータが入力される。
On the other hand, if the decision result in the step S5 is YES, a step S11 executes a run count value LCNT.
Is determined to be "0". If the determination result is NO, a compression code corresponding to the run length indicated by the run count value LCNT is read from the coding table and output in step S12. A step S13 resets the run count value LCNT to "0", and the process returns to the step S1 to input the first pixel data of the next line. If the decision result in the step S11 is YES,
The process returns to step S1, and the first pixel data of the next line is input.

【0046】ステップS7の判定結果がNOであると、
ステップS14は、ランのカウント値LCNTが「0」
であるか否かを判定し、判定結果がNOの場合は、ステ
ップS15でランのカウント値LCNTが示すランレン
グスに対応する圧縮符号を符号化テーブルから読み出し
て出力する。又、ステップS16は、ランのカウント値
LCNTを「0」にリセットして、処理はステップS1
7へ進む。ステップS14の判定結果がYES又はステ
ップS16の後、ステップS17は、差分dが差分の最
小値−DMAX以上で差分の最大値DMAX以下である
か否かを判定する。ステップS17の判定結果がYES
であると、ステップS18は、差分dに対応する圧縮符
号を符号化テーブルから読み出して出力し、処理はステ
ップSS4へ戻り、次の画素データが入力される。他
方、ステップS17の判定結果がNOであると、ステッ
プS19は、例外コードを出力することを決定する。
又、ステップS20は、元の画素データpを例外コード
として出力し、処理はステップSS4へ戻り、次の画素
データが入力される。
If the decision result in the step S7 is NO,
In step S14, the run count value LCNT is “0”.
Is determined, and if the determination result is NO, the compression code corresponding to the run length indicated by the run count value LCNT is read from the encoding table and output in step S15. In addition, a step S16 resets the run count value LCNT to “0”, and the process proceeds to the step S1.
Proceed to 7. If the decision result in the step S14 is YES or after the step S16, a step S17 decides whether or not the difference d is equal to or more than the difference minimum value -DMAX and equal to or less than the maximum difference value DMAX. If the decision result in the step S17 is YES
In step S18, the compression code corresponding to the difference d is read from the encoding table and output, and the process returns to step SS4, where the next pixel data is input. On the other hand, if the decision result in the step S17 is NO, a step S19 decides to output an exception code.
In step S20, the original pixel data p is output as an exception code, the process returns to step SS4, and the next pixel data is input.

【0047】図11において、ステップS21は、伝送
媒体を介して得られる入力圧縮符号sを入力する。ステ
ップS22は、圧縮符号sがEOFを示すか否かを判定
し、判定結果がYESであると、処理は終了する。他
方、ステップS22の判定結果がNOであると、ステッ
プS23は、圧縮符号sを伸長画素データとして出力す
る。ステップS24は、伸長画素データsを、前の画素
p-1として保持し、ステップS25は、次の入力圧縮符
号sを入力する。ステップS26は、ステップS25で
入力された次の入力圧縮符号sに対応する値pを復号化
テーブルから読み出す。ステップS27は、読み出した
値pがEOLを示すか否かを判定する。ステップS27
の判定結果がYESであると、ステップS31はEOL
符号を出力し、処理はステップS21へ戻り、次のライ
ンの入力圧縮符号sが入力される。
In FIG. 11, a step S21 inputs an input compression code s obtained via a transmission medium. A step S22 decides whether or not the compression code s indicates EOF, and the process ends if the decision result in the step S22 is YES. On the other hand, if the decision result in the step S22 is NO, a step S23 outputs the compression code s as decompressed pixel data. A step S24 holds the decompressed pixel data s as the previous pixel p-1, and a step S25 inputs the next input compression code s. A step S26 reads the value p corresponding to the next input compression code s input in the step S25 from the decoding table. A step S27 decides whether or not the read value p indicates EOL. Step S27
Is "YES", the step S31 determines that the EOL
The code is output, the process returns to step S21, and the input compression code s for the next line is input.

【0048】ステップS27の判定結果がNOの場合、
ステップS28は、値pが例外コードであるか否かを判
定し、判定結果がYESであると、ステップS29は、
値pを伸長画素データとして出力する。ステップS30
は、伸長画素データpの値を前の画素データp-1として
保持し、処理はステップS25へ戻り、次の入力圧縮符
号sが入力される。
If the decision result in the step S27 is NO,
A step S28 decides whether or not the value p is an exception code. If the decision result in the step S28 is YES, a step S29 decides
The value p is output as expanded pixel data. Step S30
Holds the value of the decompressed pixel data p as the previous pixel data p-1, the process returns to step S25, and the next input compression code s is input.

【0049】ステップS28の判定結果がNOの場合、
ステップS32は、値pが差分値dであるか否かを判定
し、判定結果がYESであると、ステップS33は、値
pを差分値dとして設定し、ステップS34は、前の画
素データp-1と差分値dとの和を伸長画素データとして
出力する。ステップS35は、ステップS34で出力し
た伸長画素データの値を前の画素データp-1として保持
し、処理はステップS25へ戻り、次の入力圧縮符号s
が入力される。
If the decision result in the step S28 is NO,
A step S32 decides whether or not the value p is a difference value d, and if the decision result is YES, a step S33 sets the value p as the difference value d, and a step S34 decides the previous pixel data p The sum of -1 and the difference value d is output as expanded pixel data. A step S35 holds the value of the decompressed pixel data output in the step S34 as the previous pixel data p-1, and the process returns to the step S25, where the next input compression code s
Is entered.

【0050】又、ステップS32の判定結果がNOの場
合、ステップS36は、値pがランレングスであるか否
かを判定し、判定結果がNOであると、ステップS37
でエラーが出力される。エラーの出力は、エラーフラグ
をセットしたり、エラーメッセージを出力することで行
われる。他方、ステップS36の判定結果がYESであ
ると、ステップS38は、値pをランのカウント値LC
NTとして設定し、ステップS39は、前の画素データ
p-1を伸長画素データとして出力する。ステップS40
は、ランのカウント値LCNTを「1」だけデクリメン
トし、ステップS41は、ランのカウント値LCNTが
「0」であるか否かを判定する。ステップS41の判定
結果がYESであると、処理はステップS39へ戻る。
ステップS41の判定結果がNOであると、処理はステ
ップS25へ戻り、次の入力圧縮符号sが入力される。
If the decision result in the step S32 is NO, a step S36 decides whether or not the value p is a run length, and if the decision result is NO, a step S37 is executed.
Will output an error. An error is output by setting an error flag or outputting an error message. On the other hand, if the decision result in the step S36 is YES, a step S38 sets the value p to the run count value LC.
In step S39, the previous pixel data p-1 is output as expanded pixel data. Step S40
Decrements the run count value LCNT by "1", and a step S41 determines whether or not the run count value LCNT is "0". If the decision result in the step S41 is YES, the process returns to the step S39.
If the decision result in the step S41 is NO, the process returns to the step S25, where the next input compression code s is inputted.

【0051】このように、本実施例では、多値画像を構
成する画素データにおけるデータ値のラン及び隣接画素
データの変化分をまとめて符号化テーブルを作成するこ
とにより、2種類の圧縮条件を統合することができる。
従って、多値画像データに対してロスレス圧縮を高い圧
縮効率で行うことができ、本実施例を電子ファイリング
システム等へ適用した場合に、システムの性能を向上す
ることができる。
As described above, in the present embodiment, two types of compression conditions can be defined by creating an encoding table in which runs of data values in pixel data constituting a multi-valued image and changes in adjacent pixel data are summarized. Can be integrated.
Therefore, lossless compression can be performed on multi-valued image data with high compression efficiency, and when this embodiment is applied to an electronic filing system or the like, the performance of the system can be improved.

【0052】次に、本発明になる画像処理装置の第2実
施例を説明する。図12は、本発明になる画像処理装置
の第2実施例の圧縮系を示すブロック図であり、図13
は、画像処理装置の第2実施例の伸長系を示すブロック
図である。図12及び図13中、図7及び図8と同一部
分には同一符号を付し、その説明は省略する。画像処理
装置の第2実施例は、本発明になる画像処理方法の第2
実施例を採用する。
Next, a description will be given of a second embodiment of the image processing apparatus according to the present invention. FIG. 12 is a block diagram showing a compression system of a second embodiment of the image processing apparatus according to the present invention.
FIG. 6 is a block diagram illustrating a decompression system according to a second embodiment of the image processing apparatus. 12 and 13, the same parts as those in FIGS. 7 and 8 are denoted by the same reference numerals, and the description thereof will be omitted. The second embodiment of the image processing apparatus is the second embodiment of the image processing method according to the present invention.
An embodiment is employed.

【0053】図12において、圧縮系は、図7に示す部
分に加え、ラッチ回路41,42,44,45、ライン
バッファ43及び予測器46を有する。ラッチ回路4
1,42は、ラッチ回路1を介して得られる画素データ
を順次ラインバッファ43に入力し、ラインバッファ4
3に1ライン分の画素データを格納する。ラインバッフ
ァ43に格納された画素データは、1画素データ毎にラ
ッチ回路44,45に順次入力される。ラッチ回路41
は、図3に示す注目画素xの画素データxをラッチし、
ラッチ回路42は図3に示す周辺画素bの画素データb
をラッチする。ラインバッファ43は、1ライン分の画
素データを格納する。又、ラッチ回路44,45は、夫
々注目画素xの属するラインより1つ前のラインの画素
データa,cをラッチする。
In FIG. 12, the compression system has latch circuits 41, 42, 44, 45, a line buffer 43, and a predictor 46 in addition to the parts shown in FIG. Latch circuit 4
1, 42 sequentially input pixel data obtained through the latch circuit 1 to the line buffer 43, and
3 stores pixel data for one line. The pixel data stored in the line buffer 43 is sequentially input to the latch circuits 44 and 45 for each pixel data. Latch circuit 41
Latches the pixel data x of the target pixel x shown in FIG.
The latch circuit 42 stores the pixel data b of the peripheral pixel b shown in FIG.
Latch. The line buffer 43 stores one line of pixel data. The latch circuits 44 and 45 respectively latch the pixel data a and c of the line immediately before the line to which the target pixel x belongs.

【0054】予測器46は、注目画素xの予測値^xを
^x=a+b−cなる平面予測により求めて減算器3a
に入力する。この減算器3aには、ラッチ回路41から
の注目画素xの画素データxも入力されている。従っ
て、減算器3aは画素データxとその予測値^xからd
=x−^xなる差分を求めて、ラッチ回路4に差分dを
入力し、以下上記第1実施例の場合と同様の動作が行わ
れる。尚、例外コード生成部18aは、比較器16での
比較結果により差分dが許容範囲外であることがわかる
と、例外コードとしてラッチ回路41から得られる元の
画素データxを出力回路14に出力する。
The predictor 46 calculates the predicted value ^ x of the pixel of interest x by plane prediction of ^ x = a + bc, and calculates the
To enter. The pixel data x of the target pixel x from the latch circuit 41 is also input to the subtractor 3a. Accordingly, the subtractor 3a calculates d from the pixel data x and its predicted value ^ x.
= X- ^ x, and the difference d is input to the latch circuit 4, and the same operation as in the first embodiment is performed thereafter. When the exception code generation unit 18a finds that the difference d is out of the allowable range based on the comparison result by the comparator 16, the exception code generation unit 18a outputs the original pixel data x obtained from the latch circuit 41 to the output circuit 14 as an exception code. I do.

【0055】図13において、伸長系は、図8に示す部
分に加え、ラッチ回路51,53,54、ラインバッフ
ァ52及び予測器55を有する。予測器55は、ラッチ
回路51,53,54からの画素データb,c,aから
注目画素xの予測値^x=a+b−cから求めて画素デ
ータ復号回路36aに入力される。この場合、画素デー
タ復号回路36aは、予測器55からの予測値^xと差
分値dとを加算して、加算結果d+^xを伸長画素デー
タpとして出力回路35に出力する。
In FIG. 13, the decompression system has latch circuits 51, 53, 54, a line buffer 52, and a predictor 55 in addition to the parts shown in FIG. The predictor 55 obtains the predicted value ^ x = a + bc of the target pixel x from the pixel data b, c, a from the latch circuits 51, 53, 54 and inputs the obtained value to the pixel data decoding circuit 36a. In this case, the pixel data decoding circuit 36a adds the prediction value ^ x from the predictor 55 and the difference value d, and outputs the addition result d + ^ x to the output circuit 35 as expanded pixel data p.

【0056】図14は、図9に示すコンピュータシステ
ムにより図12に示す圧縮系の動作を実現する場合のC
PU41の動作を示すフローチャートであり、図15
は、上記コンピュータシステムにより図13に示す伸長
系の動作を実現する場合のCPU41の動作を示すフロ
ーチャートである。図14及び図15中、図10及び図
11と同一ステップには同一符号を付し、その説明は省
略する。
FIG. 14 is a diagram showing C when the operation of the compression system shown in FIG. 12 is realized by the computer system shown in FIG.
FIG. 15 is a flowchart showing the operation of the PU 41, and FIG.
13 is a flowchart showing the operation of the CPU 41 when the decompression operation shown in FIG. 13 is realized by the computer system. 14 and 15, the same steps as those in FIGS. 10 and 11 are denoted by the same reference numerals, and description thereof will be omitted.

【0057】図14において、ステップS101は、多
値画像データを入力し、ステップS102は、図3に示
す注目画素xの周辺画素c,a,bの画素データc,
a,b及び注目画素xの画素データxを保持する。ステ
ップS102aは、注目画素データxがEOFを示すか
否かを判定し、判定結果がYESであると処理は終了す
る。他方、ステップS102aの判定結果がNOである
と、ステップS5aは、注目画素データxがEOLを示
すか否かを判定し、判定結果がNOであると、ステップ
S6aは、差分dをd=x−^x=x−(a+b−c)
から求め、処理はステップS7へ進む。ステップS20
aは、元の画素データxを例外コードとして出力する。
その他の処理は、基本的には図10に示す第1実施例の
場合と同様である。
In FIG. 14, a step S101 inputs multi-valued image data, and a step S102 selects the pixel data c, a, b of the peripheral pixels c, a, b of the target pixel x shown in FIG.
a, b and the pixel data x of the target pixel x are held. A step S102a decides whether or not the pixel data of interest x indicates EOF, and the process ends if the decision result in the step S102a is YES. On the other hand, if the decision result in the step S102a is NO, a step S5a decides whether or not the target pixel data x indicates EOL, and if the decision result is NO, a step S6a computes the difference d as d = x -^ x = x- (a + bc)
, And the process proceeds to step S7. Step S20
a outputs the original pixel data x as an exception code.
Other processes are basically the same as those of the first embodiment shown in FIG.

【0058】図15において、ステップS201は、伝
送媒体を介して得られる入力圧縮符号sを入力し、ステ
ップS202は、この圧縮符号sを保持する。ステップ
S203は、圧縮符号sがEOLであるか否かを判定
し、判定結果がNOであれば、処理はステップS201
へ戻る。他方、1ライン分の圧縮符号sが入力されてス
テップS203の判定結果がYESとなると、ステップ
S204は次の圧縮符号sを入力する。ステップS20
5は、ステップS204で入力された圧縮符号sがEO
Fであるか否かを判定し、判定結果がYESであれば、
処理は終了する。他方、ステップS205の判定結果が
NOであると、ステップS206は、ステップS204
で入力された圧縮符号sを前の画素p-1の伸長画素デー
タとして保持し、ステップS207は、圧縮符号sを伸
長画素データとして出力し、処理はステップS25へ進
む。
In FIG. 15, a step S201 inputs an input compression code s obtained through a transmission medium, and a step S202 holds the compression code s. A step S203 decides whether or not the compression code s is EOL. If the decision result in the step S203 is NO, the process proceeds to a step S201.
Return to On the other hand, when the compression code s for one line is input and the determination result in the step S203 is YES, a step S204 inputs the next compression code s. Step S20
5 indicates that the compression code s input in step S204 is EO
F is determined, and if the determination result is YES,
The process ends. On the other hand, if the decision result in the step S205 is NO, the step S206 is replaced with the step S204
Is held as decompressed pixel data of the previous pixel p-1, the compressed code s is output as decompressed pixel data in step S207, and the process proceeds to step S25.

【0059】又、ステップS32の判定結果がYESで
あると、ステップS33は値pを差分値dとして設定
し、ステップS208は、注目画素xの予測値^xを^
x=a+b−cから求める。ステップS209は、差分
値dと予測値^xとの加算結果、即ち、注目画素データ
xを、伸長画素データpとして出力する。ステップS2
10は、注目画素データxを前の画素データp-1として
保持し、処理はステップS25へ戻る。その他の処理
は、基本的には図11に示す第1実施例の場合と同様で
ある。
If the decision result in the step S32 is YES, a step S33 sets the value p as the difference value d, and a step S208 sets the predicted value ^ x of the target pixel x to ^.
It is determined from x = a + bc. A step S209 outputs the addition result of the difference value d and the predicted value ^ x, that is, the target pixel data x as the expanded pixel data p. Step S2
10 holds the target pixel data x as the previous pixel data p-1, and the process returns to step S25. Other processes are basically the same as those of the first embodiment shown in FIG.

【0060】このように、本実施例では、上記第1実施
例のロスレス圧縮に前値予測を同時に適用することによ
り、ランを延長すると共に、隣接画素のデータ値の変化
量を小変化分に集中化することで、短い圧縮符号の頻度
を増加して圧縮率を更に向上することができる。次に、
本発明になる画像処理装置の第3実施例を説明する。図
16は、本発明になる画像処理装置の第3実施例の圧縮
系を示すブロック図であり、図17は図16に示す圧縮
系の一部の構成を示すブロック図である。図18は、画
像処理装置の第3実施例の伸長系を示すブロック図であ
る。図16及び図18中、図7及び図8と同一部分には
同一符号を付し、その説明は省略する。画像処理装置の
第3実施例は、本発明になる画像処理方法の第3実施例
を採用する。
As described above, in this embodiment, the run is extended and the amount of change in the data value of the adjacent pixel is reduced to a small amount by simultaneously applying the previous value prediction to the lossless compression of the first embodiment. The centralization can increase the frequency of short compression codes and further improve the compression ratio. next,
A third embodiment of the image processing apparatus according to the present invention will be described. FIG. 16 is a block diagram showing a compression system of the third embodiment of the image processing apparatus according to the present invention, and FIG. 17 is a block diagram showing a partial configuration of the compression system shown in FIG. FIG. 18 is a block diagram showing a decompression system according to the third embodiment of the image processing apparatus. 16 and 18, the same parts as those of FIGS. 7 and 8 are denoted by the same reference numerals, and the description thereof will be omitted. The third embodiment of the image processing apparatus employs the third embodiment of the image processing method according to the present invention.

【0061】図17において、圧縮系は、図7に示す部
分に加え、網点周期予測回路61を有する。この網点周
期予測回路61は、入力多値画像データから網点周期分
の窓内の画素のデータ値の平均値Ak (k=
0,...,N−1)を求めて減算器3bにオフセット
として入力する。減算器3bは、差分dをd=p−p-1
−Ak から求めてラッチ回路4に入力する。
In FIG. 17, the compression system has a dot cycle prediction circuit 61 in addition to the parts shown in FIG. The halftone period predicting circuit 61 calculates the average value Ak (k = k) of the pixel data values within the halftone period window from the input multi-valued image data.
0,. . . , N-1) are obtained and input to the subtractor 3b as offsets. The subtractor 3b calculates the difference d as d = pp-1
−Ak and input to the latch circuit 4.

【0062】網点周期予測回路61は、図17に示の如
く接続されたシフトレジスタ62、最大値検出回路6
3、ラインメモリ64、最大値周期検出回路65、加算
器66、平均値回路67、ラインメモリ68及び網点周
期検出回路69からなる。図17では、説明の便宜上、
16の画素W0 〜W15の窓で、データ圧縮を行う前に網
点画像のラインを走査するものとする。最大値検出回路
63は、窓内の最大データ値Pmax の画素を検出してマ
ークすると共に、1ラインの処理が終了するとライン処
理完了信号を最大値周期検出回路65に供給する。又、
窓内の画素W0 〜W15のデータ値は、窓を1画素分ずつ
走査する度にラインメモリ64に格納され、ラインメモ
リ64には1ライン分のデータ値が格納される。最大値
周期検出回路69は、ラインメモリ64に格納されたマ
ークを付けられた画素の周期を検出し、ライン処理完了
信号に基づいてライン毎に最大値の周期を網点周期検出
回路69に供給する。ここでは、最大値の周期が画素数
にしてNであるものとする。
The dot period predicting circuit 61 includes a shift register 62 and a maximum value detecting circuit 6 connected as shown in FIG.
3, a line memory 64, a maximum value cycle detection circuit 65, an adder 66, an average value circuit 67, a line memory 68, and a dot cycle detection circuit 69. In FIG. 17, for convenience of explanation,
It is assumed that a halftone dot image line is scanned in a window of 16 pixels W0 to W15 before data compression. The maximum value detection circuit 63 detects and marks the pixel having the maximum data value Pmax in the window, and supplies a line processing completion signal to the maximum value period detection circuit 65 when the processing of one line is completed. or,
The data values of the pixels W0 to W15 in the window are stored in the line memory 64 each time the window is scanned one pixel at a time, and the line memory 64 stores the data values of one line. The maximum value cycle detection circuit 69 detects the cycle of the marked pixel stored in the line memory 64, and supplies the maximum value cycle for each line to the halftone dot cycle detection circuit 69 based on the line processing completion signal. I do. Here, it is assumed that the cycle of the maximum value is N in terms of the number of pixels.

【0063】加算器66は、窓内の画素W0 〜W15のデ
ータ値を加算して加算値Wsを出力し、平均値回路67
は、窓内の画素W0 〜W15のデータ値の平均値Ws/1
6(=Wave )を出力してラインメモリ68に格納す
る。平均値Wave は、窓を1画素分ずつ走査する度にラ
インメモリ68に格納され、ラインメモリ68には1ラ
イン分の平均値Wave が格納される。網点周期検出検出
回路69は、最大値周期検出回路からの最大値の周期N
の最頻値から網点周期を求め、網点周期毎にラインメモ
リ68から読み出される平均値Wave をA0 〜AN-1 と
して出力して図16に示す減算器3bに入力する。
The adder 66 adds the data values of the pixels W0 to W15 in the window and outputs an addition value Ws.
Is the average value Ws / 1 of the data values of the pixels W0 to W15 in the window.
6 (= Wave) is output and stored in the line memory 68. The average value Wave is stored in the line memory 68 each time the window is scanned by one pixel, and the line memory 68 stores the average value Wave of one line. The dot cycle detection and detection circuit 69 calculates the maximum value cycle N from the maximum value cycle detection circuit.
The average value Wave read out from the line memory 68 for each dot period is output as A0 to AN-1 and input to the subtractor 3b shown in FIG.

【0064】網点周期検出回路69は、網点の周期に適
合する画素と適合しない画素との比率から、網点の周期
のばらつきが異常に大きいと判断されると網点画像では
ないと判断する。例えば、網点の周期に適合する画素と
適合しない画素との比率が70%以上でなければ、上記
の如き網点画像に対する処理を行わず、減算器3bには
オフセットとなる平均値A0 〜AN-1 が入力されないの
で、この場合の動作は上記第1実施例の場合と同様とな
る。
The halftone dot detecting circuit 69 determines that the image is not a halftone image if it is determined that the variation of the halftone period is abnormally large based on the ratio of pixels conforming to the halftone period and non-conforming pixels. I do. For example, if the ratio of pixels conforming to the period of the halftone dot to non-conforming pixels is not 70% or more, the above-described processing for the halftone image is not performed, and the subtractor 3b supplies the offset average values A0 to AN. Since -1 is not input, the operation in this case is the same as that of the first embodiment.

【0065】図18において、伸長系は、図8に示す部
分に加え、図17に示す網点周期予測回路61と同様の
構成の網点周期予測回路71及び加算回路72を有す
る。この網点周期予測回路71は、出力回路35から出
力される伸長画像データに基づいて網点周期分の窓内の
画素のデータ値の平均値Ak (k=0,...,N−
1)を求め、加算回路72に入力する。加算回路72
は、出力回路35から出力される伸長画像データに、網
点周期予測回路71から出力される平均値Ak をオフセ
ットとして加算することにより、元の網点画像データを
出力する。
In FIG. 18, the decompression system has, in addition to the portion shown in FIG. 8, a dot cycle prediction circuit 71 and an addition circuit 72 having the same configuration as the dot cycle prediction circuit 61 shown in FIG. The halftone period predicting circuit 71 calculates the average value Ak (k = 0,..., N−) of the pixel data values within the halftone period window based on the decompressed image data output from the output circuit 35.
1) is obtained and input to the adding circuit 72. Adder circuit 72
Outputs the original halftone dot image data by adding the average value Ak output from the halftone dot period prediction circuit 71 to the decompressed image data output from the output circuit 35 as an offset.

【0066】図19は、図9に示すコンピュータシステ
ムにより図16に示す圧縮系の動作を実現する場合のC
PU41の動作を示すフローチャートであり、図20
は、上記コンピュータシステムにより図18に示す伸長
系の動作を実現する場合のCPU41の動作を示すフロ
ーチャートである。図19及び図20中、図10及び図
11と同一ステップには同一符号を付し、その説明は省
略する。
FIG. 19 is a diagram showing C when the operation of the compression system shown in FIG. 16 is realized by the computer system shown in FIG.
FIG. 20 is a flowchart showing the operation of the PU 41, and FIG.
FIG. 19 is a flowchart showing the operation of the CPU 41 in the case where the decompression operation shown in FIG. 18 is realized by the computer system. 19 and 20, the same steps as those in FIGS. 10 and 11 are denoted by the same reference numerals, and description thereof will be omitted.

【0067】図19において、ステップS301は、n
を「0」に設定し、ステップS302は、入力多値画像
データから窓内の画素Wnのデータ値W[n]を入力す
る。ステップS303は、nを「1」だけインクリメン
トする。ステップS304は、nが「16」より小さい
か否かを判定し、判定結果がYESであると、処理はス
テップS302へ戻る。これにより、16画素の窓内の
データ値が入力される。ステップS304の判定結果が
NOであると、ステップS305は、窓内のデータ値か
ら最大値pmax[ ]を検出して保持する。ステップ
S306は、nが1ライン分の画素数より小さいか否か
を判定し、判定結果がYESであると、処理はステップ
S302へ戻る。
In FIG. 19, step S301 is n
Is set to “0”, and in step S302, the data value W [n] of the pixel Wn in the window is input from the input multi-valued image data. A step S303 increments n by “1”. A step S304 decides whether or not n is smaller than "16", and the process returns to the step S302 if the decision result in the step S304 is YES. Thereby, the data value in the window of 16 pixels is input. If the decision result in the step S304 is NO, a step S305 detects and holds the maximum value pmax [] from the data values in the window. A step S306 decides whether or not n is smaller than the number of pixels for one line. If the decision result in the step S306 is YES, the process returns to the step S302.

【0068】ステップS306の判定結果がNOである
と、ステップS307は、最大値pmax[ ]の周期
Nを検出kする。ステップS308は、周期Nの最頻値
から網点周期を求め、網点周期毎に窓内の画素W[n]
のデータ値の平均値Wave をA0 〜AN-1 として出力す
る。そして、ステップS309は、周期Nを出力すると
共に、k=0,...,k<Nについて平均値Ak を出
力する。
If the decision result in the step S306 is NO, a step S307 detects the period N of the maximum value pmax []. In step S308, a dot cycle is obtained from the mode of the cycle N, and the pixel W [n] in the window is obtained for each dot cycle.
Are output as A0 to AN-1. Then, a step S309 outputs the cycle N and k = 0,. . . , K <N, the average value Ak is output.

【0069】他方、ステップS310は、入力多値画像
データのうち1ライン分の画素データを格納し、ステッ
プS311は、格納された画素データ及び出力された平
均値Ak にゲート処理を施す。ステップS312は、k
を「0」に設定する。ステップS1bは、多値画像デー
タの画素データを入力し、この場合、最初は画素データ
p-1が入力される。ステップS2bは、画素データp-1
がEOFを示すか否かを判定し、判定結果がYESであ
ると処理は終了する。他方、ステップS2bの判定結果
がNOであると、ステップS313はp-1=p-1−Ak
を求め、k≧Nであればk=0に設定する。ステップS
3bは、画素データp-1を圧縮符号として出力し、ステ
ップS4bは多値画像データの次の画素データを入力
し、この場合、画素データpが入力される。ステップS
5bは、画素データpがEOLを示すか否かを判定し、
判定結果がNOであると、ステップS314はp=p−
Akを求め、k≧Nであればk=0に設定し、処理はス
テップS6へ進む。
On the other hand, step S310 stores pixel data for one line of the input multi-valued image data, and step S311 performs a gate process on the stored pixel data and the output average value Ak. In step S312, k
Is set to “0”. In step S1b, pixel data of multi-valued image data is input. In this case, first, pixel data p-1 is input. In step S2b, the pixel data p-1
Indicates whether or not indicates EOF, and the process ends if the determination result is YES. On the other hand, if the decision result in the step S2b is NO, a step S313 decides p-1 = p-1-Ak
And if k ≧ N, set k = 0. Step S
3b outputs the pixel data p-1 as a compression code, and step S4b inputs the next pixel data of the multi-valued image data. In this case, the pixel data p is input. Step S
5b determines whether the pixel data p indicates EOL,
If the decision result is NO, step S314 is p = p-
Ak is obtained, and if k ≧ N, k = 0 is set, and the process proceeds to step S6.

【0070】尚、ステップS11の判定結果がYES、
又は、ステップS13の後、処理はステップS312へ
戻る。図20において、ステップS22の判定結果がN
Oであると、ステップS401は、周期Nを圧縮符号s
として保持する。ステップS402は、k=
0,...,k≦Nについて圧縮符号Ak を入力する。
ステップS403は、次の入力圧縮符号sを入力すると
共に、k=0に設定する。ステップS404は、s+A
kを伸長画素データとして出力し、Ak ≧Nであるとk
=0に設定する。ステップS405は、伸長画素データ
sを、前の画素p-1として保持し、ステップS25は、
次の入力圧縮符号sを入力する。
If the decision result in the step S11 is YES,
Alternatively, after step S13, the process returns to step S312. In FIG. 20, the determination result of step S22 is N
If it is O, step S401 sets the cycle N to the compression code s
Hold as. In step S402, k =
0,. . . , K ≦ N, the compression code Ak is input.
A step S403 inputs the next input compression code s and sets k = 0. Step S404 is s + A
k is output as expanded pixel data, and if Ak ≧ N, k
= 0 is set. A step S405 holds the decompressed pixel data s as a previous pixel p-1.
The next input compression code s is input.

【0071】ステップS29bは、値p+Ak を伸長画
素データとして出力し、Ak ≧Nであるとk=0に設定
する。ステップS34bは、前の画素データp-1と差分
値dと平均値Ak との和を伸長画素データとして出力
し、Ak ≧Nであるとk=0に設定する。ステップS3
9bは、前の画素データp-1+平均値Ak を伸長画素デ
ータとして出力し、Ak ≧Nであるとk=0に設定す
る。
A step S29b outputs the value p + Ak as decompressed pixel data, and sets k = 0 if Ak ≧ N. A step S34b outputs the sum of the previous pixel data p-1, the difference value d and the average value Ak as expanded pixel data, and sets k = 0 if Ak ≧ N. Step S3
9b outputs the previous pixel data p-1 + average value Ak as decompressed pixel data, and sets k = 0 if Ak≥N.

【0072】このように、本実施例では、隣接画素のデ
ータ値の変化量を求める際にオフセットを加えること
で、網点画像に対してもランを延長すると共に、隣接画
素のデータ値の変化量を小変化分に集中化することで、
短い圧縮符号の頻度を増加して圧縮率を更に向上するこ
とができる。次に、本発明になる画像処理装置の第4実
施例を説明する。図21は、本発明になる画像処理装置
の第4実施例の圧縮系を示すブロック図である。図21
中、図7と同一部分には同一符号を付し、その説明は省
略する。画像処理装置の第4実施例は、本発明になる画
像処理方法の第4実施例を採用する。
As described above, in this embodiment, the run is extended even for the halftone dot image by adding the offset when calculating the amount of change in the data value of the adjacent pixel, and the change in the data value of the adjacent pixel is obtained. By concentrating the amount on small changes,
By increasing the frequency of short compression codes, the compression ratio can be further improved. Next, a description will be given of a fourth embodiment of the image processing apparatus according to the present invention. FIG. 21 is a block diagram showing a compression system of a fourth embodiment of the image processing apparatus according to the present invention. FIG.
7, the same components as those in FIG. 7 are denoted by the same reference numerals, and the description thereof is omitted. The fourth embodiment of the image processing apparatus employs the fourth embodiment of the image processing method according to the present invention.

【0073】図21において、圧縮系は、図7に示す部
分に加え、ラインメモリ81と、シフトレジスタ82
と、減算器83〜85とを有する。ラインメモリ81
は、入力多値画像データをラッチ回路1を介して入力さ
れ、1ライン分の画素データを格納する。シフトレジス
タ82には、シフトレジスタ2に入力される隣接画素デ
ータp-1,pより1つ前のラインの対応する画素位置の
画素データpp-1,ppがラインメモリ81から入力さ
れる。従って、減算器84には、シフトレジスタ2,8
2からの画素データp-1,pp-1が入力され、減算器8
3には、シフトレジスタ2,82からの画素データp,
ppが入力される。減算器84は、画素データp-1,p
p-1の差分p-1−pp-1を求め、差分を減算器85に入
力する。又、減算器83は、画素データp,ppの差分
p−ppを求め、差分を減算器85に入力する。従っ
て、減算器85は、減算器84,83からの差分の差分
(p-1−pp-1)−(p−pp)を求め、ラッチ回路4
に入力する。ラッチ回路4は、最初の1ラインについて
は減算器2からの差分を出力し、2ライン目以降につい
ては減算器85からの差分を出力する。
In FIG. 21, a compression system includes a line memory 81 and a shift register 82 in addition to the parts shown in FIG.
And subtracters 83 to 85. Line memory 81
Receives input multi-valued image data via the latch circuit 1 and stores pixel data for one line. The shift register 82 receives from the line memory 81 the pixel data pp-1, pp at the corresponding pixel position on the line one line before the adjacent pixel data p-1, p inputted to the shift register 2. Therefore, the subtractor 84 includes the shift registers 2 and 8
2, pixel data p-1 and pp-1 are input to a subtractor 8
3, the pixel data p from the shift registers 2 and 82,
pp is input. The subtractor 84 calculates the pixel data p-1, p
The difference p−1−pp−1 of p−1 is obtained, and the difference is input to the subtractor 85. Further, the subtracter 83 obtains a difference p−pp between the pixel data p and pp, and inputs the difference to the subtractor 85. Accordingly, the subtractor 85 obtains the difference (p−1−pp−1) − (p−pp) of the difference from the subtracters 84 and 83, and
To enter. The latch circuit 4 outputs the difference from the subtractor 2 for the first one line, and outputs the difference from the subtractor 85 for the second and subsequent lines.

【0074】画像処理装置の第4実施例の伸長系のブロ
ック図は、図8に示す構成と実質的に同じで良い。本実
施例では、復号化テーブル32aの内容が、図5に示す
如き二次元圧縮に合わせて上記第1実施例の場合と異な
るだけである。図22は、図9に示すコンピュータシス
テムにより図21に示す圧縮系の動作を実現する場合の
CPU41の動作を示すフローチャートであり、図23
は、上記コンピュータシステムにより第4実施例の伸長
系の動作を実現する場合のCPU41の動作を示すフロ
ーチャートである。図22及び図23中、図10及び図
11と同一ステップには同一符号を付し、その説明は省
略する。
The block diagram of the decompression system of the fourth embodiment of the image processing apparatus may be substantially the same as the configuration shown in FIG. In this embodiment, the contents of the decoding table 32a are different from those in the first embodiment only in accordance with the two-dimensional compression as shown in FIG. FIG. 22 is a flowchart showing the operation of the CPU 41 when the operation of the compression system shown in FIG. 21 is realized by the computer system shown in FIG.
FIG. 14 is a flowchart showing the operation of the CPU 41 when the operation of the decompression system of the fourth embodiment is realized by the computer system. 22 and 23, the same steps as those in FIGS. 10 and 11 are denoted by the same reference numerals, and description thereof will be omitted.

【0075】図22において、ステップS1cは、多値
画像データの画素データを入力し、この場合、最初は1
つのラインの画素データp-1が入力されると共に、次の
ラインの処理時に使用される前のラインの画素データp
p-1として保持される。ステップSc2は、画素データ
p-1がEOFを示すか否かを判定し、判定結果がYES
であると処理は終了する。他方、ステップS2cの判定
結果がNOであると、ステップS3cは、画素データp
-1を圧縮符号として出力し、ステップS4cは多値画像
データの同じラインの次の画素データを入力し、この場
合、画素データpが入力されると共に、次のラインの処
理時に使用される前のラインの画素データppとして保
持される。ステップS5は、画素データpがEOLを示
すか否かを判定し、判定結果がNOであると、ステップ
S501は、1ライン目の画素データを処理中であるか
否かを判定する。ステップS501の判定結果がYES
であれば、ステップS6は、2つの連続する画素データ
p-1,pの差分dを求める。他方、ステップS501の
判定結果がNOであると、ステップS502は、隣接す
る2つのライン上の画素データp-1,pp-1の差分p-1
−pp-1と、画素データp,ppの差分p−ppとの差
分d=(p-1−pp-1)−(p−pp)を求める。ステ
ップS6又はS502の後、処理はステップS7へ進
む。
In FIG. 22, in step S1c, pixel data of multi-valued image data is input.
The pixel data p-1 of one line is input, and the pixel data p of the previous line used in the processing of the next line
held as p-1. A step Sc2 decides whether or not the pixel data p-1 indicates EOF, and the decision result is YES
If so, the process ends. On the other hand, if the decision result in the step S2c is NO, a step S3c determines that the pixel data p
-1 is output as a compression code, and the step S4c inputs the next pixel data of the same line of the multi-valued image data. In this case, the pixel data p is input and the pixel data p is used before the next line is processed. Is held as the pixel data pp of the line. A step S5 decides whether or not the pixel data p indicates EOL. If the decision result in the step S5 is NO, a step S501 decides whether or not the pixel data of the first line is being processed. If the determination result in step S501 is YES
In step S6, a difference d between two consecutive pixel data p-1 and p is obtained. On the other hand, if the decision result in the step S501 is NO, a step S502 decides a difference p-1 between the pixel data p-1 and pp-1 on two adjacent lines.
The difference d = (p−1−pp−1) − (p−pp) between −pp−1 and the difference p−pp between the pixel data p and pp is obtained. After step S6 or S502, the process proceeds to step S7.

【0076】図23において、ステップS501は、入
力圧縮符号sを入力する。ステップS502は、ステッ
プS501で入力された入力圧縮符号sに対応する値p
を復号化テーブルから読み出す。ステップS503は、
読み出した値pがEOLを示すか否かを判定し、判定結
果がYESであれば、処理はステップS501へ戻る。
他方、ステップS503の判定結果がNOであると、処
理はステップS21へ進み、次の入力圧縮符号sを入力
する。
In FIG. 23, a step S501 inputs an input compression code s. In step S502, a value p corresponding to the input compression code s input in step S501 is set.
From the decoding table. Step S503 is
It is determined whether or not the read value p indicates EOL. If the determination result is YES, the process returns to step S501.
On the other hand, if the decision result in the step S503 is NO, the process proceeds to a step S21 to input the next input compression code s.

【0077】ステップS29cは、画素データpと前の
ラインの画素データppとの値の和を伸長画素データと
して出力する。ステップS34cは、前の画素データp
-1と差分値dと前のラインの画素データppとの値の和
を伸長画素データとして出力する。又、ステップS39
cは、前の画素データp-1と前のラインの画素データp
pとの値の和を伸長画素データとして出力する。
A step S29c outputs the sum of the values of the pixel data p and the pixel data pp of the previous line as expanded pixel data. In step S34c, the previous pixel data p
The sum of the value of −1, the difference value d, and the pixel data pp of the previous line is output as expanded pixel data. Step S39
c is the previous pixel data p-1 and the previous line pixel data p
The sum of the values with p is output as expanded pixel data.

【0078】このように、本実施例では、隣接画素のデ
ータ値の変化量を求める際に現在のラインと前のライン
との対応する画素データの差分を求めることで、二次元
圧縮を実現して圧縮率を更に向上することができる。次
に、本発明になる画像処理装置の第5実施例を説明す
る。図24は、本発明になる画像処理装置の第5実施例
の圧縮系を示すブロック図であり、図25は、画像処理
装置の第5実施例の伸長系を示すブロック図である。図
24及び図25中、図7及び図8と同一部分には同一符
号を付し、その説明は省略する。画像処理装置の第5実
施例は、本発明になる画像処理方法の第5実施例を採用
する。
As described above, in this embodiment, two-dimensional compression is realized by obtaining the difference between the pixel data corresponding to the current line and the corresponding pixel data when calculating the amount of change in the data value of the adjacent pixel. Thus, the compression ratio can be further improved. Next, a fifth embodiment of the image processing apparatus according to the present invention will be described. FIG. 24 is a block diagram showing a compression system of a fifth embodiment of the image processing apparatus according to the present invention, and FIG. 25 is a block diagram showing a decompression system of the fifth embodiment of the image processing apparatus. 24 and 25, the same parts as those in FIGS. 7 and 8 are denoted by the same reference numerals, and description thereof will be omitted. The fifth embodiment of the image processing apparatus employs the fifth embodiment of the image processing method according to the present invention.

【0079】図24において、圧縮系は、図7に示す部
分に加え、ユニバーサル圧縮回路91及びバッファメモ
リ92を有する。シフトレジスタ2へは、8ビットの入
力画素データのうち、上位5ビットのみが入力され、残
りの下位3ビットは、ユニバーサル圧縮回路91に入力
される。入力画素データの下位3ビットは、LZW等の
ユニバーサル圧縮を施され、バッファメモリ92に格納
される。バッファメモリ92に格納された圧縮データ
は、アンド回路26の出力信号により転送開始時期を制
御され、出力回路14に供給される。
In FIG. 24, the compression system has a universal compression circuit 91 and a buffer memory 92 in addition to the parts shown in FIG. Only the upper 5 bits of the 8-bit input pixel data are input to the shift register 2, and the remaining lower 3 bits are input to the universal compression circuit 91. The lower three bits of the input pixel data are subjected to universal compression such as LZW and stored in the buffer memory 92. The transfer start time of the compressed data stored in the buffer memory 92 is controlled by the output signal of the AND circuit 26, and is supplied to the output circuit 14.

【0080】図25において、伸長系は、図8に示す部
分に加え、ユニバーサル復元回路101、アンド回路1
02及びラインバッファ103を有する。圧縮された入
力画素データの下位3ビットに対応する圧縮符号は、ユ
ニバーサル復元回路101により復号されて元の画素デ
ータの下位3ビットに復元され、アンド回路102に入
力される。他方、出力回路35からの、元の画素データ
の上位5ビットに対応する伸長画素データは、ラインバ
ッファ103で出力タイミングを調整されてからアンド
回路102に入力される。これにより、アンド回路10
2からは、元の入力画素データに対応する伸長画素デー
タが出力される。
In FIG. 25, a decompression system includes a universal restoration circuit 101 and an AND circuit 1 in addition to the parts shown in FIG.
02 and a line buffer 103. The compression code corresponding to the lower 3 bits of the compressed input pixel data is decoded by the universal restoration circuit 101 to be restored to the lower 3 bits of the original pixel data, and is input to the AND circuit 102. On the other hand, expanded pixel data corresponding to the upper 5 bits of the original pixel data from the output circuit 35 is input to the AND circuit 102 after the output timing is adjusted by the line buffer 103. Thereby, the AND circuit 10
2 outputs expanded pixel data corresponding to the original input pixel data.

【0081】図26は、図9に示すコンピュータシステ
ムにより図24に示す圧縮系の動作を実現する場合のC
PU41の動作を示すフローチャートであり、図27
は、上記コンピュータシステムにより図25に示す伸長
系の動作を実現する場合のCPU41の動作を示すフロ
ーチャートである。図26及び図27中、図10及び図
11と同一ステップには同一符号を付し、その説明は省
略する。
FIG. 26 is a diagram showing C when the operation of the compression system shown in FIG. 24 is realized by the computer system shown in FIG.
FIG. 27 is a flowchart showing the operation of the PU 41, and FIG.
FIG. 26 is a flowchart showing the operation of the CPU 41 when the decompression operation shown in FIG. 25 is realized by the computer system. 26 and 27, the same steps as those in FIGS. 10 and 11 are denoted by the same reference numerals, and description thereof will be omitted.

【0082】図26において、ステップS601は、8
ビットの入力画素データを、上位5ビットと、下位3ビ
ットとに分離する。ステップS602は、下位3ビット
に対してユニバーサル圧縮を施し、圧縮データをRAM
42に格納する。他方、ステップS1以降は、上位5ビ
ットに対して上記第1実施例と同様の処理を施す。尚、
本実施例では、ステップS13の後、ステップS603
がRAM42から圧縮データを読み出して出力した後
に、処理がステップS601へ戻る。
In FIG. 26, step S 601 is performed at 8
The input pixel data of bits is separated into upper 5 bits and lower 3 bits. In step S602, universal compression is performed on the lower three bits, and the compressed data is stored in RAM.
42. On the other hand, after step S1, the same processing as in the first embodiment is performed on the upper 5 bits. still,
In this embodiment, after step S13, step S603 is executed.
After reading the compressed data from the RAM 42 and outputting it, the process returns to step S601.

【0083】図27において、ステップS27の判定結
果がYESであると、ステップS31dは、伸長画素デ
ータの上位5ビットLB1及びEOL符号を出力し、処
理はステップS701へ進む。ステップS701は、入
力圧縮符号sを入力し、ステップS702は、圧縮符号
sがEOLを示すか否かを判定し、判定結果がNOであ
れば処理はステップS703へ進み、判定結果がYES
であれば処理はステップS704へ進む。ステップS7
03は、伸長画素データの下位3ビットLB2を出力
し、処理はステップS701へ戻る。他方、ステップS
704は、伸長画素データの上位5ビットLB1及び下
位3ビットLB2を出力し、処理はステップS21へ戻
る。
In FIG. 27, if the decision result in the step S27 is YES, a step S31d outputs the upper 5 bits LB1 and the EOL code of the decompressed pixel data, and the process advances to a step S701. A step S701 inputs the input compression code s, and a step S702 determines whether or not the compression code s indicates EOL. If the determination result is NO, the process proceeds to the step S703, and the determination result is YES
If so, the process proceeds to step S704. Step S7
03 outputs the lower 3 bits LB2 of the expanded pixel data, and the process returns to step S701. On the other hand, step S
Reference numeral 704 outputs the upper 5 bits LB1 and the lower 3 bits LB2 of the decompressed pixel data, and the process returns to step S21.

【0084】ステップS29dは、画素データpを伸長
画素データの上位5ビットLB1として出力する。ステ
ップS34dは、前の画素データp-1と差分値dとの値
の和を伸長画素データの上位5ビットLB1として出力
する。又、ステップS39dは、前の画素データp-1の
値を伸長画素データの上位5ビットLB1として出力す
る。
A step S29d outputs the pixel data p as the upper 5 bits LB1 of the expanded pixel data. A step S34d outputs the sum of the previous pixel data p-1 and the difference value d as the upper 5 bits LB1 of the decompressed pixel data. A step S39d outputs the value of the previous pixel data p-1 as the upper 5 bits LB1 of the expanded pixel data.

【0085】このように、本実施例では、画像を低品質
のイメージスキャナで読み取った場合に仕様として例え
ば8ビットの出力を規定していても実質的には例えば5
ビット程度の出力しか得られず、下位の3ビットはノイ
ズになってしまう様な場合でも、図6に示すように、本
発明を8ビット出力の例えば上位5ビットのみに対して
適用し、下位3ビットに対しては独立してLZW方式等
のユニバーサル圧縮方式を適用することにより、ノイズ
の影響を抑制して高い圧縮率を得ることができる。
As described above, in this embodiment, even when an 8-bit output is specified as a specification when an image is read by a low-quality image scanner, the output is substantially, for example, 5 bits.
Even if the output of only about bits is obtained and the lower 3 bits become noise, as shown in FIG. 6, the present invention is applied to only the upper 5 bits of the 8-bit output, By applying a universal compression method such as the LZW method for three bits independently, it is possible to suppress the influence of noise and obtain a high compression ratio.

【0086】尚、上記第1〜第5実施例は、適宜組み合
わせても良いことは言うまでもない。以上、本発明を実
施例により説明したが、本発明は上記実施例に限定され
るものではなく、本発明の範囲内で種々の変形及び改良
が可能であることは言うまでもない。
It is needless to say that the first to fifth embodiments may be appropriately combined. As described above, the present invention has been described with reference to the embodiments. However, it is needless to say that the present invention is not limited to the above embodiments, and various modifications and improvements can be made within the scope of the present invention.

【0087】[0087]

【発明の効果】請求項1及び9記載の発明によれば、多
値画像のデータを情報損失を伴うことなく高い圧縮率で
圧縮することができる。請求項2及び10記載の発明に
よれば、ランレングス例外コードの発生比率が許容範囲
内となるように最大ランレングスを設定することによ
り、高い圧縮率を実現できる。
According to the first and ninth aspects of the present invention, data of a multi-valued image can be compressed at a high compression rate without information loss. According to the second and tenth aspects of the present invention, a high compression ratio can be realized by setting the maximum run length so that the occurrence ratio of the run length exception code is within an allowable range.

【0088】請求項3及び11記載の発明によれば、多
値画像の濃度が比較的少ないビット数で表される場合
に、高い圧縮率を実現できる。請求項4及び12記載の
発明によれば、前値予測を行うことにより、データ値の
ランを多く生成して圧縮率を更に向上することができ
る。請求項5及び13記載の発明によれば、網点周期の
予測を行うことにより、網点画像に対しても対処するこ
とができる。
According to the third and eleventh aspects of the present invention, a high compression ratio can be realized when the density of a multi-valued image is represented by a relatively small number of bits. According to the fourth and twelfth aspects of the present invention, by performing the preceding value prediction, it is possible to generate many runs of data values and further improve the compression ratio. According to the fifth and thirteenth aspects of the present invention, it is possible to cope with a halftone image by predicting a halftone period.

【0089】請求項6及び14記載の発明によれば、二
次元圧縮を行うことにより、圧縮率を更に向上すること
ができる。請求項7及び15記載の発明によれば、下位
ビットに対してはユニバーサル圧縮を施すことにより、
ノイズを抑制して圧縮率を向上することができる。請求
項8及び16記載の発明によれば、伸長された画像デー
タに強調処理等を施しても、画質劣化を発生することが
ない。
According to the sixth and fourteenth aspects of the present invention, the compression ratio can be further improved by performing two-dimensional compression. According to the seventh and fifteenth aspects, universal compression is performed on the lower bits,
Noise can be suppressed and the compression ratio can be improved. According to the inventions of claims 8 and 16, even if the decompressed image data is subjected to enhancement processing or the like, the image quality does not deteriorate.

【0090】従って、本発明によれば、多値画像のデー
タを情報損失を伴うことなく高い圧縮率で圧縮すること
が可能となる。
Therefore, according to the present invention, it is possible to compress data of a multi-valued image at a high compression rate without loss of information.

【図面の簡単な説明】[Brief description of the drawings]

【図1】圧縮される多値画像を構成する画素の配列を示
す図である。
FIG. 1 is a diagram showing an array of pixels forming a multivalued image to be compressed.

【図2】多値画像の第1ライン目の画素の濃度変化を示
す図である。
FIG. 2 is a diagram illustrating a change in density of pixels on a first line of a multi-valued image.

【図3】注目画素とその周辺画素との関係を示す図であ
る。
FIG. 3 is a diagram illustrating a relationship between a target pixel and its peripheral pixels.

【図4】網点周期の予測を説明する図である。FIG. 4 is a diagram illustrating prediction of a dot period.

【図5】画素データの二次元圧縮を説明する図である。FIG. 5 is a diagram illustrating two-dimensional compression of pixel data.

【図6】ノイズの分離を説明する図である。FIG. 6 is a diagram illustrating separation of noise.

【図7】本発明になる画像処理装置の第1実施例の圧縮
系を示すブロック図である。
FIG. 7 is a block diagram showing a compression system of the first embodiment of the image processing apparatus according to the present invention.

【図8】画像処理装置の第1実施例の伸長系を示すブロ
ック図である。
FIG. 8 is a block diagram illustrating a decompression system according to the first embodiment of the image processing apparatus.

【図9】圧縮系及び伸長系の動作をソフトウェアにより
実現する際に用いるコンピュータシステムを示すブロッ
ク図である。
FIG. 9 is a block diagram showing a computer system used when realizing operations of a compression system and an expansion system by software.

【図10】コンピュータシステムにより図7に示す圧縮
系の動作を実現する場合のCPUの動作を示すフローチ
ャートである。
FIG. 10 is a flowchart showing an operation of a CPU when the operation of the compression system shown in FIG. 7 is realized by a computer system.

【図11】コンピュータシステムにより図8に示す伸長
系の動作を実現する場合のCPUの動作を示すフローチ
ャートである。
FIG. 11 is a flowchart showing the operation of the CPU when the computer system implements the operation of the decompression system shown in FIG.

【図12】本発明になる画像処理装置の第2実施例の圧
縮系を示すブロック図である。
FIG. 12 is a block diagram showing a compression system of a second embodiment of the image processing apparatus according to the present invention.

【図13】画像処理装置の第2実施例の伸長系を示すブ
ロック図である。
FIG. 13 is a block diagram illustrating a decompression system according to a second embodiment of the image processing apparatus.

【図14】コンピュータシステムにより図12に示す圧
縮系の動作を実現する場合のCPUの動作を示すフロー
チャートである。
14 is a flowchart showing the operation of the CPU when the operation of the compression system shown in FIG. 12 is realized by the computer system.

【図15】コンピュータシステムにより図13に示す伸
長系の動作を実現する場合のCPUの動作を示すフロー
チャートである。
15 is a flowchart showing the operation of the CPU when the computer system implements the operation of the decompression system shown in FIG.

【図16】本発明になる画像処理装置の第3実施例の圧
縮系を示すブロック図である。
FIG. 16 is a block diagram showing a compression system of a third embodiment of the image processing apparatus according to the present invention.

【図17】図16に示す圧縮系の一部の構成を示すブロ
ック図である。
FIG. 17 is a block diagram showing a partial configuration of the compression system shown in FIG. 16;

【図18】画像処理装置の第3実施例の伸長系を示すブ
ロック図である。
FIG. 18 is a block diagram illustrating a decompression system according to a third embodiment of the image processing apparatus.

【図19】コンピュータシステムにより図16に示す圧
縮系の動作を実現する場合のCPUの動作を示すフロー
チャートである。
FIG. 19 is a flowchart showing an operation of a CPU when the operation of the compression system shown in FIG. 16 is realized by a computer system.

【図20】コンピュータシステムにより図18に示す伸
長系の動作を実現する場合のCPUの動作を示すフロー
チャートである。
20 is a flowchart showing the operation of the CPU when the computer system implements the operation of the decompression system shown in FIG. 18.

【図21】本発明になる画像処理装置の第4実施例の圧
縮系を示すブロック図である。
FIG. 21 is a block diagram showing a compression system of a fourth embodiment of the image processing apparatus according to the present invention.

【図22】コンピュータシステムにより図21に示す圧
縮系の動作を実現する場合のCPUの動作を示すフロー
チャートである。
FIG. 22 is a flowchart showing an operation of a CPU when the operation of the compression system shown in FIG. 21 is realized by a computer system.

【図23】コンピュータシステムにより第4実施例の伸
長系の動作を実現する場合のCPUの動作を示すフロー
チャートである。
FIG. 23 is a flowchart showing the operation of the CPU when the operation of the decompression system of the fourth embodiment is realized by the computer system.

【図24】本発明になる画像処理装置の第5実施例の圧
縮系を示すブロック図である。
FIG. 24 is a block diagram showing a compression system of a fifth embodiment of the image processing apparatus according to the present invention.

【図25】画像処理装置の第5実施例の伸長系を示すブ
ロック図である。
FIG. 25 is a block diagram illustrating a decompression system according to a fifth embodiment of the image processing apparatus.

【図26】コンピュータシステムにより図24に示す圧
縮系の動作を実現する場合のCPUの動作を示すフロー
チャートである。
FIG. 26 is a flowchart showing the operation of the CPU when the operation of the compression system shown in FIG. 24 is realized by the computer system.

【図27】コンピュータシステムにより図25に示す伸
長系の動作を実現する場合のCPUの動作を示すフロー
チャートである。
FIG. 27 is a flowchart showing the operation of the CPU when the computer system implements the operation of the decompression system shown in FIG. 25.

【符号の説明】[Explanation of symbols]

1,4,13 ラッチ回路 2 シフトレジスタ 3 減算器 5,8,9,16,23 比較器 6 インクリメンタ 7 ランカウンタ 10,17 テーブル検索部 11,24 インバータ 12 符号化テーブル 14 出力回路 15 ゲート回路 18 例外コード生成部 21 デクリメンタ 22 画素カウンタ 24 オア回路 26 アンド回路 27 EOL回路 31,37 ラッチ回路 32 テーブル検索部 32a 復号化テーブル 33 前画素データ保持回路 34 例外コード復号回路 35 出力回路 36 画素データ復号回路 38 ランカウンタ 39 デクリメンタ 1, 4, 13 Latch circuit 2 Shift register 3 Subtractor 5, 8, 9, 16, 23 Comparator 6 Incrementer 7 Run counter 10, 17 Table search unit 11, 24 Inverter 12 Coding table 14 Output circuit 15 Gate circuit Reference Signs List 18 exception code generation unit 21 decrementer 22 pixel counter 24 OR circuit 26 AND circuit 27 EOL circuit 31, 37 latch circuit 32 table search unit 32a decoding table 33 previous pixel data holding circuit 34 exception code decoding circuit 35 output circuit 36 pixel data decoding Circuit 38 run counter 39 decrementer

Claims (16)

【特許請求の範囲】[Claims] 【請求項1】 多値画像を示す画像データから同じデー
タ値のランレングスを計測するステップと、 該画像データから注目画素とその隣接画素とのデータ値
の差分を算出するステップと、 計測されたランレングス及び算出された差分に基づき、
ランレングス及び差分の出現頻度を表す単一の符号化テ
ーブルを用いて該画像データを圧縮するステップとを含
む、画像処理方法。
A step of measuring a run length of the same data value from image data representing a multi-valued image; a step of calculating a difference between a data value of a target pixel and a data value of an adjacent pixel from the image data; Based on the run length and the calculated difference,
Compressing the image data using a single encoding table representing the run length and the frequency of occurrence of the difference.
【請求項2】 前記圧縮するステップは、前記ランレン
グスが最大ランレングスを越える場合にはランレングス
例外コードを出力する、請求項1記載の画像処理方法。
2. The image processing method according to claim 1, wherein said compressing step outputs a run-length exception code when said run-length exceeds a maximum run-length.
【請求項3】 前記圧縮するステップは、前記差分が差
分の最大値を越える場合にはデータ値をそのまま符号化
する、請求項1又は2記載の画像処理方法。
3. The image processing method according to claim 1, wherein the compressing step encodes the data value as it is when the difference exceeds a maximum value of the difference.
【請求項4】 前記計測するステップは、データ値の比
較を行う前に、注目画素のデータ値を注目画素に隣接す
る隣接画素から予測した予測値で置き換えることでラン
を生成する、請求項1〜3のいずれか1項記載の画像処
理方法。
4. The method according to claim 1, wherein the measuring step generates a run by replacing a data value of the target pixel with a predicted value predicted from an adjacent pixel adjacent to the target pixel before comparing the data values. The image processing method according to any one of claims 1 to 3.
【請求項5】 前記画像データから網点画像の周期を検
出し、前記網点画像の周期に基づいたデータ値のオフセ
ット値により該画像データのデータ値を修正するステッ
プを更に含む、請求項1〜4のいずれか1項記載の画像
処理方法。
5. The method according to claim 1, further comprising detecting a period of the halftone image from the image data, and correcting a data value of the image data by an offset value of a data value based on the period of the halftone image. The image processing method according to any one of claims 1 to 4.
【請求項6】 前記圧縮するステップは、前記多値画像
の2ライン目以降については、前のラインと現在のライ
ンとのデータ値の差分を求めて二次元圧縮を行う、請求
項1〜5のいずれか1項記載の画像処理方法。
6. The compression step of performing two-dimensional compression on a second and subsequent lines of the multi-valued image by calculating a difference between data values of a previous line and a current line. The image processing method according to claim 1.
【請求項7】 前記計測するステップ、前記算出するス
テップ及び前記圧縮するステップは、前記画像データの
所定上位ビットに対して処理を行い、該画像データの残
りの下位ビットに対してユニバーサル圧縮を施すステッ
プを更に含む、請求項1〜6のいずれか1項記載の画像
処理方法。
7. The step of measuring, the step of calculating and the step of compressing perform processing on predetermined upper bits of the image data, and perform universal compression on the remaining lower bits of the image data. The image processing method according to claim 1, further comprising a step.
【請求項8】 圧縮された画像データをランレングス及
び差分の出現頻度を表す単一の復号化テーブルを用いて
伸長するステップを更に含む、請求項1〜7のいずれか
1項記載の画像処理方法。
8. The image processing according to claim 1, further comprising the step of decompressing the compressed image data by using a single decoding table indicating a run length and a frequency of occurrence of a difference. Method.
【請求項9】 多値画像を示す画像データから同じデー
タ値のランレングスを計測する計測手段と、 該画像データから注目画素とその隣接画素とのデータ値
の差分を算出する算出手段と、 計測されたランレングス及び算出された差分に基づき、
ランレングス及び差分の出現頻度を表す単一の符号化テ
ーブルを用いて該画像データを圧縮する圧縮手段とを備
えた、画像処理装置。
9. A measuring means for measuring a run length of the same data value from image data representing a multi-valued image, a calculating means for calculating a difference between a data value of a pixel of interest and an adjacent pixel from the image data, Based on the calculated run length and the calculated difference,
A compression means for compressing the image data using a single encoding table representing the run length and the frequency of occurrence of the difference.
【請求項10】 前記圧縮手段は、前記ランレングスが
最大ランレングスを越える場合にはランレングス例外コ
ードを出力する、請求項9記載の画像処理装置。
10. The image processing apparatus according to claim 9, wherein said compression means outputs a run-length exception code when said run-length exceeds a maximum run-length.
【請求項11】 前記圧縮手段は、前記差分が差分の最
大値を越える場合にはデータ値をそのまま符号化する、
請求項9又は10記載の画像処理装置。
11. The compression means encodes a data value as it is when the difference exceeds a maximum value of the difference.
The image processing device according to claim 9.
【請求項12】 前記計測手段は、データ値の比較を行
う前に、注目画素のデータ値を注目画素に隣接する隣接
画素から予測した予測値で置き換えることでランを生成
する、請求項9〜11のいずれか1項記載の画像処理装
置。
12. The method according to claim 9, wherein the measuring unit generates a run by replacing the data value of the target pixel with a predicted value predicted from an adjacent pixel adjacent to the target pixel before comparing the data values. The image processing device according to any one of claims 11 to 11.
【請求項13】 前記画像データから網点画像の周期を
検出し、前記網点画像の周期に基づいたデータ値のオフ
セット値により該画像データのデータ値を修正する修正
手段を更に備えた、請求項9〜12のいずれか1項記載
の画像処理装置。
13. A correction means for detecting a cycle of a halftone image from the image data, and correcting a data value of the image data by an offset value of a data value based on the cycle of the halftone image. Item 13. The image processing device according to any one of Items 9 to 12.
【請求項14】 前記圧縮手段は、前記多値画像の2ラ
イン目以降については、前のラインと現在のラインとの
データ値の差分を求めて二次元圧縮を行う、請求項9〜
13のいずれか1項記載の画像処理装置。
14. The method according to claim 9, wherein the compression unit performs two-dimensional compression on the second and subsequent lines of the multi-valued image by calculating a difference between data values of a previous line and a current line.
The image processing device according to any one of claims 13 to 13.
【請求項15】 前記計測手段、前記算出手段及び前記
圧縮手段は、前記画像データの所定上位ビットに対して
処理を行い、 該画像データの残りの下位ビットに対してユニバーサル
圧縮を施す手段を更に備えた、請求項9〜14のいずれ
か1項記載の画像処理装置。
15. The apparatus according to claim 15, wherein said measuring means, said calculating means, and said compressing means perform processing on predetermined high-order bits of said image data, and further perform universal compression on remaining low-order bits of said image data. The image processing apparatus according to claim 9, further comprising:
【請求項16】 圧縮された画像データをランレングス
及び差分の出現頻度を表す単一の復号化テーブルを用い
て伸長する伸長手段を更に備えた、請求項9〜15のい
ずれか1項記載の画像処理装置。
16. The image processing apparatus according to claim 9, further comprising: a decompression unit that decompresses the compressed image data using a single decoding table that represents a run length and a frequency of occurrence of a difference. Image processing device.
JP9341673A 1997-12-11 1997-12-11 Image processing method and device therefor Withdrawn JPH11177828A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9341673A JPH11177828A (en) 1997-12-11 1997-12-11 Image processing method and device therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9341673A JPH11177828A (en) 1997-12-11 1997-12-11 Image processing method and device therefor

Publications (1)

Publication Number Publication Date
JPH11177828A true JPH11177828A (en) 1999-07-02

Family

ID=18347909

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9341673A Withdrawn JPH11177828A (en) 1997-12-11 1997-12-11 Image processing method and device therefor

Country Status (1)

Country Link
JP (1) JPH11177828A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007060206A (en) * 2005-08-24 2007-03-08 Fujifilm Corp Data compression apparatus and data compression program
JP2009005355A (en) * 2007-06-22 2009-01-08 Magnachip Semiconductor Ltd Image data processor
US7684629B2 (en) 2004-01-26 2010-03-23 Fujifilm Corporation Data compression apparatus, and data compression program storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7684629B2 (en) 2004-01-26 2010-03-23 Fujifilm Corporation Data compression apparatus, and data compression program storage medium
JP2007060206A (en) * 2005-08-24 2007-03-08 Fujifilm Corp Data compression apparatus and data compression program
JP4579793B2 (en) * 2005-08-24 2010-11-10 富士フイルム株式会社 Data compression apparatus and data compression program
JP2009005355A (en) * 2007-06-22 2009-01-08 Magnachip Semiconductor Ltd Image data processor

Similar Documents

Publication Publication Date Title
US4742399A (en) Method of and apparatus for generating high-resolution bilevel image data
JP5132517B2 (en) Image processing apparatus and image processing method
JP4522199B2 (en) Image encoding apparatus, image processing apparatus, control method therefor, computer program, and computer-readable storage medium
EP0376679A2 (en) Image encoding apparatus and image encoding method
JP2008042688A (en) Image processing apparatus and control method thereof, and computer program and computer readable storage medium
EP1309200A3 (en) Image coding and decoding using mapping coefficients corresponding to class information of pixel blocks
EP0613290B1 (en) Method and apparatus for binary image data compression
JP3514050B2 (en) Image processing device
JP2002262102A (en) Image coder, image coding method, and its storage medium
JPH11177828A (en) Image processing method and device therefor
JP2756371B2 (en) Image processing device
US7974484B2 (en) JBIG coding and decoding system
JP3085932B2 (en) Apparatus for generating predicted image using mask and apparatus for compressing, transmitting and restoring binary image using the same
JP3139460B2 (en) Method and apparatus for encoding binary document image
US8385664B2 (en) Method for progressive JPEG image decoding
JPH1098620A (en) Picture processor
JPH0918350A (en) Coding/decoding device and coding/decoding method
JP3195005B2 (en) Image processing apparatus and method
JP3264526B2 (en) Image processing method and apparatus
JP2009260747A (en) Image encoding device, and control method thereof
JP3235510B2 (en) Encoding method and encoding device, decoding method and decoding device
JPH1117955A (en) Image processing unit
JP3263218B2 (en) Image information data compression and playback device
JP2002209110A (en) Image encoder
JP3705771B2 (en) JBIG decoding method

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