JP2011023926A - Image compression apparatus, imaging apparatus, program and image decompression apparatus - Google Patents
Image compression apparatus, imaging apparatus, program and image decompression apparatus Download PDFInfo
- Publication number
- JP2011023926A JP2011023926A JP2009166519A JP2009166519A JP2011023926A JP 2011023926 A JP2011023926 A JP 2011023926A JP 2009166519 A JP2009166519 A JP 2009166519A JP 2009166519 A JP2009166519 A JP 2009166519A JP 2011023926 A JP2011023926 A JP 2011023926A
- Authority
- JP
- Japan
- Prior art keywords
- image
- code
- encoding
- value
- pixel
- 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.)
- Granted
Links
- 238000007906 compression Methods 0.000 title claims abstract description 74
- 230000006835 compression Effects 0.000 title claims abstract description 72
- 238000003384 imaging method Methods 0.000 title claims description 14
- 230000006837 decompression Effects 0.000 title abstract description 6
- 238000012545 processing Methods 0.000 claims abstract description 105
- 238000000034 method Methods 0.000 description 20
- 230000008569 process Effects 0.000 description 16
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 5
- 238000006243 chemical reaction Methods 0.000 description 3
- 230000006872 improvement Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000011514 reflex Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Abstract
Description
本発明は、画像圧縮装置、撮像装置、プログラムおよび画像伸張装置に関する。 The present invention relates to an image compression apparatus, an imaging apparatus, a program, and an image expansion apparatus.
従来から、一例として特許文献1に示すように、デジタル画像の圧縮処理では、画像の画素値を隣接画素差分やDCT係数などに置換した後にハフマン符号化する手法が公知である。なお、ハフマン符号化による画像の圧縮/伸長処理の場合、一般的に圧縮前後の符号の対応関係を示すLUT(ハフマンテーブル)が必要となる。
Conventionally, as shown in
しかし、従来の技術では、画像の圧縮/伸長処理においてLUTを参照する機能が必要となってコストがかかる点でなお改善の余地があった。 However, in the conventional technique, there is still room for improvement in that the function of referring to the LUT is required in the image compression / decompression processing, which is costly.
そこで、本発明は、LUTを参照せずに画像の圧縮/伸長を行う手段を提供することを目的とする。 Therefore, an object of the present invention is to provide a means for compressing / decompressing an image without referring to an LUT.
一の態様の画像圧縮装置は、処理対象画像の画素の予測差分を求める差分演算部と、画素の予測差分の大きさにより所定の値を求め、予測差分の絶対値を所定の値で除した余を示す可変長の第1符号と、予測差分の絶対値を所定の値で除した商を示す可変長の第2符号と、予測差分の正負を示す固定長の第3符号とを求める符号化処理部と、第1符号、第2符号および第3符号を所定順に配置して、処理対象画像の圧縮情報を生成する圧縮情報生成部と、を備える。 An image compression apparatus according to an aspect includes a difference calculation unit that calculates a prediction difference of a pixel of a processing target image, a predetermined value based on a size of the prediction difference of the pixel, and an absolute value of the prediction difference divided by the predetermined value A code for obtaining a variable-length first code indicating the remainder, a variable-length second code indicating the quotient obtained by dividing the absolute value of the prediction difference by a predetermined value, and a fixed-length third code indicating whether the prediction difference is positive or negative And a compression information generation unit that arranges the first code, the second code, and the third code in a predetermined order to generate compression information of the processing target image.
一の態様の画像圧縮装置において、符号化処理部は、画素の予測差分の大きさにより符号化番号nを求め、2nを所定の値としてもよい。圧縮情報生成部は、第1符号、第2符号および第3符号を所定順に配置した画素情報と符号化番号nとを対応付けしてもよい。また、処理対象画像を複数の領域に分割する領域分割部をさらに備え、符号化処理部は、領域内の複数の画素の予測差分の絶対値の平均値に基づいて、領域ごとに符号化番号nを求めてもよい。また、処理対象画像を複数の領域に分割する領域分割部をさらに備え、符号化処理部は、領域内の複数の画素の予測差分の絶対値の平均値に基づいて、領域ごとに符号化番号nを求めてもよい。例えば、符号化処理部は、予測差分の絶対値の平均値をMとしたときに、「((M+0.5)/2N)+N」の値を最小にする0以上の整数である変数Nの値を符号化番号nとしてもよい。 In the image compression apparatus according to one aspect, the encoding processing unit may obtain the encoding number n based on the size of the pixel prediction difference and set 2 n as a predetermined value. The compressed information generation unit may associate pixel information in which the first code, the second code, and the third code are arranged in a predetermined order with the encoding number n. Further, the image processing apparatus further includes a region dividing unit that divides the processing target image into a plurality of regions, and the encoding processing unit encodes an encoding number for each region based on an average absolute value of prediction differences of a plurality of pixels in the region. n may be obtained. Further, the image processing apparatus further includes a region dividing unit that divides the processing target image into a plurality of regions, and the encoding processing unit encodes an encoding number for each region based on an average absolute value of prediction differences of a plurality of pixels in the region. n may be obtained. For example, when the average value of the absolute values of the prediction differences is M, the encoding processing unit sets a variable N that is an integer of 0 or more that minimizes the value of “((M + 0.5) / 2 N ) + N”. May be the encoding number n.
一の態様において、符号化処理部は、予測差分の絶対値を2nで除した商の値まで2進数の一方の符号を連続させるとともに、一方の符号の末尾に2進数の他方の符号を付して第2符号を生成してもよい。 In one aspect, the encoding processing unit continues one binary code up to a quotient value obtained by dividing the absolute value of the prediction difference by 2 n , and adds the other binary code to the end of one code. The second code may be generated by attaching.
なお、一の態様の画像圧縮装置を備える撮像装置や、コンピュータを一の態様の画像圧縮装置として動作させるプログラムや、前記プログラムを記憶した記憶媒体や、一の態様における画像圧縮装置の動作を方法のカテゴリで表現したものも、本発明の具体的態様として有効である。 An image pickup apparatus including an image compression apparatus according to one aspect, a program that causes a computer to operate as an image compression apparatus according to one aspect, a storage medium that stores the program, and an operation of the image compression apparatus according to one aspect Those expressed in the above category are also effective as specific embodiments of the present invention.
さらに、一の態様の画像圧縮装置によって生成された処理対象画像の圧縮情報を伸張する画像伸張装置や、コンピュータを上記の画像伸長装置として動作させるプログラムや、前記プログラムを記憶した記憶媒体や、上記の画像伸長装置の動作を方法のカテゴリで表現したものも、本発明の具体的態様として有効である。 Furthermore, an image expansion device that expands the compression information of the processing target image generated by the image compression device of one aspect, a program that causes a computer to operate as the image expansion device, a storage medium that stores the program, A representation of the operation of the image expansion apparatus in the method category is also effective as a specific aspect of the present invention.
本発明では、第1符号、第2符号および第3符号を所定順に配置して、処理対象画像の圧縮情報を生成することによって、LUTを参照せずに画像の圧縮/伸長が可能となる。 In the present invention, the first code, the second code, and the third code are arranged in a predetermined order and the compression information of the processing target image is generated, so that the image can be compressed / decompressed without referring to the LUT.
<第1実施形態の説明>
図1は、第1実施形態に係る画像処理装置の構成例を示すブロック図である。一の実施形態の画像処理装置は、プログラムがインストールされたパーソナルコンピュータである。この画像処理装置を構成するコンピュータ11は、プログラムの実行によって、処理対象のデジタル画像(処理対象画像)に圧縮処理を施す。また、コンピュータ11は、プログラムの実行によって、圧縮処理によって生成された処理対象画像の圧縮情報(後述の圧縮ファイル)を伸張することもできる。
<Description of First Embodiment>
FIG. 1 is a block diagram illustrating a configuration example of an image processing apparatus according to the first embodiment. The image processing apparatus according to one embodiment is a personal computer in which a program is installed. The
ここで、上記の処理対象画像は、電子カメラやスキャナ等の撮像装置で被写体を撮像して得た画像であってもよく、あるいはコンピュータ11上で描画された画像であってもよい。
Here, the processing target image may be an image obtained by imaging a subject with an imaging device such as an electronic camera or a scanner, or may be an image drawn on the
図1に示すコンピュータ11は、データ読込部12、記憶装置13、CPU14、メモリ15および入出力I/F16、バス17を有している。データ読込部12、記憶装置13、CPU14、メモリ15および入出力I/F16は、バス17を介して相互に接続されている。さらに、コンピュータ11には、入出力I/F16を介して、入力デバイス18(キーボード、ポインティングデバイスなど)とモニタ19とがそれぞれ接続されている。なお、入出力I/F16は、入力デバイス18からの各種入力を受け付けるとともに、モニタ19に対して表示用のデータを出力する。
A
データ読込部12は、上記の処理対象画像や、プログラムを外部から読み込むときに用いられる。例えば、データ読込部12は、着脱可能な記憶媒体からデータを取得する読込デバイス(光ディスク、磁気ディスク、光磁気ディスクの読込装置など)や、公知の通信規格に準拠して外部の装置と通信を行う通信デバイス(USBインターフェース、LANモジュール、無線LANモジュールなど)で構成される。
The
記憶装置13は、例えば、ハードディスクや、不揮発性の半導体メモリなどの記憶媒体で構成される。この記憶装置13には、上記のプログラムと、プログラムの実行に必要となる各種のデータとが記録されている。なお、記憶装置13には、データ読込部12から読み込んだ処理対象画像の情報や、処理対象画像の圧縮情報(後述の圧縮ファイル)などを記憶しておくこともできる。
The
CPU14は、コンピュータ11の各部を統括的に制御するプロセッサである。このCPU14は、プログラムの実行によって、差分演算部21と、領域分割部22と、番号取得部23と、符号化処理部24と、圧縮情報生成部25として機能する(なお、CPU14に含まれる各部の動作については後述する)。
The
メモリ15は、プログラムの演算結果などを一時的に記憶する。このメモリ15は、例えば揮発性のSDRAMなどで構成される。
The
(画像圧縮処理の動作例)
次に、図2の流れ図を参照しつつ、第1実施形態の画像処理装置による画像圧縮処理の動作例を説明する。図2の処理は、ユーザによるプログラム実行指示に応じて、CPU14がプログラムを実行することで開始される。
(Operation example of image compression processing)
Next, an operation example of image compression processing by the image processing apparatus according to the first embodiment will be described with reference to the flowchart of FIG. The processing in FIG. 2 is started when the
ステップS101:CPU14は、データ読込部12または記憶装置13から処理対象画像を取得する。なお、第1実施形態では、簡単のため、色情報を含まないグレースケール画像を処理対象画像とする例を説明する。
Step S101: The
ステップS102:差分演算部21は、処理対象画像の各画素で画像内予測差分を求める。例えば、差分演算部21は、画像内予測差分として、隣接画素との画素値の差分や、数画素離れた画素との画素値の差分を公知の手法により各画素で求めればよい。なお、差分演算部21は、処理対象画像を解析して画像構造(画像内での画素値の相関)を求め、各画素についてそれぞれ画素値の相関が高くなる方向で画素の差分を求めるようにしてもよい。
Step S102: The
一例として、第1実施形態での画像内予測差分の演算例を図3に示す。図3の例での差分演算部21は、処理対象画像の一番上の行において、左側に隣接する画素との画素値の差分を、画素の画像内予測差分とする。なお、差分演算部21は、処理対象画像における左上隅の画素では、当該画素の画素値をそのまま用いるものとする。また、差分演算部21は、処理対象画像の一番上の行を除く他の行では、上側に隣接する画素との画素値の差分を、画素の画像内予測差分とする。
As an example, FIG. 3 shows a calculation example of the intra-picture prediction difference in the first embodiment. The
ステップS103:領域分割部22は、処理対象画像を複数の領域に分割する領域分割処理を行う。一例として、領域分割部22は、4×4画素サイズのブロックによって処理対象画像を格子状に分割する。
Step S103: The
ステップS104:番号取得部23は、各々のブロック(S103)において、ブロック内の画像内予測差分の大きさに基づく符号化番号nをそれぞれ求める。
Step S104: The
一例として、番号取得部23は、ブロック内における画像内予測差分の絶対値の平均値Mを各ブロックで求める。次に、番号取得部23は、以下の式(1)による値(予測される符号長)を最小にする変数Nの値を各ブロックで求める。なお、式(1)の予測される符号長は、ブロック内での画素の平均符号長に対応する。そして、番号取得部23は各ブロックにおいて、変数Nを符号化番号nとしてそれぞれ設定する(N=n)。
As an example, the
但し、式(1)において変数Nは0以上の整数である。また、第1実施形態の例では、変数Nは1−8の範囲に制限されるものとする。 However, in the formula (1), the variable N is an integer of 0 or more. In the example of the first embodiment, the variable N is limited to a range of 1-8.
ステップS105:CPU14は、処理対象画像に含まれる複数のブロックのうちから、符号化を行うブロックBを指定する。一例として、S105でのCPU14は、符号化を行うブロックBの位置を変更するときに、処理対象画像の左上隅を起点として1行ずつ左から右に順次走査でブロックBをシフトさせるものとする。
Step S105: The
ステップS106:CPU14は、符号化を行うブロックB(S105)のうちから、符号化を行う画素Pを指定する。一例として、S106でのCPU14は、符号化を行う画素Pの位置を変更するときに、ブロックBの左上隅を起点として1行ずつ左から右に順次走査で画素Pをシフトさせるものとする。
Step S106: The
ステップS107:符号化処理部24は、画素Pが属するブロックBに対応した符号化番号nの値を用いて、以下の規則による符号化処理を行う。
Step S107: The encoding
≪nが最大値以外(第1実施形態では1−7)の場合≫
(A)第1に、符号化処理部24は、画素Pの画像内予測差分の絶対値を2nで除した余を求める。そして、符号化処理部24は、求めた余の値を2進数符号化して可変長の第1符号を生成する。ここで、上記の余の値は0から2n−1の範囲となるのでnビットで表現できる。よって、第1符号の符号長は、画素Pに対応する符号化番号nの値に応じたビット数で一義的に決定できる。
<< When n is other than the maximum value (1-7 in the first embodiment) >>
(A) First, the
(B)第2に、符号化処理部24は、画素Pの画像内予測差分の絶対値を2nで除した商を求める。そして、符号化処理部24は、求めた商の値まで2進数の「1」の符号を連続させるとともに、末尾に終端を示す2進数の「0」の符号を付して可変長の第2符号を生成する。なお、符号化処理部24は、上記の「0」および「1」を反転させて第2符号を生成してもよい。
(B) Secondly, the
(C)第3に、符号化処理部24は、画素Pの画像内予測差分の正負を示す1ビット固定長の第3符号を生成する。例えば、符号化処理部24は、画素Pの画像内予測差分が正であれば第3符号を「0」とし、画素Pの画像内予測差分が負であれば第3符号を「1」とする。なお、画素Pの画像内予測差分が「0」である場合、符号化処理部24は第3符号の生成を省略する。
(C) Thirdly, the
(D)そして、符号化処理部24は、上記の第1符号、第2符号および第3符号を所定順に配置した画素Pの画素情報を生成する。例えば、第1実施形態での符号化処理部24は、第1符号、第2符号および第3符号の順に符号を繋げて画素情報を生成する(図4参照)。勿論、符号化処理部24は、画素情報における第1符号、第2符号および第3符号の配置順を適宜変更してもよい。
(D) And the
ここで、上記の場合における画素情報の生成例を説明する。一例として、画素Pの画像内予測差分が−29であり、符号化番号nが3である場合を考える。 Here, an example of generating pixel information in the above case will be described. As an example, let us consider a case where the intra-picture prediction difference of the pixel P is −29 and the encoding number n is 3.
この場合、画像内予測差分の絶対値(29)を23(8)で除した余は5であり、第1符号は2進数3ビットで「101」となる。また、画像内予測差分の絶対値(29)を23(8)で除した商は3であるので、第2符号は「1110」となる。また、画像内予測差分は負の値であるので、第3符号は「1」となる。よって、上記の場合の画素情報は「10111101」となる。なお、第1符号から第3符号の配置順と、符号化番号nとが既知であれば、上記の画素情報の上位nビットが第1符号であると識別できる。同様に、上記の画素情報に含まれる第2符号は、終端を示す「0」の符号によって識別できる。 In this case, the remainder obtained by dividing the absolute value (29) of the intra-picture prediction difference by 2 3 (8) is 5, and the first code is “101” in binary 3 bits. Further, since the quotient obtained by dividing the absolute value (29) of the intra-picture prediction difference by 2 3 (8) is 3, the second code is “1110”. Further, since the intra-picture prediction difference is a negative value, the third code is “1”. Therefore, the pixel information in the above case is “10111101”. If the arrangement order of the first code to the third code and the encoding number n are known, the upper n bits of the pixel information can be identified as the first code. Similarly, the second code included in the pixel information can be identified by the code “0” indicating the end.
また、他の例として、画素Pの画像内予測差分が「0」であり、符号化番号nが3である場合を考える。 As another example, consider a case where the intra-picture prediction difference of the pixel P is “0” and the encoding number n is 3.
この場合、画像内予測差分の絶対値(0)を23(8)で除した余は0であり、第1符号は2進数3ビットで「000」となる。また、画像内予測差分の絶対値(0)を23(8)で除した商も0であるので、第2符号は終端を示す「0」のみとなる。また、画像内予測差分は0であるので、第3符号は省略される。よって、上記の場合の画素情報は「0000」となる。このように、上記の画素情報の第1符号(上位nビット)の直後に「0」が続く場合には、画像内予測差分の絶対値が「0」であると判断できるので、1画素分の画素情報を識別することが可能となる。 In this case, the remainder obtained by dividing the absolute value (0) of the intra-picture prediction difference by 2 3 (8) is 0, and the first code is “000” in binary 3 bits. Further, since the quotient obtained by dividing the absolute value (0) of the intra-picture prediction difference by 2 3 (8) is also 0, the second code is only “0” indicating the end. In addition, since the intra-picture prediction difference is 0, the third code is omitted. Therefore, the pixel information in the above case is “0000”. Thus, when “0” follows immediately after the first code (upper n bits) of the pixel information, it can be determined that the absolute value of the intra-picture prediction difference is “0”. It is possible to identify the pixel information.
≪nが最大値(第1実施形態では8)の場合≫
この場合、符号化処理部24は、上記(A)および(B)の処理の代わりに、画素Pの画像内予測差分の絶対値を2進数符号化する。そして、符号化処理部24は、上記(C)と同様に画素Pの画像内予測差分の正負を示す1ビット固定長の第3符号を末尾に付与して、画素Pの画素情報を生成する。
<< When n is the maximum value (8 in the first embodiment) >>
In this case, the
ステップS108:CPU14は、現在の画素PがブロックBの最後の画素(ブロックBの右下隅の画素)であるか否かを判定する。上記要件を満たす場合(YES側)にはS109に処理が移行する。この場合、ブロックBの全画素で画素情報が生成された状態にある。
Step S108: The
一方、上記要件を満たさない場合(NO側)には、CPU14はS106に戻って画素Pを再指定して上記動作を繰り返す。なお、S108でのNO側のループにより、ブロックBに含まれる各画素の画素情報が順次生成されることとなる。
On the other hand, if the above requirement is not satisfied (NO side), the
ステップS109:圧縮情報生成部25は、ブロックBの各画素の画素情報とブロックBの符号化番号nとを対応付けして、ブロックBの圧縮情報を生成する。
Step S109: The compression
一例として、S109での圧縮情報生成部25は、圧縮情報の先頭に符号化番号nを所定ビット数(3ビット)で記録する。そして、圧縮情報生成部25は、画素Pの指定順に従って16画素分の画素情報を記録する(図4参照)。なお、符号化番号nを示す符号の位置およびビット数と、1ブロック分の画素情報の数とが既知であれば、上記の圧縮情報に含まれる個々の情報はそれぞれ識別可能である。
As an example, the compression
ステップS110:CPU14は、現在のブロックBが最後のブロック(処理対象画像の右下隅のブロック)であるか否かを判定する。上記要件を満たす場合(YES側)にはS111に処理が移行する。この場合、処理対象画像の全ブロックで圧縮情報が生成された状態にある。
Step S110: The
一方、上記要件を満たさない場合(NO側)には、CPU14はS105に戻ってブロックBを再指定して上記動作を繰り返す。なお、S110でのNO側のループにより、処理対象画像に含まれる各ブロックの圧縮情報が順次生成されることとなる。
On the other hand, if the above requirement is not satisfied (NO side), the
ステップS111:圧縮情報生成部25は、ヘッダ情報と各ブロックの圧縮情報とを対応付けして処理対象画像の圧縮ファイルを生成する。そして、CPU14は、記憶装置13に圧縮ファイルを記録する。
Step S111: The compression
一例として、処理対象画像の圧縮ファイルのデータ構造を図4に模式的に示す。圧縮ファイルの先頭部にはヘッダ情報が記録され、ヘッダ情報の後にはブロックBの指定順に従って各ブロックの圧縮情報が記録される。 As an example, FIG. 4 schematically shows the data structure of the compressed file of the processing target image. Header information is recorded at the head of the compressed file, and the compressed information of each block is recorded after the header information in accordance with the designation order of block B.
また、上記のヘッダ情報は、例えば、処理対象画像の画像サイズ情報(縦横の画素数)、1ブロックのサイズ情報(縦横の画素数)、ブロックの配列情報(縦横のブロック数)、符号化番号nの記録ビット数の情報を含む。なお、ヘッダ情報は、圧縮情報生成部25によって生成される。以上で、図2の流れ図の説明を終了する。
The header information includes, for example, image size information (number of vertical and horizontal pixels) of a processing target image, size information of one block (number of vertical and horizontal pixels), block arrangement information (number of vertical and horizontal blocks), and encoding number. Information on the number of recording bits of n is included. The header information is generated by the compressed
第1実施形態の画像圧縮装置は、符号化番号nに基づいて各画素の符号化を行う。そのため、ハフマン符号化とは異なり、LUTを参照せずに画像の符号化を行うことができる。 The image compression apparatus according to the first embodiment encodes each pixel based on an encoding number n. Therefore, unlike Huffman coding, an image can be coded without referring to the LUT.
また、第1実施形態の符号化においても、ハフマン符号化と同様に小さな値は短い符号となる。一般に、画像の隣接画素差分は小さな値となる確率が高いので、圧縮後の符号は平均的に短くなる傾向を示す。よって、第1実施形態の画像圧縮装置は、画像の情報を効率的に圧縮できる。 Also in the encoding of the first embodiment, a small value becomes a short code as in the Huffman encoding. In general, since the adjacent pixel difference of an image has a high probability of being a small value, the code after compression tends to be shorter on average. Therefore, the image compression apparatus of the first embodiment can efficiently compress image information.
ところで、ハフマン符号化で領域別に異なる符号化を実施する場合、各領域でそれぞれ異なるLUTが必要となり、領域ごとに異なった符号化処理を行うことが比較的に困難である。一方、第1実施形態の画像圧縮装置は、各々のブロックで符号化番号nを変化させることで、領域ごとに異なった符号化処理を極めて容易に実行できる。なお、発明者が実験したところ、画像全体を同じハフマン符号化処理で圧縮する場合よりも、第1実施形態の画像圧縮装置によってブロック毎に符号化番号nを変化させて画像の圧縮を行う方が高い圧縮率を得ることができた。なお、第1実施形態において、符号化番号nを小さく設定すれば小さな値の符号化が有利となり、符号化番号nを大きく設定すれば大きな値の符号化が有利となる。 By the way, when different encoding is performed for each region in Huffman encoding, a different LUT is required for each region, and it is relatively difficult to perform different encoding processing for each region. On the other hand, the image compression apparatus according to the first embodiment can very easily execute different encoding processes for each region by changing the encoding number n in each block. In addition, when the inventor conducted an experiment, the image compression apparatus according to the first embodiment compresses an image by changing the encoding number n for each block, rather than compressing the entire image by the same Huffman encoding process. Was able to obtain a high compression ratio. In the first embodiment, if the encoding number n is set small, encoding of a small value is advantageous, and if the encoding number n is set large, encoding of a large value is advantageous.
また、第1実施形態の画像圧縮装置は、上記の式(1)によって、非常に圧縮効率の高い符号化番号nを各ブロックで容易に求めることができる。ここで、第1実施形態において、1画素分の符号化する値(隣接画素差分)から符号化で得られる符号長は、以下の式(2)で求めることができる。 In addition, the image compression apparatus according to the first embodiment can easily obtain the encoding number n with very high compression efficiency for each block by the above equation (1). Here, in the first embodiment, the code length obtained by encoding from the value to be encoded for one pixel (adjacent pixel difference) can be obtained by the following equation (2).
式(2)の「INT(x)」はxを超えない最大の整数を返す関数を示す。また、第1実施形態では符号化する値が0の場合には正負の符号(第3符号)を省略するので、式(2)の演算結果よりも実際は1ビット分符号長が短くなる。図5は、符号化番号1−4において、式(2)により、符号化する値(隣接画素差分)の絶対値と圧縮時の符号長との関係をプロットした図である。 “INT (x)” in Expression (2) indicates a function that returns the maximum integer not exceeding x. Further, in the first embodiment, when the value to be encoded is 0, the positive and negative codes (third code) are omitted, so that the code length is actually shorter by one bit than the calculation result of Expression (2). FIG. 5 is a diagram in which the relationship between the absolute value of the value to be encoded (adjacent pixel difference) and the code length at the time of compression is plotted using the expression (2) in the encoding numbers 1-4.
上記の式(2)の符号長は、以下の式(3)で近似的に求めることができる。図6は、図5に式(3)の近似式の直線を追加した図である。図6によれば、式(3)の演算結果は、式(2)の演算結果をよく近似していることが分かる。 The code length of the above equation (2) can be approximately obtained by the following equation (3). FIG. 6 is a diagram in which a straight line of the approximate expression of Expression (3) is added to FIG. According to FIG. 6, it can be seen that the calculation result of Expression (3) closely approximates the calculation result of Expression (2).
なお、上記の式(3)は一次式であることから、上記の「符号長」を複数の符号長の平均(予測される符号長)とし、上記の「符号化する値の絶対値」を複数の符号化する値の絶対値の平均と置き替えることもでき、これにより、上記の式(1)を得ることができる。以上の説明から、上記の式(1)で求まる符号化番号nは、各ブロックで符号長の平均値を最小化できることが分かる。 In addition, since said Formula (3) is a linear formula, said "code length" is made into the average (predicted code length) of several code length, said above "absolute value of the value to encode" It is also possible to replace the average of the absolute values of a plurality of values to be encoded, thereby obtaining the above equation (1). From the above description, it can be seen that the encoding number n obtained by the above equation (1) can minimize the average code length in each block.
(画像伸長処理の動作例)
次に、図7の流れ図を参照しつつ、第1実施形態の画像処理装置による画像伸長処理の動作例を説明する。図7の処理は、ユーザによるプログラム実行指示に応じて、CPU14がプログラムを実行することで開始される。
(Example of image expansion processing)
Next, an operation example of image decompression processing by the image processing apparatus according to the first embodiment will be described with reference to the flowchart of FIG. The process of FIG. 7 is started when the
ステップS201:CPU14は、データ読込部12または記憶装置13から処理対象画像の圧縮ファイル(上記のS111で生成されたもの)を取得する。
Step S201: The
ステップS202:CPU14は、圧縮ファイルに含まれるヘッダ情報を参照し、処理対象画像の画像サイズ情報、1ブロックのサイズ情報、ブロックの配列情報、符号化番号nの記録ビット数の情報を取得する。
Step S202: The
ステップS203:CPU14は、圧縮ファイルに含まれる各ブロックの圧縮情報を順次伸長する。
Step S203: The
具体的には、CPU14は、符号化番号nの記録ビット数の情報に基づいて、各ブロックの圧縮情報の先頭部から、そのブロックに対応する符号化番号nを取得する。次に、CPU14は、上記のS107の符号化規則に基づいてブロック内の各画素情報を順次伸長し、各画素の画像内予測差分の値を取得する。なお、CPU14は、1ブロックのサイズ情報を参照することで、各画素の画像内予測差分の値を正しく再配置できる。
Specifically, the
そして、CPU14は、各ブロックで上記の動作を繰り返すことで、処理対象画像の全画素で画像内予測差分の値を取得できる。なお、CPU14は、処理対象画像の画像サイズ情報またはブロックの配列情報を参照することで、各ブロックを正しく再配置できる。
And CPU14 can acquire the value of the prediction difference in a picture in all the pixels of a process target picture by repeating said operation | movement by each block. The
ステップS204:CPU14は、S203で取得した画像内予測差分の値から、処理対象画像の各画素値を求める。これにより、CPU14は、圧縮ファイルから処理対象画像を復元できる。なお、CPU14は、復元した処理対象画像をモニタ19に表示出力してもよく、復元した処理対象画像を記憶装置13に記録してもよい。
Step S204: The
<第2実施形態の説明>
図8は、第2実施形態における電子カメラの構成例を示すブロック図である。電子カメラ31は、撮像光学系32と、撮像素子33と、画像処理エンジン34と、ROM35と、メインメモリ36と、記録I/F37と、ユーザの操作を受け付ける操作部38とを有している。ここで、撮像素子33、ROM35、メインメモリ36、記録I/F37および操作部38は、それぞれ画像処理エンジン34に接続されている。
<Description of Second Embodiment>
FIG. 8 is a block diagram illustrating a configuration example of the electronic camera according to the second embodiment. The
撮像素子33は、撮像光学系32によって結像される被写体の像を撮像し、撮像した画像の画像信号を生成する撮像デバイスである。なお、撮像素子33から出力された画像信号は、A/D変換回路(不図示)を介して制御部に入力される。
The
画像処理エンジン34は、電子カメラ31の動作を統括的に制御するプロセッサである。例えば、画像処理エンジン34は、撮像した画像のデータに対して各種の画像処理(色補間処理、階調変換処理、輪郭強調処理、ホワイトバランス調整、色変換処理など)を施す。また、画像処理エンジン34は、プログラムの実行により、画像圧縮装置(第1実施形態の差分演算部21、領域分割部22、番号取得部23、符号化処理部24、圧縮情報生成部25)として機能する。
The
ROM35には、画像処理エンジン34によって実行されるプログラムが記憶されている。また、メインメモリ36は、画像処理の前工程や後工程で画像のデータを一時的に記憶する。
The
記録I/F37は、不揮発性の記憶媒体39を接続するためのコネクタを有している。そして、記録I/F37は、コネクタに接続された記憶媒体39に対してデータの書き込み/読み込みを実行する。上記の記憶媒体39は、ハードディスクや、半導体メモリを内蔵したメモリカードなどで構成される。なお、図8では記憶媒体39の一例としてメモリカードを図示する。
The recording I /
第2実施形態の電子カメラ31は、ユーザの撮像指示をトリガとする撮像処理において、撮像素子33で撮像された画像に対して第1実施形態の画像圧縮処理(図2の流れ図の処理)を施す。そして、電子カメラ31は撮像画像の圧縮ファイルを記憶媒体39へ記録する。これにより、第2実施形態の電子カメラ31では、より多くの画像の情報を記憶媒体39へ効率的に記録することが可能となる。
The
<実施形態の補足事項>
上記の各実施形態では、差分演算部21、領域分割部22、番号取得部23、符号化処理部24、圧縮情報生成部25の機能をプログラムによってソフトウエア的に実現する例を説明したが、ASICによって上記の各部をハードウエア的に実現しても勿論かまわない。
<Supplementary items of the embodiment>
In each of the above embodiments, an example has been described in which the functions of the
また、上記の第1実施形態ではグレースケール画像を処理対象画像とする例を説明したが、カラー画像に本発明の画像圧縮処理を施しても勿論かまわない。例えば、カラー画像に本発明の画像圧縮処理を施す場合、RGBの各チャネルでそれぞれ上記の画像圧縮処理を実行すればよい。あるいはYCbCrの各チャネルでそれぞれ上記の画像圧縮処理を実行してもよい。 In the first embodiment described above, an example in which a grayscale image is a processing target image has been described. However, a color image may be subjected to the image compression processing of the present invention as a matter of course. For example, when the image compression processing of the present invention is performed on a color image, the above-described image compression processing may be executed for each of the RGB channels. Alternatively, the above-described image compression processing may be executed on each YCbCr channel.
また、上記の第1実施形態において、符号化番号nの範囲(1−8)や1ブロックのサイズ(4×4画素)はあくまで一例にすぎず、本発明の実施時にはこれらのパラメータは適宜変更してもよい。 In the first embodiment, the range of the encoding number n (1-8) and the size of one block (4 × 4 pixels) are merely examples, and these parameters are appropriately changed when the present invention is implemented. May be.
また、上記の第1実施形態において、1ブロックのサイズや符号化番号nの記録ビット数が規格化されて一義的に定まっている場合には、ヘッダ情報から上記の情報を省略してもよい。 In the first embodiment, when the size of one block and the number of recording bits of the encoding number n are standardized and uniquely determined, the above information may be omitted from the header information. .
なお、本発明の撮像装置は、例えば、携帯電話などの電子機器に内蔵されるカメラモジュールや、一眼レフ型の電子カメラや、スキャナ等の撮像装置にも広く適用できる。 Note that the imaging device of the present invention can be widely applied to imaging devices such as camera modules incorporated in electronic devices such as mobile phones, single-lens reflex electronic cameras, and scanners.
以上の詳細な説明により、実施形態の特徴点および利点は明らかになるであろう。これは、特許請求の範囲が、その精神および権利範囲を逸脱しない範囲で前述のような実施形態の特徴点および利点にまで及ぶことを意図するものである。また、当該技術分野において通常の知識を有する者であれば、あらゆる改良および変更に容易に想到できるはずであり、発明性を有する実施形態の範囲を前述したものに限定する意図はなく、実施形態に開示された範囲に含まれる適当な改良物および均等物によることも可能である。 From the above detailed description, features and advantages of the embodiments will become apparent. It is intended that the scope of the claims extend to the features and advantages of the embodiments as described above without departing from the spirit and scope of the right. Further, any person having ordinary knowledge in the technical field should be able to easily come up with any improvements and modifications, and there is no intention to limit the scope of the embodiments having the inventive features to those described above. It is also possible to use appropriate improvements and equivalents within the scope disclosed in.
11…コンピュータ、12…データ読込部、13…記憶装置、14…CPU、21…差分演算部、22…領域分割部、23…番号取得部、24…符号化処理部、25…圧縮情報生成部、31…電子カメラ、33…撮像素子、34…画像処理エンジン、35…ROM、37…記録I/F、39…記憶媒体
DESCRIPTION OF
Claims (9)
前記画素の前記予測差分の大きさにより所定の値を求め、前記予測差分の絶対値を前記所定の値で除した余を示す可変長の第1符号と、前記予測差分の絶対値を前記所定の値で除した商を示す可変長の第2符号と、前記予測差分の正負を示す固定長の第3符号とを求める符号化処理部と、
前記第1符号、前記第2符号および前記第3符号を所定順に配置して、前記処理対象画像の圧縮情報を生成する圧縮情報生成部と、
を備える画像圧縮装置。 A difference calculation unit for obtaining a prediction difference of pixels of the processing target image;
A predetermined value is obtained based on the magnitude of the prediction difference of the pixel, a variable-length first code indicating a remainder obtained by dividing the absolute value of the prediction difference by the predetermined value, and the absolute value of the prediction difference is the predetermined value An encoding processing unit that obtains a variable-length second code indicating a quotient divided by the value and a fixed-length third code indicating the sign of the prediction difference;
A compression information generating unit that arranges the first code, the second code, and the third code in a predetermined order to generate compression information of the processing target image;
An image compression apparatus comprising:
前記符号化処理部は、前記画素の前記予測差分の大きさにより符号化番号nを求め、2nを前記所定の値とし、
前記圧縮情報生成部は、前記第1符号、前記第2符号および前記第3符号を所定順に配置した画素情報と前記符号化番号nとを対応付けする画像圧縮装置。 The image compression apparatus according to claim 1.
The encoding processing unit obtains an encoding number n based on the size of the prediction difference of the pixel, 2 n is set as the predetermined value,
The compression information generation unit is an image compression device that associates pixel information in which the first code, the second code, and the third code are arranged in a predetermined order with the encoding number n.
前記処理対象画像を複数の領域に分割する領域分割部をさらに備え、
前記符号化処理部は、前記領域内の複数の前記画素の前記予測差分の絶対値の平均値に基づいて、前記領域ごとに前記符号化番号nを求める画像圧縮装置。 The image compression apparatus according to claim 2,
An area dividing unit that divides the processing target image into a plurality of areas;
The image compression device, wherein the encoding processing unit obtains the encoding number n for each region based on an average value of absolute values of the prediction differences of the plurality of pixels in the region.
前記符号化処理部は、前記予測差分の絶対値の平均値をMとしたときに、
「((M+0.5)/2N)+N」の値を最小にする0以上の整数である変数Nの値を前記符号化番号nとする画像圧縮装置。 The image compression apparatus according to claim 3.
When the average value of the absolute values of the prediction differences is M, the encoding processing unit,
An image compression apparatus in which the value of a variable N that is an integer of 0 or more that minimizes the value of “((M + 0.5) / 2 N ) + N” is the encoding number n.
前記符号化処理部は、前記予測差分の絶対値を2nで除した商の値まで2進数の一方の符号を連続させるとともに、前記一方の符号の末尾に2進数の他方の符号を付して前記第2符号を生成する画像圧縮装置。 The image compression apparatus according to any one of claims 2 to 4,
The encoding processing unit continues one binary code up to a quotient value obtained by dividing the absolute value of the prediction difference by 2 n , and attaches the other binary code to the end of the one code. An image compression apparatus for generating the second code.
請求項1から請求項5のいずれか1項に記載の画像圧縮装置と、を備える撮像装置。 An imaging unit that captures a subject and obtains a processing target image;
An image pickup apparatus comprising: the image compression apparatus according to any one of claims 1 to 5.
A program that causes a computer to operate as the image expansion device according to claim 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009166519A JP5413007B2 (en) | 2009-07-15 | 2009-07-15 | Image compression apparatus, imaging apparatus, program, and image expansion apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009166519A JP5413007B2 (en) | 2009-07-15 | 2009-07-15 | Image compression apparatus, imaging apparatus, program, and image expansion apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2011023926A true JP2011023926A (en) | 2011-02-03 |
JP5413007B2 JP5413007B2 (en) | 2014-02-12 |
Family
ID=43633617
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009166519A Active JP5413007B2 (en) | 2009-07-15 | 2009-07-15 | Image compression apparatus, imaging apparatus, program, and image expansion apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5413007B2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114760481A (en) * | 2022-04-29 | 2022-07-15 | 北京淳中科技股份有限公司 | Video coding method, device, equipment and storage medium |
CN116957524A (en) * | 2023-09-21 | 2023-10-27 | 青岛阿斯顿工程技术转移有限公司 | Talent information intelligent management method and system in technology transfer process |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000022960A (en) * | 1998-07-03 | 2000-01-21 | Canon Inc | Device and method for image processing and storage medium |
JP2000308059A (en) * | 1999-04-19 | 2000-11-02 | Sharp Corp | Method for compressing digital image, method for storing and retrieving reference frame in and from digital animation decoder, and digital animation decoder |
JP2009105838A (en) * | 2007-10-25 | 2009-05-14 | Sony Corp | Encoding method, device, and program |
-
2009
- 2009-07-15 JP JP2009166519A patent/JP5413007B2/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000022960A (en) * | 1998-07-03 | 2000-01-21 | Canon Inc | Device and method for image processing and storage medium |
JP2000308059A (en) * | 1999-04-19 | 2000-11-02 | Sharp Corp | Method for compressing digital image, method for storing and retrieving reference frame in and from digital animation decoder, and digital animation decoder |
JP2009105838A (en) * | 2007-10-25 | 2009-05-14 | Sony Corp | Encoding method, device, and program |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114760481A (en) * | 2022-04-29 | 2022-07-15 | 北京淳中科技股份有限公司 | Video coding method, device, equipment and storage medium |
CN114760481B (en) * | 2022-04-29 | 2023-05-30 | 北京淳中科技股份有限公司 | Video coding method, device, equipment and storage medium |
CN116957524A (en) * | 2023-09-21 | 2023-10-27 | 青岛阿斯顿工程技术转移有限公司 | Talent information intelligent management method and system in technology transfer process |
CN116957524B (en) * | 2023-09-21 | 2024-01-05 | 青岛阿斯顿工程技术转移有限公司 | Talent information intelligent management method and system in technology transfer process |
Also Published As
Publication number | Publication date |
---|---|
JP5413007B2 (en) | 2014-02-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8509547B2 (en) | Scan conversion apparatus, image encoding apparatus, and control method therefor | |
JP4682102B2 (en) | Image coding apparatus and image coding method | |
US8457428B2 (en) | Image coding apparatus, control method thereof, and storage medium | |
JP4641892B2 (en) | Moving picture encoding apparatus, method, and program | |
US8600183B2 (en) | Optimized method and system for entropy coding | |
US10051276B2 (en) | Image encoding apparatus, method and imaging apparatus | |
JP2008543203A (en) | Temporary image buffer for image processor using compressed raw image | |
CN107105208A (en) | A kind of lossless coding and coding/decoding method of Bayer images | |
JP2011233972A (en) | Image encoder, image encoding method, image decoder, and image decoding method | |
WO2009087783A1 (en) | Data generator for coding, method of generating data for coding, decoder and decoding method | |
JP2012129888A (en) | Image encoding apparatus and image encoding method | |
JP2016021731A (en) | Image capturing apparatus, method for controlling the same, and program | |
JP5413007B2 (en) | Image compression apparatus, imaging apparatus, program, and image expansion apparatus | |
JP2007267123A (en) | Moving image encoding apparatus | |
JP2005124001A (en) | Apparatus, method, and program for motion picture encoding apparatus, method and program for motion picture decoding | |
US9020289B2 (en) | Image processing apparatus and image processing method for compressing image data by combining spatial frequency conversion, quantization, and entropy coding | |
JP2009159303A (en) | Imaging apparatus | |
JP2009117998A (en) | Data compression device and data compression program | |
JP4706567B2 (en) | Image processing method, image processing method program, recording medium storing image processing method program, and image processing apparatus | |
US9591332B2 (en) | Image processing apparatus performing preprocessing to prevent boundary positions of divided rectangular regions of image data from being separated into dense and sparse portions | |
JP2007295319A (en) | Image processing apparatus and image forming apparatus equipped therewith | |
JP2023154574A (en) | Image processing apparatus and method for controlling the same and program | |
JP4161312B2 (en) | Image quality evaluation value calculation method and image quality evaluation value calculation device | |
JP4490051B2 (en) | Image coding apparatus and image coding method | |
JP4939460B2 (en) | Image processing device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120703 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130319 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130326 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130524 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20131015 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20131028 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5413007 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |