JP2006340198A - Coding device and coding method - Google Patents

Coding device and coding method Download PDF

Info

Publication number
JP2006340198A
JP2006340198A JP2005164413A JP2005164413A JP2006340198A JP 2006340198 A JP2006340198 A JP 2006340198A JP 2005164413 A JP2005164413 A JP 2005164413A JP 2005164413 A JP2005164413 A JP 2005164413A JP 2006340198 A JP2006340198 A JP 2006340198A
Authority
JP
Japan
Prior art keywords
plane
luminance
encoding processing
color difference
image data
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
JP2005164413A
Other languages
Japanese (ja)
Inventor
Junichi Hoshi
淳一 星
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2005164413A priority Critical patent/JP2006340198A/en
Publication of JP2006340198A publication Critical patent/JP2006340198A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To further improve the compression efficiency of image data. <P>SOLUTION: The image data is divided into at least one brightness plane for indicating the brightness and at least one color-difference plane for indicating the color difference (step S2). Thereafter, the variation in brightness existing in the brightness plane is eliminated (step S3), and then the image data is coded after eliminating the variation in brightness (step S7). <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、画像データを符号化処理するための符号化処理装置及び符号化処理方法に関するものである。   The present invention relates to an encoding processing apparatus and an encoding processing method for encoding image data.

近年、デジタルカメラの発達により、自然画像を容易にデジタル情報化出来るように成って来ている。また近頃では静止画だけでなく、動画をも撮影可能なスチル&ムービーカメラも台頭しつつある。   In recent years, with the development of digital cameras, natural images can be easily converted into digital information. Recently, still and movie cameras that can shoot not only still images but also movies are also emerging.

前記カメラは大量のメモリを消費するため、高効率なカラー画像圧縮方法が望まれている。また、前記カメラは電子ズームを前提としているため、前記ズーム時でも高精細な画像を提供出来る必要がある。しかし従来の主なコーデックであるJPEGやMPEGは非可逆圧縮方法であるため、前記高精細な画像を再生するには不向きなものになっている。   Since the camera consumes a large amount of memory, a highly efficient color image compression method is desired. Further, since the camera is premised on electronic zoom, it is necessary to provide a high-definition image even at the time of zooming. However, since JPEG and MPEG, which are conventional main codecs, are irreversible compression methods, they are not suitable for reproducing the high-definition images.

また、前記カメラは動画撮影時においても、前記動画中の任意のフレームを静止画として抽出できるのが望ましい。その点で、前記動画専用コーデックであるMPEGは失格である。また、近年の表示装置の性能向上によって、従来の放送規格であるNTSCやMPEG等が提供する画像の品質はその限界を呈しつつ有る。   In addition, it is desirable that the camera can extract any frame in the moving image as a still image even during moving image shooting. In that respect, MPEG, which is the video codec, is disqualified. In addition, with the recent improvement in performance of display devices, the quality of images provided by conventional broadcast standards such as NTSC and MPEG are becoming limited.

このような状況で注目されつつあるのが、JPEG2000と呼ばれる新しい可逆、非可逆圧縮方法である。前記圧縮方法は本質的には静止画圧縮方法であり、可逆、非可逆圧縮の両方で基本的には同一の圧縮アルゴリズム(ウェーブレット変換)を採用している。しかし前記可逆圧縮の圧縮率は余り高くなく、1/2程度である。また前記圧縮方法は動画圧縮にも適用可能で、例えば非可逆圧縮の圧縮率1/8程度で良好な動画像を提供する事ができる。   In this situation, a new lossless and lossy compression method called JPEG2000 is drawing attention. The compression method is essentially a still image compression method, and basically employs the same compression algorithm (wavelet transform) for both lossless and lossy compression. However, the compression ratio of the reversible compression is not so high and is about 1/2. The compression method can also be applied to moving image compression. For example, a good moving image can be provided at a compression ratio of about 8 of irreversible compression.

特許文献1には、スキャン方向を変換する方式が開示され、特許文献2には、画像分割して最適な圧縮方法を選択、採用する方式が開示されている。また、特許文献3には、画像分割にヒストグラムを使用する方式が開示され、特許文献4には、属性マップ/オブジェクトに基づいて画像圧縮する方式が開示されている。また、特許文献5には、ラン長の分布から画像の種類を判別する方式が開示され、特許文献6には、色差信号を原点の周りに回転する方式が開示されている。   Patent Document 1 discloses a method for converting the scan direction, and Patent Document 2 discloses a method for selecting and employing an optimal compression method by dividing an image. Patent Document 3 discloses a method of using a histogram for image division, and Patent Document 4 discloses a method of compressing an image based on an attribute map / object. Patent Document 5 discloses a method for discriminating the type of image from the run length distribution, and Patent Document 6 discloses a method for rotating a color difference signal around the origin.

また他の静止画可逆圧縮方法には、例えばGIF、PNG、JPEG−LS、CALIC、TMW等が有る。   Other still image reversible compression methods include GIF, PNG, JPEG-LS, CALIC, TMW, and the like.

特開平8−126009号公報Japanese Patent Laid-Open No. 8-126009 特開2000−333019号公報JP 2000-333019 A 特開2001−22931号公報JP 2001-22931 A 特開2001−169120号公報JP 2001-169120 A 特開2002−163658号公報JP 2002-163658 A 特許第3334242号公報Japanese Patent No. 3334242

前記高精細な画像を提供するカラー画像可逆圧縮方法、コーデックが実現すれば、前記動画像等の記録に莫大なメモリは必要でなくなる。しかしながら、前述したスチル&ムービーカメラは現状ではそのメモリ量、メモリコストが障壁となっており、本格的なカメラは未だ実現の時期を迎えていない。   If a color image reversible compression method and codec for providing a high-definition image are realized, an enormous memory is not required for recording the moving image or the like. However, the still and movie cameras described above are currently limited by the amount of memory and the memory cost, and a full-scale camera has not yet reached the stage of realization.

また前記NTSC規格においても公知の技術によって2枚のフィールド画像から1枚のフレーム画像を形成可能ではあるものの、前記2枚のフィールド画像間ではその撮像時間が僅かに異なっている為、高速に移動する物体等がブレる事が有る。従って動画中から静止画をも抽出する前記スチル&ムービーカメラにおいては、その記録方式は前記NTSC等が採用しているインターレース方式ではなくプログレッシブスキャン方式である事が望ましい。すると必然的に、前記圧縮方法は静止画を基本としたものになる。   Also in the NTSC standard, although one frame image can be formed from two field images by a known technique, since the imaging time is slightly different between the two field images, it moves at high speed. There is a case that the object to be blurred. Therefore, in the still and movie camera that extracts still images from moving images, the recording method is preferably a progressive scan method, not an interlace method adopted by the NTSC or the like. Inevitably, the compression method is based on a still image.

前記静止画の可逆圧縮効率は1/3程度と言われているが実証されたものではなく、その圧縮率は前記静止画の性質に大きく依存する。   Although the reversible compression efficiency of the still image is said to be about 1/3, it has not been proved, and the compression ratio greatly depends on the properties of the still image.

そこで、本発明の目的は、画像データの圧縮効率を更に向上させることにある。   Therefore, an object of the present invention is to further improve the compression efficiency of image data.

本発明の符号化処理装置の第1の態様は、少なくとも1枚の輝度を示す輝度プレーンと少なくとも1枚の色差を示す色差プレーンとに画像データを分離する分離手段と、前記輝度プレーン内に存在する輝度差の補正を行う傾斜補正手段と、前記傾斜補正手段による輝度差の補正処理の後に前記画像データの符号化処理を行う符号化処理手段とを有すること特徴とする。
本発明の符号化処理装置の第2の態様は、少なくとも1枚の輝度を示す輝度プレーンと少なくとも1枚の色差を示す色差プレーンとに画像データを分離する分離手段と、前記輝度プレーン及び前記色差プレーン間の相関に基づいて、前記輝度プレーン及び前記色差プレーンのうちから少なくとも1枚のプレーンを削減するプレーン削減手段と、前記プレーン削減手段によるプレーン削減処理の後に前記画像データの符号化処理を行う符号化処理手段とを有することを特徴とする。
本発明の符号化処理方法の第1の態様は、画像データの符号化処理を行う符号化処理装置による符号化処理方法であって、少なくとも1枚の輝度を示す輝度プレーンと少なくとも1枚の色差を示す色差プレーンとに画像データを分離する分離ステップと、前記輝度プレーン内に存在する輝度差の補正を行う傾斜補正ステップと、前記傾斜補正ステップによる輝度差の補正処理の後に前記画像データの符号化処理を行う符号化処理ステップとを含むこと特徴とする。
本発明の符号化処理方法の第2の態様は、画像データの符号化処理を行う符号化処理装置による符号化処理方法であって、少なくとも1枚の輝度を示す輝度プレーンと少なくとも1枚の色差を示す色差プレーンとに画像データを分離する分離ステップと、前記輝度プレーン及び前記色差プレーン間の相関に基づいて、前記輝度プレーン及び前記色差プレーンのうちから少なくとも1枚のプレーンを削減するプレーン削減ステップと、前記プレーン削減ステップによるプレーン削減処理の後に前記画像データの符号化処理を行う符号化処理ステップとを含むことを特徴とする。
本発明のプログラムは、前記の符号化処理方法の第1又は第2の態様をコンピュータに実行させることを特徴とする。
本発明のコンピュータ読み取り可能な記録媒体は、前記のプログラムを記録したことを特徴とする。
According to a first aspect of the encoding processing apparatus of the present invention, there is a separation unit that separates image data into at least one luminance plane indicating luminance and at least one color difference plane indicating color difference, and exists in the luminance plane. And an inclination correction unit that corrects the luminance difference, and an encoding processing unit that encodes the image data after the luminance difference correction processing by the inclination correction unit.
According to a second aspect of the encoding processing apparatus of the present invention, a separation unit that separates image data into at least one luminance plane indicating luminance and at least one color difference plane indicating color difference, the luminance plane, and the color difference Based on the correlation between the planes, a plane reduction unit that reduces at least one of the luminance plane and the color difference plane, and a coding process of the image data after the plane reduction process by the plane reduction unit And encoding processing means.
A first aspect of the encoding processing method of the present invention is an encoding processing method by an encoding processing device that performs encoding processing of image data, and includes at least one luminance plane indicating luminance and at least one color difference. A separation step for separating the image data into color difference planes, a slope correction step for correcting a brightness difference existing in the brightness plane, and a sign of the image data after a brightness difference correction process by the slope correction step And an encoding process step for performing an encoding process.
According to a second aspect of the encoding processing method of the present invention, there is provided an encoding processing method by an encoding processing device that performs encoding processing of image data, wherein the luminance plane indicates at least one luminance and at least one color difference. A separation step of separating image data into color difference planes, and a plane reduction step of reducing at least one of the luminance plane and the color difference plane based on a correlation between the luminance plane and the color difference plane And a coding processing step for performing coding processing of the image data after the plane reduction processing in the plane reduction step.
A program according to the present invention causes a computer to execute the first or second aspect of the encoding processing method.
The computer-readable recording medium of the present invention is characterized in that the program is recorded.

本発明によれば、画像データの圧縮効率を更に向上させることが可能となる。   According to the present invention, it is possible to further improve the compression efficiency of image data.

以下、本発明の好適な実施形態を、添付図面を参照しながら詳細に説明する。   DESCRIPTION OF EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.

先ず、本発明の実施形態の概要について説明する。以下に説明する実施形態は圧縮効率の改善を、以下の項目で示した技術によって行う。
(1)静止画像の部分画像への分割
(2)1枚の輝度プレーンと2枚の色差プレーンへの分離
(3)輝度プレーンの傾斜補正
(4)色差プレーンの色座標の決定
(5)色差プレーンの情報を用いたオブジェクト検出、画像分割
(6)最適予測方向の決定
(7)最適予測方向を考慮した符号化方向の決定
(8)ファイル情報量を減少させる為の輝度プレーンと色差プレーンでの共用化検討
(9)点欠陥の例外処理
First, an outline of an embodiment of the present invention will be described. In the embodiment described below, the compression efficiency is improved by the techniques shown in the following items.
(1) Division of still image into partial images (2) Separation into one luminance plane and two color difference planes (3) Inclination correction of luminance plane (4) Determination of color coordinates of color difference plane (5) Color difference Object detection using plane information, image segmentation (6) Determination of optimal prediction direction (7) Determination of encoding direction in consideration of optimal prediction direction (8) Luminance plane and color difference plane for reducing file information amount (9) Point defect exception handling

(3)は主にランモード時の圧縮率改善を狙ったものである。公知のように、殆どのコーデックはランモードと予測誤差モード(算術符号化モード)を用意している。そのうち飛躍的に圧縮率が高くなるのは、前者を多用できる画像である。   (3) is mainly aimed at improving the compression ratio in the run mode. As is well known, most codecs provide a run mode and a prediction error mode (arithmetic coding mode). Of these images, the compression rate dramatically increases for images that can be used extensively.

圧縮対象である自然画像は、被写体オブジェクトに外部から太陽やランプ等の照明光が当たったものと考える事ができる。既存の自然画像を画像解析してみると、図6に示すように、上下方向に大きな輝度差が観察されるのが通常である。この輝度差は、例えばあるVGA画像では平均35階調/256階調(14%)にも達する。   It can be considered that the natural image to be compressed is a subject object that is exposed to illumination light such as the sun or a lamp from the outside. When an existing natural image is analyzed, a large luminance difference is usually observed in the vertical direction, as shown in FIG. This luminance difference reaches an average of 35 gradations / 256 gradations (14%) in a certain VGA image, for example.

これは前記オブジェクトの反射率は各部分でほぼ同一で有るのに対して、前記照明光の分布はそれとは対照的に上下方向で大きく異なっていることが原因である。即ち、一般に画像の上部は明るく輝度が高く、下部は暗く輝度が低い。   This is because the reflectance of the object is substantially the same in each part, whereas the distribution of the illumination light is largely different in the vertical direction as opposed to it. That is, generally, the upper part of an image is bright and high in luminance, and the lower part is dark and low in luminance.

本発明の実施形態においては、符号化を行う前にこれらの輝度差の補正を行う。具体的には主に上下方向に線形あるいは低次の関数を用いて補正を行った後に符号化を行う。これらの変換操作による画像圧縮ファイルの情報量の増加は、前記線形あるいは低次の関数の係数分だけであるので、事実上無視できるほど小さい。   In the embodiment of the present invention, these luminance differences are corrected before encoding. Specifically, encoding is performed after correction is performed mainly using a linear or low-order function in the vertical direction. The increase in the amount of information of the image compression file by these conversion operations is only the coefficient of the linear or low-order function, and is so small that it can be virtually ignored.

(4)の色差プレーンの色座標決定方法には、大別して2つの方法がある。従来の2枚の色差プレーンとは、例えば(B−G,R−G)や(U,V)であった。しかし、部分画像に分割され特定の被写体オブジェクトがその部分画像の大半に写り込む場合には、前記画像を構成する画素の画素値の大半が特定の1色で占められるような場合も想定される。そのような場合に、前記予め決められた色差プレーン座標を用いるのは非効率的である。   There are roughly two methods for determining the color coordinates of the color difference plane in (4). The conventional two color difference planes are, for example, (BG, RG) and (U, V). However, in the case where a specific subject object is divided into most of the partial image after being divided into partial images, it may be assumed that most of the pixel values of the pixels constituting the image are occupied by a specific color. . In such a case, it is inefficient to use the predetermined color difference plane coordinates.

そこで1つの方法とは、前記特定の1色を例えば画素値のヒストグラム等から求め、その色に対して2枚の色差プレーンを回転して、一方のプレーンの色差座標をその色に合わせ込み、他方のプレーンの色差座標をその色と直交するように変換する。   Therefore, one method is to obtain the specific color from, for example, a histogram of pixel values, rotate two color difference planes for that color, and adjust the color difference coordinates of one plane to that color, The color difference coordinates of the other plane are converted so as to be orthogonal to the color.

具体的にはカラー画像の色の三原色をC1,C2,C3とすると、それと定数C0を合わせた計4つの項からなる線形量K1,K2を新しい色差プレーンの色座標とする訳である。
K1=α*C0+β*C1+γ*C2+δ*C3・・・(式1)
K2=ε*C0+ζ*C1+η*C2+θ*C3・・・(式2)
ここでα〜θは、線形結合の係数である。定数項C0は、前記K1,K2が負の値にならないように設けている訳である。ここでの情報量、ファイルサイズの増加は、先の自由度8の係数が表す数値64ビット:8バイト程度である。
Specifically, if the three primary colors of the color image are C1, C2 and C3, the linear quantities K1 and K2 consisting of a total of four terms including the constant C0 are used as the color coordinates of the new color difference plane.
K1 = α * C0 + β * C1 + γ * C2 + δ * C3 (Formula 1)
K2 = ε * C0 + ζ * C1 + η * C2 + θ * C3 (Expression 2)
Here, α to θ are linear combination coefficients. The constant term C0 is provided so that K1 and K2 do not become negative values. The increase in information amount and file size here is a numerical value of 64 bits: 8 bytes represented by the coefficient of 8 degrees of freedom.

他の方法とは、前記色差プレーンの色座標を前記三原色の線形結合ではなく、(R/W,B/W)や(R/G,B/G)とする方法である。但し、ここでは可逆圧縮技術であるから、前記色座標に用いる値は例えばカメラ出力等の由緒正しい量である必要がある。既に整数で表現されているビットマップ画像から前記色座標のそれを求めても、その効果は無効である(丸め誤差が出るため)。あくまでも、アナログ出力(光量等)を直接R/W等にAD変換した値、例えば前記カメラ出力である必要が有る。   The other method is a method in which the color coordinates of the color difference plane are not (R / W, B / W) or (R / G, B / G) instead of the linear combination of the three primary colors. However, since this is a reversible compression technique, the value used for the color coordinate needs to be a correct amount such as a camera output. Even if the color coordinate is obtained from a bitmap image already expressed by an integer, the effect is invalid (since a rounding error occurs). It is only necessary that the analog output (light quantity or the like) is directly AD converted into R / W or the like, for example, the camera output.

前述したように被写体オブジェクトの色(反射率R)が場所によらず一定であるとすると、前記被写体に当たる照明光の光量I0が変化したとしても(輝度変化)、先の色座標Kはその値を変えない所が良い所である。
Ir=I0*Rr・・・(式3)
Kr=Ir/(Ir+Ig+Ib)=Rr/(Rr+Rg+Rb)・・・(式4)
ここでIは反射光量であり、添字のr,g,bは色の三原色、赤、緑、青に各々対応している。
As described above, if the color (reflectance R) of the subject object is constant regardless of the location, even if the amount of illumination light I0 hitting the subject changes (luminance change), the previous color coordinate K is the value. The place that doesn't change is a good place.
Ir = I0 * Rr (Formula 3)
Kr = Ir / (Ir + Ig + Ib) = Rr / (Rr + Rg + Rb) (Formula 4)
Here, I is the amount of reflected light, and the subscripts r, g, and b correspond to the three primary colors, red, green, and blue, respectively.

それに対して従来は輝度が変化すると、輝度プレーンの画素値以外に色差プレーンのそれも値を変える為、同一画素値が連続する時に利用出来るランモードを利用する事が出来ず、圧縮率が低下していた。本発明の実施形態では、前記色差プレーンのダイナミックレンジが従来の例えば8ビット(256階調)から増加するため(8+10=18ビット)多少余分な中間ファイルサイズが必要となる。但し圧縮後のそれは前記圧縮効率が改善されるから、問題とはならない。   On the other hand, when the luminance changes, the value of the chrominance plane changes in addition to the pixel value of the luminance plane, so the run mode that can be used when the same pixel value is continuous cannot be used, and the compression rate decreases. Was. In the embodiment of the present invention, since the dynamic range of the color difference plane is increased from, for example, 8 bits (256 gradations), for example (8 + 10 = 18 bits), a slightly extra intermediate file size is required. However, it does not pose a problem after compression because the compression efficiency is improved.

(5)の部分画像への分割は、従来のコーデックに見られていたように、画一的な分割ではなく、前記カラー画像中に含まれるオブジェクトを充分に考慮したものである事が望ましい。そのような方法としては、以下の3つの方法が考えられる。   The division into partial images in (5) is preferably not a uniform division as seen in the conventional codec but sufficiently considering the objects included in the color image. The following three methods can be considered as such a method.

まず1つ目は、前記オブジェクトの抽出を色差プレーンの情報を用いる方法である。
現実的にはオブジェクトの抽出とは先のランモード採用の可否であるから、同一色が連続する部分を同一オブジェクトとみなす事もできる。それは前記色差プレーンの画素値を観察する事で可能である。
The first is a method of using the information of the color difference plane to extract the object.
Actually, the object extraction means whether or not the previous run mode can be adopted, so that the same color can be regarded as the same object. This is possible by observing the pixel value of the color difference plane.

2つ目は、前記オブジェクトが複数の部分画像に跨ることなく、同一の部分画像中に配置されるようにする事である。その為には、前記分割する部分画像の大きさを各カラー画像間で異なる任意の大きさとする事である。即ち、前記画像の分割は、その画像中に含まれるオブジェクトの大きさを考慮してから決定される。   Second, the object is arranged in the same partial image without straddling a plurality of partial images. For this purpose, the size of the partial image to be divided is set to an arbitrary size different between the color images. That is, the division of the image is determined in consideration of the size of the object included in the image.

また3つ目は、前記分割画像の分割開始地点をカラー画像の左上から任意の位置まで平行移動して変更し分割を開始する事である。これによれば少なくとも前記オブジェクトを部分画像の中心に据える事ができる。画像の端面処理の問題は、上を下に、左を右にサイクリック状に連続させる事で回避する事ができる。ここでの情報量、ファイルサイズの増加は、前記画像の大きさを表すビット数(数ビット)程度である。   Thirdly, the division start point of the divided image is translated from the upper left of the color image to an arbitrary position and changed to start division. According to this, at least the object can be placed at the center of the partial image. The problem of the edge processing of the image can be avoided by cyclically continuing the top down and the left right. The increase in the information amount and the file size here is about the number of bits (several bits) representing the size of the image.

(6)の予測方法は、従来のコーデックでも種々検討されている部分である。であるが、その改善効率は必ずしも高くない。本発明の実施形態では注目画素の周囲の少なくとも4方向、望ましくは8方向以上で前記予測値を求め、その予測誤差を最小とする最適予測方向を求め、その方向を圧縮符号化の方向として採用を行う。その際、5ピッチ以上離れた画素をも用いて長距離相関を求め、前記予測値を予測する。前記予測には、例えば線形予測(LPC)を用いる。   The prediction method of (6) is a part that has been variously studied even with conventional codecs. However, the improvement efficiency is not necessarily high. In the embodiment of the present invention, the prediction value is obtained in at least four directions around the target pixel, preferably eight directions or more, the optimum prediction direction that minimizes the prediction error is obtained, and the direction is adopted as the direction of compression coding. I do. At that time, a long-distance correlation is obtained also using pixels separated by 5 pitches or more, and the predicted value is predicted. For the prediction, for example, linear prediction (LPC) is used.

従来のロスレスJPEGでは、1ピッチ離れた(つまりは隣接する)左上方向の3画素の値を参照して前記予測値を計算している。また前記JPEG−LSでは、同じく4画素の値を参照している。また前記CALICでは、2ピッチ離れた左上方向の計7画素の値を参照している。また前記TMWは注目画素から1ピッチ離れた周辺8画素の値を前記線形予測に用いている。であるが、本発明の実施形態ではこれらとは距離(ピッチ数)と画素並びにおいて異なっている。   In the conventional lossless JPEG, the predicted value is calculated with reference to the values of the three pixels in the upper left direction separated by one pitch (that is, adjacent). In the JPEG-LS, the value of 4 pixels is also referred to. The CALIC refers to the value of a total of 7 pixels in the upper left direction separated by 2 pitches. In addition, the TMW uses the values of neighboring eight pixels that are one pitch away from the target pixel for the linear prediction. However, in the embodiment of the present invention, these are different in distance (number of pitches) and pixel arrangement.

本発明の実施形態において長距離相関を用いるのは、図11に示したように比較的長距離(数画素)まで、前記注目画素との相関が認められるからである。グラフの横軸は注目画素からの距離であり、縦軸はその画素と前記注目画素との階調差の絶対値である。グラフの各線は、13種のVGAカラー画像の全画素(640*480)の平均値を示している。例えばグラフが水平になる地点を無相関になる地点であるとみなすと、図の例では5画素以上まで相関が存在する事になる。   The reason why the long distance correlation is used in the embodiment of the present invention is that the correlation with the target pixel is recognized up to a relatively long distance (several pixels) as shown in FIG. The horizontal axis of the graph is the distance from the target pixel, and the vertical axis is the absolute value of the gradation difference between that pixel and the target pixel. Each line in the graph represents an average value of all pixels (640 * 480) of 13 types of VGA color images. For example, if a point where the graph is horizontal is regarded as a point where there is no correlation, in the example in the figure, there is a correlation up to 5 pixels or more.

またLPC予測においては一般に、次数が高くなるほど(即ち沢山の画素情報を用いるほど)その予測精度は向上する。この長距離相関の存在は、今後展開される多画素、高精細画像においては、より顕著化されるものと考えられる。   In general, in LPC prediction, the higher the order (that is, the more pixel information is used), the higher the prediction accuracy. The existence of this long-range correlation is considered to become more prominent in multi-pixel, high-definition images developed in the future.

また従来はエッジの検出等を比較的近距離の画素を調べて行っていたが、これでは不正確である。やはり本発明の実施形態のように長距離相関を調べ、その相関が高い(つまりは予測誤差が小さい)、エッジである可能性が高い方向を予測に用いるべきである。   Conventionally, edge detection or the like has been performed by examining pixels at a relatively short distance, but this is inaccurate. As in the embodiment of the present invention, a long distance correlation should be examined, and a direction having a high correlation (that is, a small prediction error) and a high possibility of being an edge should be used for the prediction.

また図11では前記予測の方向は、注目画素の周囲0度(水平方向)、45度、90度(垂直方向)、135度、の計4方向であるが、この数は任意である。一般には対向する方向の予測値は近く、また前記最小な予測誤差を示す最適な予測方向は、水平方向である場合が多い。しかし、特殊な画像も稀には存在するので、やはりその予測方向の選択は全方向(360度)から行われるべきである。   In FIG. 11, the prediction directions are four directions, that is, 0 degrees (horizontal direction), 45 degrees, 90 degrees (vertical direction), and 135 degrees around the target pixel, but this number is arbitrary. In general, predicted values in opposite directions are close, and the optimal prediction direction showing the minimum prediction error is often the horizontal direction. However, since there are rare special images, the prediction direction should be selected from all directions (360 degrees).

さて、(7)の必要理由を従来のコーデックを用いて説明を行う。従来のコーデックでは、予測画素に主に左上のそれを用いていた。これは符号化方向が左上から右下に向かっていたからであり、左上方向は各画素の画素値yiが確定済みであるため、それらの画素値yiと予測誤差Δeを用いて注目画素の実際値yを求める事が可能であるからである。
y=f(yi)+Δe・・・(式5)
Now, the necessity of (7) will be described using a conventional codec. In a conventional codec, the upper left pixel is mainly used as a prediction pixel. This is because the encoding direction was from the upper left to the lower right, and since the pixel value yi of each pixel has been determined in the upper left direction, the actual value y of the pixel of interest using the pixel value yi and the prediction error Δe. It is because it is possible to ask for.
y = f (yi) + Δe (Formula 5)

それに対して右下の画素値は未だ未確定なため、それを用いても前記実際値yを計算する事は不可能である。このように、本発明の実施形態では予め予測の最適方向を求めた後に、それに見合った符号化方向を決定する。   On the other hand, since the pixel value at the lower right is not yet determined, it is impossible to calculate the actual value y even if it is used. As described above, in the embodiment of the present invention, after obtaining the optimal direction of prediction in advance, an encoding direction corresponding to the optimal direction is determined.

本発明の実施形態において使用する予測方向の指定は、例えば8方向では僅か3ビットであるため、その情報量、ファイルサイズの増加は事実上無視する事ができる。   Since the designation of the prediction direction used in the embodiment of the present invention is, for example, only 3 bits in the 8 directions, the increase in the information amount and the file size can be virtually ignored.

また(8)は、従来、輝度プレーンと色差プレーンとの符号化は、各々独立に行われるのが常であった。であるが、被写体オブジェクト+照明光という自然画像においては、前記両プレーンに共通する情報量が存在する筈である。仮にそのような情報量をプレーン間で統合出来れば、圧縮画像全体の情報量を減少可能であり、前記圧縮率の大幅な改善が見込める。   In the case of (8), conventionally, encoding of the luminance plane and the color difference plane has been usually performed independently. However, in the natural image of the subject object + illumination light, there should be an information amount common to both the planes. If such information amount can be integrated between planes, the information amount of the entire compressed image can be reduced, and the compression ratio can be greatly improved.

本発明の実施形態ではこれを、以下の2つの方法によって実現している。一つ目は、プレーン枚数の削減である。ほぼ単色から成る画像の特定の部分画像においては、前記輝度プレーン1枚、色差プレーン2枚という前提が、必ずしも必要ではなくなる。その場合には、輝度プレーン1枚+色差プレーン1枚、あるいは色差プレーン2枚から前記輝度プレーンを計算式で求めても良い。勿論、色差プレーン1枚で済む場合も、稀には存在するだろう。   In the embodiment of the present invention, this is realized by the following two methods. The first is to reduce the number of planes. In a specific partial image of an image composed of substantially a single color, the premise of one luminance plane and two color difference planes is not always necessary. In that case, the luminance plane may be obtained by a calculation formula from one luminance plane + one color difference plane or two color difference planes. Of course, there may be rare cases where only one color difference plane is sufficient.

その具体的な方法とは、圧縮前に画素値等のテーブルを両プレーン間で比較する事である。各々の画素値同士が両プレーン間である簡単な式で表せるならば、一方のプレーンは必要ではなくなる。また両者の相関が予め決められた閾値よりも高ければ、上述のように隣接相関、予測誤差を用いた公知の符号化方法ではなく、前記プレーン間の相関を用いて予測誤差を求めた方が良い場合も生じる。例えばP1とP2での各画素値をy1、y2とすると、予測誤差Δeは以下のように表される。
y2=α*y1+β+Δe・・・(式6)
ここでα、βは定数である。
The specific method is to compare tables of pixel values between both planes before compression. If each pixel value can be expressed by a simple expression between both planes, one plane is not necessary. If the correlation between the two is higher than a predetermined threshold, it is better to obtain the prediction error using the correlation between the planes, rather than the known encoding method using the adjacent correlation and the prediction error as described above. A good case also occurs. For example, assuming that the pixel values at P1 and P2 are y1 and y2, the prediction error Δe is expressed as follows.
y2 = α * y1 + β + Δe (Expression 6)
Here, α and β are constants.

二つ目は、オブジェクトの位置や画像分割の方法などである。また、画像によっては前記各分割画像での最適予測方向、符号化方向をも共用化出来るかもしれない。   The second is the position of the object and the method of dividing the image. Further, depending on the image, it may be possible to share the optimum prediction direction and the encoding direction in each of the divided images.

また(9)は、撮像センサに必然的に存在する欠陥画素を考慮したものである。多画素な撮像センサには表示装置と同様に、多数の点欠陥が存在する。それらは通常例えばフレームメモリ上等で画像処理、補正されるため、一般には目立つ事はない。であるが、高々1点の点欠陥の為に、前記圧縮率を飛躍的に高めるランモードが中断される恐れも有る。またプレーン間での相関を利用する場合など、点欠陥として除去する画素が少数の場合には、充分に圧縮率改善に寄与する。   Further, (9) considers defective pixels that inevitably exist in the image sensor. A multi-pixel imaging sensor has many point defects as in the display device. Since they are usually processed and corrected on a frame memory, for example, they are generally not conspicuous. However, the run mode that dramatically increases the compression ratio may be interrupted due to a point defect at most. In addition, when the number of pixels to be removed as point defects is small, such as when correlation between planes is used, the compression ratio is sufficiently improved.

本発明の実施形態による情報量、ファイルサイズの増大は、点欠陥数*(座標を表すビット数:数ビット+階調ビット数:8ビット)程度である。   The increase in information amount and file size according to the embodiment of the present invention is about the number of point defects * (number of bits representing coordinates: several bits + number of gradation bits: 8 bits).

このように、現在マンモスコーデックと呼ばれるそれで有っても半導体集積回路の回路規模や演算速度の改善は誠に目覚しいので(各々3年4倍、3年8倍)、前記コーデックが将来的には最適化されたそれになる可能性がある。   In this way, even though it is currently called a mammoth codec, the improvement in the circuit scale and operation speed of the semiconductor integrated circuit is extremely remarkable (each 3 years 4 times, 3 years 8 times). There is a possibility of becoming it.

静止画、動画圧縮に必要なのは第一に圧縮画像ファイルサイズ、第二にデコード時間であるので、他を犠牲にした構成も充分に考えられ得る。また並列コンピューティング技術も進歩するので、前記並列処理を充分に考慮したコーデックである必要がある。本発明は上記の点でも、時代に適応している。   Since still image and moving image compression requires firstly a compressed image file size and secondly a decoding time, a configuration that sacrifices others can be considered sufficiently. Since parallel computing technology also advances, it is necessary to use a codec that fully considers the parallel processing. The present invention is also adapted to the times in the above points.

次に、本発明の実施形態を具体的に説明する。図12は、本発明の実施形態に適用される撮像装置のシステム構成を示す図である。図12において、10は撮影レンズ、12は絞り機能を備えるシャッタ、14は光学像を電気信号に変換する撮像素子、16は撮像素子14のアナログ信号出力をデジタル信号に変換するA/D変換器である。   Next, embodiments of the present invention will be specifically described. FIG. 12 is a diagram illustrating a system configuration of an imaging apparatus applied to the embodiment of the present invention. In FIG. 12, 10 is a photographing lens, 12 is a shutter having a diaphragm function, 14 is an image sensor that converts an optical image into an electric signal, and 16 is an A / D converter that converts an analog signal output of the image sensor 14 into a digital signal. It is.

18は撮像素子14、A/D変換器17、D/A変換器26にクロック信号や制御信号を供給するタイミング発生回路であり、メモリ制御回路22及びシステム制御回路50により制御される。   A timing generation circuit 18 supplies a clock signal and a control signal to the image sensor 14, the A / D converter 17, and the D / A converter 26, and is controlled by the memory control circuit 22 and the system control circuit 50.

15はCDS(相関二重サンプリング)回路、16はプログラマブルゲインアンプ(PGA)である。   Reference numeral 15 is a CDS (correlated double sampling) circuit, and 16 is a programmable gain amplifier (PGA).

20は画像処理回路であり、A/D変換器17からのデータ或いはメモリ制御回路22からのデータに対して所定の画素補間処理や色変換処理を行う。   An image processing circuit 20 performs predetermined pixel interpolation processing and color conversion processing on the data from the A / D converter 17 or the data from the memory control circuit 22.

また、画像処理回路20においては、撮像した画像データを用いて所定の演算処理を行い、得られた演算結果に基づいてシステム制御回路50が露光制御手段40、測距制御手段42に対して制御を行う、TTL(スルー・ザ・レンズ)方式のAF(オートフォーカス)処理、AE(自動露出)処理、EF(ストロボプリ発光)処理を行っている。   Further, the image processing circuit 20 performs predetermined calculation processing using the captured image data, and the system control circuit 50 controls the exposure control means 40 and the distance measurement control means 42 based on the obtained calculation result. TTL (through-the-lens) AF (autofocus) processing, AE (automatic exposure) processing, and EF (strobe pre-flash) processing are performed.

さらに、画像処理回路20においては、撮像した画像データを用いて所定の演算処理を行い、得られた演算結果に基づいてTTL方式のAWB(オートホワイトバランス)処理も行っている。   Further, the image processing circuit 20 performs predetermined arithmetic processing using captured image data, and also performs TTL AWB (auto white balance) processing based on the obtained arithmetic result.

22はメモリ制御回路であり、A/D変換器17、タイミング発生回路18、画像処理回路20、画像表示メモリ24、D/A変換器26、メモリ30、圧縮・伸長回路32を制御する。   A memory control circuit 22 controls the A / D converter 17, the timing generation circuit 18, the image processing circuit 20, the image display memory 24, the D / A converter 26, the memory 30, and the compression / decompression circuit 32.

A/D変換器17のデータが画像処理回路20、メモリ制御回路22を介して、或いはA/D変換器17のデータが直接メモリ制御回路22を介して、画像表示メモリ24或いはメモリ30に書き込まれる。   The data of the A / D converter 17 is written into the image display memory 24 or the memory 30 via the image processing circuit 20 and the memory control circuit 22 or the data of the A / D converter 17 is directly passed through the memory control circuit 22. It is.

24は画像表示メモリ、26はD/A変換器、28はTFT LCD等から成る画像表
示部であり、画像表示メモリ24に書き込まれた表示用の画像データはD/A変換器26を介して画像表示部28により表示される。画像表示部28を用いて撮像した画像データを逐次表示すれば、電子ファインダ機能を実現することが可能である。
Reference numeral 24 denotes an image display memory, 26 denotes a D / A converter, 28 denotes an image display unit including a TFT LCD, and the image data for display written in the image display memory 24 passes through the D / A converter 26. Displayed by the image display unit 28. If the image data captured using the image display unit 28 is sequentially displayed, the electronic viewfinder function can be realized.

30は撮影した静止画像や動画像を格納するためのメモリであり、所定枚数の静止画像や所定時間の動画像を格納するのに十分な記憶量を備えている。これにより、複数枚の静止画像を連続して撮影する連写撮影やパノラマ撮影の場合にも、高速かつ大量の画像書き込みをメモリ30に対して行うことが可能となる。また、メモリ30はシステム制御回路50の作業領域としても使用することが可能である。   Reference numeral 30 denotes a memory for storing captured still images and moving images, and has a sufficient storage capacity to store a predetermined number of still images and a predetermined time of moving images. This makes it possible to write a large amount of images to the memory 30 at high speed even in continuous shooting or panoramic shooting in which a plurality of still images are continuously shot. The memory 30 can also be used as a work area for the system control circuit 50.

32は、画像データを圧縮伸長する圧縮・伸長回路であり、メモリ30に格納された画像を読み込んで圧縮処理或いは伸長処理を行い、処理を終えたデータをメモリ30に書き込む。   A compression / decompression circuit 32 compresses and decompresses image data, reads an image stored in the memory 30, performs compression processing or decompression processing, and writes the processed data to the memory 30.

40は絞り機能を備えるシャッタ12を制御する露光制御手段であり、ストロボ48と連携することによりストロボ調光機能も有するものである。   Reference numeral 40 denotes exposure control means for controlling the shutter 12 having a diaphragm function, and has a flash light control function in cooperation with the flash 48.

42は撮影レンズ10のフォーカシングを制御する測距制御手段、44は撮影レンズ10のズーミングを制御するズーム制御手段、46はバリアである保護手段102の動作を制御するバリア制御手段である。   Reference numeral 42 denotes a distance measuring control means for controlling the focusing of the photographing lens 10, reference numeral 44 denotes a zoom control means for controlling zooming of the photographing lens 10, and reference numeral 46 denotes a barrier control means for controlling the operation of the protection means 102 as a barrier.

48はストロボであり、AF補助光の投光機能、ストロボ調光機能も有する。露光制御手段40、測距制御手段42はTTL方式を用いて制御されており、撮像した画像データを画像処理回路20によって演算した演算結果に基づき、システム制御回路50が露光制御手段40、測距制御手段42に対して制御を行う。   A strobe 48 has an AF auxiliary light projecting function and a strobe dimming function. The exposure control means 40 and the distance measurement control means 42 are controlled using the TTL method. Based on the calculation result obtained by calculating the captured image data by the image processing circuit 20, the system control circuit 50 performs the exposure control means 40 and the distance measurement. Control is performed on the control means 42.

50は撮像装置100全体を制御するシステム制御回路、52はシステム制御回路50の動作用の定数、変数、プログラム等を記憶するメモリである。   Reference numeral 50 denotes a system control circuit that controls the entire imaging apparatus 100, and 52 denotes a memory that stores constants, variables, programs, and the like for operation of the system control circuit 50.

54はシステム制御回路50でのプログラムの実行に応じて、文字、画像、音声等を用いて動作状態やメッセージ等を表示する液晶表示装置、スピーカ等の表示部であり、撮像装置100の操作部近辺の視認し易い位置に単数或いは複数個所設置され、例えばLCDやLED、発音素子等の組み合わせにより構成されている。   Reference numeral 54 denotes a display unit such as a liquid crystal display device or a speaker that displays an operation state or a message using characters, images, sounds, and the like in accordance with execution of a program in the system control circuit 50, and an operation unit of the imaging device 100. A single or a plurality of locations are provided in the vicinity where they can be easily seen, and are configured by a combination of, for example, an LCD, an LED, and a sounding element.

56は電気的に消去・記録可能な不揮発性メモリであり、例えばEEPROM、フラッシュメモリ等が用いられる。   Reference numeral 56 denotes an electrically erasable / recordable nonvolatile memory such as an EEPROM or a flash memory.

60、62、64、70及び72は、システム制御回路50の各種の動作指示を入力するための操作手段であり、スイッチやダイアル、タッチパネル、視線検知によるポインティング、音声認識装置等の単数或いは複数の組み合わせで構成される。   Reference numerals 60, 62, 64, 70, and 72 are operation means for inputting various operation instructions of the system control circuit 50, and include one or a plurality of switches, dials, touch panels, pointing by line-of-sight detection, voice recognition devices, and the like. Composed of a combination.

60は電源スイッチ(メインスイッチ)で、画像処理装置100の電源オン、電源オフの各モードを切り替え設定することが出来る。また、画像処理装置100に接続された各種付属装置の電源オン、電源オフの設定も合わせて切り替え設定することが出来る。   Reference numeral 60 denotes a power switch (main switch) that can switch and set the power-on and power-off modes of the image processing apparatus 100. In addition, the power on and power off settings of various accessory devices connected to the image processing apparatus 100 can be switched and set together.

62はシャッタスイッチSW1で、不図示のシャッタボタンの操作途中でONとなり、AF(オートフォーカス)処理、AE(自動露出)処理、AWB(オートホワイトバランス)処理、EF(ストロボプリ発光)処理等の動作開始を指示する。   Reference numeral 62 denotes a shutter switch SW1, which is turned on during the operation of a shutter button (not shown), and performs AF (auto focus) processing, AE (automatic exposure) processing, AWB (auto white balance) processing, EF (strobe pre-flash) processing, and the like. Instruct to start operation.

64はシャッタスイッチSW2で、不図示のシャッタボタンの操作完了でONとなり、撮像素子14から読み出した信号をA/D変換器17、メモリ制御回路22を介してメモリ30に画像データを書き込む露光処理、画像処理回路20やメモリ制御回路22での演算を用いた現像処理、メモリ30から画像データを読み出し、圧縮・伸長回路32で圧縮を行い、記録媒体200に画像データを書き込む記録処理という一連の処理の動作開始を指示する。70は各種ボタンやタッチパネル等からなる操作部である。   Reference numeral 64 denotes a shutter switch SW2, which is turned on when an operation of a shutter button (not shown) is completed, and an exposure process for writing a signal read from the image sensor 14 to the memory 30 via the A / D converter 17 and the memory control circuit 22. A series of recording processes such as a development process using an operation in the image processing circuit 20 and the memory control circuit 22, a recording process in which the image data is read out from the memory 30, compressed in the compression / decompression circuit 32, and the image data is written in the recording medium 200. Instructs the start of processing operation. An operation unit 70 includes various buttons and a touch panel.

72はモードダイアルスイッチで、自動撮影モード、撮影モード、パノラマ撮影モード、再生モード、マルチ画面再生・消去モード、PC接続モード等の各機能モードを切り替え設定することが出来る。   Reference numeral 72 denotes a mode dial switch which can switch and set various function modes such as an automatic shooting mode, a shooting mode, a panoramic shooting mode, a playback mode, a multi-screen playback / erase mode, and a PC connection mode.

80は電源制御手段で、電池検出回路、DC−DCコンバータ、通電するブロックを切り替えるスイッチ回路等により構成されており、電池の装着の有無、電池の種類、電池残量の検出を行い、検出結果及びシステム制御回路50の指示に基づいてDC−DCコンバータを制御し、必要な電圧を必要な期間、記録媒体を含む各部へ供給する。   Reference numeral 80 denotes a power supply control means, which includes a battery detection circuit, a DC-DC converter, a switch circuit for switching a block to be energized, etc., and detects the presence / absence of a battery, the type of battery, the remaining battery level, In addition, the DC-DC converter is controlled based on an instruction from the system control circuit 50, and a necessary voltage is supplied to each unit including the recording medium for a necessary period.

82はコネクタ、84はコネクタ、86はアルカリ電池やリチウム電池等の一次電池やNiCd電池やNiMH電池、Li-ion電池等の二次電池、ACアダプタ等からなる電源手段である。   Reference numeral 82 denotes a connector, 84 denotes a connector, 86 denotes a primary battery such as an alkaline battery or a lithium battery, a secondary battery such as a NiCd battery, NiMH battery, or Li-ion battery, an AC adapter, or the like.

90はメモリカードやハードディスク等の記録媒体とのインタフェース、92はメモリカードやハードディスク等の記録媒体と接続を行うコネクタである。   Reference numeral 90 denotes an interface with a recording medium such as a memory card or hard disk, and reference numeral 92 denotes a connector for connecting to a recording medium such as a memory card or hard disk.

102は、撮像装置100のレンズ10を含む撮像部を覆う事により、撮像部の汚れや破損を防止するバリアである保護手段である。   Reference numeral 102 denotes protection means that is a barrier that prevents the imaging unit from being soiled or damaged by covering the imaging unit including the lens 10 of the imaging device 100.

104は光学ファインダであり、画像表示部28による電子ファインダ機能を使用すること無しに、光学ファインダのみを用いて撮影を行うことが可能である。また、光学ファインダ104内には、表示部54の一部の機能、例えば、合焦表示、手振れ警告表示、ストロボ充電表示、シャッタスピード表示、絞り値表示、露出補正表示などが設置されている。   Reference numeral 104 denotes an optical viewfinder, which can take an image using only the optical viewfinder without using the electronic viewfinder function of the image display unit 28. In the optical viewfinder 104, some functions of the display unit 54, for example, focus display, camera shake warning display, strobe charge display, shutter speed display, aperture value display, exposure correction display, and the like are installed.

