JP2017085556A - Image processing apparatus, imaging apparatus, image processing method, and program - Google Patents

Image processing apparatus, imaging apparatus, image processing method, and program Download PDF

Info

Publication number
JP2017085556A
JP2017085556A JP2016196000A JP2016196000A JP2017085556A JP 2017085556 A JP2017085556 A JP 2017085556A JP 2016196000 A JP2016196000 A JP 2016196000A JP 2016196000 A JP2016196000 A JP 2016196000A JP 2017085556 A JP2017085556 A JP 2017085556A
Authority
JP
Japan
Prior art keywords
plane
image data
code amount
target code
sum
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
Application number
JP2016196000A
Other languages
Japanese (ja)
Other versions
JP6875817B2 (en
Inventor
東 克彦
Katsuhiko Azuma
克彦 東
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 US15/333,403 priority Critical patent/US10032252B2/en
Publication of JP2017085556A publication Critical patent/JP2017085556A/en
Application granted granted Critical
Publication of JP6875817B2 publication Critical patent/JP6875817B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a technique for enabling efficient encoding of RAW data.SOLUTION: An image processing apparatus for encoding image data of a Bayer array, comprises: color separation means 121 that separates a plurality of color components constructing image data into a plurality of plane image data on the basis of a Bayer array; sum plane generation means 124 that generates plane image data of a sum plane by performing addition of components having the same color among from the plurality of plane image data; difference plane generation means 125 that generates plane image data of a difference plane by performing subtraction of components having the same color; and encoding means for performing compression encoding of plane image data that performs compression encoding of plane image data of a sum plane and a difference plane.SELECTED DRAWING: Figure 1B

Description

本発明は、画像処理装置、撮像装置、画像処理方法及びプログラムに関する。 The present invention relates to an image processing device, an imaging device, an image processing method, and a program.

昨今のデジタルカメラやデジタルカムコーダー等の撮像装置は、撮像素子にCCDセンサまたはCMOSセンサを採用している。それらのセンサは主に単板式で構成されており、センサ表面のカラーフィルターアレイ(以下、CFAと呼称する)によって1つの画素で1つの色成分(例えばRGBの内の1つ)の画素値を取得する。CFAを用いることで、例えば図2(a)に示すようなR(赤)、G0(緑)、B(青)、G1(緑)の周期的なパターンで配置されたベイヤー配列の画像データ(以下、RAWデータと呼称する)が得られる。人間の視覚が輝度成分に対し、高い感度を持っていることから、図2(a)のRAWデータは輝度成分を多く含む緑成分が赤成分や青成分に比べ2倍の画素数を割り当てられている。RAWデータは前述した通り、1画素に1つの色成分の情報しか持たないため、デモザイク処理を用いて、1画素に対して赤、青、緑の画素値を生成する必要がある。「デモザイク」(de-mosaic)処理とは、各画素に対してその周辺画素から足りない色情報を集め与えることで色情報を補完し、フルカラー画像を作り出す処理である。   Recent imaging apparatuses such as digital cameras and digital camcorders employ CCD sensors or CMOS sensors as imaging elements. These sensors are mainly composed of a single plate type, and a pixel value of one color component (for example, one of RGB) is obtained by one pixel by a color filter array (hereinafter referred to as CFA) on the sensor surface. get. By using CFA, for example, image data of a Bayer array (R) (red), G0 (green), B (blue), and G1 (green) arranged in a periodic pattern as shown in FIG. (Hereinafter referred to as RAW data). Since human vision has high sensitivity to the luminance component, the RAW data in FIG. 2 (a) is assigned twice as many pixels as the green component containing the luminance component compared to the red and blue components. ing. Since RAW data has only one color component information per pixel as described above, it is necessary to generate red, blue, and green pixel values for one pixel using demosaic processing. The “de-mosaic” process is a process of creating a full-color image by complementing color information by collecting and giving missing color information from surrounding pixels to each pixel.

一般に、撮像装置においては、デモザイクによって得られたRGB信号、あるいはRGB信号から変換して得られたYUV信号の画像データを符号化して記録する。一方、近年では、デモザイク前のRAWデータを符号化して記録する方法も提案されている。   In general, an imaging apparatus encodes and records image data of an RGB signal obtained by demosaicing or a YUV signal obtained by conversion from an RGB signal. On the other hand, in recent years, a method of encoding and recording RAW data before demosaicing has been proposed.

例えば、特許文献1には、RAWデータを信号成分毎(R、G0、B、G1)に分類して4つのコンポーネント(プレーン)に整理した後に符号化をする方法が示されている。   For example, Patent Document 1 discloses a method of encoding after classifying RAW data into signal components (R, G0, B, G1) and arranging them into four components (planes).

特開2003−125209号公報JP 2003-125209 A

しかしながら、RAWデータを各色の信号成分毎に分離することで、元々画素位置が近く、同色で相関が高いG0成分とG1成分を別プレーンに分離してしまうことになる。そのため、G0、G1それぞれにおいて隣接画素の画素値が離れてしまう場合があり、結果として符号化効率が悪くなることが考えられる。   However, by separating the RAW data for each color signal component, the G0 component and G1 component that are originally close to each other and have the same color and high correlation are separated into different planes. For this reason, the pixel values of adjacent pixels may be separated in G0 and G1, respectively, and as a result, the encoding efficiency may be deteriorated.

そこで、本発明は、RAWデータの効率的な符号化を可能とする技術を提供することを目的とする。 Therefore, an object of the present invention is to provide a technique that enables efficient encoding of RAW data.

上記課題を解決するための本発明は、ベイヤー配列の画像データを符号化する画像処理装置であって、
前記画像データを構成する複数の色成分を前記ベイヤー配列に基づき複数のプレーン画像データに分離する色分離手段と、
前記複数のプレーン画像データのうち、同色の成分同士を加算して和プレーンのプレーン画像データを生成する和プレーン生成手段と、
前記同色の成分同士を減算して差プレーンのプレーン画像データを生成する差プレーン生成手段と、
前記プレーン画像データを圧縮符号化する符号化手段であって、前記同色の成分のプレーン画像データについては、前記和プレーン及び前記差プレーンのプレーン画像データを圧縮符号化する符号化手段と
を備えることを特徴とする。
The present invention for solving the above problems is an image processing apparatus that encodes Bayer array image data,
Color separation means for separating a plurality of color components constituting the image data into a plurality of plane image data based on the Bayer array;
A sum plane generating means for generating a sum plane plane image data by adding components of the same color among the plurality of plane image data;
Difference plane generating means for subtracting the same color components to generate plane image data of a difference plane;
Coding means for compressing and coding the plain image data, the plain image data of the same color component comprising coding means for compressing and coding the plain image data of the sum plane and the difference plane It is characterized by.

本発明によれば、RAWデータの効率的な符号化が可能となる。   According to the present invention, it is possible to efficiently encode RAW data.

発明の実施形態に係る撮像装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the imaging device which concerns on embodiment of invention. 発明の実施形態に係る画像処理部の構成例を示すブロック図である。It is a block diagram which shows the structural example of the image process part which concerns on embodiment of invention. (a)ベイヤー配列を示す図、及び、(b)倍密度ベイヤー配列を示す図である。(A) The figure which shows a Bayer arrangement | sequence, (b) The figure which shows a double-density Bayer arrangement | sequence. 発明の実施形態1に係る符号化動作の一例を示すフローチャートである。It is a flowchart which shows an example of the encoding operation | movement which concerns on Embodiment 1 of invention. ベイヤー配列のRAWデータの色分離、プレーン形成方法を模式的に示す図である。It is a figure which shows typically the color separation of RAW data of a Bayer arrangement | sequence, and the plane formation method. 発明の実施形態に係る和プレーン生成方法の一例を示す説明図である。It is explanatory drawing which shows an example of the sum plane production | generation method which concerns on embodiment of invention. 発明の実施形態に係る差プレーン生成方法の一例を示す説明図である。It is explanatory drawing which shows an example of the difference plane production | generation method which concerns on embodiment of invention. ウェーブレット変換後のサブバンド画像を例示する図である。It is a figure which illustrates the subband image after wavelet transform. 倍密度ベイヤーの色成分毎の画素値の扱いを表した図である。It is a figure showing handling of the pixel value for every color component of a double density Bayer. 発明の実施形態2に係る符号化動作の一例を示すフローチャートである。It is a flowchart which shows an example of the encoding operation | movement which concerns on Embodiment 2 of invention. 発明の実施形態3に係る符号化動作の一例を示すフローチャートである。It is a flowchart which shows an example of the encoding operation | movement which concerns on Embodiment 3 of invention. 発明の実施形態3に係るサブバンド毎に和プレーンと差プレーンの目標符号量の重み付けの一例を示す図である。It is a figure which shows an example of weighting of the target code amount of a sum plane and a difference plane for every subband which concerns on Embodiment 3 of invention. 発明の実施形態4に係る画像処理部の構成例を示すブロック図である。It is a block diagram which shows the structural example of the image process part which concerns on Embodiment 4 of invention. 発明の実施形態4に係る符号化動作の一例を示すフローチャートである。It is a flowchart which shows an example of the encoding operation | movement which concerns on Embodiment 4 of invention. 発明の実施形態5に係るプレーン、サブバンド毎の目標符号量の重み付けの一例を示す図である。It is a figure which shows an example of the weighting of the target code amount for every plane and subband which concerns on Embodiment 5 of invention.

以下、本発明の好ましい実施の形態を添付の図面を参照して詳細に説明する。なお、本発明は以下の実施の形態に限定されるものではない。すなわち、以下の実施の形態は特許請求の範囲に係る発明を限定するものでなく、また実施の形態で説明されている特徴の組み合わせの全てが発明の解決手段に必須のものとは限らない。   Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Note that the present invention is not limited to the following embodiments. That is, the following embodiments do not limit the invention according to the claims, and all combinations of features described in the embodiments are not necessarily essential to the solution means of the invention.

また、本実施形態において説明される各機能ブロックは必ずしも個別のハードウェアである必要はない。すなわち、例えばいくつかの機能ブロックの機能は、1つのハードウェアにより実行されても良い。また、いくつかのハードウェアの連係動作により1つの機能ブロックの機能または、複数の機能ブロックの機能が実行されても良い。また、各機能ブロックの機能は、CPUがメモリ上に展開したコンピュータプログラムにより実行されても良い。   In addition, each functional block described in the present embodiment does not necessarily need to be individual hardware. That is, for example, the functions of some functional blocks may be executed by one piece of hardware. In addition, the function of one functional block or the functions of a plurality of functional blocks may be executed by some hardware linked operations. Further, the function of each functional block may be executed by a computer program developed on the memory by the CPU.

[実施形態1]
以下、発明の第1の実施形態について説明する。本実施形態では、デジタルカメラ等の撮像装置を例にとって説明するが、ベイヤー配列のRAW画像データを圧縮することができる装置であればどのような装置でも良い。たとえば、携帯電話、スマートフォン、タブレット型情報端末、ノート型情報端末、コンピュータ等の通信装置や情報処理装置等であってもよい。以下、発明の実施形態に対応する撮像装置について説明する。
[Embodiment 1]
Hereinafter, a first embodiment of the invention will be described. In the present embodiment, an imaging apparatus such as a digital camera will be described as an example. However, any apparatus may be used as long as it can compress Bayer array RAW image data. For example, it may be a communication device such as a mobile phone, a smartphone, a tablet information terminal, a notebook information terminal, a computer, an information processing device, or the like. Hereinafter, an imaging device corresponding to an embodiment of the invention will be described.

まず、図1Aを参照して、本実施形態の撮像装置100の主要な構成を説明する。図1において、制御部101は、例えば、CPU(MPU)、メモリ(DRAM、SRAM)、不揮発性メモリ(EEPROM)などからなり、各種処理(プログラム)を実行して撮像装置100の各ブロックを制御したり、各ブロック間でのデータ転送を制御したりする。また、制御部101は、ユーザからの操作を受け付ける操作部102からの操作信号に応じて、撮像装置100の各ブロックを制御する。   First, with reference to FIG. 1A, a main configuration of the imaging apparatus 100 of the present embodiment will be described. In FIG. 1, the control unit 101 includes, for example, a CPU (MPU), a memory (DRAM, SRAM), a nonvolatile memory (EEPROM), and the like, and executes various processes (programs) to control each block of the imaging apparatus 100. And control data transfer between each block. Further, the control unit 101 controls each block of the imaging apparatus 100 in accordance with an operation signal from the operation unit 102 that receives an operation from the user.

操作部102は、例えば、電源ボタン、静止画記録ボタン、動画記録開始ボタン、ズーム調整ボタン、オートフォーカスボタンなどの撮影に関連する各種操作を入力するスイッチ類からなる。また、メニュー表示ボタン、決定ボタン、その他カーソルキー、ポインティングデバイス、タッチパネル等からなり、ユーザによりこれらのキーやボタンが操作されると制御部101に操作信号を送信する。なお、撮像装置100は、不図示の電気的に消去・記録可能な不揮発性メモリを有し、制御部101の動作用の定数、プログラム等が記憶される。   The operation unit 102 includes switches for inputting various operations related to shooting such as a power button, a still image recording button, a moving image recording start button, a zoom adjustment button, and an autofocus button. Further, it includes a menu display button, a determination button, other cursor keys, a pointing device, a touch panel, and the like. When these keys and buttons are operated by the user, an operation signal is transmitted to the control unit 101. Note that the imaging apparatus 100 has an electrically erasable / recordable non-volatile memory (not shown), and stores constants, programs, and the like for the operation of the control unit 101.

撮像部103は、レンズにより取り込まれた被写体の光学像(被写体像)を、絞りにより光量を制御して、CCDセンサやCMOSセンサ等の撮像素子により画像信号に変換し、アナログデジタル変換をして、画像処理部104に送信する。画像処理部104は、入力されたデジタル画像信号を処理し、処理された画像データは制御部101により不図示の不揮発性メモリに格納される。具体的な処理については後述する。なお、ここで撮像素子により得られた画像信号は、いわゆるRAW画像データであり、ベイヤー配列のRGBデータである。   The imaging unit 103 controls the light amount of an optical image (subject image) of a subject captured by a lens by an aperture, converts it into an image signal by an imaging element such as a CCD sensor or a CMOS sensor, and performs analog-digital conversion. And transmitted to the image processing unit 104. The image processing unit 104 processes the input digital image signal, and the processed image data is stored in a non-illustrated nonvolatile memory by the control unit 101. Specific processing will be described later. Here, the image signal obtained by the image sensor is so-called RAW image data, which is RGB data in a Bayer array.

音声入力部105は、例えば、内蔵された無指向性のマイクまたは音声入力端子を介して接続された外部マイク等により、撮像装置100の周囲の音声を集音(収音)し、アナログデジタル変換をして音声処理部106に送信する。音声処理部106は、入力されたデジタル音声信号のレベルの適正化処理等の音声に関する処理を行う。そして、音声処理部106で処理された音声データは、制御部101により不図示の不揮発性メモリに格納される。   The audio input unit 105 collects (collects) sound around the imaging apparatus 100 using, for example, a built-in omnidirectional microphone or an external microphone connected via an audio input terminal, and performs analog-digital conversion. And transmitted to the voice processing unit 106. The sound processing unit 106 performs processing related to sound such as level optimization processing of the input digital sound signal. The audio data processed by the audio processing unit 106 is stored in a non-illustrated non-volatile memory by the control unit 101.

画像処理部104及び音声処理部106により処理され、不図示の不揮発性メモリに格納された画像データ、音声データは、制御部101により、記録再生部110に送信され、記録媒体111に記録される。ここで、記録媒体111は、撮像装置に内蔵された記録媒体でも、取外し可能な記録媒体でもよく、撮像装置100で生成した圧縮画像信号、圧縮音声信号、音声信号、各種データなどを記録することができればよい。例えば、記録媒体111は、ハードディスク、光ディスク、光磁気ディスク、CD−R、DVD−R、磁気テープ、不揮発性の半導体メモリ、フラッシュメモリ、などのあらゆる方式の記録媒体を含む。   Image data and audio data processed by the image processing unit 104 and the audio processing unit 106 and stored in a nonvolatile memory (not shown) are transmitted to the recording / reproducing unit 110 by the control unit 101 and recorded on the recording medium 111. . Here, the recording medium 111 may be a recording medium built in the imaging apparatus or a removable recording medium, and records a compressed image signal, a compressed audio signal, an audio signal, various data, and the like generated by the imaging apparatus 100. If you can. For example, the recording medium 111 includes all types of recording media such as a hard disk, an optical disk, a magneto-optical disk, a CD-R, a DVD-R, a magnetic tape, a nonvolatile semiconductor memory, and a flash memory.

また、記録媒体111に記録された圧縮画像信号、圧縮音声信号は、画像処理部104及び音声処理部106により復号され、画像は表示制御部109を介して表示部108に表示され、音声はスピーカユニット107より音声出力される。   Also, the compressed image signal and the compressed audio signal recorded on the recording medium 111 are decoded by the image processing unit 104 and the audio processing unit 106, the image is displayed on the display unit 108 via the display control unit 109, and the audio is transmitted from the speaker. Audio is output from the unit 107.

通信部112は、撮像装置100と外部装置との間で通信を行うもので、例えば、音声信号、画像信号、圧縮音声信号、圧縮画像信号などのデータを送信したり受信したりする。また、撮影開始や終了コマンド等の、撮影にかかる制御信号や、その他の情報を送信したり受信したりする。通信部112は、例えば、赤外線通信モジュール、Bluetooth(登録商標)通信モジュール、無線LAN通信モジュール、WirelessUSB、GPS受信機等の無線通信モジュールである。   The communication unit 112 performs communication between the imaging device 100 and an external device. For example, the communication unit 112 transmits or receives data such as an audio signal, an image signal, a compressed audio signal, and a compressed image signal. Also, it transmits and receives control signals related to shooting, such as shooting start and end commands, and other information. The communication unit 112 is, for example, a wireless communication module such as an infrared communication module, a Bluetooth (registered trademark) communication module, a wireless LAN communication module, a Wireless USB, or a GPS receiver.

次に、本実施形態に対応する画像処理部104の構成及び処理の流れについて、図1bのブロック図を参照しながら説明を行う。   Next, the configuration and processing flow of the image processing unit 104 corresponding to the present embodiment will be described with reference to the block diagram of FIG.

本実施形態の画像処理部104は符号化部として機能し、色分離部121、メモリI/F部122、メモリ123、和プレーン生成部124、差プレーン生成部125、符号化順序設定部126、符号量制御部127、ウェーブレット変換部128、量子化部129、エントロピー符号化部130、及び符号量判定部131で構成される。   The image processing unit 104 according to the present embodiment functions as an encoding unit, and includes a color separation unit 121, a memory I / F unit 122, a memory 123, a sum plane generation unit 124, a difference plane generation unit 125, an encoding order setting unit 126, The code amount control unit 127, the wavelet transform unit 128, the quantization unit 129, the entropy encoding unit 130, and the code amount determination unit 131 are configured.

色分離部121はベイヤー配列のRAWデータを図4に示すようにR、G0、G1、Bの画素毎に独立したプレーン画像データ(以下、単に「プレーン」という)に分離する。色分離部121によって生成された各色成分のプレーンの内、R、Bプレーンは、メモリI/F部122を介してメモリ123に書き込まれ、G0、G1プレーンは和プレーン生成部124、差プレーン生成部125に入力される。メモリI/F部122は、各処理部からのメモリアクセス要求を調停し、メモリ123に対する読み出し・書き込み制御を行う。メモリ123は各処理部から出力される各種データを保持するための記憶領域である。   The color separation unit 121 separates the Bayer array RAW data into independent plane image data (hereinafter simply referred to as “plane”) for each of R, G0, G1, and B pixels as shown in FIG. Among the planes of the respective color components generated by the color separation unit 121, the R and B planes are written to the memory 123 via the memory I / F unit 122, and the G0 and G1 planes are the sum plane generation unit 124 and the difference plane generation. Input to the unit 125. The memory I / F unit 122 arbitrates memory access requests from the processing units and performs read / write control on the memory 123. The memory 123 is a storage area for holding various data output from each processing unit.

和プレーン生成部124は、図5に示すように、入力された2つのプレーンの同位置の画素値同士を加算し、出力される和プレーンの画素値とする。和プレーン生成部124によって生成された和プレーンは、メモリI/F部122を介してメモリ123に書き込まれる。差プレーン生成部125は、図6に示すように、入力された2つのプレーンの同位置の画素値同士を減算し、出力される差プレーンの画素値とする。差プレーン生成部125によって生成された差プレーンは、メモリI/F部122を介してメモリ123に書き込まれる。   As shown in FIG. 5, the sum plane generation unit 124 adds the pixel values at the same position of the two input planes to obtain the pixel value of the output sum plane. The sum plane generated by the sum plane generation unit 124 is written into the memory 123 via the memory I / F unit 122. As illustrated in FIG. 6, the difference plane generation unit 125 subtracts the pixel values at the same position of the two input planes to obtain the pixel value of the output difference plane. The difference plane generated by the difference plane generation unit 125 is written into the memory 123 via the memory I / F unit 122.

符号化順序設定部126は、R、B、和、差プレーンの符号化の順番を設定して、メモリ123から設定した順番通りにプレーンを読みだすように、メモリI/F部122を制御する。符号量制御部127は、各プレーンの符号化データの目標符号量を、量子化部129、及び符号量判定部131に設定する。   The encoding order setting unit 126 sets the encoding order of the R, B, sum, and difference planes, and controls the memory I / F unit 122 to read the planes in the order set from the memory 123. . The code amount control unit 127 sets the target code amount of the encoded data of each plane in the quantization unit 129 and the code amount determination unit 131.

ウェーブレット変換部128は、メモリI/F部122を介してメモリ123から読み出したR、B、及び和、差プレーンに対して、ウェーブレット変換を実行した後、サブバンド画像の形式で生成した変換係数を量子化部129に送る。ここで、ウェーブレット変換とは、処理対象の画像を周波数帯域毎に階層的な画像(サブバンド)に変換する変換処理である。具体的に、画像全体に対してローパスフィルタ処理とハイパスフィルタ処理を掛けることで、低域成分と高域成分を切り分ける処理のことを指す。ウェーブレット変換後の変換係数は図7に示すようなサブバンド画像の形式をとる。ウェーブレット変換は、分割回数を増やす度に低域のサブバンドのみを繰り返し分割するが、これは画像のエネルギーの多くが低域バンドに集中している特性を利用して符号化効率を高くするために使用される。   The wavelet transform unit 128 performs wavelet transform on the R, B, sum, and difference planes read from the memory 123 via the memory I / F unit 122, and then generates transform coefficients generated in the subband image format. Is sent to the quantization unit 129. Here, the wavelet transform is a conversion process for converting an image to be processed into a hierarchical image (subband) for each frequency band. Specifically, it refers to a process of separating a low-frequency component and a high-frequency component by applying low-pass filter processing and high-pass filter processing to the entire image. The transform coefficient after the wavelet transform takes the form of a subband image as shown in FIG. The wavelet transform repeatedly divides only the low frequency sub-band every time the number of divisions is increased. This is because the encoding efficiency is increased by utilizing the characteristic that much of the image energy is concentrated in the low frequency band. Used for.

続いて、サブバンド画像について図7を用いて説明する。図7はウェーブレット変換を2回実行して生成されたサブバンド画像の例であり、計7個のサブバンドで形成されていることを表す。ここで、Lが低域、Hが高域を表し、L、Hの前の数字が階層レベルを表す。例えば、1HLは、水平方向が高域成分で、垂直方向が低域成分である階層レベル=1のサブバンド画像を表す。また、左上のサブバンドほど低域成分を多く持ち、画像のエネルギーが集中している。   Next, the subband image will be described with reference to FIG. FIG. 7 is an example of a subband image generated by executing the wavelet transform twice, and shows that it is formed by a total of seven subbands. Here, L represents a low frequency, H represents a high frequency, and numbers before L and H represent hierarchical levels. For example, 1HL represents a subband image with a layer level = 1 where the horizontal direction is a high-frequency component and the vertical direction is a low-frequency component. Also, the upper left subband has more low-frequency components and the image energy is concentrated.

量子化部129は、ウェーブレット変換部128から送られたサブバンド画像に対し、量子化を実行して、エントロピー符号化部130に送る。尚、量子化を行う際に用いるパラメータは、符号量制御部127によって設定された目標符号量を基に設定される。エントロピー符号化部130は、量子化部129で量子化されたサブバンド画像を、エントロピー符号化して符号化データを生成する。生成された符号化データは符号量判定部131に送られる。エントロピー符号化部130で実行されるエントロピー符号化としては、例えばJPEG2000方式で採用されているEBCOT(Embedded Block Coding with Optimized Truncation)を用いる。符号量判定部131は、エントロピー符号化部130から送られた符号化データが、符号量制御部127によって設定された目標符号量よりも大きくなるか判定する。   The quantization unit 129 performs quantization on the subband image sent from the wavelet transform unit 128 and sends the result to the entropy coding unit 130. Note that the parameters used for quantization are set based on the target code amount set by the code amount control unit 127. The entropy encoding unit 130 entropy encodes the subband image quantized by the quantization unit 129 to generate encoded data. The generated encoded data is sent to the code amount determination unit 131. As entropy coding executed by the entropy coding unit 130, for example, EBCOT (Embedded Block Coding with Optimized Truncation) employed in the JPEG2000 system is used. The code amount determination unit 131 determines whether the encoded data sent from the entropy encoding unit 130 is larger than the target code amount set by the code amount control unit 127.

また、本実施形態では符号化データが目標符号量よりも大きかった場合、符号量判定部131は符号化データの大きさが目標符号量を満たすように、符号化データを更に圧縮する。符号化データを更に圧縮する方法としては、例えばJPEG2000の機能の1つであるポスト量子化を用いる。ポスト量子化は、JPEG2000で用いられているエントロピー符号化のEBCOTが、変換係数を各ビットプレーンで符号化していることを利用して、完成した符号化データを下位ビットから切り捨てることで、目標符号量を達成する方法である。   In the present embodiment, when the encoded data is larger than the target code amount, the code amount determination unit 131 further compresses the encoded data so that the size of the encoded data satisfies the target code amount. As a method for further compressing the encoded data, for example, post-quantization which is one of the functions of JPEG2000 is used. Post-quantization uses the entropy coding EBCOT used in JPEG2000 to encode the transform coefficient in each bit plane, and truncates the completed encoded data from the lower order bits. How to achieve quantity.

続いて、本実施形態のRAWデータ1フレームに対する符号化処理について図3に示すフローチャートを基に説明を行う。図3のフローチャートは、例えば、画像処理部104として機能するプロセッサがメモリ(ROM)に格納されているプログラムをワークメモリ(RAM)に展開し実行することにより実現することができる(他の実施形態における図3に対応するフローチャートについても同様)。   Next, the encoding process for one frame of RAW data according to the present embodiment will be described based on the flowchart shown in FIG. The flowchart in FIG. 3 can be realized by, for example, a processor functioning as the image processing unit 104 developing and executing a program stored in a memory (ROM) in a work memory (RAM) (another embodiment). The same applies to the flowchart corresponding to FIG.

まず、S301では、色分離部121がRAWデータからR、B、G0、G1を分離してそれぞれでプレーンを形成する。色成分毎にプレーンを形成した後に、S302において和プレーンと差プレーンとを生成する。具体的に、和プレーン生成部124がG0プレーンとG1プレーンの加算を実行して、和プレーンを生成する。また、差プレーン生成部125がG0プレーンとG1プレーンの減算を実行して、差プレーンを生成する。尚、R、Bプレーン及び和、差プレーンはそれぞれを生成した後に、メモリI/F部122を介してメモリ123に書き込まれる。   First, in S301, the color separation unit 121 separates R, B, G0, and G1 from the RAW data to form a plane for each. After forming a plane for each color component, a sum plane and a difference plane are generated in S302. Specifically, the sum plane generating unit 124 adds the G0 plane and the G1 plane to generate a sum plane. In addition, the difference plane generation unit 125 performs subtraction of the G0 plane and the G1 plane to generate a difference plane. The R and B planes and the sum and difference planes are generated and then written to the memory 123 via the memory I / F unit 122.

R、B、和、差プレーンを生成した後、S303にて符号化順序設定部126がどのプレーンから符号化処理を実行するかを設定する。ここでは一例としてR、B、和、差の順番に設定するが、この順番に限定されるものではない。符号化対象のプレーンを設定した後、S304にて符号量制御部127が選択されたプレーンに対し目標符号量を設定する。本実施形態では、符号量制御部127はRAWデータ全体の目標符号量をプレーン数で等分した値をプレーン毎の目標符号量として設定する。すなわち、R、B、和、差プレーンそれぞれの目標符号量はほぼ同じ符号量に設定される。   After generating the R, B, sum, and difference planes, the encoding order setting unit 126 sets from which plane the encoding process is executed in S303. Here, as an example, the order of R, B, sum, and difference is set, but the order is not limited. After setting the encoding target plane, the code amount control unit 127 sets a target code amount for the selected plane in S304. In this embodiment, the code amount control unit 127 sets a value obtained by equally dividing the target code amount of the entire RAW data by the number of planes as the target code amount for each plane. That is, the target code amounts of the R, B, sum, and difference planes are set to substantially the same code amount.

目標符号量を設定した後、S305にてウェーブレット変換部128が、選択プレーンをメモリI/F部122を介してメモリ123から読み出し、ウェーブレット変換を実行する。次に、S306にて、ウェーブレット変換された画像を量子化部129が量子化する。尚、量子化に用いる量子化パラメータは、符号量制御部127で設定した目標符号量に基づいて決定する。   After setting the target code amount, in S305, the wavelet transform unit 128 reads the selected plane from the memory 123 via the memory I / F unit 122, and executes wavelet transform. Next, in S306, the quantization unit 129 quantizes the wavelet-transformed image. The quantization parameter used for quantization is determined based on the target code amount set by the code amount control unit 127.

量子化後、S307にて、エントロピー符号化部130がサブバンド画像を圧縮符号化して、符号化データを出力する。圧縮符号化の終了後、符号量判定部131はS308にて、出力符号化データの符号量が、符号量制御部127が設定した目標符号量よりも大きいか判定する。もし目標符号量よりも大きい場合は、S307に戻ってエントロピー符号化部130が、目標符号量を満たすために符号化データを更に圧縮する。符号量が目標符号量以下の場合はS309にて、R、B、和、差プレーンの全てに対して符号化が実行されたかどうかを判定し、未処理のプレーンがあればS303に戻って処理を継続する。一方、全てについて処理が完了した場合は符号化処理を終了する。   After quantization, in S307, the entropy encoding unit 130 compresses and encodes the subband image and outputs encoded data. After the completion of the compression encoding, the code amount determination unit 131 determines whether the code amount of the output encoded data is larger than the target code amount set by the code amount control unit 127 in S308. If it is larger than the target code amount, the process returns to S307, and the entropy encoding unit 130 further compresses the encoded data to satisfy the target code amount. If the code amount is less than or equal to the target code amount, in S309, it is determined whether encoding has been performed for all of the R, B, sum, and difference planes. If there is an unprocessed plane, the process returns to S303 for processing. Continue. On the other hand, when the process is completed for all, the encoding process is terminated.

尚、本実施形態では、1フレーム単位での処理の例を示したが、任意の大きさに分割して、それぞれで独立して上記の処理を実行しても良い。また、本実施形態ではウェーブレット変換を用いた例を示したが、JPEGやJPEG XR、MPEG−4 AVC等の符号化技術で用いられている離散コサイン変換を代わりに用いても良い。更に、エントロピー符号化をハフマン符号化にしても良い。   In the present embodiment, an example of processing in units of one frame has been described. However, the processing may be performed independently by dividing the frame into arbitrary sizes. In the present embodiment, an example using wavelet transform is shown, but discrete cosine transform used in encoding techniques such as JPEG, JPEG XR, and MPEG-4 AVC may be used instead. Furthermore, the entropy coding may be Huffman coding.

尚、本実施形態では、図2(a)に示すようなベイヤー配列の画素データを扱ったが、図2(b)に示すような倍密度ベイヤー配列を用いても良い。倍密度ベイヤー配列は、ベイヤー配列の画素密度を2倍にするとともに斜め45゜に配列した画素配列であり、R0、R1、B0、B1、及びGで構成されている。倍密度ベイヤー配列は、ベイヤー配列と同様、Gの画素数がR(R0とR1の合計数)やB(B0とB1の合計数)の2倍になっている。倍密度ベイヤー配列を符号化する際には、図8(a)から(c)に示すようにR0、R1、B0、B1、及びGでプレーンを生成し、R0とR1、B0とB1でそれぞれ和プレーンと差プレーンを生成することで、ベイヤー配列と同様にプレーン毎の符号化処理を行うことができる。   In this embodiment, pixel data having a Bayer array as shown in FIG. 2A is used. However, a double-density Bayer array as shown in FIG. 2B may be used. The double-density Bayer array is a pixel array in which the pixel density of the Bayer array is doubled and arranged at an angle of 45 °, and is composed of R0, R1, B0, B1, and G. In the double-density Bayer array, the number of G pixels is twice that of R (the total number of R0 and R1) and B (the total number of B0 and B1), as in the Bayer array. When encoding a double-density Bayer array, planes are generated with R0, R1, B0, B1, and G as shown in FIGS. 8A to 8C, and R0 and R1, and B0 and B1, respectively. By generating the sum plane and the difference plane, the encoding process for each plane can be performed in the same manner as the Bayer array.

この場合、図3の処理では、S301でR0、R1、B0、B1、及びGでプレーンを生成し、S302でR0とR1、B0とB1でそれぞれ和プレーンと差プレーンを生成する。その後、GプレーンとRの和プレーン、差プレーン、Bの和プレーン、差プレーンとにつき、S303からS309までの処理を実行する。   In this case, in the process of FIG. 3, a plane is generated with R0, R1, B0, B1, and G in S301, and a sum plane and a difference plane are generated with R0 and R1, and B0 and B1, respectively. Thereafter, the processing from S303 to S309 is executed for the G plane and the R sum plane, the difference plane, the B sum plane, and the difference plane.

以上のように本実施形態によれば、ベイヤー配列の各色成分をそれぞれ独立した画像であるプレーンに分離し、そのうち同色成分同士のプレーンから、加算により和プレーンを、減算により差プレーンをそれぞれ生成する。即ち、通常のベイヤー配列では、G0とG1の緑の同色成分同士から和プレーン、差プレーンを生成し、倍密度ベイヤー配列ではR0とR1の赤成分、B0とB1の青成分の同色成分同士からそれぞれ和プレーン、差プレーンを生成する。ここで、加算はローパスフィルタ演算であるため、和プレーンの生成はRAWデータの緑成分に対して、ローパスフィルタで低域成分を抽出する処理に相当する。また、減算はハイパスフィルタ演算であるため、差プレーンの生成はRAWデータの緑成分に対して、ハイパスフィルタで高域成分を抽出する処理に相当する。そのため、符号化処理の前にRAWデータの緑成分の低域成分と高域成分が切り分けられる。その結果、ウェーブレット変換時の周波数成分分割効率の悪化を軽減し、符号化処理の圧縮効率を高めることが出来る。なお、これは離散コサイン変換においても同様に、符号化処理の圧縮効率を高めることができる。   As described above, according to the present embodiment, each color component of the Bayer array is separated into planes that are independent images, and a sum plane is generated from the planes of the same color components by addition, and a difference plane is generated by subtraction. . That is, in the normal Bayer arrangement, the sum plane and the difference plane are generated from the same green color components of G0 and G1, and in the double density Bayer arrangement, the red color components of R0 and R1, and the blue color components of B0 and B1 are generated from each other. A sum plane and a difference plane are generated respectively. Here, since the addition is a low-pass filter operation, the generation of the sum plane corresponds to a process of extracting a low-frequency component with a low-pass filter for the green component of the RAW data. Since subtraction is a high-pass filter operation, the generation of the difference plane corresponds to a process of extracting a high-frequency component with a high-pass filter for the green component of the RAW data. Therefore, the low frequency component and the high frequency component of the green component of the RAW data are separated before encoding processing. As a result, it is possible to reduce the deterioration of the frequency component division efficiency at the time of wavelet transform and increase the compression efficiency of the encoding process. Note that this can also improve the compression efficiency of the encoding process in the discrete cosine transform.

尚、本実施形態では基本となる目標符号量をR、B、G0、G1に均等に割り振っているが、R、Bの符号量を少なくし、G0、G1に多く割り振るなど、色成分毎に割り振る符号量の比率を変えても良い。   In this embodiment, the basic target code amount is evenly allocated to R, B, G0, and G1, but the R and B code amounts are reduced and allocated to G0 and G1 for each color component. You may change the ratio of the code amount to allocate.

[実施形態2]
続いて、発明の第2の実施形態に対応する符号化方法について説明する。本実施形態において、撮像装置100及び符号化部として機能する画像処理部104の構成は実施形態1の図1A及び図1Bに示したものと同様である。本実施形態では、実施形態1で述べた、和プレーンがRAWデータの緑成分の低域成分、差プレーンが高域成分に相当することを考慮し、和プレーンの符号量を差プレーンの符号量よりも大きく設定することを特徴とする。
[Embodiment 2]
Subsequently, an encoding method corresponding to the second embodiment of the invention will be described. In the present embodiment, the configuration of the imaging apparatus 100 and the image processing unit 104 that functions as an encoding unit is the same as that illustrated in FIGS. 1A and 1B of the first embodiment. In the present embodiment, considering that the sum plane corresponds to the low frequency component of the green component of the RAW data and the difference plane corresponds to the high frequency component described in the first embodiment, the code amount of the sum plane is changed to the code amount of the difference plane. It is characterized in that it is set larger.

以下、図9のフローチャートを参照して本実施形態の符号化動作を説明する。尚、実施形態1と同様の処理には同じ符号を付して示し、ここでの説明を簡略にする。まず実施形態1と同様に、S301からS303においてR、B、G0、G1毎にプレーンを形成し、G0、G1プレーンを用いて和プレーンと差プレーンを生成した後、R、B、和、差プレーンのどのプレーンに対して符号化処理を実行するかを設定する。本実施形態でも、一例としてR、B、和、差の順番に設定されるものとする。続いて、S901にて符号化順序設定部126が、和プレーンを符号化対象として設定しているか否かを判定する。和プレーンが符号化対象である場合、S902において差プレーンよりも符号量が多くなるように符号量制御部127が目標符号量の重み付けを設定する。   Hereinafter, the encoding operation of this embodiment will be described with reference to the flowchart of FIG. In addition, the same code | symbol is attached | subjected and shown to the process similar to Embodiment 1, and description here is simplified. First, in the same manner as in the first embodiment, in S301 to S303, a plane is formed for each of R, B, G0, and G1, a sum plane and a difference plane are generated using the G0 and G1 planes, and then R, B, sum, and difference are generated. It is set to which plane of the plane the encoding process is executed. Also in this embodiment, it shall be set to the order of R, B, the sum, and a difference as an example. Subsequently, in S901, the encoding order setting unit 126 determines whether or not the sum plane is set as an encoding target. When the sum plane is an encoding target, the code amount control unit 127 sets the weighting of the target code amount so that the code amount is larger than that of the difference plane in S902.

本実施形態では目標符号量に重みを付ける方法として、符号量制御部127が別途設定した基本の目標符号量(一例として、RAWデータ全体の目標符号量をプレーン数で等分した値とする)を、任意に設定したパラメータX(%)だけ増大させる手法を用いる。重み付けに基づいた和プレーンの目標符号量の設定方法は例えば式1に基づく方法がある。ここで、基本の目標符号量をT、重み付け後の目標符号量をT'とする。   In this embodiment, as a method of weighting the target code amount, a basic target code amount separately set by the code amount control unit 127 (as an example, a value obtained by equally dividing the target code amount of the entire RAW data by the number of planes) Is increased by an arbitrarily set parameter X (%). As a method for setting the target code amount of the sum plane based on weighting, for example, there is a method based on Equation 1. Here, the basic target code amount is T, and the weighted target code amount is T ′.

T' = (100+X)T/100 (式1)
例えば、Xを15と設定した場合、和プレーンの目標符号量は、基本の目標符号量に対して15%だけ大きくなる。しかしながら、和プレーンの目標符号量を大きくすることで、RAWデータ全体の目標符号量が増大してしまう。そこで本実施形態では、和プレーンについて増加した分、差プレーンの目標符号量を減少させる。具体的に、S903にて符号化順序設定部126が、差プレーンを符号化対象として設定しているか否かを判定する。差プレーンが符号化対象である場合、S904にて符号量制御部127は差プレーンの目標符号量が基本の目標符号量と比べ、X%だけ少なくなるように重み付けを設定する。重み付けに基づいた差プレーンの目標符号量の設定方法は例えば式2に基づく方法がある。ここで、基本の目標符号量をT、重み付け後の目標符号量をT'とする。
T ′ = (100 + X) T / 100 (Formula 1)
For example, when X is set to 15, the target code amount of the sum plane is increased by 15% with respect to the basic target code amount. However, increasing the target code amount of the sum plane increases the target code amount of the entire RAW data. Therefore, in the present embodiment, the target code amount of the difference plane is decreased by the amount increased for the sum plane. Specifically, in step S903, the encoding order setting unit 126 determines whether the difference plane is set as an encoding target. When the difference plane is an encoding target, in step S904, the code amount control unit 127 sets weighting so that the target code amount of the difference plane is smaller by X% than the basic target code amount. As a setting method of the target code amount of the difference plane based on weighting, for example, there is a method based on Expression 2. Here, the basic target code amount is T, and the weighted target code amount is T ′.

T' = (100−X)T/100 (式2)
このようにして、和プレーンの符号量が増加した分だけ差プレーンの符号量が少なくなるように差プレーンの目標符号量に重み付けをすることで、RAWデータ全体の符号量の増大を抑えることができる。符号化順序設定部126が設定する符号化対象のプレーンが、和プレーン、差プレーンの何れでもない(つまりR、Bプレーン)場合(S901、S903で共に「NO」)、符号量制御部127は基本となる目標符号量をそのまま設定する。よって、重み付けを設定しない。符号量制御部127がS304でプレーン毎の重み付けを反映した目標符号量を設定した後、実施形態1と同様にS305からS309の処理を行う。
T ′ = (100−X) T / 100 (Formula 2)
In this way, the increase in the code amount of the entire RAW data can be suppressed by weighting the target code amount of the difference plane so that the code amount of the difference plane decreases as much as the code amount of the sum plane increases. it can. When the encoding target plane set by the encoding order setting unit 126 is neither a sum plane nor a difference plane (that is, R and B planes (both “NO” in S901 and S903)), the code amount control unit 127 The basic target code amount is set as it is. Therefore, no weighting is set. After the code amount control unit 127 sets the target code amount reflecting the weight for each plane in S304, the processing from S305 to S309 is performed as in the first embodiment.

尚、本実施形態では1フレーム単位での処理の例を示したが、任意の大きさに分割して、それぞれで独立して上記の処理を実行しても良い。また、本実施形態ではウェーブレット変換を用いた実施例を示したが、JPEGやJPEG XR、MPEG−4 AVC等の符号化技術で用いられている離散コサイン変換を代わりに用いても良い。更に、エントロピー符号化をハフマン符号化にしても良い。   In the present embodiment, an example of processing in units of one frame has been described. However, the processing may be performed independently by dividing the frame into arbitrary sizes. In the present embodiment, an example using wavelet transform is shown, but discrete cosine transform used in encoding techniques such as JPEG, JPEG XR, and MPEG-4 AVC may be used instead. Furthermore, the entropy coding may be Huffman coding.

尚、本実施形態では、図2(a)に示すようなベイヤー配列の画素データを扱ったが、図2(b)、図8に示すような倍密度ベイヤー配列を用いても良い。この場合、R0とR1、B0とB1でそれぞれ和プレーンと差プレーンを生成した場合に、和プレーンの目標符号量を差プレーンに対して大きく設定することができる。   In this embodiment, pixel data having a Bayer array as shown in FIG. 2A is used. However, a double-density Bayer array as shown in FIGS. 2B and 8 may be used. In this case, when a sum plane and a difference plane are generated by R0 and R1, and B0 and B1, respectively, the target code amount of the sum plane can be set larger than the difference plane.

以上の様に本実施形態によれば、和プレーンを他のプレーンよりも重視し、符号量を多く割り当てることで、RAWデータの緑成分が有する低域成分の劣化を抑えることができる。画像の低域成分は画質への影響が大きく、また画像の輝度成分は緑成分を赤、青成分よりも多分に含む。そのため本実施例を適用することで、RAWデータの緑成分、延いては画像の輝度の低域成分を維持し、画質劣化を抑えることができる。尚、本実施形態でも基本となる目標符号量をR、B、G0、G1に均等に割り振っているが、R、Bの符号量を少なくし、G0、G1に多く割り振るなど、色成分毎に割り振る符号量の比率を変えても良い。   As described above, according to the present embodiment, the sum plane is more important than the other planes, and by assigning a larger amount of code, it is possible to suppress the deterioration of the low frequency component of the green component of the RAW data. The low frequency component of the image has a large influence on the image quality, and the luminance component of the image contains a green component more than red and blue components. Therefore, by applying the present embodiment, it is possible to maintain the green component of the RAW data, and thus the low-frequency component of the luminance of the image, and suppress image quality deterioration. In this embodiment, the basic target code amount is evenly allocated to R, B, G0, and G1, but the R and B code amounts are reduced and the code amount is allocated to G0 and G1, for each color component. You may change the ratio of the code amount to allocate.

[実施形態3]
続いて、発明の第3の実施形態に対応する符号化方法について説明する。本実施形態において、撮像装置100及び符号化部として機能する画像処理部104の構成は実施形態1の図1A及び図1Bに示したものと同様である。本実施形態では、実施形態2で述べた和プレーンと差プレーンの目標符号量の重み付けにつき、ウェーブレット変換の特徴を活かした手法を述べる。
[Embodiment 3]
Subsequently, an encoding method corresponding to the third embodiment of the invention will be described. In the present embodiment, the configuration of the imaging apparatus 100 and the image processing unit 104 that functions as an encoding unit is the same as that illustrated in FIGS. 1A and 1B of the first embodiment. In the present embodiment, a technique using the characteristics of wavelet transform will be described for the weighting of the target code amounts of the sum plane and the difference plane described in the second embodiment.

以下、図10のフローチャートを参照して本実施形態の符号化動作を説明する。尚、実施形態1と同様の処理には同じ符号を付して示し、ここでの説明を簡略にする。   Hereinafter, the encoding operation of this embodiment will be described with reference to the flowchart of FIG. In addition, the same code | symbol is attached | subjected and shown to the process similar to Embodiment 1, and description here is simplified.

まず実施形態1と同様に、S301からS303においてR、B、G0、G1毎にプレーンを形成し、G0、G1プレーンを用いて和プレーンと差プレーンを生成した後、R、B、和、差プレーンのどのプレーンに対して符号化処理を実行するかを設定する。本実施形態でも、一例としてR、B、和、差の順番に設定されるものとする。続いて、S1001にて符号化順序設定部126が和プレーンを符号化対象のプレーンとして設定しているか否かを判定する。和プレーンが符号化対象である場合、S1002にて符号量制御部127が和プレーンに対して設定された重み付けを目標符号量に施す。また、符号化順序設定部126が差プレーンを符号化対象のプレーンとして設定しているか否かを判定する。差プレーンが符号化対象である場合、S1004にて符号量制御部127が差プレーンに対して設定された重み付けを目標符号量に施す。   First, in the same manner as in the first embodiment, in S301 to S303, a plane is formed for each of R, B, G0, and G1, a sum plane and a difference plane are generated using the G0 and G1 planes, and then R, B, sum, and difference are generated. It is set to which plane of the plane the encoding process is executed. Also in this embodiment, it shall be set to the order of R, B, the sum, and a difference as an example. Subsequently, in S1001, the encoding order setting unit 126 determines whether or not the sum plane is set as an encoding target plane. When the sum plane is an encoding target, the code amount control unit 127 weights the target code amount in step S1002 for the sum plane. Also, the encoding order setting unit 126 determines whether or not the difference plane is set as the encoding target plane. When the difference plane is an encoding target, the code amount control unit 127 weights the target code amount in S1004, which is set for the difference plane.

本実施形態では、ウェーブレット変換により周波数成分がサブバンド毎に切り分けられていることを利用して、符号量制御部127による和プレーンと、差プレーンの目標符号量の設定をサブバンド毎に行う。目標符号量の設定方法の詳細については図11を参照して後述する。符号化順序設定部126が設定する符号化対象のプレーンが、和、差プレーンの何れでもない(R、Bプレーン)場合、基本となる目標符号量(例えば、RAWデータ全体の目標符号量をプレーン数で等分した値とする)をそのまま設定する。符号量制御部127がS304でサブバンド毎の重み付けを反映した目標符号量を設定した後、実施形態1と同様にS305からS309の処理を行う。   In the present embodiment, the code amount control unit 127 sets the target code amount of the sum plane and the difference plane for each subband by using the fact that the frequency components are separated for each subband by the wavelet transform. Details of the target code amount setting method will be described later with reference to FIG. When the encoding target plane set by the encoding order setting unit 126 is neither a sum nor a difference plane (R, B plane), the basic target code amount (for example, the target code amount of the entire RAW data is set to the plane). Set the value as it is (divided equally by number). After the code amount control unit 127 sets the target code amount reflecting the weight for each subband in S304, the processing from S305 to S309 is performed as in the first embodiment.

次に、本実施形態におけるサブバンド毎の和プレーンと差プレーンの目標符号量の重み付けについて説明する。和プレーンと差プレーンの目標符号量の重み付けの例を図11に示す。図11のサブバンド画像は説明を簡単にするため、ウェーブレット変換による分割回数を1回としている。また、図11の4隅のオブジェクトは、各サブバンドの和プレーンと差プレーンの符号量の比率を表したものである。和プレーンはRAWデータの緑成分の低域に相当するため、ウェーブレット変換の結果として、低域のサブバンドに画像のエネルギーがより多く集中する。そこで、低域のサブバンドで和プレーンの符号量の比率を、差プレーンよりも大きくすることで、画像のエネルギーをより多く残し、画質劣化を抑制することができる。   Next, the weighting of the target code amount of the sum plane and the difference plane for each subband in this embodiment will be described. An example of the weighting of the target code amount of the sum plane and the difference plane is shown in FIG. In order to simplify the description of the subband image in FIG. 11, the number of divisions by wavelet transform is set to one. Also, the objects at the four corners in FIG. 11 represent the ratio of the code amount of the sum plane and the difference plane of each subband. Since the sum plane corresponds to the low band of the green component of the RAW data, as a result of the wavelet transform, more image energy is concentrated in the low band subbands. Therefore, by making the ratio of the code amount of the sum plane in the low-frequency subband larger than that of the difference plane, more image energy can be left and image quality deterioration can be suppressed.

一方で、低域の情報を優先することで、画像の輪郭がぼやけてしまうことも想定される。そこで、差プレーンがRAWデータの緑成分の高域に相当することから、高域のサブバンドでは差プレーンの符号量の比率を和プレーンと同等、あるいは和プレーンよりも大きくすることで、高域の情報を残し画像の輪郭を保つことができる。和プレーン及び差プレーンの符号量を割り振る際に、各サブバンドで和プレーンと差プレーンの目標符号量の合計を設定する。本実施形態では、RAWデータ全体の目標符号量から算出した、プレーン二つ分の目標符号量を更にサブバンド数で等分した値を、和プレーンと差プレーンの目標符号量の合計として設定する。例えば、RAWデータ全体の目標符号量が800KB、サブバンド数が4つとすると、プレーン2つ分の目標符号量は400KBである。また、各サブバンドの和プレーンと差プレーンの符号量の合計はそれぞれ100KBに設定される。   On the other hand, it is also assumed that the outline of the image is blurred by giving priority to low-frequency information. Therefore, since the difference plane corresponds to the high frequency of the green component of the RAW data, the high frequency subband is set to a high frequency by making the ratio of the code amount of the difference plane equal to or larger than the sum plane. It is possible to keep the contour of the image while leaving the information. When allocating the code amounts of the sum plane and the difference plane, the sum of the target code amounts of the sum plane and the difference plane is set for each subband. In the present embodiment, a value obtained by further dividing the target code amount for two planes by the number of subbands calculated from the target code amount for the entire RAW data is set as the sum of the target code amounts for the sum plane and the difference plane. . For example, if the target code amount of the entire RAW data is 800 KB and the number of subbands is four, the target code amount for two planes is 400 KB. Further, the sum of the code amount of the sum plane and the difference plane of each subband is set to 100 KB.

和プレーンと差プレーンのサブバンド毎の符号量の割り振りを、サブバンド毎の和プレーンと差プレーンの符号量の合計を100KB、サブバンド数が4つ、図11で示した比率を用いた場合で具体的に示す。0LLバンドは和プレーンと差プレーンの比率が8:2であることから、和プレーンに80KB、差プレーンに20KB割り振られる。同様に1HLバンド、1LHバンドで和プレーンと差プレーンの比率が6:4であることから、和プレーンに60KB、差プレーンに40KB割り振られる。1HHバンドでは和プレーンと差プレーンの比率が4:6であることから、和プレーンに40KB、差プレーンに60KB割り振られる。   When the amount of code for each subband of the sum plane and difference plane is allocated, the sum of the amount of codes for the sum plane and difference plane for each subband is 100 KB, the number of subbands is four, and the ratio shown in FIG. 11 is used. This will be shown in detail. Since the ratio of the sum plane and the difference plane is 8: 2, the 0LL band is allocated 80 KB for the sum plane and 20 KB for the difference plane. Similarly, since the ratio of the sum plane and the difference plane in the 1HL band and 1LH band is 6: 4, 60 KB is allocated to the sum plane and 40 KB is allocated to the difference plane. In the 1HH band, since the ratio of the sum plane and the difference plane is 4: 6, 40 KB is allocated to the sum plane and 60 KB is allocated to the difference plane.

このようにサブバンド毎に和プレーンと差プレーンの符号量が割り振られる。尚、和プレーンと差プレーンのサブバンド毎の符号量設定については、符号量制御部127で実行する。なお、本実施形態では1フレーム単位での処理の例を示したが、任意の大きさに分割して、それぞれで独立して上記の処理を実行しても良い。   In this way, the code amounts of the sum plane and the difference plane are allocated for each subband. It should be noted that the code amount control unit 127 executes the code amount setting for each subband of the sum plane and the difference plane. In the present embodiment, an example of processing in units of one frame has been described. However, the processing may be performed independently by dividing the frame into arbitrary sizes.

以上の本実施形態によれば、和プレーンと差プレーンの符号量をサブバンド毎に細かく設定することができる。具体的には、低域のサブバンドでRAWデータの緑成分の低域に相当する和プレーンの符号量を多く、高域のサブバンドでRAWデータの緑成分の高域に相当する差プレーンの符号量を多くするように、それぞれの目標符号量に重み付けをする。その効果として、低域成分だけでなく、高域成分も残すことが出来、画質劣化を抑えることが出来る。   According to the present embodiment described above, the code amounts of the sum plane and the difference plane can be set finely for each subband. Specifically, the code amount of the sum plane corresponding to the low frequency of the green component of the RAW data is large in the low frequency subband, and the difference plane corresponding to the high frequency of the green component of the RAW data in the high frequency subband. Each target code amount is weighted so as to increase the code amount. As an effect, not only a low frequency component but also a high frequency component can be left, and image quality deterioration can be suppressed.

尚、本実施形態では、各サブバンドの和プレーンと差プレーンの符号量の合計を均等にしているが、各サブバンドで違う値を設定しても良い。例えば、0LL、1HL、1LH、1HHで100KBとしていたのを、0LLで130KB、1HL、1LHで100KB、1HHで70KBとしても良い。   In this embodiment, the sum of the code amounts of the sum plane and the difference plane of each subband is made equal, but a different value may be set for each subband. For example, instead of 100 KB for 0LL, 1HL, 1LH, and 1HH, it may be 130 KB for 0LL, 100 KB for 1HL, 100 KB for 1LH, and 70 KB for 1HH.

[実施形態4]
続いて、発明の第4の実施形態に対応する符号化方法について説明する。本実施形態では、和プレーンと差プレーンの目標符号量の重み付けの際に、差プレーンを構成するG0プレーンとG1プレーンの差分値のばらつきから差プレーンの発生符号量を予測し、動的に重み付けを変更する。本実施形態において、撮像装置100の構成は実施形態1の図1Aに示したものと同様である。但し、本実施形態に係わる符号化部としての画像処理部104の構成は図12に示す通りである。本実施形態の画像処理部104の構成は、画像特徴解析部1201と重み付け設定部1202とを有し、画像特徴解析処理と重み付け設定処理を行う点で、図1Bの構成とは異なる。尚、図1Bと同様の構成部分は同じ参照符号を付して示し、ここでの説明を省略する。
[Embodiment 4]
Subsequently, an encoding method corresponding to the fourth embodiment of the invention will be described. In this embodiment, when weighting the target code amount of the sum plane and the difference plane, the generated code amount of the difference plane is predicted from the variation in the difference value between the G0 plane and the G1 plane constituting the difference plane, and dynamically weighted. To change. In the present embodiment, the configuration of the imaging apparatus 100 is the same as that shown in FIG. 1A of the first embodiment. However, the configuration of the image processing unit 104 as an encoding unit according to the present embodiment is as shown in FIG. The configuration of the image processing unit 104 of this embodiment is different from the configuration of FIG. 1B in that it has an image feature analysis unit 1201 and a weighting setting unit 1202 and performs image feature analysis processing and weighting setting processing. Components similar to those in FIG. 1B are denoted by the same reference numerals, and description thereof is omitted here.

以下、図13のフローチャートを参照して本実施形態の符号化動作を説明する。尚、実施形態1と同様の処理には同じ符号を付して示し、ここでの説明を簡略にする。   Hereinafter, the encoding operation of this embodiment will be described with reference to the flowchart of FIG. In addition, the same code | symbol is attached | subjected and shown to the process similar to Embodiment 1, and description here is simplified.

まず実施形態1と同様に、S301とS302にてR、B、G0、G1毎にプレーンを形成し、G0、G1プレーンを用いて和プレーンと差プレーンを生成する。その後、S1301にて画像特徴解析部1201が差プレーンの画素値のばらつきを解析し、解析情報に基づき重み付け設定部1202が和プレーンと差プレーンの符号量の重み付け設定に用いるパラメータYを設定する。本実施形態では、ばらつきの解析の際には、式3の式に基づく分散を用いる。分散をδ、mを差プレーンを構成する成分の総数、x^を差プレーンの全成分の平均値、xiを差プレーンを構成する1からm番の成分の内のi番目の成分の値をそれぞれ表す。

Figure 2017085556
First, similarly to the first embodiment, a plane is formed for each of R, B, G0, and G1 in S301 and S302, and a sum plane and a difference plane are generated using the G0 and G1 planes. Thereafter, in S1301, the image feature analysis unit 1201 analyzes the variation in the pixel value of the difference plane, and the weight setting unit 1202 sets the parameter Y used for the weight setting of the code amount of the sum plane and the difference plane based on the analysis information. In the present embodiment, dispersion based on the expression of Expression 3 is used in analyzing the variation. The variance is δ, m is the total number of components constituting the difference plane, x ^ is the average value of all components of the difference plane, and xi is the value of the i-th component among the 1st to m-th components constituting the difference plane. Represent each.
Figure 2017085556

重み付け設定部1202は、複数の閾値を有しており、画像特徴解析部1201が出力した分散と閾値を照らし合わせてパラメータYを設定する。Yの設定方法の具体例については後述する。パラメータYを設定した後、S303にて符号化順序設定部126がR、B、和、差プレーンのどのプレーンに対して符号化処理を実行するかを設定する。本実施形態では、一例として和、差、R、Bの順番に設定されるものとする。S1302で符号化順序設定部126が和プレーンを符号化対象として設定しているか否かを判定する。和プレーンを符号化対象に設定している場合、S1303にて符号量制御部127がパラメータYに基づいて和プレーンの符号量の重み付けを設定する。和プレーンを符号化対象に設定していない場合、S1304で符号化順序設定部126が差プレーンを符号化対象として設定しているか否かを判定する。差プレーンを符号化対象に設定している場合、S1305にて符号量制御部127がパラメータYに基づいて差プレーンの符号量の重み付けを設定する。符号化順序設定部126が設定する符号化対象のプレーンが、和、差プレーンの何れでもない(R、Bプレーン)場合、基本となる目標符号量をそのまま設定する。ここでは、RAWデータ全体の目標符号量を、プレーン数で等分した値を用いることができる。その後、符号量制御部127がプレーン毎の重み付けを反映した目標符号量を設定した後、実施形態1と同様にS305からS309までの処理を行う。   The weighting setting unit 1202 has a plurality of threshold values, and sets the parameter Y by comparing the variance output from the image feature analysis unit 1201 with the threshold values. A specific example of the Y setting method will be described later. After setting the parameter Y, in S303, the encoding order setting unit 126 sets which of the R, B, sum, and difference planes is to be encoded. In the present embodiment, as an example, the sum, difference, R, and B are set in this order. In S1302, the encoding order setting unit 126 determines whether the sum plane is set as an encoding target. When the sum plane is set as an encoding target, the code amount control unit 127 sets weighting of the code amount of the sum plane based on the parameter Y in S1303. If the sum plane is not set as an encoding target, the encoding order setting unit 126 determines whether or not the difference plane is set as an encoding target in S1304. When the difference plane is set as an encoding target, the code amount control unit 127 sets the weighting of the code amount of the difference plane based on the parameter Y in S1305. When the encoding target plane set by the encoding order setting unit 126 is neither the sum nor the difference plane (R, B plane), the basic target code amount is set as it is. Here, a value obtained by equally dividing the target code amount of the entire RAW data by the number of planes can be used. After that, after the code amount control unit 127 sets a target code amount reflecting the weight for each plane, the processing from S305 to S309 is performed as in the first embodiment.

続いて、差プレーンの分散の解析と符号量の重み付けについて説明する。前述した通り、重み付け設定部1202は、複数の閾値を有しており、画像特徴解析部1201が出力した分散と閾値を照らし合わせて重み付けパラメータYを設定する。ここで、例として閾値をT1、T2(T1<T2)、重み付け設定用パラメータYを0、1、2とする。差プレーンの分散δがT1以下(T1≧δ)の場合にY=0とする。分散がT1とT2の間の値である場合(T1<δ<T2)にY=1とする。分散がT2以上の場合(T2≦δ)にY=2とする。差プレーンの分散δが大きい場合、差プレーンの発生符号量が大きくなる。そこで分散が大きいときに設定されるY=2の場合は、差プレーンの符号量をできるだけ少なくしない(増やす)ように重み付けを設定する。逆に、分散が小さいほど差プレーンの発生符号量は少なくなる。そこで分散が小さいときに設定されるY=0の場合は、和プレーンの符号量をできるだけ多くするように重み付けが設定される。   Subsequently, analysis of variance of the difference plane and weighting of the code amount will be described. As described above, the weighting setting unit 1202 has a plurality of threshold values, and sets the weighting parameter Y by comparing the variance output from the image feature analysis unit 1201 with the threshold values. Here, as an example, the threshold values are T1, T2 (T1 <T2), and the weight setting parameter Y is 0, 1, 2. When the variance δ of the difference plane is T1 or less (T1 ≧ δ), Y = 0. When the variance is a value between T1 and T2 (T1 <δ <T2), Y = 1 is set. When the dispersion is equal to or greater than T2 (T2 ≦ δ), Y = 2. When the variance δ of the difference plane is large, the generated code amount of the difference plane increases. Therefore, when Y = 2, which is set when the variance is large, weighting is set so as not to reduce (increase) the code amount of the difference plane as much as possible. Conversely, the smaller the variance, the smaller the generated code amount of the difference plane. Therefore, when Y = 0, which is set when the variance is small, weighting is set so as to increase the code amount of the sum plane as much as possible.

また、重み付け前の目標符号量として、基本の目標符号量が、符号量制御部127によって別途設定される。ここでは、RAWデータ全体の目標符号量を、プレーン数で等分した値を用いる。符号量の重み付けは、和プレーンの符号量が、差プレーン符号量よりも多くなるように設定される。符号量の重み付けについて例を示すと、Y=0の場合は、和プレーンの目標符号量を10%増大、差プレーンの目標符号量を10%減少させる。また、Y=1の場合に和プレーンの目標符号量を5%減少、差プレーンの目標符号量を5%増大させ、Y=2の場合に和プレーンの目標符号量を20%減少、差プレーンの目標符号量を20%増加させる。なお、ここに示す目標符号量の比率についてはあくまで一例であって、差プレーンの分散が大きいほど差プレーンに目標符号量を多めに割り振り、分散が小さくなるほど和プレーンに目標符号量を多めに割り振れればよい。   In addition, a basic target code amount is separately set by the code amount control unit 127 as the target code amount before weighting. Here, a value obtained by equally dividing the target code amount of the entire RAW data by the number of planes is used. The code amount weighting is set such that the sum plane code amount is larger than the difference plane code amount. As an example of the weighting of the code amount, when Y = 0, the target code amount of the sum plane is increased by 10%, and the target code amount of the difference plane is decreased by 10%. Further, when Y = 1, the target code amount of the sum plane is decreased by 5%, the target code amount of the difference plane is increased by 5%, and when Y = 2, the target code amount of the sum plane is decreased by 20%. Is increased by 20%. The ratio of the target code amount shown here is merely an example. The larger the variance of the difference plane, the more target code amount is allocated to the difference plane, and the smaller the variance is, the more target code amount is allocated to the sum plane. Just swing.

尚、本実施形態では1フレーム単位での処理の例を示したが、任意の大きさの領域に分割して、それぞれで独立して上記の処理を実行しても良い。本実施形態ではウェーブレット変換を用いた実施例を示したが、JPEGやJPEG XR、MPEG−4 AVC等の符号化技術で用いられている離散コサイン変換を代わりに用いても良い。更に、エントロピー符号化をハフマン符号化にしても良い。   In the present embodiment, an example of processing in units of one frame has been shown, but the above processing may be executed independently by dividing into regions of an arbitrary size. In the present embodiment, an example using wavelet transform is shown, but discrete cosine transform used in coding techniques such as JPEG, JPEG XR, MPEG-4 AVC, etc. may be used instead. Furthermore, the entropy coding may be Huffman coding.

本実施形態によれば、低域成分への目標符号量を高域成分への目標符号量よりは多めに割り振りながらも、画像の特徴に基づいて、高域成分への目標符号量を適切に増減させることで画質を向上させることが出来る。輪郭がはっきりと出ている画像の場合は、輪郭がぼけた絵に比べて、隣接画素間の画素値の差が大きいため、差プレーンの分散が大きくなる。そこで、差プレーンの分散が大きいとき、差プレーンつまり高域成分への目標符号量を多めに割り振ることで、画像の輪郭を保つことができる。また、空模様などの隣接画素間の差が小さい平坦な画像の場合は、差プレーンの分散が小さくなる。そこで、差プレーンの分散が小さいときに、差プレーンの目標符号量を少なくし、和プレーンつまり低域成分の符号量を多くすることで、画質を良くすることが出来る。   According to the present embodiment, the target code amount for the high frequency component is appropriately set based on the characteristics of the image while the target code amount for the low frequency component is allocated more than the target code amount for the high frequency component. The image quality can be improved by increasing or decreasing. In the case of an image having a clear outline, since the difference in pixel values between adjacent pixels is larger than that in a picture with a blurred outline, the variance of the difference plane is increased. Therefore, when the variance of the difference plane is large, the outline of the image can be maintained by assigning a larger target code amount to the difference plane, that is, the high frequency component. Further, in the case of a flat image with a small difference between adjacent pixels such as a sky pattern, the variance of the difference plane is reduced. Therefore, when the variance of the difference plane is small, the image quality can be improved by reducing the target code amount of the difference plane and increasing the sum plane, that is, the code amount of the low frequency component.

尚、本実施形態では、差プレーンに対して画像特徴解析処理を行ったが、和プレーン、あるいはR、Bプレーンに対して画像特徴解析処理を行っても良い。その場合においても、解析処理の結果に基づき高域成分と低域成分とでどちらの成分が多いか、言い換えれば、どちらの成分に対してより符号量を割り当てるべきかを判別して、差プレーンと和プレーンのいずれに対して符号量を多く割り当てるかを決定することができる。例えば、和プレーンにおける分散を計算した場合、空模様など平坦度のより高い画像については和プレーンにおいても分散が小さくなり、平坦度が高い、即ち和プレーンに対する符号量を多くすべきことが判別できる。また、和プレーンの分散が大きい場合には、逆に差プレーンに対する符号量を多くすべきことを決定できる。   In this embodiment, the image feature analysis process is performed on the difference plane. However, the image feature analysis process may be performed on the sum plane or the R and B planes. Even in that case, the difference plane is determined by determining which component is higher in the high frequency component and the low frequency component based on the result of the analysis process, in other words, which component should be assigned the more code amount. It is possible to determine which of the sum plane and the code amount is to be allocated more. For example, when the variance in the sum plane is calculated, it can be determined that the image having a higher flatness such as a sky pattern has a smaller variance in the sum plane, and the flatness is high, that is, the code amount for the sum plane should be increased. On the contrary, when the variance of the sum plane is large, it can be determined that the code amount for the difference plane should be increased.

[実施形態5]
続いて、第5の実施形態に対応する符号化方法について説明する。本実施形態は、実施形態1〜4とは、目標符号量の設定方法が異なっているが、撮像装置100及び符号化部として機能する画像処理部104の構成は実施形態1の図1A及び図1Bに示したものと同様である。本実施形態では、実施形態2のようにプレーン毎の重みづけを行い、さらに、実施形態3のようにサブバンド毎の重みづけも行う。基本的な処理は同じであるため、説明は省略し、実施形態1〜4と異なる部分のみ、図14を参照して説明する。
[Embodiment 5]
Subsequently, an encoding method corresponding to the fifth embodiment will be described. Although the present embodiment differs from the first to fourth embodiments in the target code amount setting method, the configuration of the image processing unit 104 that functions as the imaging device 100 and the encoding unit is the same as that of FIG. It is the same as that shown in 1B. In the present embodiment, weighting is performed for each plane as in the second embodiment, and weighting is performed for each subband as in the third embodiment. Since the basic processing is the same, the description is omitted, and only the parts different from the first to fourth embodiments will be described with reference to FIG.

図14(a)は、ベイヤ配列のRAW画像をG1、G2、B、Rプレーンに分離して、ウェーブレット変換して得られたサブバンド毎に符号化する場に、各プレーン、サブバンドに目標符号量を割り当てた場合を示している。この場合は、各プレーン、各サブバンドに対して、均等に目標符号量を割り当てている。
RAWデータ1フレームに対する目標符号量を100%としたときに、G1、G2、B、Rの各プレーンには、それぞれ25%割り当てられる。そして、プレーン内では、プレーンに割り当てたれた目標符号量を100%としたときに、それぞれのサブバンド(LL、HL、LH、HH)には、25%ずつ目標符号量が割り当てられる。各サブバンドのカッコ内の数値は、1フレームに対する目標符号量を100%としたときに、各サブバンドに割り当てられる目標符号量を示している。
FIG. 14 (a) shows a case where a Bayer array RAW image is separated into G1, G2, B, and R planes and encoded for each subband obtained by wavelet transform. The case where the code amount is allocated is shown. In this case, the target code amount is equally allocated to each plane and each subband.
When the target code amount for one frame of RAW data is 100%, 25% is allocated to each of the G1, G2, B, and R planes. In the plane, when the target code amount assigned to the plane is 100%, each subband (LL, HL, LH, HH) is assigned a target code amount of 25%. The numerical value in parentheses of each subband indicates the target code amount assigned to each subband when the target code amount for one frame is 100%.

これに対し、図14(b)は、G1/G2プレーンから、和プレーン、差プレーンを生成し、和、差、B,Rプレーンを符号化する場合に、プレーンおよびサブバンドに応じて重みづけを行って目標符号量を割り当てた場合の目標符号量の割り当てを示している。1フレームの目標符号量を100%としたとき、和プレーンに30%、差プレーンに20%、B/Rプレーンには、図14(a)と同様に25%割り当てている。   On the other hand, in FIG. 14B, when generating a sum plane and a difference plane from the G1 / G2 plane and encoding the sum, difference, and B and R planes, weighting is performed according to the plane and subband. Shows the assignment of the target code amount when the target code amount is assigned by performing the above. Assuming that the target code amount of one frame is 100%, 30% is allocated to the sum plane, 20% is allocated to the difference plane, and 25% is allocated to the B / R plane, as in FIG.

和プレーンはRAWデータの緑の低域成分に相当し、差プレーンは、緑の高域成分に相当する。画像データにおいて、低域成分は重要な成分であり、低域成分の損失が大きいと画質が劣化するため、和プレーンには目標符号量を多く割り当てている。そして、高域成分は低域成分よりも重要度は低いため、差プレーンは、和プレーン、Bプレーン、Rプレーンよりも、少ない目標符号量を割りあてている。   The sum plane corresponds to the green low-frequency component of the RAW data, and the difference plane corresponds to the green high-frequency component. In the image data, the low frequency component is an important component, and if the loss of the low frequency component is large, the image quality deteriorates. Therefore, a large target code amount is allocated to the sum plane. Since the high frequency component is less important than the low frequency component, the difference plane is assigned a smaller target code amount than the sum plane, B plane, and R plane.

また、各プレーンの目標符号量を、さらに、サブバンド毎に割り当てている。和プレーンについては、LL:HL:LH:HH=44:20:20:16となるようにサブバンド目標符号量を割り当てている。このとき、やはり低域成分が重要な成分であるため低域のサブバンドに目標符号量をより多く割り当てている。1フレームに対する目標符号量を100%としたときに、和プレーンには30%のプレーン目標符号量が割り当てられている。そのため、1フレームの目標符号量に対する各サブバンドの目標符号量の比率は、LLは13.2%、HLは6%、LHは6%、HHは4.8%となる。   Further, the target code amount of each plane is further assigned for each subband. For the sum plane, the subband target code amount is assigned such that LL: HL: LH: HH = 44: 20: 20: 16. At this time, since the low frequency component is also an important component, a larger amount of target code is allocated to the low frequency sub-band. When the target code amount for one frame is 100%, a plane target code amount of 30% is assigned to the sum plane. Therefore, the ratio of the target code amount of each subband to the target code amount of one frame is 13.2% for LL, 6% for HL, 6% for LH, and 4.8% for HH.

差プレーンについては、LL:HL:LH:HH=13:29:29:29となるようにサブバンド目標符号量を割り当てている。このとき、差プレーンは緑の高域成分に相当するため、差プレーンでは、高域のサブバンドに目標符号量をより多く割り当てて、他のプレーンでの高域のサブバンドへの目標符号量の割り当ての割合よりも多い割合となるようにしている。なお、図14(b)の例では、HL、LH、HHの割当て比率は同一であるが、HHをより高い比率としても良い。1フレームに対する目標符号量を100%としたときに、差プレーンには20%のプレーン目標符号量が割り当てられている。そのため、1フレームの目標符号量に対する各サブバンドの目標符号量の比率は、LLは2.6%、HLは5.8%、LHは5.8%、HHは5.8%となる。ここで、差プレーンのHHサブバンドの目標符号量は、和プレーンのHHサブバンドの目標符号量よりも大きくなっている。   For the difference plane, the subband target code amount is assigned such that LL: HL: LH: HH = 13: 29: 29: 29. At this time, since the difference plane corresponds to a green high-frequency component, in the difference plane, a higher target code amount is allocated to the high-frequency subband, and the target code amount to the high-frequency subband in the other planes The ratio is larger than the allocation ratio. In the example of FIG. 14B, the allocation ratio of HL, LH, and HH is the same, but HH may be a higher ratio. When the target code amount for one frame is 100%, a 20% plane target code amount is assigned to the difference plane. Therefore, the ratio of the target code amount of each subband to the target code amount of one frame is 2.6% for LL, 5.8% for HL, 5.8% for LH, and 5.8% for HH. Here, the target code amount of the HH subband of the difference plane is larger than the target code amount of the HH subband of the sum plane.

BプレーンおよびRプレーンについては、LL:HL:LH:HH=25:25:25:25となるようにサブバンド目標符号量を割り当てている。1フレームに対する目標符号量を100%としたときに、B/Rプレーンには25%のプレーン目標符号量が割り当てられている。そのため、1フレームの目標符号量に対する各サブバンドの目標符号量の比率は、全て6.25%となる。   For the B plane and the R plane, the subband target code amount is assigned so that LL: HL: LH: HH = 25: 25: 25: 25. When the target code amount for one frame is 100%, a plane target code amount of 25% is allocated to the B / R plane. Therefore, the ratio of the target code amount of each subband to the target code amount of one frame is all 6.25%.

このような比率で1フレームに与えられた目標符号量を、各サブバンドに割り当て、割り当てられた目標符号量に基づいて、上述の実施例で説明したように、量子化および符号化を行う。また、本実施形態では、図14の目標符号量の比率で各プレーン、各サブバンドに目標符号量を割り当てた。しかし、さらに、実施形態4のように画像の解析を行って、解析結果に応じて、図14の目標符号量の比率にさらに重みづけを行って、目標符号量を決定するようにしてもよい。この場合、画像解析の結果、プレーン目標符号量に重みづけをおこなってもよいし、サブバンド目標符号量に重みづけをおこなってもいし、プレーン目標符号量とサブバンド目標符号量の両方に重みづけをおこなってもよい。   A target code amount given to one frame at such a ratio is assigned to each subband, and quantization and encoding are performed based on the assigned target code amount as described in the above-described embodiment. In this embodiment, the target code amount is assigned to each plane and each subband at the ratio of the target code amount shown in FIG. However, the image may be analyzed as in the fourth embodiment, and the target code amount may be determined by further weighting the ratio of the target code amount in FIG. 14 according to the analysis result. . In this case, as a result of the image analysis, the plane target code amount may be weighted or the subband target code amount may be weighted, and both the plane target code amount and the subband target code amount are weighted. It may be done.

(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other examples)
The present invention supplies a program that realizes one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in a computer of the system or apparatus read and execute the program This process can be realized. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

100:撮像装置、101:制御部、102:操作部 100: imaging device, 101: control unit, 102: operation unit

Claims (18)

ベイヤー配列の画像データを符号化する画像処理装置であって、
前記画像データを構成する複数の色成分を前記ベイヤー配列に基づき複数のプレーン画像データに分離する色分離手段と、
前記複数のプレーン画像データのうち、同色の成分同士を加算して和プレーンのプレーン画像データを生成する和プレーン生成手段と、
前記同色の成分同士を減算して差プレーンのプレーン画像データを生成する差プレーン生成手段と、
前記プレーン画像データを圧縮符号化する符号化手段であって、前記同色の成分のプレーン画像データについては、前記和プレーン及び前記差プレーンのプレーン画像データを圧縮符号化する符号化手段と
を備えることを特徴とする画像処理装置。
An image processing apparatus for encoding Bayer array image data,
Color separation means for separating a plurality of color components constituting the image data into a plurality of plane image data based on the Bayer array;
A sum plane generating means for generating a sum plane plane image data by adding components of the same color among the plurality of plane image data;
Difference plane generating means for subtracting the same color components to generate plane image data of a difference plane;
Coding means for compressing and coding the plain image data, the plain image data of the same color component comprising coding means for compressing and coding the plain image data of the sum plane and the difference plane An image processing apparatus.
前記符号化手段が圧縮符号化するプレーン画像データのそれぞれに対し、該圧縮符号化における目標符号量を設定する設定手段を更に備え、
前記設定手段は、前記和プレーンのプレーン画像データに対する目標符号量と前記差プレーンのプレーン画像データに対する目標符号量とを同じに設定することを特徴とする請求項1に記載の画像処理装置。
A setting means for setting a target code amount in the compression encoding for each of the plain image data to be compression-encoded by the encoding means;
The image processing apparatus according to claim 1, wherein the setting unit sets the target code amount for the plane image data of the sum plane and the target code amount for the plane image data of the difference plane to be the same.
前記符号化手段が圧縮符号化するプレーン画像データのそれぞれに対し、該圧縮符号化における目標符号量を設定する設定手段を更に備え、
前記設定手段は、前記和プレーンのプレーン画像データに対する目標符号量を、前記差プレーンのプレーン画像データに対する目標符号量よりも多く設定することを特徴とする請求項1に記載の画像処理装置。
A setting means for setting a target code amount in the compression encoding for each of the plain image data to be compression-encoded by the encoding means;
The image processing apparatus according to claim 1, wherein the setting unit sets a target code amount for the plane image data of the sum plane larger than a target code amount for the plane image data of the difference plane.
前記和プレーンのプレーン画像データに対する目標符号量と前記差プレーンのプレーン画像データに対する目標符号量との合計は、前記和プレーンのプレーン画像データに対する目標符号量と前記差プレーンのプレーン画像データに対する目標符号量とを同じに設定した場合の合計と同じであることを特徴とする請求項3に記載の画像処理装置。   The sum of the target code amount for the plane image data of the sum plane and the target code amount for the plane image data of the difference plane is the target code amount for the plane image data of the sum plane and the target code for the plane image data of the difference plane. The image processing apparatus according to claim 3, wherein the amount is the same as the total when the amount is set to be the same. 前記プレーン画像データを周波数帯域毎に階層的に変換する変換手段を更に備え、
前記符号化手段は、前記変換手段が変換したプレーン画像データを圧縮符号化し、
前記設定手段は、前記変換手段が生成するサブバンドごとに目標符号量を設定することを特徴とする請求項2乃至4のいずれか1項に記載の画像処理装置。
Further comprising conversion means for hierarchically converting the plain image data for each frequency band;
The encoding means compresses and encodes the plain image data converted by the conversion means,
The image processing apparatus according to claim 2, wherein the setting unit sets a target code amount for each subband generated by the conversion unit.
前記符号化手段は、前記変換手段が変換した前記和プレーンのプレーン画像データと前記差プレーンのプレーン画像データとにつき、低域成分を抽出したサブバンドの和プレーンと差プレーンとの目標符号量の比率に対して、高域成分を抽出したサブバンドの和プレーンと差プレーンとの目標符号量の比率の方が、差プレーンに与える目標符号量が大きくなるように圧縮符号化することを特徴とする請求項5に記載の画像処理装置。   The encoding means has a target code amount of the subband sum plane and difference plane from which low-frequency components are extracted for the plane image data of the sum plane and the plane image data of the difference plane converted by the conversion means. The ratio of the target code amount of the sub-band sum plane and the difference plane from which the high frequency component is extracted to the ratio is compression-encoded so that the target code amount given to the difference plane is larger. The image processing apparatus according to claim 5. 前記設定手段は、前記和プレーンにおいては、高域のサブバンドよりも低域のサブバンドに目標符号量が多く割り当てられるように目標符号量を設定し、前記差プレーンにおいては、低域のサブバンドよりも高域のサブバンドに目標符号量が多く割り当てられるように目標符号量を設定することを特徴とする請求項5に記載の画像処理装置。   The setting means sets a target code amount so that a larger target code amount is allocated to a low-frequency subband than a high-frequency subband in the sum plane, and a low-frequency subband in the difference plane. 6. The image processing apparatus according to claim 5, wherein the target code amount is set so that a larger target code amount is allocated to a sub-band higher than the band. 前記設定手段は、前記和プレーンの目標符号量を、前記差プレーンの目標符号量よりも大きく設定し、前記差プレーンのHHサブバンドの目標符号量を、前記和プレーンのHHサブバンドの目標符号量よりも大きく設定することを特徴とする請求項5に記載の画像処理装置。   The setting means sets the target code amount of the sum plane to be larger than the target code amount of the difference plane, and sets the target code amount of the HH subband of the difference plane to the target code of the HH subband of the sum plane. The image processing apparatus according to claim 5, wherein the image processing apparatus is set to be larger than the amount. 前記画像データが有する画像の特徴を解析して解析情報を生成する解析手段を更に備え、
前記設定手段は、前記解析情報を用いて前記和プレーンのプレーン画像データに対する目標符号量と、前記差プレーンのプレーン画像データに対する目標符号量とを設定することを特徴とする請求項2乃至8のいずれか1項に記載の画像処理装置。
Further comprising analysis means for generating analysis information by analyzing image characteristics of the image data;
9. The setting unit according to claim 2, wherein the setting unit sets a target code amount for plane image data of the sum plane and a target code amount for plane image data of the difference plane using the analysis information. The image processing apparatus according to any one of the above.
前記解析情報は、前記色成分のプレーン画像データにおける画素値の分散を示すことを特徴とする請求項9に記載の画像処理装置。   The image processing apparatus according to claim 9, wherein the analysis information indicates a variance of pixel values in the plain image data of the color component. 前記設定手段は、前記分散が大きいほど前記差プレーンのプレーン画像データに対する目標符号量を増やすことを特徴とする請求項10に記載の画像処理装置。   The image processing apparatus according to claim 10, wherein the setting unit increases a target code amount for plane image data of the difference plane as the variance increases. 前記解析情報は、前記和プレーンのプレーン画像データにおける画素値の分散であることを特徴とする請求項9乃至11のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 9, wherein the analysis information is a variance of pixel values in the plane image data of the sum plane. 前記解析情報は、前記差プレーンのプレーン画像データにおける画素値の分散であることを特徴とする請求項9乃至11のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 9, wherein the analysis information is a variance of pixel values in the plane image data of the difference plane. 前記ベイヤー配列は、第1の緑成分、第2の緑成分、青成分及び赤成分で構成され、前記同色の成分は、前記第1の緑成分と前記第2の緑成分であることを特徴とする請求項1乃至13のいずれか1項に記載の画像処理装置。   The Bayer array includes a first green component, a second green component, a blue component, and a red component, and the same-color components are the first green component and the second green component. The image processing apparatus according to any one of claims 1 to 13. 前記ベイヤー配列は、第1の赤成分、第2の赤成分、第1の青成分、第2の青成分及び緑成分で構成され、前記同色の成分は、前記第1の赤成分と前記第2の赤成分、及び前記第1の青成分と前記第2の青成分であることを特徴とする請求項1乃至13のいずれか1項に記載の画像処理装置。   The Bayer array includes a first red component, a second red component, a first blue component, a second blue component, and a green component, and the same color component includes the first red component and the first red component. The image processing apparatus according to claim 1, wherein the image processing apparatus includes two red components, and the first blue component and the second blue component. 被写体像を撮像しベイヤー配列の画像データを生成する撮像手段と、
前記ベイヤー配列の画像データを符号化する請求項1乃至15のいずれか1項に記載の画像処理装置と
を備えることを特徴とする撮像装置。
Imaging means for capturing a subject image and generating Bayer array image data;
An image processing apparatus comprising: the image processing apparatus according to claim 1, wherein the image processing apparatus encodes the Bayer array image data.
ベイヤー配列の画像データを符号化する画像処理方法であって、
前記画像データを構成する複数の色成分を前記ベイヤー配列に基づき複数のプレーン画像データに分離する色分離工程と、
前記複数のプレーン画像データのうち、同色の成分同士を加算して和プレーンのプレーン画像データを生成する和プレーン生成工程と、
前記同色の成分同士を減算して差プレーンのプレーン画像データを生成する差プレーン生成工程と、
前記プレーン画像データを圧縮符号化する符号化工程であって、前記同色の成分のプレーン画像データについては、前記和プレーン及び前記差プレーンのプレーン画像データを圧縮符号化する符号化工程と
を含むことを特徴とする画像処理方法。
An image processing method for encoding Bayer array image data,
A color separation step of separating a plurality of color components constituting the image data into a plurality of plane image data based on the Bayer array;
Of the plurality of plane image data, a sum plane generation step of adding the same color components to generate the plane image data of the sum plane;
A difference plane generating step for generating plane image data of a difference plane by subtracting the same color components;
An encoding step of compressing and encoding the plain image data, the encoding step of compressing and encoding the plain image data of the sum plane and the difference plane for the plain image data of the same color component An image processing method characterized by the above.
コンピュータに、ベイヤー配列の画像データを符号化する画像処理方法を実行させるためのプログラムであって、
前記画像処理方法は、
前記画像データを構成する複数の色成分を前記ベイヤー配列に基づき複数のプレーン画像データに分離する色分離工程と、
前記複数のプレーン画像データのうち、同色の成分同士を加算して和プレーンのプレーン画像データを生成する和プレーン生成工程と、
前記同色の成分同士を減算して差プレーンのプレーン画像データを生成する差プレーン生成工程と、
前記プレーン画像データを圧縮符号化する符号化工程であって、前記同色の成分のプレーン画像データについては、前記和プレーン及び前記差プレーンのプレーン画像データを圧縮符号化する符号化工程と
を含むことを特徴とするプログラム。
A program for causing a computer to execute an image processing method for encoding Bayer array image data,
The image processing method includes:
A color separation step of separating a plurality of color components constituting the image data into a plurality of plane image data based on the Bayer array;
Of the plurality of plane image data, a sum plane generation step of adding the same color components to generate the plane image data of the sum plane;
A difference plane generating step for generating plane image data of a difference plane by subtracting the same color components;
An encoding step of compressing and encoding the plane image data, the encoding step of compressing and encoding the plane image data of the sum plane and the difference plane for the plane image data of the same color component A program characterized by
JP2016196000A 2015-10-30 2016-10-03 Image processing equipment, imaging equipment, image processing methods and programs Active JP6875817B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/333,403 US10032252B2 (en) 2015-10-30 2016-10-25 Image processing apparatus, image capturing apparatus, image processing method, and non-transitory computer readable storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2015214802 2015-10-30
JP2015214802 2015-10-30

Publications (2)

Publication Number Publication Date
JP2017085556A true JP2017085556A (en) 2017-05-18
JP6875817B2 JP6875817B2 (en) 2021-05-26

Family

ID=58713375

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016196000A Active JP6875817B2 (en) 2015-10-30 2016-10-03 Image processing equipment, imaging equipment, image processing methods and programs

Country Status (1)

Country Link
JP (1) JP6875817B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019142821A1 (en) * 2018-01-16 2019-07-25 株式会社ニコン Encoder, decoder, encoding method, decoding method, encoding program, and decoding program

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1141613A (en) * 1997-07-17 1999-02-12 Nec Corp Digital camera
JP2005286415A (en) * 2004-03-26 2005-10-13 Olympus Corp Image compression method and image compression device
JP2006067390A (en) * 2004-08-27 2006-03-09 Olympus Corp Imaging apparatus and reproducing apparatus
WO2012101708A1 (en) * 2011-01-28 2012-08-02 日本電気株式会社 2d signal encoding device
WO2013187132A1 (en) * 2012-06-11 2013-12-19 富士フイルム株式会社 Image-processing device, imaging-capturing device, computer, image-processing method, and program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1141613A (en) * 1997-07-17 1999-02-12 Nec Corp Digital camera
JP2005286415A (en) * 2004-03-26 2005-10-13 Olympus Corp Image compression method and image compression device
JP2006067390A (en) * 2004-08-27 2006-03-09 Olympus Corp Imaging apparatus and reproducing apparatus
WO2012101708A1 (en) * 2011-01-28 2012-08-02 日本電気株式会社 2d signal encoding device
WO2013187132A1 (en) * 2012-06-11 2013-12-19 富士フイルム株式会社 Image-processing device, imaging-capturing device, computer, image-processing method, and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019142821A1 (en) * 2018-01-16 2019-07-25 株式会社ニコン Encoder, decoder, encoding method, decoding method, encoding program, and decoding program

Also Published As

Publication number Publication date
JP6875817B2 (en) 2021-05-26

Similar Documents

Publication Publication Date Title
US10032252B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and non-transitory computer readable storage medium
CN106612432B (en) Coding method and decoding processing method
CN117793373A (en) Machine learning video processing system and method
TWI436287B (en) Method and apparatus for coding image
JP2004128583A (en) Imaging apparatus, image processing method, program, and recording medium
JPWO2007066710A1 (en) Encoding apparatus, encoding method and encoding program, and decoding apparatus, decoding method and decoding program
JPWO2007066709A1 (en) Encoding apparatus, encoding method and encoding program, and decoding apparatus, decoding method and decoding program
JP6986868B2 (en) Image coding device, image decoding device, image coding method, image decoding method, program
JP2021077942A (en) Encoding apparatus, encoding method, decoding apparatus and decoding method
JP6512916B2 (en) Image pickup apparatus, control method thereof and program
JP7001383B2 (en) Coding device, coding method, and program
JP6871727B2 (en) Imaging equipment, image processing methods, and programs
JP6875817B2 (en) Image processing equipment, imaging equipment, image processing methods and programs
JP7033013B2 (en) Image coding device, image decoding device, their control method, and program
JP6792370B2 (en) Image processing equipment, its control method, and computer programs
JP7129326B2 (en) IMAGING DEVICE, CONTROL METHOD AND PROGRAM THEREOF
US20230133895A1 (en) Image encoding apparatus and method for controlling the same and non-transitory computer-readable storage medium
JP6849359B2 (en) Coding device, coding device control method, and program
JP2006074130A (en) Image decoding method, image decoding apparatus, and imaging apparatus
JP4375662B2 (en) Image processing apparatus, image processing method, program, information recording medium, and imaging apparatus
JP6775339B2 (en) Image coding device and its control method
JP6465570B2 (en) IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD
JP6907004B2 (en) Image processing equipment, image processing methods, and programs
JP7321237B2 (en) Image encoding device, image encoding method, program
JP2023070055A (en) Image encoding device, control method thereof, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190920

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200721

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200803

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20201002

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20210103

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210113

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210423

R151 Written notification of patent or utility model registration

Ref document number: 6875817

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151