Nothing Special   »   [go: up one dir, main page]

JPH0541805A - Image data compression method and apparatus thereof - Google Patents

Image data compression method and apparatus thereof

Info

Publication number
JPH0541805A
JPH0541805A JP19773991A JP19773991A JPH0541805A JP H0541805 A JPH0541805 A JP H0541805A JP 19773991 A JP19773991 A JP 19773991A JP 19773991 A JP19773991 A JP 19773991A JP H0541805 A JPH0541805 A JP H0541805A
Authority
JP
Japan
Prior art keywords
label
flag
pattern
patterns
code
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.)
Pending
Application number
JP19773991A
Other languages
Japanese (ja)
Inventor
Takashi Kurumisawa
孝 胡桃澤
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP19773991A priority Critical patent/JPH0541805A/en
Publication of JPH0541805A publication Critical patent/JPH0541805A/en
Pending legal-status Critical Current

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Image Processing (AREA)

Abstract

(57)【要約】 【目的】 2値の画像データを圧縮する符号テ−ブルを
半分にした画像データ圧縮方法とその装置を提供するこ
と。 【構成】 白と黒の画像データをブロック毎に分割し、
加算すると全部黒になるパタ−ンを1つのラベルで表
し、一方に0のフラグ、他方に1のフラグを付加する。
このラベルを符号テ−ブルとする。 【効果】 固定ビットである制御コ−ドや符号テ−ブル
へ割り当てる符号が短くなることにより高圧縮率とな
る。また、画像ごとに符号テ−ブルを変化させる処理も
簡単になり高速処理ができる。
(57) [Abstract] [PROBLEMS] To provide an image data compression method and apparatus for halving the code table for compressing binary image data. [Structure] Divide white and black image data into blocks,
A pattern that makes all black when added is represented by one label, and a flag of 0 is added to one and a flag of 1 is added to the other.
This label is used as a code table. [Effect] A high compression rate can be achieved by shortening the code to be assigned to the control code and the code table which are fixed bits. Also, the process of changing the code table for each image is simplified and high-speed processing can be performed.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、画像を走査し画素単位
にサンプリングして得られる2値の画像データの圧縮方
法およびその装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method and apparatus for compressing binary image data obtained by scanning an image and sampling in pixel units.

【0002】[0002]

【従来の技術】2値画像の圧縮データを得る方法として
は、特開昭54−2619にある2次元ブロック符号化
方法などが知られている。2次元ブロック符号化法と
は、符号化単位を固定大の2次元ブロックとし、この2
次元ブロックの表現できるパタ−ンの出現頻度に応じて
集計して各々のパタ−ンに可変長の符号を割り当てパタ
−ン符号化を行うことによりデータ圧縮を行うものであ
った。
2. Description of the Related Art As a method of obtaining compressed data of a binary image, a two-dimensional block coding method disclosed in Japanese Patent Laid-Open No. 54-2619 is known. In the two-dimensional block coding method, the coding unit is a fixed-sized two-dimensional block, and
Data compression is performed by aggregating according to the frequency of appearance of patterns that can express a dimensional block and assigning a variable-length code to each pattern for pattern coding.

【0003】[0003]

【発明が解決しようとする課題】前記従来の2次元ブロ
ック符号化方法においては、パタ−ンと符号の対応を示
す符号テ−ブルが大きいため画像全体の圧縮効率が上が
らない課題を有していた。特に、もとの画像のデータ量
が符号化テ−ブルに比して大きくない場合において顕著
であった。
The conventional two-dimensional block coding method has a problem that the compression efficiency of the entire image cannot be improved because the code table showing the correspondence between the pattern and the code is large. It was In particular, it was remarkable when the data amount of the original image was not large as compared with the coding table.

【0004】また、符号テ−ブルが大きい場合、ハフマ
ン法等で符号を割り当てる演算がより複雑になり、デー
タ圧縮にかかる時間が多くなる課題も有していた。
Further, when the code table is large, there is a problem in that the calculation for assigning the code by the Huffman method or the like becomes more complicated and the time required for data compression increases.

【0005】本発明は、上記課題を鑑みてなされたもの
であり、符号テ−ブルを小さくし、データ圧縮時間も少
なくできる新規な画像データ圧縮方法およびその装置を
提供しようとするものである。
The present invention has been made in view of the above problems, and an object of the present invention is to provide a novel image data compression method and apparatus capable of reducing the code table and the data compression time.

【0006】[0006]

【課題を解決するための手段】上記の課題を解決するた
めに、本発明の画像データ圧縮方法および装置は以下の
ような点を特徴とする。
In order to solve the above problems, the image data compression method and apparatus of the present invention are characterized by the following points.

【0007】(1)本発明による画像データ圧縮方法
は、画像を走査し、画素単位にサンプリングして得た濃
度値が0か1の2値の画像データを圧縮する方法におい
て、(a)N行×M列で表現されるパタ−ンのうち、あ
る2つのパタ−ンについて、同行同列の位置にある画素
どうしの濃度値を加算した値が、N行×M列のすべての
位置で1(high)になる場合に、前記2つのパタ−
ン各々に、同一のラベルを付与し、かつ一方のパタ−ン
に0、他方に1のフラグを付与することで予めN行×M
列の画素で表現されているパタ−ンを分類し、(b)画
像データをN行×M列の画素ブロックに分割し、(c)
前記N行×M列の画素ブロックを(a)で分類されてい
るどの前記パタ−ンと一致するかを調べ、一致したパタ
−ンに付与されているラベルとフラグを前記画素ブロッ
クに付与し、(d)複数個の画像ブロックについてラベ
ルの出現頻度を計測して、出現頻度の大きなラベルから
順に短い符号を割り当て、(e)画素ブロックの各々
に、それが付与されているラベルに対応する符号を付与
し、(f)(c)で付与されたフラグと(e)で付与さ
れた符号を圧縮結果とすることを特徴とする。
(1) An image data compression method according to the present invention is a method of compressing binary image data in which a density value is 0 or 1 obtained by scanning an image and sampling in pixel units. Of the patterns expressed in rows × M columns, the value obtained by adding the density values of the pixels at the positions in the same row and the same column to a certain two patterns is 1 at all positions in the N rows × M columns. When it becomes (high), the two patterns
Each row is given the same label, and one pattern is given a flag of 0 and the other is given a flag of 1 so that N rows × M in advance.
Patterns expressed by pixels in columns are classified, (b) image data is divided into pixel blocks of N rows x M columns, and (c)
The pixel block of N rows × M columns is checked to see which of the patterns classified in (a) matches, and the label and flag given to the matched pattern are given to the pixel block. , (D) the appearance frequency of the label is measured for a plurality of image blocks, and a short code is assigned in order from the label with the highest appearance frequency, and (e) each pixel block corresponds to the label to which it is attached. A code is added, and the flag given in (f) and (c) and the code given in (e) are used as compression results.

【0008】(2)本発明の画像データ圧縮方法は、画
像を走査し、画素単位にサンプリングして得た濃度値が
0か1の2値の画像データを圧縮する方法において、
(a)N行×M列で表現されるパタ−ンのうち、ある2
つのパタ−ンについて、同行同列の位置にある画素どう
しの濃度値を加算した値が、N行×M列のすべての位置
で1(high)になる場合に、前記2つのパタ−ン各
々に、同一のラベルを付与し、かつ一方のパタ−ンに
0、他方に1のフラグを付与することで予めN行×M列
の画素で表現されているパタ−ンを分類し、(b)画像
データをN行×M列の画素ブロックに分割し、(c)前
記N行×M列の画素ブロックを(a)で分類されている
どの前記パタ−ンと一致するかを調べ、一致したパタ−
ンに付与されているラベルとフラグを前記画素ブロック
に付与し、(d)複数個の画像ブロックについてラベル
の出現頻度を計測して、出現頻度の大きなラベルから順
に短い符号を割り当て、(e)画素ブロックの各々に、
それが付与されているラベルに対応する符号を付与し、
(f)(c)で付与されたフラグと(e)で付与された
符号を圧縮結果とし、(g)さらに前記フラグを、
(a)から(f)の処理によって再圧縮することを特徴
とする。
(2) The image data compression method of the present invention is a method for compressing binary image data having a density value of 0 or 1 obtained by scanning an image and sampling in pixel units.
(A) Among patterns expressed in N rows × M columns, some 2
For each of the two patterns, if the value obtained by adding the density values of the pixels in the same row and the same column is 1 (high) in all the positions of N rows × M columns, the two patterns are respectively added. , The same label is given, and a flag of 0 is given to one pattern and a flag of 1 is given to the other pattern to classify the patterns expressed in pixels of N rows × M columns in advance, (b) The image data is divided into pixel blocks of N rows × M columns, and (c) the pixel block of N rows × M columns is examined to see which of the patterns classified in (a) matches, and they match. Pattern
A label and a flag assigned to each pixel block are assigned to the pixel block, (d) the appearance frequency of the label is measured for a plurality of image blocks, and a short code is assigned in order from the label with the highest appearance frequency, (e) For each of the pixel blocks,
Give the code corresponding to the label that has been given,
(F) The flag given in (c) and the code given in (e) are compression results, and (g) the flag is
Recompressing is performed by the processes of (a) to (f).

【0009】(3)本発明の画像データ圧縮装置は、画
像を走査して濃度値が0か1の2値のデジタル信号を得
る情報入力部と前記デジタル信号を符号化する符号化部
と前記符号を保存する圧縮データ保持部と前記情報入力
部と前記符号化部と前記圧縮データ保持部を制御する制
御部からなる画像データ圧縮装置において、(a)画像
データをN行×M列の画素ブロックに分割するブロック
化回路と、(b)N行×M列で表現されるパタ−ンのう
ち、ある2つのパタ−ンについて、同行同列の位置にあ
る画素どうしの濃度値を加算した値が、N行×M列のす
べての位置で1(high)になる場合に、前記2つの
パタ−ン各々に、同一のラベルを付与し、かつ一方のパ
タ−ンに0、他方に1のフラグを付与することで予めN
行×M列の画素で表現されているパタ−ンを分類し、
(a)においてブロック化した画素ブロックが、どの前
記パタ−ンと一致するかを調べ、一致したパタ−ンに付
与されているラベルとフラグを前記画素ブロックに付与
するブロック情報変換回路と、(c)複数個の画像ブロ
ックについてラベルの出現頻度を計測して、出現頻度の
大きなラベルから順に短い符号を割り当て、画素ブロッ
クの各々に、それが付与されているラベルに対応する符
号を付与し、前記符号と(b)で付与されたフラグを圧
縮結果とする符号化回路とからなることを特徴とする。
(3) The image data compression apparatus of the present invention comprises an information input section for scanning an image to obtain a binary digital signal having a density value of 0 or 1, an encoding section for encoding the digital signal, and An image data compression device comprising a compressed data holding unit for storing a code, the information input unit, the encoding unit, and a control unit for controlling the compressed data holding unit. A value obtained by adding the density values of pixels located at the same row and the same column for a certain two patterns among (b) the pattern expressed by N rows × M columns Is 1 (high) at all positions of N rows × M columns, the same label is given to each of the two patterns, and 0 is assigned to one pattern and 1 is assigned to the other pattern. By adding a flag, N
Patterns expressed by pixels of rows x M columns are classified,
A block information conversion circuit for checking which of the patterns the pixel block made into a block in (a) matches and adding the label and the flag given to the matched pattern to the pixel block. c) The appearance frequency of the label is measured for a plurality of image blocks, a short code is assigned in order from the label with the highest appearance frequency, and a code corresponding to the label to which the label is attached is assigned to each pixel block, It is characterized by comprising the above-mentioned code and an encoding circuit which makes the flag given in (b) a compression result.

【0010】[0010]

【作用】本発明の方法に使われるパタ−ンと圧縮用の符
号の対応を示した符号テ−ブルは、特開昭54−261
9の用いているような発生し得るすべてのパタ−ンにつ
いての符号テ−ブルに比べ、半分以下の大きさになる。
符号テ−ブルが半分以下になることによって、制御コ−
ドや、符号テ−ブルに割り当てられる符号が短くなるこ
とによって符号テ−ブルを含めた全圧縮データは、従来
の技術より少ないデータにできる。
A code table showing the correspondence between the pattern used in the method of the present invention and the code for compression is disclosed in Japanese Patent Laid-Open No. 54-261.
It is less than half the size of the code table for all possible patterns as used in FIG.
When the code table becomes half or less, the control code is
Since the code assigned to the code table and the code table becomes shorter, the total compressed data including the code table can be made smaller than the conventional technique.

【0011】[0011]

【実施例】(実施例1)本発明の1実施例を図面に基づ
いて説明する。
(Embodiment 1) An embodiment of the present invention will be described with reference to the drawings.

【0012】図1は、本発明の画像データ圧縮方法の流
れを示す流れ図である。
FIG. 1 is a flow chart showing the flow of the image data compression method of the present invention.

【0013】以下に流れの概略を説明する。The outline of the flow will be described below.

【0014】始めに、2値の画像を準備する。(S10
1)処理単位をN行×M列とする。(S102)N行×
M列の画素ブロックが表現できるすべてのパタ−ンに、
ラベルとフラグを割り付ける。パタ−ンに、ラベルとフ
ラグを割り付ける動作の詳細は、後述する。(S10
3)走査するブロック数Zを0とする。(S104)入
力された画像を左から1ラインずつ走査しながら、N行
×M列の画素にブロック化する。(S105)N行×M
列画素のブロックのパタ−ンが、S103のどのパタ−
ンと一致するかを調べ、前記パタ−ンに割り付けてある
ラベルとフラグをブロックに与える。途中、N走査の終
了ならばEOL(End of Line)符号を出力する。Zは、
最大で画像の全ブロック数だが、入力画像が大きい場合
や複数の種類の画像が含まれ分割して圧縮する場合、前
記全ブロック数より小さい適当な値を設けてもよい。
(S106、S107、S108、S109、S11
0)ラベルの累積発生頻度を集計し、大きい累積発生頻
度を持つラベルに短い符号を付与する。(S111)全
ブロックの終了を判断する。(S112)全ブロック終
了ならば符号とフラグとEOL符号に、全データの終了
を示すRTC(Return to Control)符号を付加して保存
する。(S112)以下に処理の内容を詳細に説明す
る。
First, a binary image is prepared. (S10
1) The processing unit is N rows × M columns. (S102) N rows x
For all patterns that can express the pixel block of M columns,
Assign labels and flags. Details of the operation of assigning labels and flags to patterns will be described later. (S10
3) The number Z of blocks to be scanned is set to 0. (S104) While scanning the input image line by line from the left, it is divided into pixels of N rows × M columns. (S105) N rows × M
The pattern of the block of column pixels is the pattern of S103.
The block is given the label and flag assigned to the pattern. On the way, if N scanning is completed, an EOL (End of Line) code is output. Z is
Although the maximum number of all blocks of the image is the maximum, when the input image is large or when plural types of images are included and divided and compressed, an appropriate value smaller than the total number of blocks may be provided.
(S106, S107, S108, S109, S11
0) The cumulative occurrence frequency of labels is totaled, and a short code is given to a label having a high cumulative occurrence frequency. (S111) Determine the end of all blocks. (S112) If all blocks have ended, the RTC (Return to Control) code indicating the end of all data is added to the code, the flag, and the EOL code and saved. (S112) The details of the process will be described below.

【0015】図2は、N×M画素の画素ブロックで表現
されるすべてのパタ−ンにラベルとフラグを付与する過
程(S103)で用いるパタ−ンを、1画素が2値で表
現されている2×2画素のパタ−ンの例を用いて説明す
るための図である。No.1に示すように2×2画素の
パタ−ンの4画素の位置をそれぞれA,B,C,Dとし
ている。
FIG. 2 shows the pattern used in the step (S103) of assigning labels and flags to all patterns represented by a pixel block of N × M pixels, where one pixel is represented by a binary value. It is a figure for demonstrating using the example of the pattern of the 2x2 pixel which exists. No. As shown in FIG. 1, the positions of 4 pixels of the pattern of 2 × 2 pixels are A, B, C and D, respectively.

【0016】図2に示すNo.1からNo.16は、白
ベタで示されている白画素21と、斜線で示されている
黒画素22によって表現できる全部のパタ−ンを示して
いる。
No. 1 shown in FIG. 1 to No. Reference numeral 16 denotes all the patterns that can be represented by the white pixels 21 shown in solid white and the black pixels 22 shown in diagonal lines.

【0017】パタ−ンの状態を白画素を0、黒画素を1
で表すと、このパタ−ンは、0から1までの2階調パタ
−ンである。No.1のパタ−ンは、ABCDの順に0
000、No.9のパタ−ンは、同様に1111とな
る。そこで、No.1のパタ−ンとNo.9のパタ−ン
の状態を表すビットを位置毎に加算すると1111とな
る。同様に、No.2のパタ−ンは、1001、No.
10のパタ−ンは、0110であり、位置毎の加算値は
1111となる。
The pattern state is 0 for white pixels and 1 for black pixels.
This pattern is a 2-gradation pattern from 0 to 1. No. The pattern of 1 is 0 in the order of ABCD
000, No. Similarly, the pattern of 9 becomes 1111. Therefore, No. No. 1 pattern and No. 1 pattern. Bits representing the state of the 9 patterns are added at each position to obtain 1111. Similarly, No. The pattern of No. 2 is 1001, No.
The pattern of 10 is 0110, and the added value for each position is 1111.

【0018】同様にしてNo.1からNo.16までの
全体の16パタ−ンについて、状態を表すビットの加算
値がABCDすべて1となる2つのパタ−ンをまとめ、
1つのラベルによって表現すると、ラベル1(No.1
とNo.9のパタ−ン)、ラベル2(No.2とNo.
10のパタ−ン)、ラベル3(No.3とNo.11の
パタ−ン)、ラベル4(No.4とNo.12のパタ−
ン)、ラベル5(No.5とNo.13のパタ−ン)、
ラベル6(No.6とNo.14のパタ−ン)、ラベル
7(No.7とNo.15のパタ−ン)、ラベル8(N
o.8とNo.16のパタ−ン)の8つのラベルで表現
し、パタ−ンを分類することができる。次に、見方を変
えるとNo.1のパタ−ン(A,B,C,Dの全部の画
素が白画素21によって構成されているパタ−ン)の画
素の白と黒を反転させた場合にNo.9のパタ−ン
(A,B,C,Dの画素が全部黒画素22によって構成
されているパタ−ン)になる。同様に、No.2のパタ
−ン(A,Cの画素が黒画素22で、B,Dの画素が白
画素21によって構成されているパタ−ン)の白画素2
1と黒画素22を反転させるとNo.10のパタ−ン
(A,Cの画素が白画素21で、B,Dの画素が黒画素
22によって構成されているパタ−ン)になる。このよ
うなパタ−ンの組合せおよび、ラベルから2つの原パタ
−ンを発生させる方法は、処理系に固定され前もって分
かっているものとする。
Similarly, No. 1 to No. For all 16 patterns up to 16, two patterns in which the added value of the bits indicating the state are all 1 in ABCD are put together,
When expressed by one label, label 1 (No. 1
And No. 9 pattern), label 2 (No. 2 and No. 2).
No. 10 pattern), label 3 (No. 3 and No. 11 pattern), label 4 (No. 4 and No. 12 pattern)
Label), label 5 (patterns of No. 5 and No. 13),
Label 6 (No. 6 and No. 14 patterns), Label 7 (No. 7 and No. 15 patterns), Label 8 (N
o. 8 and No. It is possible to classify the patterns by expressing them with 8 labels of 16 patterns). Next, changing the viewpoint, No. When the white and black of the pixels of the pattern 1 (the pattern in which all the pixels of A, B, C, and D are composed of the white pixels 21) are reversed, No. 9 patterns (patterns in which all pixels A, B, C, and D are composed of black pixels 22). Similarly, No. White pixel 2 of pattern 2 (pattern in which A and C pixels are black pixels 22 and B and D pixels are white pixels 21)
No. 1 when the black pixel 22 and the black pixel 22 are reversed. 10 patterns (patterns in which A and C pixels are white pixels 21 and B and D pixels are black pixels 22). The combination of such patterns and the method of generating two original patterns from the label are fixed to the processing system and are known in advance.

【0019】1ラベルでまとめられた2つのパタ−ンの
うち、どちらのパタ−ンを示すのかをフラグで示す。フ
ラグの0をNo.1からNo.8のパタ−ンに、1をN
o.9からNo.16までのパタ−ンに付与する。
A flag indicates which of the two patterns grouped by one label is shown. If the flag 0 is set to No. 1 to No. 8 pattern, 1 for N
o. 9 to No. Assign to patterns up to 16.

【0020】例えば、ラベル1でフラグ0ならば、N
o.1のパタ−ンを示し、ラベル1で、フラグ1ならば
No.9のパタ−ンを示す。
For example, if label 1 and flag 0, then N
o. No. 1 pattern, and if the label is 1 and the flag is 1, 9 shows a pattern of 9.

【0021】以上、2値の2×2画素ブロックの16個
のパタ−ンすべてが8個のラベルと0と1のフラグによ
って表現できることを説明した。
It has been described above that all 16 patterns of a binary 2 × 2 pixel block can be represented by 8 labels and 0 and 1 flags.

【0022】従来のブロック符号化法の場合、前記の1
6個のパタ−ンそれぞれに別の符号を割り当てることか
ら、符号テ−ブルには、16個のパタ−ンと符号の対応
の記述が必要である。しかし、本発明の方法によれば、
8個のラベルと符号の対応を記述する符号テ−ブルとす
ることにより、符号テ−ブルの大きさは従来の半分とな
る。
In the case of the conventional block coding method, the above 1
Since a different code is assigned to each of the 6 patterns, it is necessary to describe the correspondence between the 16 patterns and the codes in the code table. However, according to the method of the present invention,
By using a code table that describes the correspondence between the eight labels and the code, the size of the code table is half that of the conventional one.

【0023】次に、実際の画像データを圧縮した例を用
いて、符号テ−ブルの作成の方法および本発明の効果を
説明する。
Next, the method of creating the code table and the effect of the present invention will be described using an example in which actual image data is compressed.

【0024】図3(a)(b)(c)(d)は、文字フ
ォントデータを圧縮した場合の一例を示した図である。
3 (a), (b), (c) and (d) are diagrams showing an example when the character font data is compressed.

【0025】図3(a)において、入力された2値の画
像は48×48画素のフォント’愛’である。黒の四角
が、黒画素を示し、白の四角が、白画素を示している。
この画像を左上から走査し、2×2画素のブロックに分
けると24×24個のブロックができる。このブロック
が表すパタ−ンに図2において示した2×2画素のパタ
−ン中から一致するものを探し、これに割り付けられて
いるフラグとラベルを前記ブロックに付与する。すべて
のブロックを処理した後、ブロックに付与されているラ
ベルの累積発生頻度を集計するとラベル1から8は、図
4(b)に示す発生頻度になる。また、図2おいて示し
たパタ−ンNo.1からNo.16までの発生頻度は、
図3(c)のようになる。
In FIG. 3A, the input binary image is a font "love" of 48 × 48 pixels. Black squares represent black pixels, and white squares represent white pixels.
When this image is scanned from the upper left and divided into blocks of 2 × 2 pixels, 24 × 24 blocks are formed. The pattern represented by this block is searched for a match from the pattern of 2 × 2 pixels shown in FIG. 2, and the flag and label assigned to this pattern are given to the block. After processing all blocks, the cumulative occurrence frequencies of the labels given to the blocks are aggregated, and the labels 1 to 8 have the occurrence frequencies shown in FIG. 4B. Further, the pattern No. shown in FIG. 1 to No. The frequency of occurrence up to 16 is
It becomes like FIG.3 (c).

【0026】このようなラベルに公知のハフマン法によ
り符号を割り当てた符号テ−ブルを図4(a)に示す。
A code table in which codes are assigned to such labels by the known Huffman method is shown in FIG. 4 (a).

【0027】このようにすると、前記の24×24個の
ブロックは、その各々が図4(a)に示した各ラベルに
対応した符号と、先に述べたフラグ1ビットで表現され
るので、圧縮後の画像のビット数は、385×2ビット
+12×7ビット+88×3ビット+30×5ビット+
15×6ビット+21×5ビット+25×5ビット+0
×8ビット+23×9ビット(EOL)+10ビット
(RTC)=1705ビットとなる。各ラベルに割り当
てた符号の合計ビット数は、33ビットになり8個のパ
タ−ンを示すために32ビット(8×4ビット)必要で
あるから符号テ−ブル自体が65ビット必要なので、こ
れを含めた総合計は、1770ビットになる。48×4
8の文字フォントを単純なビットマップとして2値表現
した場合、2304(48×48)ビットであるから、
圧縮率は、1770/2304(圧縮ビット数/2値表
現ビット数)=0.77となる。
In this way, each of the 24 × 24 blocks is represented by the code corresponding to each label shown in FIG. 4A and the flag 1 bit described above. The number of bits of the compressed image is 385 x 2 bits + 12 x 7 bits + 88 x 3 bits + 30 x 5 bits +
15 x 6 bits + 21 x 5 bits + 25 x 5 bits + 0
X8 bits + 23 x 9 bits (EOL) + 10 bits (RTC) = 1705 bits. Since the total number of bits of the code assigned to each label is 33 bits and 32 bits (8 × 4 bits) are required to indicate 8 patterns, the code table itself needs 65 bits. The total number including 1 is 1770 bits. 48 x 4
When the character font of 8 is expressed in binary as a simple bitmap, since it is 2304 (48 × 48) bits,
The compression rate is 1770/2304 (compression bit number / binary expression bit number) = 0.77.

【0028】一方、従来のブロック符号化のように、図
3(c)の累積発生頻度によって公知のハフマン法によ
って割り当てた符号テ−ブルを図4(b)に示す。
On the other hand, FIG. 4B shows a code table assigned by the known Huffman method based on the cumulative occurrence frequency of FIG. 3C, as in the conventional block coding.

【0029】この符号テ−ブルで、圧縮すると293×
1ビット+6×6ビット+45×3ビット+15×5ビ
ット+7×7ビット+9×6ビット+16×6ビット+
0×8ビット+92×3ビット+6×7ビット+43×
4ビット+15×5ビット+8×8ビット+12×5ビ
ット+9×6ビット+0×9ビット+23×10ビット
(EOL)+11ビット(RTC)=1722ビットと
なる。EOLとRTCは、すべてのラベルに区別する必
要があるため、EOLが10ビット、RTCが11ビッ
トとなっている。符号テ−ブル自体は、150ビットに
なるため圧縮データは、総計1872ビットになる。従
来の方法による圧縮率は、0.81であり、本方法の圧
縮率は、0.77となり、本発明の方法の方が圧縮率は
良い。
When compressed with this code table, 293 ×
1 bit + 6 x 6 bits + 45 x 3 bits + 15 x 5 bits + 7 x 7 bits + 9 x 6 bits + 16 x 6 bits +
0 x 8 bits + 92 x 3 bits + 6 x 7 bits + 43 x
4 bits + 15 x 5 bits + 8 x 8 bits + 12 x 5 bits + 9 x 6 bits + 0 x 9 bits + 23 x 10 bits (EOL) + 11 bits (RTC) = 1722 bits. Since it is necessary to distinguish all labels from EOL and RTC, EOL has 10 bits and RTC has 11 bits. Since the code table itself has 150 bits, the compressed data has a total of 1872 bits. The compression ratio according to the conventional method is 0.81, and the compression ratio according to the present method is 0.77. The compression ratio according to the method of the present invention is better.

【0030】パタ−ン同士の組合せは、そのほか任意の
方法が考えられるが、互いに反転関係にあるパタ−ンを
組合せる本方法は、図3(c)に示すようにパタ−ンの
発生頻度の近いパタ−ンを組み合わせる方法となる。よ
って、制御コ−ド、符号テ−ブルを入れない合計ビット
数は、パタ−ンによる圧縮では、1481ビット、本方
法のラベルによる圧縮では、1488ビットと7ビット
の増加に抑えられる。そのほかの任意の組合せでは、発
生頻度の近いものの組合せにならないため、本方法によ
る圧縮よりもビット数が増加してしまう。
As for the combination of the patterns, any other method can be considered, but in the present method of combining the patterns which are in the inversion relation to each other, the frequency of occurrence of the patterns as shown in FIG. 3 (c). This is a method of combining patterns close to each other. Therefore, the total number of bits not including the control code and the code table is suppressed to 1481 bits by the pattern compression and 1488 bits and 7 bits by the label compression of the present method. With any other arbitrary combination, the ones that have similar occurrence frequencies are not combined, so the number of bits increases compared to the compression by this method.

【0031】パタ−ンの反転関係を利用した本方法は、
16パタ−ンの発生頻度を8ラベル発生頻度でよく近似
できることで優れている。
This method using the pattern inversion relation is as follows.
This is excellent because the frequency of occurrence of 16 patterns can be closely approximated by the frequency of occurrence of 8 labels.

【0032】本発明による方法のほうが通常のブロック
符号化による方法よりも符号テ−ブルを含めた総計で1
02ビット、圧縮率で0.04良い。この理由は、符号
テ−ブルのビット数が、本発明の方法では65ビット、
従来の方法では150ビットであり、本発明の方法によ
る符号テ−ブルは、従来の方法のそれの半分以下の大き
さであるためである。
The method according to the present invention has a total of 1 including the code table as compared with the method by the ordinary block coding.
02 bits, compression ratio 0.04 is good. The reason is that the number of bits in the code table is 65 bits in the method of the present invention.
This is because the conventional method has 150 bits, and the code table according to the method of the present invention is less than half the size of that of the conventional method.

【0033】さらに、本発明の方法では、画像によって
違う符号割当てを行い符号を決定しても、ラベル数が半
分であるため出現可能性のある全パタ−ンを符号に割り
当てる従来の符号化方法に比べ演算が少なく、圧縮時間
が短い。また、ラベルと符号を対応させる符号テ−ブル
が、従来の半分以下で済むため、ファクシミリなどの通
信に使用する場合に、符号テ−ブルを送信しても画像通
信時間が短くて済む。また、図3(a)の原パタ−ンに
おいて黒画素と白画素を反転したパタ−ンに対しても、
本発明の方法によって変換されたラベルには図3(a)
に比べて、全く変化がない。つまり、黒画素が多いパタ
−ンにも、白画素が多いパタ−ンの場合にも、全く同じ
符号テ−ブルで圧縮処理が可能である。しかし、従来の
方法では、黒画素と白画素の出現頻度によって符号テ−
ブルを変化させる必要がある。また、本発明の方法で白
黒を反転させる再生は、原画像データの1/4の情報と
なっているフラグを反転させるだけで白画素と黒画素が
反転した画像を得ることが出来る。
Further, according to the method of the present invention, even if a code is assigned differently depending on the image and the code is determined, since the number of labels is half, all the possible patterns are assigned to the code. Compared to, there are few calculations and the compression time is short. Further, since the code table for associating the label with the code is less than half of the conventional one, the image communication time can be shortened even when the code table is transmitted when used for communication such as facsimile. Also, for the original pattern of FIG. 3A, in which the black pixel and the white pixel are inverted,
The label converted by the method of the present invention is shown in FIG.
There is no change compared to. That is, the compression processing can be performed with the same code table regardless of whether the pattern has many black pixels or the pattern has many white pixels. However, in the conventional method, the code table is determined by the frequency of appearance of black pixels and white pixels.
It is necessary to change the bull. In the reproduction of inverting black and white by the method of the present invention, an image in which white pixels and black pixels are inverted can be obtained only by inverting a flag which is information of 1/4 of the original image data.

【0034】以上、図3(a)(b)(c)(d)にお
いて文字フォントデータを圧縮した実施例を用いて説明
した。
In the above, the embodiment in which the character font data is compressed in FIGS. 3 (a) (b) (c) (d) has been described.

【0035】本実施例では、横のブロックとの相関を使
っていないが、1ブロックを1画素と考え、圧縮にラン
レングス法を適用することは、容易に考えられる。
In this embodiment, the correlation with the horizontal block is not used, but it is easily conceivable to consider one block as one pixel and apply the run length method for compression.

【0036】図5(a)は、ラベルとフラグと制御コ−
ド(EOL,RTC)、符号テ−ブルの記憶順序を示す
ものである。
FIG. 5A shows a label, a flag and a control code.
(EOL, RTC), the storage order of the code table.

【0037】記憶順序は、符号テ−ブル、フラグ1、ラ
ベル1、・・・、フラグn1、ラベルn1、EOL、フ
ラグn2、ラベルn2、・・・、フラグn3、ラベルn
3、RTCの順序となる。
The storage order is the code table, flag 1, label 1, ..., Flag n1, label n1, EOL, flag n2, label n2, ..., Flag n3, label n.
3, RTC order.

【0038】図5(b)は、もう一つのラベルとフラグ
と制御コ−ド(EOL,RTC)、符号テ−ブルの記憶
順序を示すものである。
FIG. 5B shows the storage order of another label, flag, control code (EOL, RTC), and code table.

【0039】記憶順序は、符号テ−ブル、フラグ1、・
・・フラグn1、ラベル1、・・・ラベルn1、EO
L、ラベルn2、・・・フラグn3、RTCの順序とな
る。図5(b)では、EOLまでのラベルとフラグを分
離した記憶順序となる。
The storage order is the code table, flag 1, ...
..Flag n1, label 1, ... Label n1, EO
The order is L, label n2, ... Flag n3, RTC. In FIG. 5B, the storage order is such that labels and flags up to EOL are separated.

【0040】本発明の方法は、2×2画素以外のブロッ
クのサイズの場合にも容易に適用できることは言うまで
もない。
It goes without saying that the method of the present invention can be easily applied to the case of a block size other than 2 × 2 pixels.

【0041】(実施例2)本実施例では、フラグを圧縮
前の生データとして用いて圧縮することにより画像を階
層的に符号化する例を示すものである。
(Embodiment 2) In this embodiment, an image is hierarchically encoded by compressing by using a flag as raw data before compression.

【0042】本発明の1実施例を図面を用いて詳細に説
明する。
An embodiment of the present invention will be described in detail with reference to the drawings.

【0043】図2において、2×2画素のパタ−ンを1
/4である1画素に縮小するには、フラグの0を白画
素、1を黒の画素に対応させることによって表せる。以
下に詳しく説明する。
In FIG. 2, the pattern of 2 × 2 pixels is 1
In order to reduce it to 1 pixel which is / 4, it can be represented by associating 0 of the flag with a white pixel and 1 with a black pixel. This will be described in detail below.