200はメモリカードやハードディスク等の記録媒体である。記録媒体200は、半導体メモリや磁気ディスク等から構成される記録部202、撮像装置100とのインタフェース204、撮像装置100と接続を行うコネクタ206を備えている。なお、記録媒体200は本実施形態では撮像装置100に内蔵される構成として説明しているが、外部に構成されることも本発明の範疇内である。   Reference numeral 200 denotes a recording medium such as a memory card or a hard disk. The recording medium 200 includes a recording unit 202 composed of a semiconductor memory, a magnetic disk, and the like, an interface 204 with the imaging device 100, and a connector 206 that connects to the imaging device 100. Although the recording medium 200 is described as a configuration built in the imaging apparatus 100 in the present embodiment, it is also within the scope of the present invention to be configured outside.

以下に説明する実施形態は、主に画像処理回路20及び圧縮・伸張回路32によって実現されるものである。先ず、本発明の第1の実施形態について説明する。本実施形態における、カラー画像の可逆圧縮方法のメインルーチンを図1に示す。   The embodiment described below is mainly realized by the image processing circuit 20 and the compression / decompression circuit 32. First, a first embodiment of the present invention will be described. The main routine of the lossless compression method for color images in this embodiment is shown in FIG.

本実施形態は図5に示したように各画素に8ビットのRGB色情報を有するVGA画像(640*480画素)51を可逆圧縮するものであり、前記画像はまず大きさ80*60画素の部分画像52に64分割される(ステップS1)。   In the present embodiment, as shown in FIG. 5, a VGA image (640 * 480 pixels) 51 having 8-bit RGB color information in each pixel is reversibly compressed, and the image has a size of 80 * 60 pixels. The image is divided into 64 partial images 52 (step S1).

次いで下記の式7〜9に基づいて、輝度プレーン(Y)と色差プレーン(Cb、Cr)の分離が行われる(ステップS2)。
Y=R+2*G+B・・・(式7)
Cb=B−G・・・(式8)
Cr=R−G・・・(式9)
ここでR、G、Bは各画素での画素値(RGB値)である。
Next, the luminance plane (Y) and the color difference planes (Cb, Cr) are separated based on the following formulas 7 to 9 (step S2).
Y = R + 2 * G + B (Formula 7)
Cb = BG (Formula 8)
Cr = R−G (Formula 9)
Here, R, G, and B are pixel values (RGB values) at each pixel.

次いで各部分画像の輝度プレーンYにおいて、画素値の傾斜補正がy方向のみで行われる(ステップS3)。これはまず行(j)毎に各画素値Y(i,j)を加算した値Y(j)を求める。
Y(j)=ΣY(i,j)・・・(式10)
和はiに対して取られる。
Next, in the luminance plane Y of each partial image, the inclination correction of the pixel value is performed only in the y direction (step S3). First, a value Y (j) obtained by adding each pixel value Y (i, j) for each row (j) is obtained.
Y (j) = ΣY (i, j) (Equation 10)
The sum is taken over i.

それを下記の式11によって1次式で近似する。
Y(j)p=a*i+b・・・(式11)
上記aやbの値は、例えば公知の最小自乗法などで求められる。ここでY(j)pは先のY(j)の近似値である。
It is approximated by a linear expression by the following expression 11.
Y (j) p = a * i + b (Formula 11)
The values of a and b are obtained by, for example, a known least square method. Here, Y (j) p is an approximate value of the previous Y (j).

このY(j)pを先の画素値Y(i,j)から引く事によって、前記傾斜補正が行われる。
ΔY(i,j)=Y(i,j)−Y(j)p・・・(式12)
The tilt correction is performed by subtracting Y (j) p from the previous pixel value Y (i, j).
ΔY (i, j) = Y (i, j) −Y (j) p (Equation 12)

実際に符号化されるのは、式12のΔY(i,j)で表される量(差分)である。また先の2つの係数a、b(情報量16ビット)は、前記各部分画像毎に記録、保存される。   What is actually encoded is the amount (difference) represented by ΔY (i, j) in Equation 12. The previous two coefficients a and b (information amount of 16 bits) are recorded and stored for each partial image.

次いで色差プレーンの座標変換が、各部分画像毎に独立に行われる(ステップS4)。まず最初に各色差プレーン(CrまたはCb)で、部分画像全体の画素に対して画素値Cr(i,j)、Cb(i,j)のヒストグラムが取られる。そのヒストグラム中での最大頻度を示す値を各々Crfreq、Cbfreqとすると、式13で決められる回転角θで色座標(Cr、Cb)を回転してできる、式14、式15で示される新たな色座標(K1,K2)を用いて、更にヒストグラムを求める。色座標(Cr、Cb)と色座標(K1,K2)との関係を図7に示す。
tanθ=Cbfreq/Crfreq・・・(式13)
K1=Cr*cosθ+Cb*sinθ・・・(式14)
K2=−Cr*sinθ+Cb*cosθ・・・(式15)
Next, coordinate conversion of the color difference plane is performed independently for each partial image (step S4). First, in each color difference plane (Cr or Cb), a histogram of pixel values Cr (i, j) and Cb (i, j) is taken for the pixels of the entire partial image. If the values indicating the maximum frequency in the histogram are Crfreq and Cbfreq, respectively, new coordinates shown in Equations 14 and 15 can be obtained by rotating the color coordinates (Cr, Cb) at the rotation angle θ determined in Equation 13. A histogram is further obtained using the color coordinates (K1, K2). The relationship between the color coordinates (Cr, Cb) and the color coordinates (K1, K2) is shown in FIG.
tan θ = Cbfreq / Crfreq (Equation 13)
K1 = Cr * cos θ + Cb * sin θ (Expression 14)
K2 = −Cr * sin θ + Cb * cos θ (Expression 15)

そして前記両色差プレーンK1、K2で、下記の量を計算する。
H=−ΣPi*(logPi/log2)・・・(式16)
和はiに対して取られる。
Pi=N(Kn(i))/(80*60)・・・(式17)
式16は良く知られた、圧縮限界を示す式(エントロピー式)である。ここでKn(i)は、各色差プレーンのヒストグラムにおける、値iを示す度数である。また80*60は、前記部分画像の総画素数である。従ってlogPiは、その値iの度数が示す確率である。
Then, the following quantities are calculated using the color difference planes K1 and K2.
H = −ΣPi * (logPi / log2) (Equation 16)
The sum is taken for i.
Pi = N (Kn (i)) / (80 * 60) (Expression 17)
Expression 16 is a well-known expression (entropy expression) indicating the compression limit. Here, Kn (i) is a frequency indicating the value i in the histogram of each color difference plane. 80 * 60 is the total number of pixels of the partial image. Therefore, logPi is a probability indicated by the frequency of the value i.

各色差プレーンK1、K2で求めた式16の値H1、H2の和H1+H2が予め決められた値(閾値)よりも小さい場合には、前記色差座標K1、K2を符号化座標に採用する。また前記和が前記閾値を越える場合には、先の最頻値Crfreq、Cbfreqの周囲あるいはセカンドピーク(次に頻度が高い値)の周囲についても、同様な調査を行う。それでも前記関係を満足しない場合には、前記和の中で最も小さな和を示す色差座標を前記符号化の座標に採用する。   When the sum H1 + H2 of the values H1 and H2 of Expression 16 obtained by the color difference planes K1 and K2 is smaller than a predetermined value (threshold value), the color difference coordinates K1 and K2 are adopted as encoded coordinates. When the sum exceeds the threshold value, the same investigation is also performed around the previous mode values Crfreq and Cbfreq or around the second peak (the next most frequent value). If the relationship is still not satisfied, the color difference coordinate indicating the smallest sum among the sums is adopted as the encoding coordinate.

本実施形態が本ステップで行っている事は、前記色情報を一方の座標(この場合はK1)に集中して符号化効率を高める工夫である。   What this embodiment is doing in this step is a device that concentrates the color information on one coordinate (in this case, K1) to increase the coding efficiency.

次に公知の予測符号化手法を用いて、符号化の為の差分情報を求める。その為には前記予測に用いられる画素予測値を求める必要が有るが、本実施形態では前記予測を図8に示したように注目画素の5画素外方の8方向から、予測を行う(ステップS5)。   Next, difference information for encoding is obtained using a known predictive encoding method. For this purpose, it is necessary to obtain a predicted pixel value used for the prediction, but in this embodiment, the prediction is performed from eight directions outside the five pixels of the target pixel as shown in FIG. S5).

注目画素をP0、それから1ピッチ離れた画素をP1、以下同様に5ピッチ離れた画素をP5とすると、公知の線形予測法(LPC)によって予測誤差ΔPは、次の式18、式19によって求められる。
ΔP=P0−Pproj・・・(式18)
Pproj=−u*P1−v*P2−w*P3−x*P4−y*P5・・・(式19)
ここでu,v,w,x,yの各係数は、前記部分画像全体の画素に対して最適化されている。
Assuming that the pixel of interest is P0, the pixel 1 pitch away from it is P1, and the pixel 5 pitches apart is P5, the prediction error ΔP is obtained by the following linear prediction method (LPC) by the following equations 18 and 19. It is done.
ΔP = P0−Pproj (Equation 18)
Pproj = -u * P1-v * P2-w * P3-x * P4-y * P5 (Equation 19)
Here, the coefficients of u, v, w, x, and y are optimized for the pixels of the entire partial image.

前記予測誤差ΔPの最小自乗和は、前記予測の方向毎に異なる値を示す。そのうち最小の最小自乗和を示す方向を、本実施形態は予測の最適方向として採用する。   The least square sum of the prediction error ΔP indicates a different value for each direction of the prediction. Of these, the direction showing the minimum least square sum is adopted as the optimum direction of prediction in the present embodiment.

最適な予測方向が求まったならば、次は各画素の符号化方向を決める(ステップS6)。図9に示すように、符号化の方向94は前記予測の最適方向93と同じ方向である。
本実施形態では各部分画像の各行毎に、並列処理的な符号化が行われる。その際に、右側の出発画素91から4画素分は式19では符号化が不可能であるが、存在しない画素の値は0であるとして式19を解釈、流用する。最後に公知の算術符号化で符号化が行われる(ステップS7)。
Once the optimum prediction direction has been determined, the encoding direction of each pixel is next determined (step S6). As shown in FIG. 9, the encoding direction 94 is the same as the optimal direction 93 of the prediction.
In the present embodiment, parallel processing encoding is performed for each row of each partial image. At that time, the four pixels from the right starting pixel 91 cannot be encoded by the equation 19, but the equation 19 is interpreted and diverted assuming that the value of the nonexistent pixel is 0. Finally, encoding is performed by known arithmetic encoding (step S7).

本実施形態によれば、輝度プレーンの傾斜補正を行っているため、ランモード採用の割合が増加し、圧縮率が改善される。また部分画像毎に色差座標を変更しているため、それだけその部分画像に含まれる特定色を効率良く符号化可能である。またその符号化も、最適な方向を選択して符号化を行っているため、前記符号化の効率は良好である。   According to the present embodiment, since the inclination correction of the luminance plane is performed, the ratio of adopting the run mode is increased and the compression rate is improved. In addition, since the color difference coordinates are changed for each partial image, the specific color included in the partial image can be efficiently encoded. In addition, since the encoding is performed by selecting the optimum direction, the encoding efficiency is good.

本実施形態はVGAカラー画像以外の任意のカラー画像にも、用いる事ができる。またその部分画像への分割数や分割画像の大きさも任意である。また本実施形態に用いる式7〜式9で示される輝度色差プレーンの分離方法は、その他の公知の方法でも構わない。例えば、輝度YはY=R+G+Bで有っても良い。   This embodiment can also be used for any color image other than the VGA color image. The number of divisions into the partial images and the size of the divided images are also arbitrary. In addition, the luminance / chrominance plane separation method represented by Expression 7 to Expression 9 used in the present embodiment may be other known methods. For example, the luminance Y may be Y = R + G + B.

また式12で示される輝度プレーンの傾き補正は、一次式の補正だけでなくより高次の補正式でも構わない。その場合にはその増えた係数分だけ多少、画像圧縮に必要な情報量は増加する。また前記輝度の補正は、y方向だけでなく、x方向(水平方向)に行っても無論構わない。   Further, the correction of the inclination of the luminance plane expressed by Expression 12 is not limited to a linear expression, but may be a higher-order correction expression. In that case, the amount of information required for image compression slightly increases by the increased coefficient. Of course, the luminance correction may be performed not only in the y direction but also in the x direction (horizontal direction).