【0044】No.1、No.4、No.5、No.
6、No.7のパタ−ンは、4画素の内、黒画素22が
0画素、もしくは1画素であり、1/4に縮小する場合
には1個の白画素として変換される。また、No.
9、、No.12、No.13、No.14、No.1
5のパタ−ンは、黒画素が、4画素もしくわ3画素であ
るため、1/4に縮小される場合に1個の黒画素として
変換される。No.2、No.3、No.4、No.
8、No.11、No.16のパタ−ンは、4画素の中
で黒画素が2画素、白画素が2画素となる。
No. 1, No. 4, No. 5, No.
6, No. In the pattern of 7, the black pixel 22 is 0 pixel or 1 pixel among the 4 pixels, and when it is reduced to ¼, it is converted as one white pixel. In addition, No.
9, No. 12, No. 13, No. 14, No. 1
In the pattern of 5, the black pixels are 4 pixels or 3 pixels, and thus are converted into one black pixel when reduced to ¼. No. 2, No. 3, No. 4, No.
8, No. 11, No. The 16 patterns have 2 black pixels and 2 white pixels out of 4 pixels.

【0045】1/4に縮小をする場合、従来の方法で
は、濃度にしきい値を設けて縮小する。No.2、N
o.3、No.4、No.8、No.11、No.16
のパタ−ンは、しきい値を黒画素2画素以上とした場
合、すべて黒画素1画素となり、しきい値を3画素以上
とした場合、白画素1画素となる。
In the case of reducing to 1/4, the conventional method is to reduce the density by providing a threshold value. No. 2, N
o. 3, No. 4, No. 8, No. 11, No. 16
When the threshold value is 2 or more black pixels, all the patterns are 1 black pixel, and when the threshold is 3 or more pixels, 1 white pixel.

【0046】しかし、本発明の画像データ圧縮方法で用
いているフラグを利用した場合には、No.2、No.
3、No.8のパタ−ンは、白画素へ変換され、No.
10、No.11、No.16のパタ−ンは、黒画素へ
変換される。No.2、No.3、No.8のパタ−ン
とNo.10、No.11、No.16のパタ−ンが等
確率で出現する場合、フラグを利用した1/4の縮小の
画像は、入力画像の黒画素と白画素の割合を正確に縮小
した画像となる。
However, when the flag used in the image data compression method of the present invention is used, No. 2, No.
3, No. The pattern of No. 8 is converted into white pixels, and No.
10, No. 11, No. The 16 patterns are converted to black pixels. No. 2, No. 3, No. No. 8 pattern and No. 8 pattern. 10, No. 11, No. When 16 patterns appear with equal probability, a 1/4 reduced image using the flag is an image in which the ratio of black pixels and white pixels of the input image is accurately reduced.

【0047】図3(d)は、フラグが0のパタ−ンを黒
画素によって、フラグが1のパタ−ンを白画素によって
示したもので、図3(a)の48×48画素の文字フォ
ントが24×24画素のフォントに変換されていること
がわかる。つまり、前記フォントを新たなフォントデー
タとして用いることにより48×48画素と24×24
画素の文字フォントデータを、1フォント分のデータ量
で表現することができる。このように考えると24×2
4画素の文字フォントの2値表現の576ビット(24
×24)と48×48画素の2値表現の2304ビット
を加え、2880ビットを圧縮前のビット数とすると、
フォントデータに対する圧縮率は1770/2880=
0.61といっても良い。
FIG. 3 (d) shows the pattern of which the flag is 0 by black pixels and the pattern of which the flag is 1 by white pixels. The character of 48 × 48 pixels of FIG. 3 (a) is shown. It can be seen that the font has been converted into a 24 × 24 pixel font. In other words, by using the font as new font data, 48 × 48 pixels and 24 × 24 pixels can be obtained.
The character font data of pixels can be expressed by the data amount of one font. 24 × 2
576 bits (24
X24) and 2304 bits of the binary representation of 48 × 48 pixels are added, and 2880 bits is the number of bits before compression,
The compression rate for font data is 1770/2880 =
It can be said that it is 0.61.

【0048】画像データを1/4に縮小した画像となる
フラグを再圧縮することにより、圧縮率を高くすること
ができる。本実施例では、フラグを再圧縮する例を説明
する。
The compression rate can be increased by recompressing the flag that becomes an image obtained by reducing the image data to 1/4. In this embodiment, an example of recompressing the flag will be described.

【0049】図6は、本発明の画像データ圧縮方法の流
れを示す流れ図である。
FIG. 6 is a flow chart showing the flow of the image data compression method of the present invention.

【0050】以下に流れの概略を説明する。The outline of the flow will be described below.

【0051】始めに、画素で構成された2値の画像を準
備する。(S1001)N行×M列の画素とする。(S
1002)N行×M列の画素ブロックが表現できるすべ
てのパタ−ンに、ラベルとフラグを割り付ける。パタ−
ンに、ラベルとフラグを割り付ける動作の詳細は、実施
例1で説明したものと同じ。(S1003)走査するブ
ロック数Zを0とする。(S1004)入力された画像
を左から1ラインずつ走査しながら、N行×M列の画素
にブロック化する。(S1005)N行×M列画素のブ
ロックのパタ−ンが、S1003のどのパタ−ンと一致
するかを調べ、前記パタ−ンに割り付けてあるラベルと
フラグをブロックに与える。途中、N走査の終了ならば
EOL(End of Line)符号を出力する。Zは、最大で画
像の全ブロック数だが、入力画像が大きい場合や複数の
種類の画像が含まれ分割して圧縮する場合、前記全ブロ
ック数より小さい適当な値を設けてもよい。(S100
6、S1007、S1008、S1009、S110
0)適当な数のブロックが偏れば、ラベルの累積発生頻
度を集計し、大きい累積発生頻度を持つラベルに短い符
号を付与する。(S1011)全ブロックの終了を判断
する。(S1012)全ブロック終了ならば符号とEO
L符号とRTC(Return to Control)符号を保存する。
(S1013)何回繰り返して符号化する回数を階層数
として予め指定する。階層数よりも回数Hが少なけれ
ば、フラグとN、Mを新にS1003へ送る。(S10
14、S1015)Hが階層数以上ならば、符号、フラ
グ、EOL、にRTCを付加して保存する。(S101
6) (実施例3)図7は、本発明の画像データ圧縮装置の1
実施例を示すブロック図である。
First, a binary image composed of pixels is prepared. (S1001) N pixels by M columns. (S
1002) Labels and flags are assigned to all patterns that can be represented by a pixel block of N rows x M columns. Pattern
The details of the operation of assigning the label and the flag to the user are the same as those described in the first embodiment. (S1003) The number Z of blocks to be scanned is set to 0. (S1004) While scanning the input image line by line from the left, it is divided into pixels of N rows × M columns. (S1005) It is checked which pattern of the block of N rows × M columns of pixels matches the pattern of S1003, and the label and flag assigned to the pattern are given to the block. On the way, if N scanning is completed, an EOL (End of Line) code is output. Z is the maximum number of all blocks of the image, but when the input image is large or when plural types of images are included and divided and compressed, an appropriate value smaller than the total number of blocks may be provided. (S100
6, S1007, S1008, S1009, S110
0) If an appropriate number of blocks are biased, the cumulative occurrence frequency of labels is aggregated, and a short code is given to a label having a large cumulative occurrence frequency. (S1011) Determine the end of all blocks. (S1012) Code and EO if all blocks are finished
The L code and the RTC (Return to Control) code are saved.
(S1013) The number of times of repeated coding is designated in advance as the number of layers. If the number of times H is less than the number of layers, the flag and N and M are newly sent to S1003. (S10
14, S1015) If H is equal to or larger than the number of layers, the RTC is added to the code, the flag, and the EOL and stored. (S101
6) (Embodiment 3) FIG. 7 shows an image data compression apparatus 1 according to the present invention.
It is a block diagram which shows an Example.

【0052】本発明の画像データ圧縮装置は、情報入力
部71と符号化部72と圧縮データ保持部73とこれら
を制御する制御部74によって構成され、符号化部72
は、ブロック化回路75とブロック情報変換回路76と
符号化回路77によって構成される。
The image data compression apparatus of the present invention comprises an information input section 71, an encoding section 72, a compressed data holding section 73, and a control section 74 for controlling these, and the encoding section 72.
Is composed of a blocking circuit 75, a block information conversion circuit 76, and an encoding circuit 77.

【0053】情報入力部71において、画像や文字フォ
ント等を走査して画素単位でサンプリングして得たアナ
ログ信号は、情報入力部71内にある図示されていない
A/D変換器によってデジタル信号に変換された後、符
号化部72へ入力される。符号化部72の詳細は後述す
る。符号化部72へ入力されたデジタル信号は、符号3
00となって圧縮データ保持部73へ出力される。
In the information input section 71, an analog signal obtained by scanning an image, a character font or the like and sampling in pixel units is converted into a digital signal by an A / D converter (not shown) in the information input section 71. After the conversion, it is input to the encoding unit 72. Details of the encoding unit 72 will be described later. The digital signal input to the encoding unit 72 has the code 3
00 is output to the compressed data holding unit 73.