また色座標の選定は式14、式15で表現される座標回転だけでなく、先の式1、式2で表されるより一般的な線形式で有っても、勿論構わない。また本実施形態は可逆圧縮を対象としているので、前記色差座標K1,K2が表す階調値は、実数値であるよりも整数値である方が望ましい(計算で丸め誤差が出るため)。従って前記色差座標K1,K2の選定は、それらを考慮して決定する必要が有る。そのような座標には、下記の式20、式21のようなものがある。
K1=αCr+βCb・・・(式20)
K2=αCr−βCb・・・(式21)
ここでα、βは整数である。
In addition, the selection of the color coordinates is not limited to the coordinate rotation expressed by the equations 14 and 15, but may be of a more general line format expressed by the equations 1 and 2. In addition, since this embodiment is intended for lossless compression, it is desirable that the gradation values represented by the color difference coordinates K1 and K2 are integer values rather than real values (since a rounding error occurs in the calculation). Therefore, the selection of the color difference coordinates K1, K2 needs to be determined in consideration of them. Such coordinates include the following equations 20 and 21.
K1 = αCr + βCb (Equation 20)
K2 = αCr−βCb (Formula 21)
Here, α and β are integers.

またK1、K2の各階調値は公知のように、最小値K1min、K2minを各々の値から引くことによって、0または正の整数とする事ができる。このようにしておくと、後の符号化が容易となる。   As is well known, each gradation value of K1 and K2 can be set to 0 or a positive integer by subtracting the minimum values K1min and K2min from the respective values. In this way, later encoding becomes easy.

また前記色差座標K1、K2の選択の際に使用する選択基準は何も先のエントロピー式である必要はなく、例えば従来コーデックのTMWのように、実際に圧縮を行ってそのコードサイズを知り最小なコードを生成するK1、K2を選択しても良い。   In addition, the selection criteria used for selecting the color difference coordinates K1 and K2 need not be the entropy type ahead, and for example, as in the conventional codec TMW, the code size is actually determined by knowing the code size. K1 and K2 for generating a simple code may be selected.

また前記予測の方向は何も8方向に限る事はなく、全方位を考慮した4方向以上で有りさえすれば良い。またその次数も、その予測精度を向上させるために、画素ピッチ3以上画素を含む任意の数で良い。また前記予測は線形予測だけでなく、公知の任意の予測方法でも構わない。また符号化の方法は、公知の、例えばハフマン符号化等でも構わない。   Further, the direction of the prediction is not limited to eight directions, and may be four or more directions considering all directions. Also, the order may be any number including pixels with a pixel pitch of 3 or more in order to improve the prediction accuracy. The prediction is not limited to linear prediction, and any known prediction method may be used. The encoding method may be known, for example, Huffman encoding.

次に、本発明の第2の実施形態について説明する。本実施形態における、VGAカラー画像の可逆圧縮のメインルーチンを図2に示す。本実施形態では画像分割に先立ってオブジェクトの検出を行う。   Next, a second embodiment of the present invention will be described. FIG. 2 shows a main routine for reversible compression of a VGA color image in this embodiment. In this embodiment, an object is detected prior to image division.

まず前述のように、輝度色差プレーンの分離を行う(ステップS11)。次いで図10に示すように、前記色差プレーン101で、オブジェクト102の検出を行う(ステップ12)。   First, as described above, the luminance color difference plane is separated (step S11). Next, as shown in FIG. 10, the object 102 is detected by the color difference plane 101 (step 12).

その方法とは、各色差プレーンで画素値のヒストグラムを作成し、前記画素値がその最頻値±Δを示す領域を、前記オブジェクト102であると認識する。ここでΔの値は、256階調の場合、0から3程度の値である。前記検出されたオブジェクト102を考慮して、前記VGA画像の分割を行う(ステップS13)。   In this method, a histogram of pixel values is created for each color difference plane, and an area where the pixel values indicate the mode value ± Δ is recognized as the object 102. Here, the value of Δ is about 0 to 3 in the case of 256 gradations. The VGA image is divided in consideration of the detected object 102 (step S13).

分割の方法とは、まず最初に前記オブジェクトの横と縦の大きさLx、Lyと重心位置(Gx,Gy)を検出する。次いで前記オブジェクトの大きさと想定する分割部分画像の大きさ(通常は40*30〜160*120)とを比較して、前記分割線103のピッチを決定する。前記オブジェクト102の大きさが大きい場合には、図10に示したように複数の部分画像に跨って前記オブジェクト102が存在するようになる。   In the division method, first, the horizontal and vertical sizes Lx, Ly and the center of gravity (Gx, Gy) of the object are detected. Next, the pitch of the dividing line 103 is determined by comparing the size of the object with the size of the assumed divided partial image (usually 40 * 30 to 160 * 120). When the size of the object 102 is large, the object 102 exists across a plurality of partial images as shown in FIG.

前記画像の分割に際しては、図に示したように前記重心位置(Gx,Gy)を考慮してその分割開始位置を決定する。前記画像を分割する分割線103は、前記画像101上で等間隔に引かれる。   When the image is divided, the division start position is determined in consideration of the barycentric position (Gx, Gy) as shown in the figure. Dividing lines 103 that divide the image are drawn on the image 101 at equal intervals.

次いで前述したように、前記オブジェクト102の色に適した色差プレーンの座標系が決定される(ステップS14)。次いで、圧縮後のファイルサイズを小さくするために(つまりは圧縮率改善)、前記3枚のプレーン間での圧縮情報の共用化が検討される(ステップS15)。検討される項目と順序は、以下の通りである。
(1)プレーン枚数の削減
(2)予測方法の変更
(3)色差座標系の座標パラメータの共通化
Next, as described above, the coordinate system of the color difference plane suitable for the color of the object 102 is determined (step S14). Next, in order to reduce the file size after compression (that is, to improve the compression rate), the sharing of compression information among the three planes is considered (step S15). The items and order to be considered are as follows.
(1) Reduction of the number of planes (2) Change of prediction method (3) Coordination of coordinate parameters of color difference coordinate system

一番圧縮効率が上がるのはプレーン枚数の削減であるから、まず最初に、これの可否を検討する。その方法とは、3枚のプレーンを調べ、その各プレーンの全画素値Pn(i,j)間に、以下の関係が成立する時である。
Pm(i,j)=A*Pn(i,j)+B・・・(式22)
ここでPm(i,j)、Pn(i,j)は任意の2枚のプレーンの画素値であり、A、Bは定数である。
Since the most efficient compression efficiency is the reduction of the number of planes, first, the possibility of this is examined. The method is when three planes are examined and the following relationship is established between all pixel values Pn (i, j) of each plane.
Pm (i, j) = A * Pn (i, j) + B (Expression 22)
Here, Pm (i, j) and Pn (i, j) are pixel values of any two planes, and A and B are constants.

勿論自然画像でこのような事が生じるのは稀であるが、例えばパワーポイント等で作成した図面の場合や分割画像の全画素数が小さくなった場合には、その確率も無視できないほどに高くなる。また前記プレーンの削減の有無は、前記圧縮ファイルのヘッダ部分に書き込まれる。それに要する情報量の増大は、僅か数ビットである。   Of course, this rarely occurs in natural images, but for example in the case of drawings created with PowerPoint, etc., or when the total number of pixels in a divided image becomes small, the probability is so high that it cannot be ignored. . The presence / absence of the plane reduction is written in the header portion of the compressed file. The increase in the amount of information required is only a few bits.

次いで(2)の予測方法の変更であるが、通常の場合の符号化は各プレーン内での画素値の隣接相関を用いて行われるが、(1)ほどで無いにしても式22に近いような関係が両プレーン間で成立している場合には、前記隣接相関を用いず各プレーン間の相関を用いた方が圧縮効率が向上する場合もある。つまり前述の線形予測を用いず、符号化の対象情報として、先のPm(i,j)−A*Pn(i,j)−Bを用いる訳である。どちらを用いるかの判定は、先のエントロピー式で行う。前記隣接相関の見積もりは、前記予測方向を水平方向として求めたそれで、仮に行われる。   Next, the prediction method is changed in (2), but encoding in the normal case is performed using adjacent correlation of pixel values in each plane, but it is close to Equation 22 even if not as much as (1). When such a relationship is established between the two planes, the compression efficiency may be improved by using the correlation between the planes without using the adjacent correlation. That is, the above-described linear prediction is not used, and the previous Pm (i, j) -A * Pn (i, j) -B is used as the information to be encoded. Which one is used is determined by the previous entropy method. The estimation of the adjacent correlation is temporarily performed with the prediction direction obtained as the horizontal direction.

(3)の座標パラメータの共通化とは、部分画像毎に求めた色差座標変換係数の中で共通化できるものが存在するか、の検討である。もし共通化できるものがある場合には、前記圧縮後のファイルのヘッダに整理して書き込まれる。前記係数の共通化による情報量の削減の程度は、前記係数が示す情報量(数バイト)*共通な部分画像枚数程度である。   The common use of coordinate parameters in (3) is an examination of whether there is a common color difference coordinate conversion coefficient obtained for each partial image. If there is something that can be shared, they are organized and written in the header of the compressed file. The degree of reduction in the amount of information due to the common use of the coefficients is the amount of information indicated by the coefficients (several bytes) * the number of common partial images.

次いで前述したように最適な予測方向の検出(ステップS16)、符号化方向の決定(ステップS17)が行われる。   Next, as described above, the optimum prediction direction is detected (step S16) and the encoding direction is determined (step S17).

前記予測値の検出に他のプレーンとの相関を利用する場合には、前記ステップS16の一部の工程は省略される。最後に同様に符号化が行われる(ステップS18)。   When the correlation with other planes is used for the detection of the predicted value, a part of the step S16 is omitted. Finally, encoding is performed similarly (step S18).

本実施形態によれば、オブジェクトを考慮した画像分割が行われているので、前記連続的なオブジェクトを圧縮する際の圧縮効率が向上する。またその効果は全体に波及する。また前記プレーン間での情報共用化の検討も行われるので、更にその圧縮効率も向上する。   According to the present embodiment, since image division is performed in consideration of objects, the compression efficiency when compressing the continuous objects is improved. In addition, the effect spreads throughout. Further, since the information sharing between the planes is also studied, the compression efficiency is further improved.

また本実施形態のオブジェクトの抽出は、各プレーン間で各々別々に行われても良い。その場合には、前記部分画像への分割は別の位置、大きさ、形状になる。また前記抽出は、輝度プレーンで行われても良い。本実施形態のオブジェクトの抽出の目的は圧縮効率の向上にあるので、抽出されるオブジェクトは、必ずしも被写体オブジェクトで無くとも良い。また前記部分画像への分割は、必ずしも同じ大きさ、等ピッチでなくとも良い。また前記情報量の共用化には、先の3項目以外にも適用する事ができる。また共用の判断に用いたエントロピー式は、実際の圧縮結果、ファイルサイズ(コードサイズ)であっても構わない。   Further, the object extraction of this embodiment may be performed separately between the planes. In that case, the division into the partial images has a different position, size, and shape. The extraction may be performed using a luminance plane. Since the object extraction object of the present embodiment is to improve the compression efficiency, the extracted object is not necessarily the subject object. Further, the division into partial images does not necessarily have the same size and equal pitch. The information amount can be shared in addition to the above three items. In addition, the entropy method used for the sharing determination may be an actual compression result or a file size (code size).

次に本発明の第3の実施形態について説明する。本実施形態における、VGA画像の可逆圧縮方法のメインルーチンを図3に示す。図3のステップS21〜S24迄は、図2のステップS11〜S14と同じであるため説明は省略する。   Next, a third embodiment of the present invention will be described. FIG. 3 shows a main routine of the lossless compression method for VGA images in the present embodiment. Steps S21 to S24 in FIG. 3 are the same as steps S11 to S14 in FIG.

ステップS25のプレーン間共用化検討では、先の(1)プレーン枚数の削減工程で、任意の2枚のプレーン間相関を調べる。具体的には、先の(22)式で予想される予測値との差、予測誤差Pm(i,j)−A*Pn(i,j)−Bの自乗和を計算する。その値が予め決められた値(閾値)よりも小さい場合には、前述のように隣接相関を用いた予測方法ではなく、プレーン間の相関を用いた方法に符号化方法を変更するわけである。   In the inter-plane sharing study in step S25, the correlation between any two planes is examined in the previous (1) reduction process of the number of planes. Specifically, the difference from the predicted value predicted by the previous equation (22), the sum of squares of the prediction error Pm (i, j) −A * Pn (i, j) −B is calculated. When the value is smaller than a predetermined value (threshold value), the encoding method is changed to a method using correlation between planes instead of a prediction method using adjacent correlation as described above. .

またステップS26では同様に8方向から前記長距離相関を用いたLPC予測で、予測値と予測誤差を求める。その際、予測誤差の大きな画素に対しては、
(1)その画素座標を記憶する。
(2)大きな予測誤差を部分画像毎に設けられているヘッダ部分に記憶する。
(3)予測誤差を0と置く。
という作業(点欠陥法)で、前記大きな予測誤差による表現ビット数の増加を防ぐ。ステップS27からステップS29は、第2の実施形態と同じである。
In step S26, similarly, a prediction value and a prediction error are obtained by LPC prediction using the long distance correlation from eight directions. At that time, for pixels with a large prediction error,
(1) Store the pixel coordinates.
(2) A large prediction error is stored in a header portion provided for each partial image.
(3) The prediction error is set to 0.
In this operation (point defect method), an increase in the number of expression bits due to the large prediction error is prevented. Steps S27 to S29 are the same as those in the second embodiment.

本実施形態によれば、大きな予測誤差を示す画素を点欠陥として扱い、その画素値(予測誤差)を別途記録する事によって、前記圧縮後の情報量を減少可能である。本実施形態の点欠陥法は、例えばオブジェクト境界等に存在する階調段差を別途記録し、その中の比較的平坦、連続的なオブジェクト内部のみを効率的に符号化する事ができる。また時々見られる、デジタルカメラ等の画素欠陥補正の失敗による非連続的な輝点が存在する画像などに対しても、その悪影響を除去する事ができる。   According to the present embodiment, it is possible to reduce the amount of information after compression by treating a pixel showing a large prediction error as a point defect and separately recording the pixel value (prediction error). In the point defect method of this embodiment, for example, gradation steps existing at an object boundary or the like are separately recorded, and only a relatively flat and continuous object inside can be efficiently encoded. In addition, it is possible to remove the adverse effects of an image that includes discontinuous bright spots due to failure of pixel defect correction such as a digital camera.

次に本発明の第4の実施形態について説明する。本実施形態における、デジタルカメラの静止画像取得のメインルーチンを図4に示す。ステップS31はCCD等の撮像センサによる静止画像の撮像工程である。   Next, a fourth embodiment of the present invention will be described. FIG. 4 shows a main routine for acquiring a still image of the digital camera in this embodiment. Step S31 is a still image capturing step using an image sensor such as a CCD.

前記撮像センサは、出力として式23〜25で表される輝度Y、色差K1、K2を出力する。
Y=W=R+G+B・・・(式23)
K1=R/W・・・(式24)
K2=B/W・・・(式25)
The imaging sensor outputs luminance Y and color differences K1 and K2 expressed by Expressions 23 to 25 as outputs.
Y = W = R + G + B (Equation 23)
K1 = R / W (Equation 24)
K2 = B / W (Equation 25)

前記出力は前記撮像センサの最終段で256階調のデジタル信号に変換されている。ステップS32はその撮像したアナログ信号をフレームメモリに移送しデジタル信号として記憶する工程である。   The output is converted into a 256-gradation digital signal at the final stage of the image sensor. Step S32 is a step of transferring the captured analog signal to the frame memory and storing it as a digital signal.

前記撮像センサから出力された輝度Yや色差K1、K2信号は、ADコンバータ等で最大256階調のデジタル信号に変換される。変換されたデジタル画像情報は、前記デジタルカメラ内に存在するフレームメモリに記憶される(ステップS33)。   The luminance Y and color difference K1, K2 signals output from the image sensor are converted into digital signals with a maximum of 256 gradations by an AD converter or the like. The converted digital image information is stored in a frame memory existing in the digital camera (step S33).

ステップS34では前述したように画像分割が行われ、各部分画像毎に最適な色差プレーン座標が選択される(ステップS35)。その選択方法とは、式26、式27に示すとおりである。
J1=αK1+βK2・・・(式26)
J2=αK1−βK2・・・(式27)
ここでJ1、J2は新しい色差座標系であり、α、βは整数である。
In step S34, image division is performed as described above, and optimal color difference plane coordinates are selected for each partial image (step S35). The selection method is as shown in Expression 26 and Expression 27.
J1 = αK1 + βK2 (Equation 26)
J2 = αK1-βK2 (Formula 27)
Here, J1 and J2 are new color difference coordinate systems, and α and β are integers.

次いで算術符号により圧縮が行われ(ステップS36)、圧縮された画像は記録媒体に記録される(ステップS37)。   Next, compression is performed using arithmetic codes (step S36), and the compressed image is recorded on a recording medium (step S37).

本実施形態によれば前記色差プレーンが前記輝度プレーンと完全に分離しているため、仮に被写体オブジェクトに当たる照明光の強度分布にムラが有る場合にも、前記色差プレーンでは連続な画素値となるため、ランモードや予測符号化の効率が向上する。その為、出力される圧縮画像のファイルサイズも小さくなる。   According to the present embodiment, since the color difference plane is completely separated from the luminance plane, even if there is unevenness in the intensity distribution of illumination light hitting the subject object, the color difference plane has continuous pixel values. The efficiency of run mode and predictive coding is improved. For this reason, the file size of the output compressed image is also reduced.

本実施形態に用いる色差座標は何もR/WやB/Wに限ることはなく、例えばR/GやB/Gその他で有っても構わない。選択のポイントは、輝度プレーンとは完全に分離している事である。また本実施形態はデジタルカメラだけではなく、他の撮像系に容易に適用する事ができる。   The color difference coordinates used in this embodiment are not limited to R / W and B / W, and may be R / G, B / G, or the like. The point of selection is that it is completely separated from the luminance plane. Further, the present embodiment can be easily applied not only to a digital camera but also to other imaging systems.

以上のように、本発明の実施形態によれば、全体画像を分割して生じる各部分画像の性質に応じた符号化手法が各々の画像符号化で採用するため、全体画像の圧縮効率を向上させることが可能となる。   As described above, according to the embodiment of the present invention, the encoding method according to the property of each partial image generated by dividing the entire image is adopted in each image encoding, so the compression efficiency of the entire image is improved. It becomes possible to make it.

また、本発明の目的は、前述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体を、システム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU)が記憶媒体に格納されたプログラムコードを読み出し実行することによっても、達成されることは言うまでもない。   Another object of the present invention is to supply a storage medium storing software program codes for realizing the functions of the above-described embodiments to a system or apparatus, and the computer (or CPU or MPU) of the system or apparatus stores the storage medium. Needless to say, this can also be achieved by reading and executing the program code stored in.

この場合、記憶媒体から読み出されたプログラムコード自体が前述した実施形態の機能を実現することになり、プログラムコード自体及びそのプログラムコードを記憶した記憶媒体は本発明を構成することになる。   In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the program code itself and the storage medium storing the program code constitute the present invention.

プログラムコードを供給するための記憶媒体としては、例えば、フレキシブルディスク、ハードディスク、光ディスク、光磁気ディスク、CD−ROM、CD−R、磁気テープ、不揮発性のメモリカード、ROM等を用いることができる。   As a storage medium for supplying the program code, for example, a flexible disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a CD-R, a magnetic tape, a nonvolatile memory card, a ROM, or the like can be used.

また、コンピュータが読み出したプログラムコードを実行することにより、前述した実施形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼動しているOS(基本システム或いはオペレーティングシステム)などが実際の処理の一部又は全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。   Further, by executing the program code read by the computer, not only the functions of the above-described embodiments are realized, but also an OS (basic system or operating system) running on the computer based on the instruction of the program code. Needless to say, a case where the functions of the above-described embodiment are realized by performing part or all of the actual processing and the processing is included.

さらに、記憶媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込まれた後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPU等が実際の処理の一部又は全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。   Further, after the program code read from the storage medium is written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, the function is determined based on the instruction of the program code. It goes without saying that the CPU or the like provided in the expansion board or function expansion unit performs part or all of the actual processing and the functions of the above-described embodiments are realized by the processing.

本発明の第1の実施形態におけるカラー画像の可逆圧縮方法のメインルーチンを示す図である。It is a figure which shows the main routine of the reversible compression method of the color image in the 1st Embodiment of this invention. 本発明の第2の実施形態におけるカラー画像の可逆圧縮方法のメインルーチンを示す図である。It is a figure which shows the main routine of the reversible compression method of the color image in the 2nd Embodiment of this invention. 本発明の第3の実施形態におけるカラー画像の可逆圧縮方法のメインルーチンを示す図である。It is a figure which shows the main routine of the lossless compression method of the color image in the 3rd Embodiment of this invention. 本発明の第4の実施形態におけるカラー画像の可逆圧縮方法のメインルーチンを示す図である。It is a figure which shows the main routine of the lossless compression method of the color image in the 4th Embodiment of this invention. VGA画像に対する分割方法を説明するための図である。It is a figure for demonstrating the division | segmentation method with respect to a VGA image. 上下方向の輝度差を説明するための図である。It is a figure for demonstrating the luminance difference of an up-down direction. 色座標(Cr、Cb)と新たな色座標(K1,K2)との関係を示す図である。It is a figure which shows the relationship between color coordinates (Cr, Cb) and new color coordinates (K1, K2). 画素予測値を求めるための予測方向を説明するための図である。It is a figure for demonstrating the prediction direction for calculating | requiring a pixel prediction value. 符号化方向と画素予測値を求めるための予測方向との関係を示す図である。It is a figure which shows the relationship between an encoding direction and the prediction direction for calculating | requiring a pixel prediction value. オブジェクトと分割画像との関係を説明するための図である。It is a figure for demonstrating the relationship between an object and a divided image. 注目画素と周辺画素との相関を説明するための図である。It is a figure for demonstrating the correlation with an attention pixel and a surrounding pixel. 本発明の実施形態に適用可能な撮像装置の構成を示す図である。It is a figure which shows the structure of the imaging device applicable to embodiment of this invention.

符号の説明Explanation of symbols

10:撮影レンズ
12:シャッタ
14:撮像素子
15:CDS回路
16:PGA
17:A/D変換器
18:タイミング発生回路
20:画像処理回路
22:メモリ制御回路
24:画像表示メモリ
26:D/A変換器
28:画像表示部
30:メモリ
32:画像圧縮・伸長回路
40:露光制御手段
42:測距制御手段
44:ズーム制御手段
46:バリア制御手段
48:ストロボ
50:システム制御回路
52:メモリ
54:表示部
56:不揮発性メモリ
60:電源スイッチ(メインスイッチ)
62:シャッタスイッチSW1
64:シャッタスイッチSW2
70:操作部
72:モードダイアルスイッチ
80:電源制御手段
82、84、92、206:コネクタ
86:電源手段
90、204:インタフェース
100:撮像装置
102:保護手段
104:光学ファインダ
200:記録媒体
202:記録部
10: Shooting lens 12: Shutter 14: Image sensor 15: CDS circuit 16: PGA
17: A / D converter 18: Timing generation circuit 20: Image processing circuit 22: Memory control circuit 24: Image display memory 26: D / A converter 28: Image display unit 30: Memory 32: Image compression / decompression circuit 40 : Exposure control means 42: Distance measurement control means 44: Zoom control means 46: Barrier control means 48: Strobe 50: System control circuit 52: Memory 54: Display unit 56: Non-volatile memory 60: Power switch (main switch)
62: Shutter switch SW1
64: Shutter switch SW2
70: Operation unit 72: Mode dial switch 80: Power supply control means 82, 84, 92, 206: Connector 86: Power supply means 90, 204: Interface 100: Imaging device 102: Protection means 104: Optical viewfinder 200: Recording medium 202: Recording section