【0054】制御部74は、情報入力部71よりN走査
の終了の信号を受取り、符号化部72へN走査終了信号
EOL(End of Line)を出力する。さらに、制御部7
4は、情報入力部71より画像データ終了の信号を受取
り、符号化部72へデータ終了信号RTC(Return to
Control)を出力する。
The control section 74 receives a signal of the end of N scanning from the information input section 71 and outputs an N scanning end signal EOL (End of Line) to the encoding section 72. Furthermore, the control unit 7
4 receives a signal indicating the end of image data from the information input unit 71, and the data end signal RTC (Return to
Control) is output.

【0055】圧縮データ保持部73は、前記符号300
を保持するものである。
The compressed data holding unit 73 has the code 300.
Is to hold.

【0056】以下に、符号化部72において、入力され
たデジタル信号が符号300となる過程を詳細に説明す
る。
The process in which the input digital signal becomes the code 300 in the encoder 72 will be described in detail below.

【0057】符号化部72へ入力されたデジタル信号
は、符号化部72内のブロック化回路75へ入力され、
N×M画素ごとにブロック化され、ブロック情報変換回
路76へ入力され、フラグ100とラベル200に変換
される。なお、ブロック化回路75とブロック情報変換
回路76の詳細は後述する。
The digital signal input to the encoding unit 72 is input to the blocking circuit 75 in the encoding unit 72,
It is divided into blocks for each N × M pixels, input to the block information conversion circuit 76, and converted into a flag 100 and a label 200. The details of the blocking circuit 75 and the block information conversion circuit 76 will be described later.

【0058】前記フラグ100と前記ラベル200は、
符号化回路77へ入力される。符号化回路77の詳細は
後述する。フラグ100とラベル200は、符号化回路
77において公知のエントロピ−符号化方法であるハフ
マン法や算術符号法等によって符号化され符号201と
なる。
The flag 100 and the label 200 are
It is input to the encoding circuit 77. Details of the encoding circuit 77 will be described later. The flag 100 and the label 200 are coded as a code 201 in the coding circuit 77 by a known entropy coding method such as Huffman method or arithmetic coding method.

【0059】符号化部72内にある符号化回路77は、
制御部4より受け取ったEOLを符号へ変換してN走査
ごとの前記符号201へ付加し、RTCを符号へ変換し
て全画像データ終了の前記符号201の終了へ付加し、
符号300とする。
The coding circuit 77 in the coding unit 72 is
The EOL received from the control unit 4 is converted into a code and added to the code 201 for every N scans, the RTC is converted into a code and added to the end of the code 201 of the end of all image data,
The reference numeral 300 is used.

【0060】図8は、1画素が2値で、1つのブロック
が2×2画素の場合、ブロック化回路75とブロック情
報変換回路76をゲ−ト回路を用いて構成した1例を示
したものである。
FIG. 8 shows an example in which the block forming circuit 75 and the block information converting circuit 76 are formed by using a gate circuit when one pixel is binary and one block is 2 × 2 pixels. It is a thing.

【0061】ブロック化回路75は、1ライン分のライ
ンバッファ81と2ライン分のラインバッファ82とラ
ッチ83,84,85,86から構成されており、ブロ
ック情報変換回路76は、ANDゲ−ト87aから87
pとORゲ−ト88aから88iによって構成されてい
る。
The blocking circuit 75 is composed of a line buffer 81 for one line, a line buffer 82 for two lines, and latches 83, 84, 85 and 86. The block information conversion circuit 76 is an AND gate. 87a to 87
p and OR gates 88a to 88i.

【0062】情報入力部1から出力されたデジタル信号
は、入力端子80からブロック化回路のラインバッファ
81に入力され、1ライン分のデータとして蓄積され
る。デジタル信号は、highで黒画素を、lowで白
画素を表すものとする。以後、highを1、lowを
0で示す。デジタル信号は、1ラインづつラインバッフ
ァ82に入力され、計2ライン分のデジタル信号が蓄積
される。4画素のデータ、A,B,C,Dは、ラッチ8
3,84,85,86によってラッチされる。このと
き、入力されたデジタル信号が、2ライン分のデータが
無い場合には、1ライン分のデータが、コピ−されて2
ライン分のデータとしてラインバッファ82に蓄積され
る。
The digital signal output from the information input unit 1 is input from the input terminal 80 to the line buffer 81 of the blocking circuit and accumulated as data for one line. A digital signal represents a black pixel when it is high and a white pixel when it is low. Hereinafter, high is indicated by 1 and low is indicated by 0. The digital signals are input to the line buffer 82 line by line, and digital signals for a total of two lines are accumulated. The data of 4 pixels, A, B, C and D are latched by 8
Latched by 3, 84, 85, 86. At this time, if the input digital signal does not have the data for two lines, the data for one line is copied and
It is accumulated in the line buffer 82 as data for a line.

【0063】2ライン分のデータが、処理されている間
に、ラインバッファ81に次のデータが入力される。
While the data for two lines is being processed, the next data is input to the line buffer 81.

【0064】4画素のデータ、A,B,C,Dは、ブロ
ック情報変換回路の16個のANDゲ−ト87aから8
7pへ入力され、16個のパタ−ン情報となる。例え
ば、図2のパタ−ンNo.1は、ANDゲ−ト87aに
おいて、0000を入力された場合に、AND回路67
aから出力1として1個出力される。同様に、図2のパ
タ−ンNo.9は、ANDゲ−ト87bにおいて111
1を入力された場合に、ANDゲ−ト87bから出力1
として1個出力される。ANDゲ−ト87aから87p
までの入力と出力を、図2において対応するパタ−ンの
番号を用いて図9(a)に示す。
The data of 4 pixels, A, B, C, D are 8 from the 16 AND gates 87a of the block information conversion circuit.
It is input to 7p and becomes 16 pieces of pattern information. For example, the pattern No. 1 shown in FIG. In the AND gate 87a, 1 is the AND circuit 67 when 0000 is input.
One is output as output 1 from a. Similarly, the pattern No. 1 in FIG. 9 is 111 in the AND gate 87b
Output 1 from AND Gate 87b when 1 is input
Is output. AND gate 87a to 87p
The inputs and outputs up to are shown in FIG. 9 (a) using the corresponding pattern numbers in FIG.

【0065】ANDゲ−ト87aと87bの出力は、O
Rゲ−ト88aへ入力され、図2におけるNo.1とN
o.9に対して同一のラベル1が出力される。同様に、
ANDゲ−ト87cと87dの出力は、ORゲ−ト88
bへ入力され、図2におけるNo.2とNo.10に対
して同一のラベル2が出力される。同様に、ORゲ−ト
88c,88d,88e,88f,88g,88hは、
ラベル3,8,4,5,7,6をバス89へ出力する。
ORゲ−ト88aから88hの入力と出力の関係を、図
2における対応するラベルの番号を用いて図7(b)に
示す。
The outputs of the AND gates 87a and 87b are O
It is input to the R gate 88a, and the No. in FIG. 1 and N
o. The same label 1 is output for 9. Similarly,
The outputs of the AND gates 87c and 87d are the OR gates 88.
2 is input to No. b in FIG. 2 and No. The same label 2 is output for 10. Similarly, the OR gates 88c, 88d, 88e, 88f, 88g, 88h are
The labels 3, 8, 4, 5, 7, 6 are output to the bus 89.
The relationship between the inputs and outputs of the OR gates 88a to 88h is shown in FIG. 7 (b) using the corresponding label numbers in FIG.

【0066】ORゲ−ト88iは、ANDゲ−ト87
b,87d,87f,87h,87j,87l,87
n、87pの出力が入力され、フラグ100を出力す
る。2×2画素のパタ−ン入力とORゲ−ト88iの出
力の関係を、図2において対応するパタ−ンの番号を用
いて図9(c)に示す。
The OR gate 88i is the AND gate 87.
b, 87d, 87f, 87h, 87j, 87l, 87
The outputs of n and 87p are input and the flag 100 is output. The relationship between the pattern input of 2 × 2 pixels and the output of the OR gate 88i is shown in FIG. 9 (c) using the corresponding pattern numbers in FIG.