Claims (15)

少なくとも1枚の輝度を示す輝度プレーンと少なくとも1枚の色差を示す色差プレーンとに画像データを分離する分離手段と、
前記輝度プレーン内に存在する輝度差の補正を行う傾斜補正手段と、
前記傾斜補正手段による輝度差の補正処理の後に前記画像データの符号化処理を行う符号化処理手段とを有すること特徴とする符号化処理装置。
Separating means for separating image data into a luminance plane indicating at least one luminance and a color difference plane indicating at least one color difference;
Inclination correction means for correcting a luminance difference existing in the luminance plane;
An encoding processing apparatus comprising encoding processing means for performing encoding processing of the image data after luminance difference correction processing by the inclination correction means.
前記傾斜補正手段は、前記輝度プレーン内の上下方向の輝度差を補正することを特徴とする請求項1に記載の符号化処理装置。   The encoding processing apparatus according to claim 1, wherein the inclination correction unit corrects a luminance difference in a vertical direction in the luminance plane. 少なくとも2枚の前記色差プレーン内で最大頻度を示す値に基づいて、前記色差プレーンの色座標変換を行う座標変換手段を更に有し、
前記符号化処理手段は、前記座標変換手段により座標変換された前記色差プレーンを符号化処理に用いることを特徴とする請求項1又は2に記載の符号化処理装置。
Coordinate conversion means for performing color coordinate conversion of the color difference plane based on a value indicating the maximum frequency in at least two of the color difference planes;
The encoding processing apparatus according to claim 1, wherein the encoding processing unit uses the color difference plane coordinate-converted by the coordinate conversion unit for encoding processing.
注目画素を基点とする複数方向から夫々、予測誤差を求める予測誤差算出手段と、
前記複数方向毎に夫々求められた予測誤差に基づいて、前記注目画素の画素値を予測するための方向を決定する予測方向決定手段とを更に有し、
前記予測処理手段は、前記予測方向決定手段により決定された予測方向に基づいて、咳画像データの符号化方向を決定することを特徴とする請求項1乃至3の何れか1項に記載の符号化処理装置。
A prediction error calculation means for obtaining a prediction error from each of a plurality of directions based on the target pixel;
Prediction direction determining means for determining a direction for predicting the pixel value of the pixel of interest based on the prediction error obtained for each of the plurality of directions;
The code according to any one of claims 1 to 3, wherein the prediction processing means determines a coding direction of cough image data based on the prediction direction determined by the prediction direction determination means. Processing equipment.
前記予測誤差算出手段は、前記複数方向の夫々について前記注目画素から少なくとも5ピッチ以上離れた画素まで用いて予測誤差を求めることを特徴とする請求項4に記載の符号化処理装置。   The encoding processing apparatus according to claim 4, wherein the prediction error calculation unit obtains a prediction error by using pixels up to at least 5 pitches away from the target pixel in each of the plurality of directions. 少なくとも1枚の輝度を示す輝度プレーンと少なくとも1枚の色差を示す色差プレーンとに画像データを分離する分離手段と、
前記輝度プレーン及び前記色差プレーン間の相関に基づいて、前記輝度プレーン及び前記色差プレーンのうちから少なくとも1枚のプレーンを削減するプレーン削減手段と、
前記プレーン削減手段によるプレーン削減処理の後に前記画像データの符号化処理を行う符号化処理手段とを有することを特徴とする符号化処理装置。
Separating means for separating image data into a luminance plane indicating at least one luminance and a color difference plane indicating at least one color difference;
Plane reduction means for reducing at least one of the luminance plane and the chrominance plane based on the correlation between the luminance plane and the chrominance plane;
An encoding processing apparatus comprising: encoding processing means for performing encoding processing of the image data after plane reduction processing by the plane reduction means.
前記輝度プレーン及び前記色差プレーン間の相関に基づいて、プレーン間の相関を用いて注目画素の画素値を予測する画素値予測手段を更に有し、
前記符号化処理手段は、前記画素値予測手段により予測される画素値を用いて前記画像データの符号化処理を行うことを特徴とする請求項6に記載の符号化処理装置。
Based on the correlation between the luminance plane and the color difference plane, further comprising a pixel value prediction means for predicting the pixel value of the target pixel using the correlation between the planes,
The encoding processing apparatus according to claim 6, wherein the encoding processing unit performs encoding processing of the image data using a pixel value predicted by the pixel value prediction unit.
前記色差プレーンを複数に分割する分割手段と、
前記色差プレーン内で最大頻度を示す値に基づいて、前記色差プレーンの色座標変換を行う座標変換手段と、
前記座標変換手段による色座標変換処理にて用いられる色座標変換処理に係る情報を、前記分割手段による分割領域間で共用する情報共用手段とを有することを特徴とする請求項6又は7に記載の符号化処理装置。
A dividing means for dividing the color difference plane into a plurality of parts;
Coordinate conversion means for performing color coordinate conversion of the color difference plane based on a value indicating the maximum frequency in the color difference plane;
8. The information sharing means for sharing information related to the color coordinate conversion process used in the color coordinate conversion process by the coordinate conversion means between the divided areas by the dividing means. Encoding processing apparatus.
前記分割手段は、前記画像データ内に存在するオブジェクトの大きさに基づいて、前記分割領域の大きさを決定することを特徴とする請求項8に記載の符号化処理装置。   9. The encoding processing apparatus according to claim 8, wherein the dividing unit determines the size of the divided area based on the size of an object existing in the image data. 前記分割手段は、前記オブジェクトの重心位置に基づいて、分割の開始位置を定め、前記開始位置から分割線を平行移動させて分割領域を決定することを特徴とする請求項8又は9に記載の符号化処理装置。   10. The division unit according to claim 8 or 9, wherein the division unit determines a division start position based on a center of gravity position of the object, and determines a division region by translating a division line from the start position. Encoding processing device. 前記予測誤差算出手段により算出された前記予測誤差が所定の値より大きい場合、前記予測誤差を所定の値に変更する予測誤差値変更手段を更に有することを特徴とする請求項4に記載の符号化処理装置。   The code according to claim 4, further comprising prediction error value changing means for changing the prediction error to a predetermined value when the prediction error calculated by the prediction error calculating means is larger than a predetermined value. Processing equipment. 画像データの符号化処理を行う符号化処理装置による符号化処理方法であって、
少なくとも1枚の輝度を示す輝度プレーンと少なくとも1枚の色差を示す色差プレーンとに画像データを分離する分離ステップと、
前記輝度プレーン内に存在する輝度差の補正を行う傾斜補正ステップと、
前記傾斜補正ステップによる輝度差の補正処理の後に前記画像データの符号化処理を行う符号化処理ステップとを含むこと特徴とする符号化処理方法。
An encoding processing method by an encoding processing device for encoding image data,
A separation step of separating image data into a luminance plane indicating at least one luminance and a color difference plane indicating at least one color difference;
An inclination correction step for correcting a luminance difference existing in the luminance plane;
An encoding processing step of performing encoding processing of the image data after the luminance difference correction processing in the inclination correction step.
画像データの符号化処理を行う符号化処理装置による符号化処理方法であって、
少なくとも1枚の輝度を示す輝度プレーンと少なくとも1枚の色差を示す色差プレーンとに画像データを分離する分離ステップと、
前記輝度プレーン及び前記色差プレーン間の相関に基づいて、前記輝度プレーン及び前記色差プレーンのうちから少なくとも1枚のプレーンを削減するプレーン削減ステップと、
前記プレーン削減ステップによるプレーン削減処理の後に前記画像データの符号化処理を行う符号化処理ステップとを含むことを特徴とする符号化処理方法。
An encoding processing method by an encoding processing device for encoding image data,
A separation step of separating image data into a luminance plane indicating at least one luminance and a color difference plane indicating at least one color difference;
A plane reduction step of reducing at least one of the luminance plane and the chrominance plane based on the correlation between the luminance plane and the chrominance plane;
And a coding processing step of performing coding processing of the image data after the plane reduction processing in the plane reduction step.
請求項12又は13に記載の符号化処理方法をコンピュータに実行させるためのプログラム。   A program for causing a computer to execute the encoding processing method according to claim 12 or 13. 請求項14に記載のプログラムを記録したコンピュータ読み取り可能な記録媒体。   The computer-readable recording medium which recorded the program of Claim 14.
JP2005164413A 2005-06-03 2005-06-03 Coding device and coding method Pending JP2006340198A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005164413A JP2006340198A (en) 2005-06-03 2005-06-03 Coding device and coding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005164413A JP2006340198A (en) 2005-06-03 2005-06-03 Coding device and coding method

Publications (1)

Publication Number Publication Date
JP2006340198A true JP2006340198A (en) 2006-12-14

Family

ID=37560321

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005164413A Pending JP2006340198A (en) 2005-06-03 2005-06-03 Coding device and coding method

Country Status (1)

Country Link
JP (1) JP2006340198A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014123846A (en) * 2012-12-20 2014-07-03 Olympus Corp Imaging apparatus and imaging method
JP2020072458A (en) * 2018-11-02 2020-05-07 日本放送協会 Image encoder, image decoder, and program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014123846A (en) * 2012-12-20 2014-07-03 Olympus Corp Imaging apparatus and imaging method
JP2020072458A (en) * 2018-11-02 2020-05-07 日本放送協会 Image encoder, image decoder, and program
JP7291471B2 (en) 2018-11-02 2023-06-15 日本放送協会 Image encoding device, image decoding device, and program

Similar Documents

Publication Publication Date Title
US7733389B2 (en) Image capturing apparatus having electronic zoom function
CN101489051B (en) Image processing apparatus and image processing method and image capturing apparatus
US8089527B2 (en) Image capturing apparatus, image capturing method and storage medium
US20170024606A1 (en) Face detection device, imaging apparatus, and face detection method
JP4818031B2 (en) Image processing apparatus and image processing method
US8335399B2 (en) Image processing apparatus, control method therefor, and program
TW200937351A (en) Image processing apparatus and image processing method
JP2009003011A (en) Image display device, imaging apparatus, image reproducing device, and image display method
US20160117803A1 (en) Image processing apparatus capable of properly emphasizing differences in brightness between bright spots, image processing method, and storage medium
US20170280066A1 (en) Image processing method by image processing apparatus
JP2014126803A (en) Image processing apparatus, image processing method, and image processing program
US7505069B2 (en) Method and apparatus for maintaining consistent white balance in successive digital images
US8717457B2 (en) Adaptive spectral imaging for video capture
KR20100113864A (en) Digital image signal processing method, apparatus applying the method and medium for recording the method
JP2013165488A (en) Image processing apparatus, image capturing apparatus, and program
US20190304071A1 (en) Image processing apparatus, method for controlling the same, and recording medium
US8736739B2 (en) Imaging apparatus, imaging control method, and program
CN107295255B (en) Shooting mode determining method and device and terminal
US20130208144A1 (en) Image processing device, image processing method, image processing program
US20020008774A1 (en) Prompter and signal processing device therefor
JP2006340198A (en) Coding device and coding method
JP2006157432A (en) Three-dimensional photographic apparatus and photographic method of three-dimensional image
CN100534136C (en) Image pick-up device
US11405562B2 (en) Image processing apparatus, method of controlling the same, image capturing apparatus, and storage medium
EP2515543B1 (en) Image capturing apparatus and image capturing method