【0067】ANDゲ−ト87b,87d,87f,8
7h,87j,87l,87n、87pにおいてデータ
A,B,C,Dの処理が終了すると、ラッチ83,8
4,85,86は、次のデータE,F,G,Hをラッチ
し、A,B,C,Dと同じ処理によって、フラグとラベ
ルが生成される。ラインバッファ82の最終ブロックに
おいて、4画素のデータが無い場合には、ラッチ83,
84,85,86は、データi、jを、i,i,j,j
のようにラッチする。ラインバッファ82のデータがす
べて処理を終了すると、ラインバッファ82は、ライン
バッファ81から1ライン分づつ計2ライン分のデジタ
ル信号を蓄積する。2ライン分の新たなデジタル信号
が、ラインバッファ82に蓄積されると上記と同じ処理
によって、フラグとラベルへ変換される。
AND gates 87b, 87d, 87f, 8
When the processing of the data A, B, C, D in 7h, 87j, 87l, 87n, 87p is completed, the latches 83, 8
4, 85 and 86 latch the next data E, F, G and H, and a flag and label are generated by the same processing as A, B, C and D. In the last block of the line buffer 82, if there is no 4-pixel data, the latch 83,
84, 85, 86 convert data i, j to i, i, j, j
Latch like. When the processing of all the data in the line buffer 82 is completed, the line buffer 82 accumulates digital signals for one line from the line buffer 81 for two lines in total. When a new digital signal for two lines is accumulated in the line buffer 82, it is converted into a flag and a label by the same processing as above.

【0068】上記実施例では、入力画像情報を2値とし
て2×2画素のブロックに分割してブロック情報をラベ
ルとフラグへ変換した例を説明した。しかし、回路の多
少の変更によってブロックの分割サイズが可能なのは、
言うまでもない。
In the above embodiment, the input image information is binarized and divided into blocks of 2 × 2 pixels, and the block information is converted into labels and flags. However, it is possible to divide the block size by changing the circuit slightly.
Needless to say.

【0069】図10は、符号化回路を汎用のプロセッサ
によって構成した例を示すものである。符号化回路は、
汎用プロセッサであるCPU101とRAM102と符
号メモリ103とROM104によって構成されてい
る。CPU101は、バス89、バス105、出力バス
108と接続されている。RAM102は、バス106
によってバス105を介しCPU101に接続されてい
る。符号メモリは、バス107によってバス105を介
しCPU101に接続されている。
FIG. 10 shows an example in which the encoding circuit is composed of a general-purpose processor. The encoding circuit
The CPU 101 is a general-purpose processor, the RAM 102, the code memory 103, and the ROM 104. The CPU 101 is connected to the bus 89, the bus 105, and the output bus 108. The RAM 102 is the bus 106
Is connected to the CPU 101 via the bus 105. The code memory is connected to the CPU 101 via the bus 107 via the bus 107.

【0070】ブロック情報変換回路から出力されたラベ
ルは、バス89を介してCPU101へ入力され、ブロ
ック数Zまでラベル毎の累積出現頻度が計測される。こ
の累積出現頻度とバス89上に出力されたフラグとラベ
ルは、CPU101からRAM102へ出力され記憶さ
れる。ブロック数Zは、通常画像の全画素から生成した
ブロック数であるが、少なくてもよい。CPU101
は、この出現頻度の大きいラベルほど少ない符号を割り
当てる。符号の割り当ては、公知のエントロピ−符号化
方法であるハフマン法や算術符号化法等による。割り当
てられたラベルの符号は、符号メモリ103に格納され
る。
The label output from the block information conversion circuit is input to the CPU 101 via the bus 89, and the cumulative appearance frequency for each label up to the number of blocks Z is measured. The cumulative appearance frequency and the flag and label output on the bus 89 are output from the CPU 101 to the RAM 102 and stored therein. The number of blocks Z is the number of blocks generated from all the pixels of a normal image, but may be small. CPU 101
Assigns fewer codes to the label with the higher appearance frequency. The code is assigned by a known entropy coding method such as Huffman method or arithmetic coding method. The assigned label code is stored in the code memory 103.

【0071】EOL信号を受けるとCPU101は、1
ライン分のフラグとラベルの最後にEOL信号をRAM
102に記憶する。RTC信号を受けるとCPU101
は、全画像分のフラグとラベルの最後にEOL信号をR
AM102に記憶する。
Upon receiving the EOL signal, the CPU 101 sets 1
RAM of EOL signal at the end of line flag and label
It is stored in 102. CPU 101 receives RTC signal
R flag the EOL signal at the end of the flag and label for all images.
It is stored in the AM 102.

【0072】EOLとRTCの符号は、符号メモリ10
3に予め記憶されている。
The codes of EOL and RTC are code memory 10
3 is stored in advance.

【0073】CPU101は、RAM102に記憶され
ているラベルとEOL信号とRTC信号を符号メモリ1
03を参照して符号化し、符号300にする。フラグと
符号300は、CPU101によってバス108に出力
され、バス108を介して圧縮データ保持部へ出力され
る。
The CPU 101 stores the label, the EOL signal and the RTC signal stored in the RAM 102 in the code memory 1
The reference numeral 03 is referred to, and encoding is performed to obtain the reference numeral 300. The flag and the code 300 are output to the bus 108 by the CPU 101 and output to the compressed data holding unit via the bus 108.

【0074】以上説明したCPU101の動作は、RO
M104にプログラムとして記憶されている。
The operation of the CPU 101 described above is based on the RO
It is stored in M104 as a program.

【0075】以上、符号化回路を汎用のプロセッサを用
いて構成した場合の動作を説明した。しかし、符号化回
路は、専用のハ−ドウェアによって構成されていてもよ
い。
The operation when the encoding circuit is configured by using a general-purpose processor has been described above. However, the encoding circuit may be composed of dedicated hardware.

【0076】[0076]

【発明の効果】本発明は、以上説明したように符号テ−
ブルが半分になることによって、制御コ−ドや、符号テ
−ブル自身に割り当てられるビット数が少なくなること
によって高い圧縮効率を達成できる画像データ圧縮方法
とその装置を提供することができる。また、符号テ−ブ
ルが小さくなることにより圧縮処理にかかる時間を短縮
することができる。
As described above, the present invention provides a code table.
By halving the number of bits, it is possible to provide an image data compression method and apparatus capable of achieving high compression efficiency by reducing the number of bits assigned to the control code and the code table itself. Further, the time required for the compression processing can be shortened by reducing the code table.

【0077】さらに、請求項2の発明においては、文字
フォントデータ等の画像に適用した場合、フラグを型が
同じで解像度の異なる文字フォントデータとして用いる
ことにより、同一圧縮ファイル中に解像度の異なる画像
データを複数保存することになるため高圧縮率が得られ
る。
Furthermore, in the invention of claim 2, when applied to an image such as character font data, the flag is used as character font data having the same type but different resolution, so that images having different resolutions in the same compressed file are used. A high compression rate can be obtained because a plurality of data will be stored.

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

【図1】本発明の画像データ圧縮方法の処理の流れを示
す流れ図。
FIG. 1 is a flowchart showing a processing flow of an image data compression method of the present invention.

【図2】パタ−ンをラベルとフラグに変換する動作を2
値入力された2×2画素のブロックの例を用いて説明す
るための図。
FIG. 2 shows the operation of converting a pattern into a label and a flag.
The figure for demonstrating using the example of the block of 2x2 pixel by which the value was input.

【図3】(a)〜(d)は本発明の方法を文字フォント
画像に適用した場合を示す図。
3A to 3D are diagrams showing a case where the method of the present invention is applied to a character font image.

【図4】(a)は図3のラベルと符号の対応の1例を示
した図。(b)は図3のパタ−ンと符号の対応の1例を
示した図。
4A is a diagram showing an example of correspondence between labels and codes in FIG. FIG. 6B is a diagram showing an example of correspondence between patterns and symbols in FIG.

【図5】(a)〜(b)は符号テ−ブルとラベルとフラ
グと制御コ−ドの記憶順序の1例を示す図。
5A and 5B are diagrams showing an example of a storage order of a code table, a label, a flag, and a control code.

【図6】本発明の画像データ圧縮方法を用いてフラグを
再度圧縮処理を行う1例を示す処理の流れを示す流れ
図。
FIG. 6 is a flowchart showing a processing flow showing an example in which the flag is compressed again using the image data compression method of the present invention.

【図7】本発明の画像データ圧縮装置の1実施例を示す
ブロック図。
FIG. 7 is a block diagram showing an embodiment of an image data compression device of the present invention.

【図8】ブロック化回路とブロック情報変換回路の1例
を示した図。
FIG. 8 is a diagram showing an example of a block formation circuit and a block information conversion circuit.

【図9】(a)は図8のANDゲ−トの入力と出力の関
係を示した図。(b)は図8のORゲ−トの入力と出力
の関係を示した図。(c)は図8のフラグを出力するO
Rゲ−トの入力と出力の関係を示した図。
9A is a diagram showing the relationship between the input and output of the AND gate shown in FIG. FIG. 9B is a diagram showing the relationship between the input and output of the OR gate shown in FIG. (C) is an O that outputs the flag of FIG.
The figure which showed the relationship of the input and output of R gate.

【図10】符号化回路の1例を示した図。FIG. 10 is a diagram showing an example of an encoding circuit.

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

71 情報入力部 72 符号化部 73 圧縮データ保持部 74 制御部 75 ブロック化回路 76 ブロック情報変換回路 77 符号化回路 81 ラインバッファ 82 ラインバッファ 83,84,85,86 ラッチ 87 ANDゲ−ト 88 ORゲ−ト 101 CPU 102 RAM 103 符号メモリ 104 ROM 71 Information Input Unit 72 Encoding Unit 73 Compressed Data Holding Unit 74 Control Unit 75 Blocking Circuit 76 Block Information Conversion Circuit 77 Encoding Circuit 81 Line Buffer 82 Line Buffer 83, 84, 85, 86 Latch 87 AND Gate 88 OR Gate 101 CPU 102 RAM 103 Code memory 104 ROM

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 画像を走査し、画素単位にサンプリング
して得た濃度値が0か1の2値の画像データを圧縮する
方法において、 (a)N行×M列で表現されるパタ−ンのうち、ある2
つのパタ−ンについて、同行同列の位置にある画素どう
しの濃度値を加算した値が、N行×M列のすべての位置
で1(high)になる場合に、前記2つのパタ−ン各
々に、同一のラベルを付与し、かつ一方のパタ−ンに0
(low)、他方に1(high)のフラグを付与する
ことで予めN行×M列の画素で表現されているパタ−ン
を分類し、 (b)画像データをN行×M列の画素ブロックに分割
し、 (c)前記N行×M列の画素ブロックを(a)で分類さ
れているどのパタ−ンと一致するかを調べ、一致したパ
タ−ンに付与されているラベルとフラグを前記画素ブロ
ックに付与し、 (d)複数個の画像ブロックについてラベルの出現頻度
を計測して、出現頻度の大きなラベルから順に短い符号
を割り当て、 (e)画素ブロックの各々に、それが付与されているラ
ベルに対応する符号を付与し、 (f)(c)で付与されたフラグと(e)で付与された
符号を圧縮結果とすることを特徴とする画像データ圧縮
方法。
1. A method for compressing binary image data having a density value of 0 or 1 obtained by scanning an image and sampling in pixel units, wherein (a) a pattern represented by N rows × M columns. 2 out of
For each of the two patterns, if the value obtained by adding the density values of the pixels in the same row and the same column is 1 (high) in all the positions of N rows × M columns, the two patterns are respectively added. , Give the same label and 0 to one pattern
(Low) and the other one is assigned a flag of 1 (high) to classify patterns represented in advance in pixels of N rows × M columns, and (b) image data to pixels of N rows × M columns. It is divided into blocks, and (c) the pixel block of N rows × M columns is checked to see which pattern classified in (a) matches, and the label and flag given to the matched pattern. Is assigned to the pixel block, (d) the appearance frequency of the label is measured for a plurality of image blocks, and a short code is assigned in order from the label with the highest appearance frequency. (E) It is assigned to each of the pixel blocks. An image data compression method, characterized in that a code corresponding to a given label is added, and the flag given in (f) and (c) and the code given in (e) are used as compression results.
【請求項2】 請求項1に記載の画像圧縮方法につい
て、 特に圧縮結果となったフラグを、請求項1に記載の
(a)から(f)の処理によって再圧縮することを特徴
とする請求項1に記載の画像データ圧縮方法。
2. The image compression method according to claim 1, wherein a flag which is a compression result is recompressed by the processing of (a) to (f) according to claim 1. Item 1. The image data compression method according to Item 1.
【請求項3】 画像を走査して濃度値が0か1の2値の
デジタル信号を得る情報入力部と前記デジタル信号を符
号化する符号化部と前記符号を保存する圧縮データ保持
部と前記情報入力部と前記符号化部と前記圧縮データ保
持部を制御する制御部からなる装置において、 (a)画像データをN行×M列の画素ブロックに分割す
るブロック化回路と、 (b)N行×M列で表現されるパタ−ンのうち、ある2
つのパタ−ンについて、同行同列の位置にある画素どう
しの濃度値を加算した値が、N行×M列のすべての位置
で1(high)になる場合に、前記2つのパタ−ン各
々に、同一のラベルを付与し、かつ一方のパタ−ンに
0、他方に1のフラグを付与することで予めN行×M列
の画素で表現されているパタ−ンを分類し、(a)にお
いてブロック化した画素ブロックが、どの前記パタ−ン
と一致するかを調べ、一致したパタ−ンに付与されてい
るラベルとフラグを前記画素ブロックに付与するブロッ
ク情報変換回路と、 (c)複数個の画像ブロックについてラベルの出現頻度
を計測して、出現頻度の大きなラベルから順に短い符号
を割り当て、画素ブロックの各々に、それが付与されて
いるラベルに対応する符号を付与し、前記符号と(b)
で付与されたフラグを圧縮結果とする符号化回路とから
なることを特徴とする画像データ圧縮装置。
3. An information input section for scanning an image to obtain a binary digital signal having a density value of 0 or 1, an encoding section for encoding the digital signal, a compressed data holding section for storing the code, and In a device including an information input unit, the encoding unit, and a control unit that controls the compressed data holding unit, (a) a block circuit that divides image data into pixel blocks of N rows × M columns, and (b) N Some 2 of the patterns expressed in rows x M columns
For each of the two patterns, if the value obtained by adding the density values of the pixels in the same row and the same column is 1 (high) in all the positions of N rows × M columns, the two patterns are respectively added. , The same label is given, and a flag of 0 is given to one pattern and a flag of 1 is given to the other pattern to classify the patterns expressed in pixels of N rows × M columns in advance, (a) A block information conversion circuit that checks which of the patterns the pixel block that has been divided into blocks matches, and adds the label and the flag given to the matched pattern to the pixel block; The frequency of appearance of the label is measured for each image block, a short code is assigned in order from the label with the highest appearance frequency, a code corresponding to the label to which it is given is given to each pixel block, and (B)
An image data compression device, comprising: an encoding circuit that uses the flag added in step 1 as a compression result.
JP19773991A 1991-08-07 1991-08-07 Image data compression method and apparatus thereof Pending JPH0541805A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP19773991A JPH0541805A (en) 1991-08-07 1991-08-07 Image data compression method and apparatus thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP19773991A JPH0541805A (en) 1991-08-07 1991-08-07 Image data compression method and apparatus thereof

Publications (1)

Publication Number Publication Date
JPH0541805A true JPH0541805A (en) 1993-02-19

Family

ID=16379538

Family Applications (1)

Application Number Title Priority Date Filing Date
JP19773991A Pending JPH0541805A (en) 1991-08-07 1991-08-07 Image data compression method and apparatus thereof

Country Status (1)

Country Link
JP (1) JPH0541805A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009077006A (en) * 2007-09-19 2009-04-09 Dainippon Printing Co Ltd Method for displaying two-dimensional code on data broadcast screen, system, data broadcast programming, data broadcast programming data, data broadcast programming program,

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009077006A (en) * 2007-09-19 2009-04-09 Dainippon Printing Co Ltd Method for displaying two-dimensional code on data broadcast screen, system, data broadcast programming, data broadcast programming data, data broadcast programming program,

Similar Documents

Publication Publication Date Title
JP3108479B2 (en) Encoding / decoding method and apparatus therefor
US4316222A (en) Method and apparatus for compression and decompression of digital image data
EP0776569B1 (en) Method and system for encoding and decoding image data
JPH08265800A (en) Compression method, expansion method, parallel context modeller, parallel entropy coder, parallel entropy decoder, picture compression device and picture expansion device
US5424854A (en) Image processing apparatus for half-tone processing and reproducing high speed images of different resolutions
US4972497A (en) Image coding system
JPH1023259A (en) Image pattern converter
JPH0541805A (en) Image data compression method and apparatus thereof
JPH10271495A (en) Image data encoding method and apparatus
JPH05151349A (en) Image data compression method and encoding circuit
JPH1117959A (en) Run length coding method for binary image and recording medium storing run length coding program
JP3990949B2 (en) Image coding apparatus and image coding method
JP2755464B2 (en) Image data compression method
JPH0723238A (en) Image data compression and decompression device
JP2615215B2 (en) Image data compression method
KR0173079B1 (en) Printing method
JPH0936749A (en) Encoding / decoding apparatus and encoding method used therefor
JP3146092B2 (en) Encoding device and decoding device
JP2708252B2 (en) Image data compression method
JP2755463B2 (en) Image data compression method
JP2995740B2 (en) Facsimile image density converter
JPH0370268A (en) Data compression method
JPH06245086A (en) Encoding and decoding method
JPH05252404A (en) Picture information processor
JPH02252364A (en) Picture signal processor