JP6242244B2 - Imaging apparatus, imaging method, and program - Google Patents

Imaging apparatus, imaging method, and program Download PDF

Info

Publication number
JP6242244B2
JP6242244B2 JP2014038264A JP2014038264A JP6242244B2 JP 6242244 B2 JP6242244 B2 JP 6242244B2 JP 2014038264 A JP2014038264 A JP 2014038264A JP 2014038264 A JP2014038264 A JP 2014038264A JP 6242244 B2 JP6242244 B2 JP 6242244B2
Authority
JP
Japan
Prior art keywords
image
image data
data
unit
compression
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.)
Active
Application number
JP2014038264A
Other languages
Japanese (ja)
Other versions
JP2015162851A (en
Inventor
学 市川
学 市川
拓也 松永
拓也 松永
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.)
Olympus Corp
Original Assignee
Olympus Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Olympus Corp filed Critical Olympus Corp
Priority to JP2014038264A priority Critical patent/JP6242244B2/en
Publication of JP2015162851A publication Critical patent/JP2015162851A/en
Application granted granted Critical
Publication of JP6242244B2 publication Critical patent/JP6242244B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、複数の画像データを合成し、合成画像を生成可能な撮像装置、撮像方法、およびプログラムに関する。   The present invention relates to an imaging apparatus, an imaging method, and a program capable of synthesizing a plurality of image data and generating a synthesized image.

デジタルカメラ等の撮像装置において、複数の画像を撮影し、この複数の画像を合成することにより、1枚の画像では表現できない画質を実現する機能を搭載したものが市販されている。   An imaging device such as a digital camera is commercially available that has a function of realizing a picture quality that cannot be represented by a single image by taking a plurality of images and combining the plurality of images.

複数の画像を合成する技術としては、例えば、焦点位置を移動しながら複数の画像を撮影し、この撮影によって取得した複数の画像データを用い、被写体の位置合わせを行い、画像を合成することで、全焦点画像やボケをコントロールした画像を生成することが提案されている(特許文献1参照)。また、階調の異なる複数の画像を撮影し、この撮影によって取得した複数の画像データを合成することにより、単体の画像では実現できない階調特性を有するHDR(High Dynamic Range)効果のある画像を生成することが提案されている(特許文献2参照)。   As a technique for synthesizing a plurality of images, for example, a plurality of images are photographed while moving a focal position, a plurality of image data acquired by the photographing is used, a subject is aligned, and the images are synthesized. In addition, it has been proposed to generate an omnifocal image or an image in which blur is controlled (see Patent Document 1). In addition, by photographing a plurality of images having different gradations and combining a plurality of image data acquired by the photographing, an image having an HDR (High Dynamic Range) effect having gradation characteristics that cannot be realized by a single image. Producing is proposed (see Patent Document 2).

特開2008−271240号公報JP 2008-271240 A 特開2011−004353号公報JP 2011-004353 A

このように、複数の画像データを合成し、合成画像データを生成する技術は種々提案されているが、画像を合成する際に、一般に画像枚数を多くするほど、良好な結果を得られる。このため、画質の観点からは撮影枚数を可能な限り多くすることが好ましいといえる。一方、デジタルカメラ等の撮像装置に搭載されているSDRAM等のメモリは容量が限られているために、同時に記憶できる画像データの数も限られている。   As described above, various techniques for synthesizing a plurality of image data and generating the synthesized image data have been proposed. However, when the images are synthesized, generally, as the number of images increases, a better result can be obtained. For this reason, it can be said that it is preferable to increase the number of shots as much as possible from the viewpoint of image quality. On the other hand, a memory such as an SDRAM mounted on an imaging apparatus such as a digital camera has a limited capacity, and therefore the number of image data that can be stored simultaneously is also limited.

本発明は、このような事情を鑑みてなされたものであり、限られた容量において、可能な限り多くの撮影枚数を確保でき、十分な画質の合成画像を生成可能な撮像装置、撮像方法、およびプログラムを提供することを目的とする。   The present invention has been made in view of such circumstances, and an imaging device, an imaging method, and an imaging device that can secure as many shots as possible and generate a composite image with sufficient image quality in a limited capacity. And to provide a program.

上記目的を達成するため第1の発明に係る撮像装置は、被写体を撮像素子で撮像して画像データを出力する撮像部と、上記被写体を、上記撮像部の撮像素子に合焦させるように合焦位置を調節する合焦部と、上記画像データから基準画像データを生成する基準画像生成部と、上記画像データのデータ量を削減し、上記基準画像データよりデータ量の少ない合成用画像データを生成する画像データ量削減部と、上記基準画像データと上記合成用画像データを用いて画像データの合成を行い、合成画像データを生成する画像合成部と、を有し、上記画像データ量削減部は、上記画像データのガンマ成分を抽出し、ガンマ成分に応じた圧縮特性に基づきデータ量を削減し、上記合焦部により、複数の異なる合焦位置のそれぞれの合焦位置において、上記撮像部により出力される複数の画像データを取得し、上記画像データ量削減部により、上記複数の画像データのそれぞれのデータ量を削減し、上記画像合成部により合成画像データを生成する。 In order to achieve the above object, an image pickup apparatus according to a first aspect of the present invention focuses an image pickup unit that picks up a subject with an image pickup element and outputs image data, and focuses the subject on the image pickup element of the image pickup unit. A focusing unit that adjusts a focal position; a reference image generation unit that generates reference image data from the image data; and a data amount of the image data is reduced, and composition image data having a data amount smaller than the reference image data is reduced. and generating image data amount reduction unit which performs the synthesis of image data by using the reference image data and the image data for the above synthesis, an image combining unit for generating a composite image data, the possess, the image data amount reduction unit Extracts the gamma component of the image data, reduces the amount of data based on the compression characteristics according to the gamma component, and at each in-focus position of a plurality of different in-focus positions by the in-focus unit, Obtaining a plurality of image data output by the serial imaging unit by the image data quantity reduction unit reduces the respective amount of data of the plurality of image data to generate synthesized image data by the image combining unit.

第2の発明に係る撮像装置は、上記第1の発明において、上記画像データ量削減部は、上記画像データのビット精度を低下させる。
第3の発明に係る撮像装置は、上記第の発明において、上記画像データ削減部は、テーブルまたは折れ線による階調変換部を含み、上記画像データに対して階調変換する
In the imaging device according to a second aspect of the present invention, in the first aspect, the image data amount reduction unit reduces the bit accuracy of the image data.
According to a third aspect of the present invention, in the image pickup apparatus according to the first aspect , the image data amount reduction unit includes a gradation conversion unit using a table or a broken line, and performs gradation conversion on the image data.

第4の発明に係る撮像装置は、上記第1の発明において、上記画像データ削減部は、上記画像データを符号化して圧縮する圧縮部を含む
第5の発明に係る撮像装置は、上記第4の発明において、上記圧縮部は非可逆圧縮を行う。
第6の発明に係る撮像装置は、上記第1の発明において、上記画像データ削減部は、色差信号のデータ量を削減する。
In the imaging device according to a fourth aspect based on the first aspect, the image data amount reduction unit includes a compression unit that encodes and compresses the image data. In the fourth invention, the compression unit performs lossy compression.
Imaging device according to a sixth invention, in the above Symbol first invention, the image data amount reduction unit to reduce the amount of data of the color difference signal.

の発明に係る撮像装置は、上記第1の発明において、上記基準画像データは、上記画像合成部において合成を行う複数の画像データの内、最初に撮像された画像データ、またはピントの合っている画像データである。 The image pickup apparatus according to a seventh invention is the image pickup apparatus according to the first invention, wherein the reference image data is the first image data picked up from a plurality of pieces of image data to be combined in the image combiner, or in focus. and that is the image data.

の発明に係る撮像装置は、上記第1の発明において、上記合成画像データを記録する画像記録部を有し、上記画像データ量削減部によってデータ量が削減された合成用画像データを用いて、上記合成画像データを生成した場合には、上記合成画像データに削減情報を添付の上、上記画像記録部に記録する。
の発明に係る撮像装置は、上記第1の発明において、上記画像データ量削減部は、非可逆な方式によりデータ量を削減する。
An imaging apparatus according to an eighth aspect of the present invention is the imaging apparatus according to the first aspect, wherein the imaging apparatus has an image recording unit that records the composite image data, and the image data for synthesis whose data amount is reduced by the image data amount reduction unit is used. Te, when generating the composite image data, on the accompanying reduction information to the composite image data is recorded in the image Zoki recording unit.
In the imaging device according to a ninth aspect based on the first aspect, the image data amount reduction unit reduces the data amount by an irreversible method.

第10の発明に係る撮像方法は、被写体を撮像素子で撮像して基準画像の画像データを生成し、上記被写体を、上記撮像素子に合焦させるように合焦位置を調節し、被写体を撮像して合成用画像の画像データを生成し、上記合成用画像の画像データを上記基準画像の画像データよりデータ量の少なくなるようにデータ量を削減し、上記基準画像の画像データと上記合成用画像の画像データを用いて、画像データの合成を行い、合成画像データを生成し、さらに、上記画像データのガンマ成分を抽出し、ガンマ成分に応じた圧縮特性に基づきデータ量を削減し、複数の異なる合焦位置のそれぞれの合焦位置において、上記撮像素子により出力される複数の画像データを取得し、上記複数の画像データのそれぞれのデータ量を削減し、合成画像データを生成する。 Imaging method according to the tenth invention generates image data of the reference image by imaging a subject by the imaging device, the subject, and adjust the focus position to focus on SL IMAGING element, subject Image data of the image for synthesis is generated, the data amount of the image data of the image for synthesis is reduced so that the data amount is smaller than the image data of the reference image, and the image data of the reference image and the image data of the reference image The image data of the image for synthesis is used to synthesize the image data, generate the synthesized image data, further extract the gamma component of the image data, and reduce the amount of data based on the compression characteristics according to the gamma component Acquiring a plurality of image data output by the imaging device at each of a plurality of different in-focus positions, reducing a data amount of each of the plurality of image data, and combining image data; To generate the data.

第11の発明に係るプログラムは、被写体を撮像素子で撮像して基準画像の画像データを生成し、被写体を撮像して合成用画像の画像データを生成し、上記被写体を、上記撮像素子に合焦させるように合焦位置を調節し、上記合成用画像の画像データを上記基準画像の画像データよりデータ量の少なくなるようにデータ量を削減し、上記基準画像の画像データと上記合成用画像の画像データを用いて、画像データの合成を行い、合成画像データを生成し、さらに、上記画像データのガンマ成分を抽出し、ガンマ成分に応じた圧縮特性に基づきデータ量を削減し、複数の異なる合焦位置のそれぞれの合焦位置において、上記撮像素子により出力される複数の画像データを取得し、上記複数の画像データのそれぞれのデータ量を削減し、合成画像データを生成する、ことをコンピュータに実行させる。
Program according to the eleventh invention generates image data of the reference image by imaging a subject by the imaging device, by imaging a subject to generate image data of the composite image, the object, the upper Symbol IMAGING element The focus position is adjusted so that the image is in focus, the data amount of the image for synthesis is reduced so that the amount of data is less than the image data of the reference image, and the image data of the reference image is combined with the image data of the reference image Using the image data of the image for the image, the image data is synthesized, and the synthesized image data is generated. Further, the gamma component of the image data is extracted, the data amount is reduced based on the compression characteristic according to the gamma component, A plurality of image data output by the imaging element is obtained at each of the plurality of different in-focus positions, the amount of each of the plurality of image data is reduced, and the composite image Generating a chromatography data, it causes the computer to execute the.

本発明によれば、限られた容量において、可能な限り多くの撮影枚数を確保でき、十分な画質の合成画像を生成可能な撮像装置、撮像方法、およびプログラムを提供することができる。   According to the present invention, it is possible to provide an imaging device, an imaging method, and a program that can secure as many shots as possible with a limited capacity and can generate a composite image with sufficient image quality.

本発明の第1実施形態に係るカメラの主として電気的構成を示すブロック図である。It is a block diagram which shows mainly an electrical structure of the camera which concerns on 1st Embodiment of this invention. 本発明の第1実施形態に係るカメラのメイン動作を示すフローチャートである。It is a flowchart which shows the main operation | movement of the camera which concerns on 1st Embodiment of this invention. 本発明の第1実施形態に係るカメラのメイン動作を示すフローチャートである。It is a flowchart which shows the main operation | movement of the camera which concerns on 1st Embodiment of this invention. 本発明の第1実施形態に係るカメラの撮影・画像処理の動作を示すフローチャートである。It is a flowchart which shows operation | movement of imaging | photography and image processing of the camera which concerns on 1st Embodiment of this invention. 本発明の第1実施形態に係るカメラの撮影・画像処理の動作を示すフローチャートである。It is a flowchart which shows operation | movement of imaging | photography and image processing of the camera which concerns on 1st Embodiment of this invention. 本発明の第1実施形態に係るカメラにおけるRAW圧縮特性の一例を示すグラフであり、(a)はHDR合成時のRAW圧縮特性の一例を示し、(b)は深度合成時のRAW圧縮特性の一例を示す。It is a graph which shows an example of the RAW compression characteristic in the camera which concerns on 1st Embodiment of this invention, (a) shows an example of the RAW compression characteristic at the time of HDR synthetic | combination, (b) is the RAW compression characteristic at the time of depth synthetic | combination. An example is shown. 本発明の第1実施形態に係るカメラにおけるRAW伸張特性の一例を示すグラフであり、(a)はHDR合成時のRAW伸張特性の一例を示し、(b)は深度合成時のRAW伸張特性の一例を示す。5 is a graph illustrating an example of a RAW expansion characteristic in the camera according to the first embodiment of the present invention, where (a) illustrates an example of a RAW expansion characteristic during HDR composition, and (b) illustrates a RAW expansion characteristic during depth composition. An example is shown. 本発明の第2実施形態に係るカメラの主として電気的構成を示すブロック図である。It is a block diagram which mainly shows the electrical structure of the camera which concerns on 2nd Embodiment of this invention. 本発明の第2実施形態に係るカメラのメイン動作を示すフローチャートである。It is a flowchart which shows the main operation | movement of the camera which concerns on 2nd Embodiment of this invention. 本発明の第2実施形態に係るカメラのメイン動作を示すフローチャートである。It is a flowchart which shows the main operation | movement of the camera which concerns on 2nd Embodiment of this invention. 本発明の第3実施形態に係るカメラの主として電気的構成を示すブロック図である。It is a block diagram which mainly shows the electrical structure of the camera which concerns on 3rd Embodiment of this invention. 本発明の第3実施形態に係るカメラのメイン動作を示すフローチャートである。It is a flowchart which shows the main operation | movement of the camera which concerns on 3rd Embodiment of this invention. 本発明の第3実施形態に係るカメラのメイン動作を示すフローチャートである。It is a flowchart which shows the main operation | movement of the camera which concerns on 3rd Embodiment of this invention.

以下、本発明の実施形態としてデジタルカメラに適用した例について説明する。このデジタルカメラは、撮像部を有し、この撮像部によって被写体像を画像データに変換し、この変換された画像データに基づいて、被写体像を本体の背面に配置した表示部にライブビュー表示する。撮影者はライブビュー表示を観察することにより、構図やシャッタチャンスを決定する。レリーズ操作時には、画像データが記録媒体に記録される。記録媒体に記録された画像データは、再生モードを選択すると、表示部に再生表示することができる。   Hereinafter, an example applied to a digital camera as an embodiment of the present invention will be described. This digital camera has an imaging unit, and the imaging unit converts the subject image into image data, and based on the converted image data, the subject image is displayed in live view on a display unit disposed on the back of the main body. . The photographer determines the composition and the photo opportunity by observing the live view display. During the release operation, image data is recorded on the recording medium. The image data recorded on the recording medium can be reproduced and displayed on the display unit when the reproduction mode is selected.

また、第1実施形態に係るカメラは、複数の画像データを合成する際に、基準となる画像データよりも、合成する画像データのサイズを小さくしてからSDRAM等の内部メモリに記憶する。このため限られた容量の内部メモリ内に多くの撮影画像データを記憶することができ、同じ容量の内部メモリの場合と比較すると、より高品位の合成画像を生成することができる。   The camera according to the first embodiment, when combining a plurality of image data, reduces the size of the image data to be combined from the reference image data and then stores it in an internal memory such as an SDRAM. Therefore, a large amount of captured image data can be stored in an internal memory having a limited capacity, and a higher-quality composite image can be generated as compared with the case of an internal memory having the same capacity.

図1は、本発明の第1実施形態に係るカメラの主として電気的構成を示すブロック図である。このカメラは、カメラ本体100と、これに脱着可能な交換式レンズ200とから構成される。なお、本実施形態においては、撮影レンズは交換レンズ式としたが、これに限らず、カメラ本体に撮影レンズが固定されるタイプのデジタルカメラであっても勿論かまわない。   FIG. 1 is a block diagram mainly showing an electrical configuration of the camera according to the first embodiment of the present invention. This camera includes a camera body 100 and an interchangeable lens 200 that can be attached to and detached from the camera body 100. In the present embodiment, the photographing lens is an interchangeable lens type, but the present invention is not limited to this, and a digital camera of a type in which the photographing lens is fixed to the camera body may of course be used.

交換式レンズ200は、撮影レンズ201、絞り203、ドライバ205、マイクロコンピュータ207、フラッシュメモリ209から構成され、後述するカメラ本体100との間にインターフェース(以後、I/Fと称す)199を有する。   The interchangeable lens 200 includes a photographing lens 201, a diaphragm 203, a driver 205, a microcomputer 207, and a flash memory 209, and has an interface (hereinafter referred to as I / F) 199 with a camera body 100 described later.

撮影レンズ201は、被写体像を形成するための複数の光学レンズから構成され、単焦点レンズまたはズームレンズである。この撮影レンズ201の光軸の後方には、絞り203が配置されており、絞り203は開口径が可変であり、撮影レンズ201を通過した被写体光束の光量を制限する。また、撮影レンズ201はドライバ205によって光軸方向に移動可能であり、マイクロコンピュータ207からの制御信号に基づいて、撮影レンズ201のピント位置が制御され、ズームレンズの場合には、焦点距離も制御される。また、ドライバ205は、絞り203の開口径の制御も行う。   The taking lens 201 is composed of a plurality of optical lenses for forming a subject image, and is a single focus lens or a zoom lens. A diaphragm 203 is disposed behind the optical axis of the photographing lens 201. The diaphragm 203 has a variable aperture diameter, and restricts the amount of light of the subject light beam that has passed through the photographing lens 201. The photographing lens 201 can be moved in the optical axis direction by a driver 205, and the focus position of the photographing lens 201 is controlled based on a control signal from the microcomputer 207. In the case of a zoom lens, the focal length is also controlled. Is done. The driver 205 also controls the aperture diameter of the diaphragm 203.

ドライバ205に接続されたマイクロコンピュータ207は、I/F199およびフラッシュメモリ209に接続されている。マイクロコンピュータ207は、フラッシュメモリ209に記憶されているプログラムに従って動作し、後述するカメラ本体100内のマイクロコンピュータ121と通信を行い、マイクロコンピュータ121からの制御信号に基づいて交換式レンズ200の制御を行う。   The microcomputer 207 connected to the driver 205 is connected to the I / F 199 and the flash memory 209. The microcomputer 207 operates according to a program stored in the flash memory 209, communicates with a microcomputer 121 in the camera body 100 described later, and controls the interchangeable lens 200 based on a control signal from the microcomputer 121. Do.

フラッシュメモリ209には、前述したプログラムの他、交換式レンズ200の光学的特性や調整値等の種々の情報が記憶されている。I/F199は、交換式レンズ200内のマイクロコンピュータ207とカメラ本体100内のマイクロコンピュータ121の相互間の通信を行うためのインターフェースである。   The flash memory 209 stores various information such as optical characteristics and adjustment values of the interchangeable lens 200 in addition to the above-described program. The I / F 199 is an interface for performing communication between the microcomputer 207 in the interchangeable lens 200 and the microcomputer 121 in the camera body 100.

カメラ本体100内であって、撮影レンズ201の光軸上には、メカシャッタ101が配置されている。このメカシャッタ101は、被写体光束の通過時間を制御し、公知のフォーカルプレーンシャッタ等が採用される。このメカシャッタ101の後方であって、撮影レンズ201によって被写体像が形成される位置には、撮像素子103が配置されている。   A mechanical shutter 101 is disposed in the camera body 100 on the optical axis of the taking lens 201. The mechanical shutter 101 controls the passage time of the subject luminous flux and employs a known focal plane shutter or the like. An image sensor 103 is disposed behind the mechanical shutter 101 and at a position where a subject image is formed by the photographing lens 201.

撮像素子103は、撮像部としての機能を果たし、各画素を構成するフォトダイオードが二次元的にマトリックス状に配置されており、各フォトダイオードは受光量に応じた光電変換電流を発生し、この光電変換電流は各フォトダイオードに接続するキャパシタによって電荷蓄積される。各画素の前面には、ベイヤ―配列のRGBフィルタが配置されている。また、撮像素子103は電子シャッタを有している。電子シャッタは、撮像素子103の電荷蓄積から電荷読出までの時間を制御することにより露光時間の制御を行う。なお、撮像素子103はベイヤ配列に限定されず、例えばFoveon(登録商標)のような積層形式でも勿論かまわない。撮像素子103は被写体を撮像して画像データを出力する撮像部として機能する。   The imaging element 103 functions as an imaging unit, and photodiodes constituting each pixel are two-dimensionally arranged in a matrix, and each photodiode generates a photoelectric conversion current corresponding to the amount of received light. The photoelectric conversion current is accumulated by a capacitor connected to each photodiode. A Bayer array RGB filter is arranged in front of each pixel. The image sensor 103 has an electronic shutter. The electronic shutter controls the exposure time by controlling the time from charge accumulation to charge readout of the image sensor 103. Note that the image sensor 103 is not limited to the Bayer array, and may of course be a stacked form such as Foveon (registered trademark). The imaging element 103 functions as an imaging unit that images a subject and outputs image data.

撮像素子103はアナログ処理部105に接続されており、このアナログ処理部105は、撮像素子103から読み出した光電変換信号(アナログ画像信号)に対し、リセットノイズ等を低減した上で波形整形を行い、さらに適切な輝度になるようにゲインアップを行う。   The image sensor 103 is connected to an analog processing unit 105. The analog processing unit 105 performs waveform shaping on the photoelectric conversion signal (analog image signal) read from the image sensor 103 while reducing reset noise and the like. Further, the gain is increased so as to obtain a more appropriate luminance.

アナログ処理部105はA/D変換部107に接続されており、このA/D変換部107は、アナログ画像信号をアナログ―デジタル変換し、デジタル画像信号(以後、画像データという)をバス110およびRAWデータ圧縮部108に出力する。なお、本明細書においては、画像処理部109において画像処理される前の生の画像データをRAWデータと称する。   The analog processing unit 105 is connected to an A / D conversion unit 107. The A / D conversion unit 107 performs analog-digital conversion on the analog image signal, and converts the digital image signal (hereinafter referred to as image data) into the bus 110 and The data is output to the RAW data compression unit 108. In this specification, raw image data before image processing in the image processing unit 109 is referred to as RAW data.

RAWデータ圧縮部108は、A/D変換部107から出力されたRAWデータの圧縮を行い、基準画像以外のRAWデータの取り込み時に使用する。基準画像は、複数枚の画像データを合成する際に、基準とする画像をいう。基準画像としては、後述する画像合成部109cにおいて合成を行う複数の画像データの内、最初に撮像された画像データ、またはピントの合っている画像データ、または適正露出で撮影された画像データのいずれかである。   The RAW data compression unit 108 compresses the RAW data output from the A / D conversion unit 107 and uses it when capturing RAW data other than the reference image. The reference image is an image used as a reference when combining a plurality of pieces of image data. As the reference image, any one of a plurality of pieces of image data to be combined in an image combining unit 109c, which will be described later, is first captured image data, focused image data, or image data captured with appropriate exposure. It is.

RAWデータ圧縮部108は、A/D変換されたRAWデータに対して、折れ線またはテーブルを用い、入力データよりもデータ量の小さいデータに変換する。単純な下位ビット切り落としや、1未満の係数を乗じるような変換方法でもよいが、画像処理部109におけるガンマ変換を考慮し、折れ線やテーブルを用いた変換の方が、画質劣化を少なくすることができる。RAWデータ圧縮部108は、画像データのデータ量を削減し、基準画像データよりデータ量の少ない合成用画像データを生成する画像データ量削減部として機能する。この画像データ量削減部は、画像データ量の削減にあたっては、非可逆な方式によりデータ量を削減する。また、RAWデータ圧縮部108における圧縮特性については、図6を用いて後述する。   The RAW data compression unit 108 converts the A / D converted RAW data into data having a data amount smaller than that of the input data using a polygonal line or a table. A simple conversion method such as truncation of lower bits or multiplication by a coefficient less than 1 may be used. However, in consideration of gamma conversion in the image processing unit 109, conversion using a polygonal line or a table may reduce image quality degradation. it can. The RAW data compression unit 108 functions as an image data amount reduction unit that reduces the amount of image data and generates image data for synthesis that has a smaller data amount than the reference image data. The image data amount reduction unit reduces the data amount by an irreversible method when reducing the image data amount. The compression characteristics in the RAW data compression unit 108 will be described later with reference to FIG.

バス110は、カメラ本体100の内部で読み出され若しくは生成された各種データをカメラ本体100の内部に転送するための転送路である。バス110には、前述のA/D変換部107とRAWデータ圧縮部108の他、画像処理部109、AE(Auto Exposure)処理部111、AF(Auto Focus)処理部113、画像圧縮部115、画像伸張部117、マイクロコンピュータ121、SDRAM127、メモリインターフェース(以後、メモリI/Fという)129、表示ドライバ133が接続されている。   The bus 110 is a transfer path for transferring various data read or generated in the camera body 100 to the camera body 100. The bus 110 includes an image processing unit 109, an AE (Auto Exposure) processing unit 111, an AF (Auto Focus) processing unit 113, an image compression unit 115, in addition to the A / D conversion unit 107 and the RAW data compression unit 108 described above. An image expansion unit 117, a microcomputer 121, an SDRAM 127, a memory interface (hereinafter referred to as a memory I / F) 129, and a display driver 133 are connected.

画像処理部109は、圧縮されたRAWデータを伸張するRAWデータ伸張部109aと、通常の画像処理を行う基本画像処理部109bと、画像合成を行う画像合成部109cを有する。複数の画像を合成する場合には、RAWデータ伸張部109a、基本画像処理部109b、および画像合成部109cを使用する。   The image processing unit 109 includes a RAW data expansion unit 109a that expands compressed RAW data, a basic image processing unit 109b that performs normal image processing, and an image composition unit 109c that performs image composition. When combining a plurality of images, the RAW data expansion unit 109a, the basic image processing unit 109b, and the image combining unit 109c are used.

基準画像以外の画像データは、RAWデータ圧縮部108によって圧縮されており、RAWデータ伸張部109aは、圧縮されたRAWデータの伸張を行う。RAWデータ伸張部109aは、RAWデータ圧縮部108の逆特性を適用し、A/D変換直後と同様のデータに変換する。圧縮が可逆であれば、同一のデータになり、また不可逆圧縮であれば、同様のデータに変換する。一般には、A/D変換後のデータは、露光量に対してリニアな特性のため、SDRAMに記憶されている圧縮されたRAWデータをリニアなRAWデータに変換する。RAWデータ伸張部109aにおける伸張特性は、図7を用いて後述する。   Image data other than the reference image is compressed by the RAW data compression unit 108, and the RAW data decompression unit 109a decompresses the compressed RAW data. The RAW data decompression unit 109a applies the reverse characteristics of the RAW data compression unit 108, and converts the data into the same data immediately after A / D conversion. If the compression is reversible, the data is the same. If the compression is irreversible, the data is converted to the same data. In general, since the data after A / D conversion is linear with respect to the exposure amount, the compressed RAW data stored in the SDRAM is converted into linear RAW data. The expansion characteristics in the RAW data expansion unit 109a will be described later with reference to FIG.

基本画像処理部109bは、RAWデータに対して、オプティカルブラック(OB)減算処理、ホワイトバランス(WB)補正、ベイヤデータの場合に行う同時化処理、色再現処理、ガンマ補正処理、カラーマトリックス演算、ノイズリダクション(NR)処理、エッジ強調処理等を行う。1枚撮影で、かつ特殊効果等が設定されていない場合には、この基本画像処理部109aによる処理のみで画像処理が完了する。   The basic image processing unit 109b performs optical black (OB) subtraction processing, white balance (WB) correction, synchronization processing performed in the case of Bayer data, color reproduction processing, gamma correction processing, color matrix calculation, noise on RAW data. Reduction (NR) processing, edge enhancement processing, and the like are performed. If a single image is shot and no special effect or the like is set, the image processing is completed only by the processing by the basic image processing unit 109a.

画像合成部109cは、設定されている合成モード等応じて種々の画像合成を行う。この画像合成部109cは、基準画像データと合成用画像データを用いて画像データの合成を行い、合成画像データを生成する画像合成部として機能する。本実施形態においては、後述するように、ダイナミックレンジを広げるHDR合成、被写界の深度を深くする深度合成、および解像度の高くする超解像合成の3種類の合成モードが設定可能である。HDR合成モードが設定されている場合には、画像合成部109cは、複数の露光量で撮影した複数の画像データに対し、基準画像に対して位置合わせと合成を行うことで、単写よりも広いダイナミックレンジの画像を生成する。   The image composition unit 109c performs various image composition according to the set composition mode and the like. The image synthesizing unit 109c functions as an image synthesizing unit that synthesizes image data using the reference image data and the image data for synthesis, and generates synthesized image data. In the present embodiment, as will be described later, three types of composition modes can be set: HDR composition that expands the dynamic range, depth composition that increases the depth of the object scene, and super-resolution composition that increases the resolution. When the HDR synthesizing mode is set, the image synthesizing unit 109c performs alignment and synthesizing with respect to the reference image with respect to the plurality of image data photographed with the plurality of exposure amounts, so that the single image can be obtained. Generate a wide dynamic range image.

また、深度合成モードが設定されている場合には、画像合成部109cは、複数のフォーカス位置で撮影した複数の画像データに対し、基準画像に対して位置合わせと合成を行うことで、単写とは異なる被写界深度の画像を生成する。超解像合成モードが設定されている場合には、画像合成部109cは、複数の画像データに対し、基準画像に対して位置合わせと合成を行うことがで、単写よりも解像感のある画像を生成する。   When the depth compositing mode is set, the image compositing unit 109c performs alignment and compositing with respect to the reference image for a plurality of image data photographed at a plurality of focus positions, so that a single image is captured. To generate an image with a different depth of field. When the super-resolution composition mode is set, the image composition unit 109c can perform alignment and composition with respect to the reference image with respect to a plurality of image data, so that a sense of resolution can be improved as compared with single shooting. Generate an image.

AE処理部111は、バス110を介して入力した画像データに基づいて被写体輝度を測定し、この被写体輝度情報を、バス110を介してマイクロコンピュータ121に出力する。被写体輝度の測定のために専用の測光センサを設けても良いが、本実施形態においては、画像データに基づいて被写体輝度を算出する。   The AE processing unit 111 measures subject brightness based on image data input via the bus 110, and outputs the subject brightness information to the microcomputer 121 via the bus 110. Although a dedicated photometric sensor may be provided for measuring the subject brightness, in this embodiment, the subject brightness is calculated based on the image data.

AF処理部113は、画像データから高周波成分の信号を抽出し、積算処理により合焦評価値を取得し、バス110を介してマイクロコンピュータ121に出力する。本実施形態においては、いわゆるコントラスト法によって撮影レンズ201のピント合わせを行う。この実施形態では、コントラスト法によるAF制御を例にとって説明したが、被写体光束を分割し、その光路上に位相差センサを設け、または撮像素子上に位相差センサを設け、位相差AFによるAF制御によりピント合わせを行ってもよい。   The AF processing unit 113 extracts a high-frequency component signal from the image data, acquires a focus evaluation value by integration processing, and outputs the focus evaluation value to the microcomputer 121 via the bus 110. In the present embodiment, the photographing lens 201 is focused by a so-called contrast method. In this embodiment, the AF control based on the contrast method has been described as an example. However, the subject luminous flux is divided and a phase difference sensor is provided on the optical path, or a phase difference sensor is provided on the image sensor, and AF control based on the phase difference AF is performed. You may also focus.

画像圧縮部115は、画像データの記録媒体131への記録時に、SDRAM127から読み出した画像データを、静止画の場合にはJPEG圧縮方式等、また動画の場合にはMPEG等の各種圧縮方式に従って圧縮する。   The image compression unit 115 compresses the image data read from the SDRAM 127 when recording the image data on the recording medium 131 according to various compression methods such as a JPEG compression method for a still image and MPEG for a moving image. To do.

また、画像伸張部117は、画像再生表示用にJPEG画像データやMPEG画像データの伸張も行う。伸張にあたっては、記録媒体131に記録されているファイルを読み出し、画像伸張部115において伸張処理を施した上で、伸張した画像データをSDRAM127に一時記憶する。なお、本実施形態においては、画像圧縮方式としては、JPEG圧縮方式やMPEG圧縮方式を採用するが、圧縮方式はこれに限らずTIFF、H.264等、他の圧縮方式でも勿論かまわない。また、圧縮方式は、可逆圧縮でも、非可逆圧縮でもよい。   The image decompression unit 117 also decompresses JPEG image data and MPEG image data for image reproduction display. In decompression, the file recorded on the recording medium 131 is read out, subjected to decompression processing in the image decompression unit 115, and the decompressed image data is temporarily stored in the SDRAM 127. In the present embodiment, a JPEG compression method or an MPEG compression method is adopted as an image compression method, but the compression method is not limited to this, and TIFF, H.264, or the like. Of course, other compression methods such as H.264 may be used. The compression method may be lossless compression or lossy compression.

マイクロコンピュータ121は、このカメラ全体の制御部としての機能を果たし、フラッシュメモリ125に記憶されているプログラムに従って、カメラの各種シーケンスを総括的に制御する。マイクロコンピュータ121には、前述のI/F199以外に、操作部123およびフラッシュメモリ125が接続されている。   The microcomputer 121 functions as a control unit for the entire camera, and comprehensively controls various sequences of the camera according to a program stored in the flash memory 125. In addition to the I / F 199 described above, an operation unit 123 and a flash memory 125 are connected to the microcomputer 121.

操作部123は、電源釦、レリーズ釦、動画釦、再生釦、メニュー釦、十字キー、OK釦等、各種入力釦や各種入力キー等の操作部材を含み、これらの操作部材の操作状態を検知し、検知結果をマイクロコンピュータ121に出力する。マイクロコンピュータ121は、操作部123からの操作部材の検知結果に基づいて、ユーザの操作に応じた各種シーケンスを実行する。電源釦は、当該デジタルカメラの電源のオン/オフを指示するための操作部材である。電源釦が押されると当該デジタルカメラの電源はオンとなり、再度、電源釦が押されると当該デジタルカメラの電源はオフとなる。   The operation unit 123 includes operation members such as various input buttons and various input keys such as a power button, a release button, a moving image button, a playback button, a menu button, a cross key, and an OK button, and detects operation states of these operation members. The detection result is output to the microcomputer 121. The microcomputer 121 executes various sequences according to the user's operation based on the detection result of the operation member from the operation unit 123. The power button is an operation member for instructing to turn on / off the power of the digital camera. When the power button is pressed, the power of the digital camera is turned on. When the power button is pressed again, the power of the digital camera is turned off.

レリーズ釦は、半押しでオンになるファーストレリーズスイッチと、半押しから更に押し込み全押しとなるとオンになるセカンドレリーズスイッチからなる。マイクロコンピュータ121は、ファーストレリーズスイッチがオンとなると、AE動作やAF動作等の撮影準備シーケンスを実行する。また、セカンドレリーズスイッチがオンとなると、メカシャッタ101等を制御し、撮像素子103等から被写体画像に基づく画像データを取得し、この画像データを記録媒体131に記録する一連の撮影シーケンスを実行して撮影を行う。   The release button includes a first release switch that is turned on when the button is half-pressed and a second release switch that is turned on when the button is further depressed after being half-pressed and then fully pressed. When the first release switch is turned on, the microcomputer 121 executes a shooting preparation sequence such as an AE operation and an AF operation. When the second release switch is turned on, the mechanical shutter 101 and the like are controlled, image data based on the subject image is acquired from the image sensor 103 and the like, and a series of shooting sequences for recording the image data on the recording medium 131 are executed. Take a picture.

動画釦は、動画撮影の開始と終了を指示するための操作釦であり、最初に動画釦を操作すると動画撮影を開始し、再度、操作すると動画撮影を終了する。再生釦は、再生モードの設定と解除するための操作釦であり、再生モードが設定されると、記録媒体131から撮影画像の画像データを読み出し、表示パネル135に撮影画像を再生表示する。   The moving image button is an operation button for instructing start and end of moving image shooting. When the moving image button is first operated, moving image shooting is started, and when operated again, moving image shooting is ended. The playback button is an operation button for setting and canceling the playback mode. When the playback mode is set, the image data of the captured image is read from the recording medium 131 and the captured image is reproduced and displayed on the display panel 135.

メニュー釦は、メニュー画面を表示パネル135に表示させるための操作釦である。メニュー画面上では、各種のカメラ設定を行うことができる。カメラ設定としては、例えば、HDR合成、深度合成、および超解像合成等の合成モードがある。   The menu button is an operation button for displaying a menu screen on the display panel 135. Various camera settings can be made on the menu screen. Examples of camera settings include synthesis modes such as HDR synthesis, depth synthesis, and super-resolution synthesis.

フラッシュメモリ125は、マイクロコンピュータ121の各種シーケンスを実行するためのプログラムを記憶している。マイクロコンピュータ121はこのプログラムに基づいてカメラ全体の制御を行う。   The flash memory 125 stores a program for executing various sequences of the microcomputer 121. The microcomputer 121 controls the entire camera based on this program.

SDRAM127は、画像データ等の一時記憶用の電気的書き換え可能な揮発性メモリである。このSDRAM127は、A/D変換部107から出力された画像データや、画像処理部109、画像圧縮部115、画像伸張部117等において処理された画像データを一時記憶する。   The SDRAM 127 is an electrically rewritable volatile memory for temporary storage of image data and the like. The SDRAM 127 temporarily stores image data output from the A / D conversion unit 107 and image data processed by the image processing unit 109, the image compression unit 115, the image expansion unit 117, and the like.

メモリI/F129は、記録媒体131に接続されており、画像データや画像データに添付されたヘッダ等のデータを、記録媒体131に書き込みおよび読出しの制御を行う。記録媒体131は、例えば、カメラ本体100に着脱自在なメモリカード等の記録媒体であるが、これに限らず、カメラ本体100に内蔵されたハードディスク等であっても良い。記録媒体131は、合成画像データを記録する画像記録部として機能する。   The memory I / F 129 is connected to the recording medium 131, and controls writing and reading of image data and data such as a header attached to the image data on the recording medium 131. The recording medium 131 is, for example, a recording medium such as a memory card that is detachably attached to the camera body 100, but is not limited thereto, and may be a hard disk or the like built in the camera body 100. The recording medium 131 functions as an image recording unit that records the composite image data.

表示ドライバ133は、表示パネル135に接続されており、SDRAM127や記録媒体131から読み出され、画像伸張部117によって伸張された画像データに基づいて画像を表示パネル135において表示させる。表示パネル135は、カメラ本体100の背面等に配置され、画像表示を行う。表示パネル135は、背面等のカメラ本体の外装部に表示面が配置されることから、外光の影響を受け易い表示部であるが、大型の表示パネルを設定することが可能である。なお、表示部としては、液晶表示パネル(LCD、TFT)、有機EL等、種々の表示パネルを採用できる。   The display driver 133 is connected to the display panel 135, and displays an image on the display panel 135 based on the image data read from the SDRAM 127 or the recording medium 131 and expanded by the image expansion unit 117. The display panel 135 is disposed on the back surface of the camera body 100 and performs image display. The display panel 135 is a display unit that is easily affected by external light because the display surface is disposed on the exterior of the camera body such as the back surface, but a large display panel can be set. In addition, as a display part, various display panels, such as a liquid crystal display panel (LCD, TFT) and organic EL, are employable.

表示パネル135における画像表示としては、撮影直後、記録される画像データを短時間だけ表示するレックビュー表示、記録媒体131に記録された静止画や動画の画像ファイルの再生表示、およびライブビュー表示等の動画表示が含まれる。   As the image display on the display panel 135, a rec view display that displays recorded image data for a short time immediately after shooting, a playback display of a still image or moving image file recorded on the recording medium 131, a live view display, or the like. Video display.

次に、図2よび図3に示すフローチャートを用いて、本実施形態におけるカメラのメイン処理について説明する。なお、図2、図3、および後述する図4、図5、図9、図10、図12、図13に示すフローチャートは、フラッシュメモリ125に記憶されているプログラムに従ってマイクロコンピュータ121が各部を制御し実行する。   Next, the main processing of the camera in this embodiment will be described using the flowcharts shown in FIGS. 2 and 3, and the flowcharts shown in FIGS. 4, 5, 9, 10, 12, and 13, which will be described later, are controlled by the microcomputer 121 in accordance with a program stored in the flash memory 125. And run.

操作部123の内の電源釦が操作され、電源オンとなると、図2に示すメインフローが動作を開始する。動作を開始すると、まず、初期化を実行する(S1)。初期化としては、機械的初期化や各種フラグ等の初期化等の電気的初期化を行う。各種フラグの1つとして、動画記録中か否かを示す記録中フラグをオフにリセットする(ステップS13、S15、S31等参照)。   When the power button in the operation unit 123 is operated and the power is turned on, the main flow shown in FIG. When the operation is started, first, initialization is executed (S1). As initialization, electrical initialization such as mechanical initialization and initialization of various flags is performed. As one of the various flags, a recording flag indicating whether or not a moving image is being recorded is reset to OFF (see steps S13, S15, S31, etc.).

初期化を行うと、次に、再生釦が押されたか否かを判定する(S3)。ここでは、操作部123内の再生釦の操作状態を検知し、判定する。この判定の結果、再生釦が押された場合には、再生・編集を実行する(S5)。ここでは、記録媒体131から画像データを読み出し、LCD135に静止画と動画の一覧を表示する。ユーザは十字キーを操作することにより、一覧の中から画像を選択し、OK釦により画像を確定する。また、選択している画像の編集を行うことができる。   Once initialization has been carried out, it is next determined whether or not the playback button has been pressed (S3). Here, the operation state of the playback button in the operation unit 123 is detected and determined. If the result of this determination is that the playback button has been pressed, playback / editing is executed (S5). Here, image data is read from the recording medium 131 and a list of still images and moving images is displayed on the LCD 135. The user operates the cross key to select an image from the list, and confirms the image with the OK button. In addition, the selected image can be edited.

ステップS5における再生・編集を実行すると、またはステップS3における判定の結果、再生釦が押されていなかった場合には、カメラ設定を行うか否かを判定する(S7)。操作部123の内のメニュー釦が操作された際に、メニュー画面においてカメラ設定を行う。そこで、このステップでは、このカメラ設定が行われたか否かに基づいて判定する。   When playback / editing in step S5 is executed, or if the result of determination in step S3 is that the playback button has not been pressed, it is determined whether or not camera settings are to be made (S7). When a menu button in the operation unit 123 is operated, camera settings are performed on the menu screen. Therefore, in this step, determination is made based on whether or not this camera setting has been performed.

ステップS7における判定の結果、カメラ設定の場合には、カメラ設定を行う(S9)。前述したように、種々のカメラ設定をメニュー画面で行うことができる。カメラ設定としては、前述したように、例えば、撮影モードとしては、通常撮影、HDR合成、深度合成、超解像合成等のモードが設定可能である。また、静止画記録モードとしては、JPEG記録、TIFF記録、JPEG−RAW記録、RAW記録等のモードが設定可能である。動画記録モードとしては、Motion JPEG記録、H.264記録等のモードの設定が可能である。画質モードとしては、ファイン(Fine)、ノーマル(Normal)等のモードが設定可能である。   If the result of determination in step S7 is camera setting, camera setting is carried out (S9). As described above, various camera settings can be performed on the menu screen. As described above, as camera settings, for example, normal shooting, HDR synthesis, depth synthesis, super-resolution synthesis, and the like can be set as the shooting mode. As the still image recording mode, modes such as JPEG recording, TIFF recording, JPEG-RAW recording, and RAW recording can be set. Movie recording modes include Motion JPEG recording, H.264 recording, It is possible to set a mode such as H.264 recording. As the image quality mode, a mode such as Fine or Normal can be set.

ステップS9においてカメラ設定を行うと、またはステップS7における判定の結果、カメラ設定でなかった場合には、次に、動画釦が押されたか否かの判定を行う(S11)。ここでは、マイクロコンピュータ121は操作部123から動画釦の操作状態を入力し、判定する。   If camera setting is performed in step S9, or if the result of determination in step S7 is not camera setting, it is next determined whether or not the movie button has been pressed (S11). Here, the microcomputer 121 inputs the operation state of the moving image button from the operation unit 123 and determines.

ステップS11における判定の結果、動画釦が押された場合には、記録中フラグの反転を行う(S13)。記録中フラグは、動画撮影中にはオン(1)が設定され、動画を撮影していない場合にはオフ(0)にリセットされている。このステップにおいては、フラグを反転、すなわちオン(1)が設定されていた場合には、オフ(0)に反転させ、オフ(0)が設定されていた場合には、オン(1)に反転させる。   If the result of determination in step S11 is that a movie button has been pressed, the recording flag is reversed (S13). The recording flag is set to on (1) during moving image shooting, and is reset to off (0) when no moving image is being shot. In this step, the flag is inverted, that is, when ON (1) is set, it is inverted to OFF (0), and when OFF (0) is set, it is inverted to ON (1). Let

ステップS13において記録中フラグの反転を行うと、次に、動画記録中か否を判定する(S15)。ここでは、ステップS13において反転された記録中フラグがオンに設定されているか、オフに設定されているかに基づいて判定する。   If the recording flag is reversed in step S13, it is next determined whether or not a moving image is being recorded (S15). Here, the determination is made based on whether the recording flag inverted in step S13 is set to ON or OFF.

ステップS15における判定の結果、動画記録中の場合には、動画ファイルを生成する(S19)。後述するステップS61において動画の記録を行うが、このステップでは、動画記録用の動画ファイルを生成し、動画の画像データを記録できるように準備する。   If the result of determination in step S15 is that movie recording is in progress, a movie file is generated (S19). In step S61, which will be described later, a moving image is recorded. In this step, a moving image file for moving image recording is generated, and preparation is made so that moving image data can be recorded.

一方、判定の結果、動画記録中でない場合には、動画ファイルを閉じる(S17)。動画釦が操作され、動画撮影が終了したことから、このステップで動画ファイルを閉じる。動画ファイルを閉じるにあたって、動画ファイルのヘッダにフレーム数を記録する等により、動画ファイルとして再生可能な状態にし、ファイル書き込みを終了する。   On the other hand, if the result of determination is that a moving image is not being recorded, the moving image file is closed (S17). Since the moving image button is operated and the moving image shooting is completed, the moving image file is closed in this step. When the moving image file is closed, the number of frames is recorded in the header of the moving image file so that the moving image file can be reproduced, and the file writing is ended.

ステップS17において動画ファイルを閉じると、またはステップS19において動画ファイルを生成すると、またはステップS11における判定の結果、動画釦が押されていない場合には、次に、動画記録中か否かの判定を行う(S31)。このステップでは、ステップS15と同様に、記録中フラグのオンかオフに基づいて判定する。   If the moving image file is closed in step S17, or if the moving image file is generated in step S19, or if the result of determination in step S11 is that the moving image button has not been pressed, it is next determined whether or not moving image recording is in progress. Perform (S31). In this step, as in step S15, the determination is made based on whether the recording flag is on or off.

ステップS31における判定の結果、動画記録中でない場合には、レリーズ釦が半押しされたか否か、言い換えると、ファーストレリーズスイッチがオフからオンとなったか否かの判定を行う(S33)。この判定は、レリーズ釦に連動するファーストレリーズスイッチの状態を操作部123によって検知し、この検知結果に基づいて行う。検知の結果、ファーストレリーズスイッチがオフからオンに遷移した場合には判定結果はYesとなり、一方、オン状態またはオフ状態が維持されている場合には、判定結果はNoとなる。   If the result of determination in step S31 is that moving image recording is not in progress, it is determined whether or not the release button has been half-pressed, in other words, whether or not the first release switch has been turned on from off (S33). This determination is made based on the detection result obtained by detecting the state of the first release switch linked to the release button by the operation unit 123. As a result of the detection, when the first release switch is changed from OFF to ON, the determination result is Yes. On the other hand, when the ON state or the OFF state is maintained, the determination result is No.

ステップS33における判定の結果、レリーズ釦が半押しされ、オフからファーストレリーズに遷移した場合には、AE・AF動作を実行する(S35)。ここでは、AE処理部111が、撮像素子103によって取得された画像データに基づいて被写体輝度を検出し、この被写体輝度に基づいて、適正露出となるシャッタ速度、絞り値等を算出する。   If the result of determination in step S33 is that the release button has been half-pressed and transitioned from OFF to first release, AE / AF operation is executed (S35). Here, the AE processing unit 111 detects subject brightness based on the image data acquired by the image sensor 103, and calculates a shutter speed, an aperture value, and the like for appropriate exposure based on the subject brightness.

また、ステップS33においては、AF動作を行う。ここでは、AF処理部113によって取得された合焦評価値がピーク値となるように、交換式レンズ200内のマイクロコンピュータ207を介してドライバ205が撮影レンズ201のピント位置を移動させる。したがって、動画撮影を行っていない場合に、レリーズ釦が半押しされると、その時点で、撮影レンズ201のピント合わせを行う。その後、ステップS35へ進む。   In step S33, an AF operation is performed. Here, the driver 205 moves the focus position of the photographing lens 201 via the microcomputer 207 in the interchangeable lens 200 so that the focus evaluation value acquired by the AF processing unit 113 becomes a peak value. Accordingly, when the movie shooting is not being performed and the release button is pressed halfway, the photographing lens 201 is focused at that time. Thereafter, the process proceeds to step S35.

ステップS31における判定の結果、レリーズ釦がオフからファーストレリーズに遷移しなかった場合には、次に、レリーズ釦が全押しされ、セカンドレリーズスイッチがオンになったか否かの判定を行う(S41)。このステップでは、レリーズ釦に連動するセカンドレリーズスイッチの状態を操作部123によって検知し、この検知結果に基づいて判定を行う。   If the result of determination in step S31 is that the release button has not transitioned from off to first release, it is next determined whether or not the release button has been fully pressed and the second release switch has been turned on (S41). . In this step, the state of the second release switch linked to the release button is detected by the operation unit 123, and a determination is made based on the detection result.

ステップS41における判定の結果、レリーズ釦が全押しされ、セカンドレリーズスイッチがオンになった場合には、撮影・画像処理を行う(S43)。ここでは、ステップS33において演算された絞り値で絞り203が制御され、また演算されたシャッタ速度でメカシャッタ101のシャッタ速度が制御される。そして、シャッタ速度に応じた露光時間が経過すると、撮像素子103から画像信号が読み出され、アナログ処理部105およびA/D変換部107によって処理されたRAWデータがバス110に出力される。   If the result of determination in step S41 is that the release button has been fully pressed and the second release switch has been turned on, shooting and image processing are carried out (S43). Here, the aperture 203 is controlled by the aperture value calculated in step S33, and the shutter speed of the mechanical shutter 101 is controlled by the calculated shutter speed. When the exposure time corresponding to the shutter speed elapses, an image signal is read from the image sensor 103, and RAW data processed by the analog processing unit 105 and the A / D conversion unit 107 is output to the bus 110.

また、ステップS43においては、撮影を行うと画像処理を行う。撮像素子103で取得されたRAWデータを読出し、画像処理部109によって画像処理を行う。また、画像合成モードが設定されている場合には、このステップにおいて、画像合成モードに応じて複数回の撮影が行われ、画像合成の際に使用する画像データが記録媒体133等に一時的に退避する。この撮影・画像処理の詳しい動作については、図4および図5を用いて後述する。   In step S43, image processing is performed after shooting. RAW data acquired by the image sensor 103 is read, and image processing is performed by the image processing unit 109. If the image composition mode is set, in this step, shooting is performed a plurality of times in accordance with the image composition mode, and image data used for image composition is temporarily stored in the recording medium 133 or the like. evacuate. Detailed operations of the photographing / image processing will be described later with reference to FIGS.

撮影・画像処理を行うと、次に静止画記録を行う(S45)。ここでは、画像処理が施された静止画の画像データを記録媒体131に記録する。静止画記録にあたっては、設定されている形式で記録を行う。JPEGが設定されている場合には、画像処理済みデータを画像圧縮部115においてJPEG圧縮して記録する。またTIFF形式の場合には、RGBデータに変換してRGB形式で記録する。また、RAW記録が設定されている場合に、撮影によって取得したRAWデータと合成を行った場合には、合成RAWデータも記録する。ここで、撮影によって取得したRAWデータを合成した場合、合成する前の複数のRAWデータを記録し、ステップS5において複数のRAWデータを1セットとしてユーザが選択可能にし、ユーザが編集を指示した場合には、ステップS43における画像処理部分のみ(図5参照)を処理するようにしてもよい。画像データの記録先は、カメラ本体内の記録媒体131でもよいし、通信部(不図示)を介して外部の機器へ記録するようにしてもよい。   Once shooting / image processing has been performed, still image recording is performed (S45). Here, the image data of the still image subjected to the image processing is recorded on the recording medium 131. When recording a still image, recording is performed in a set format. If JPEG is set, the image processed data is JPEG compressed and recorded by the image compression unit 115. In the case of the TIFF format, it is converted into RGB data and recorded in the RGB format. In addition, when RAW recording is set, when combining with RAW data acquired by photographing, combined RAW data is also recorded. Here, when RAW data acquired by photographing is combined, a plurality of RAW data before combining is recorded, and in step S5, the user can select a plurality of RAW data as one set, and the user instructs editing Alternatively, only the image processing portion in step S43 (see FIG. 5) may be processed. The recording destination of the image data may be the recording medium 131 in the camera body, or may be recorded in an external device via a communication unit (not shown).

ステップS41における判定の結果、レリーズ釦2ndでなかった場合、またはステップS31における判定の結果、動画記録中であった場合には、次に、AEを行う(S51)。前述のステップS41の判定がNoであった場合は、レリーズ釦に対して何ら操作を行っていない場合であり、この場合には後述するステップS57においてライブビュー表示を行う。また、前述のステップS31の判定がYesであった場合は、動画記録中である。このステップでは、適正露出でライブビュー表示または動画撮影を行うための撮像素子103の電子シャッタのシャッタ速度およびISO感度を算出する。   If the result of determination in step S41 is not the release button 2nd, or if the result of determination in step S31 is that moving image recording is in progress, then AE is performed (S51). If the determination in Step S41 is No, it means that no operation is performed on the release button. In this case, live view display is performed in Step S57 described later. If the determination in step S31 is Yes, moving image recording is in progress. In this step, the shutter speed and ISO sensitivity of the electronic shutter of the image sensor 103 for performing live view display or moving image shooting with appropriate exposure are calculated.

AEを行うと、次に、電子シャッタによる撮影を行う(S53)。ここでは、被写体像を画像データに変換する。すなわち、撮像素子103の電子シャッタによって決まる露光時間の間、電荷蓄積を行い、露光時間が経過すると蓄積電荷を読み出することにより画像データを取得する。   Once AE is performed, next, photographing with an electronic shutter is performed (S53). Here, the subject image is converted into image data. That is, charge accumulation is performed for an exposure time determined by the electronic shutter of the image sensor 103, and image data is acquired by reading the accumulated charge when the exposure time has elapsed.

電子シャッタによる撮影を行うと、次に、取得した画像データに対して画像処理を行う(S55)。このステップでは、基本画像処理部109bによって、WB補正、カラーマトリックス演算、ガンマ変換、エッジ強調、ノイズリダクションン等の基本画像処理を行う。   Once photographing with the electronic shutter is performed, next, image processing is performed on the acquired image data (S55). In this step, the basic image processing unit 109b performs basic image processing such as WB correction, color matrix calculation, gamma conversion, edge enhancement, and noise reduction.

基本画像処理を行うと、次に、ライブビュー表示を行う(S57)。このステップでは、ステップS55における基本画像処理された画像データを用いて、表示パネル135にライブビュー表示を行う。すなわち、ステップS53において画像データを取得し、画像処理を行ったことから、この処理された画像を用いて、ライブビュー表示の更新を行う。撮影者はこのライブビュー表示を観察することにより、構図やシャッタタイミングを決定することができる。   Once the basic image processing is performed, next, live view display is performed (S57). In this step, live view display is performed on the display panel 135 using the image data that has undergone the basic image processing in step S55. That is, since image data is acquired and image processing is performed in step S53, the live view display is updated using the processed image. The photographer can determine the composition and shutter timing by observing the live view display.

ステップS57においてライブビュー表示を行うと、次に、動画記録中か否かの判定を行う(S59)。ここでは、記録中フラグがオンか否かを判定する。この判定の結果、動画記録中であった場合には、動画記録を行う(S61)。ここでは、撮像素子103から読み出される撮像データを動画用の画像データに画像処理を行い、動画ファイルに記録する。   If live view display is performed in step S57, it is next determined whether or not moving image recording is in progress (S59). Here, it is determined whether or not the recording flag is ON. If the result of this determination is that video recording is in progress, video recording is performed (S61). Here, the image data read from the image sensor 103 is subjected to image processing on moving image data and recorded in a moving image file.

ステップS61において動画記録を行うと、またはステップS59における判定の結果、動画記録中でない場合、またはステップS45において静止画記録を行うと、またはステップS35において、AE・AFを行うと、次に、電源オフか否かの判定を行う(S37)。このステップでは、操作部123の電源釦が再度、押されたか否かを判定する。この判定の結果、電源オフではなかった場合には、ステップS3に戻る。一方、判定の結果、電源オフであった場合には、メインフローの終了動作を行ったのち、このメインフローを終了する。   If moving image recording is performed in step S61, or if the result of determination in step S59 is that moving image recording is not being performed, still image recording is performed in step S45, or AE / AF is performed in step S35, It is determined whether or not it is off (S37). In this step, it is determined whether or not the power button of the operation unit 123 has been pressed again. If the result of this determination is that power is not off, processing returns to step S3. On the other hand, if the result of determination is that the power is off, the main flow is terminated after the main flow is completed.

このように本発明の第1実施形態におけるメインフローにおいては、画像合成モード等の設定が可能であり(S9)、画像合成モードが設定されると、撮影・画像処理において、画像合成モードに応じて複数回、撮影が行われ(S43)、合成された画像データが記録される(S45)。   As described above, in the main flow in the first embodiment of the present invention, the image composition mode or the like can be set (S9). When the image composition mode is set, the shooting / image processing is performed according to the image composition mode. Then, photographing is performed a plurality of times (S43), and the synthesized image data is recorded (S45).

なお、ステップS45またはS61において、画像データを記録媒体131に記録する際に、後述するステップS115、S127、S138において画像データを圧縮し、S157、S167、S177において画像合成を行った場合には、合成画像データに削減情報を添付の上、記録媒体に131に記録してもよい。この場合、削減情報としては、データ量削減の有無の他に、例えば、削減率等であってもよい。   Note that when image data is recorded on the recording medium 131 in step S45 or S61, the image data is compressed in steps S115, S127, and S138, which will be described later, and the image composition is performed in steps S157, S167, and S177. The reduction information may be attached to the composite image data and recorded on the recording medium 131. In this case, the reduction information may be, for example, a reduction rate in addition to the presence or absence of data amount reduction.

また、ステップS115、S127、S137において、画像データの削減を行うにあたって、RAWデータ圧縮部は、画像データのデータ量に応じて、またカメラの外部にデータ送信する際の送信先の条件に応じて、画像データの削減量(削減率)を変更するようにしてもよい。   In steps S115, S127, and S137, when the image data is reduced, the RAW data compression unit responds according to the data amount of the image data and according to the condition of the transmission destination when transmitting data to the outside of the camera. The image data reduction amount (reduction rate) may be changed.

次に、図4および図5に示すフローチャートを用いて、ステップS43の撮影・画像処理の詳しい動作について説明する。撮影・画像処理のフローに入ると、まず、適正露出撮影を行う(S101)。ここでは、レリーズ釦が半押しされた際に、ステップS35において算出された露出条件で撮影を行う。また、ステップS35において焦点調節が行われていることから、合焦状態で撮影を行う。なお、撮影モード等によっては、このステップでの撮影は適正露光としなくてもよく、また非合焦状態でもよい。   Next, detailed operations of the photographing / image processing in step S43 will be described using the flowcharts shown in FIGS. When the shooting / image processing flow is entered, first, proper exposure shooting is performed (S101). Here, when the release button is half-pressed, shooting is performed under the exposure condition calculated in step S35. In addition, since focus adjustment is performed in step S35, shooting is performed in a focused state. Depending on the shooting mode and the like, shooting at this step may not be performed with proper exposure, or may be in an out-of-focus state.

適正露出撮影を行うと、次に、RAW取り込みを行う(S103)。ステップS101における撮影は基準画像であり、画質を優先するために、RAWデータ圧縮部108によってデータ圧縮を行うことなく、非圧縮でRAW画像データを取り込みSDRAM127に記憶する。ここでは、撮像素子103が画像データから基準画像を生成する基準画像生成部として機能する。   Once proper exposure shooting has been performed, RAW capture is performed (S103). The shooting in step S101 is a reference image. In order to prioritize the image quality, the RAW image data is not compressed by the RAW data compression unit 108, and the RAW image data is captured and stored in the SDRAM 127. Here, the image sensor 103 functions as a reference image generation unit that generates a reference image from image data.

RAW取り込みを行うと、次に、HDR合成か否かを判定する(S105)。ステップS9のカメラ設定において、撮影モードとしてHDR合成モードが設定されたか否かを判定する。HDR合成モードは、前述したように、異なる露光量で順次撮影することによって取得した複数の画像データを用いて、単写よりも広いダイナミックレンジの画像を生成するモードである。   Once RAW capture has been carried out, it is next determined whether or not HDR synthesis is performed (S105). In the camera setting in step S9, it is determined whether the HDR synthesis mode is set as the shooting mode. As described above, the HDR synthesizing mode is a mode for generating an image having a dynamic range wider than that of a single shot by using a plurality of image data acquired by sequentially photographing with different exposure amounts.

ステップS105における判定の結果、HDR合成の場合には、露光量変更を行う(S111)。露光量を、例えば、ステップS35で決定した適正露光条件に対して、−1段、+1段と順次変更する。露光量を変更すると、合成用画像の撮影を行う(S113)。ここでは、ステップS111において変更した露光量に従って撮影を行う。   If the result of determination in step S105 is HDR composition, exposure amount change is performed (S111). For example, the exposure amount is sequentially changed to −1 step and +1 step with respect to the appropriate exposure condition determined in step S35. When the exposure amount is changed, a composite image is taken (S113). Here, photographing is performed according to the exposure amount changed in step S111.

撮影を行うと、RAW圧縮取り込みを行う(S115)。露光量を変更して撮影した画像は基準画像でないことから、多少の画質の劣化は許容される。そこで、画像データの容量を小さくするために、読み出された画像データを、RAWデータ圧縮部108によってデータ圧縮し、この圧縮したRAW画像データを合成用画像RAWデータとしてSDRAM127に一時記憶する。   When shooting is performed, RAW compression capture is performed (S115). Since an image photographed by changing the exposure amount is not a reference image, some deterioration in image quality is allowed. Therefore, in order to reduce the capacity of the image data, the read image data is compressed by the RAW data compression unit 108, and the compressed RAW image data is temporarily stored in the SDRAM 127 as the composition image RAW data.

RAW圧縮取り込みを行うと、次に、合成用画像の撮影枚数が所定枚数か否かを判定する(S117)。ここでは、HDR合成を行うために設定されている枚数、例えば、合成用画像の撮影枚数が2枚に達したか否かを判定する。この判定の結果、所定枚数に達していない場合には、ステップS111に戻り、HDR合成のための撮影を続行する。   Once RAW compression capture has been performed, it is next determined whether or not the number of composite images to be captured is a predetermined number (S117). Here, it is determined whether or not the number of sheets set for performing the HDR composition, for example, the number of images for compositing images has reached two. As a result of this determination, if the predetermined number has not been reached, the process returns to step S111 to continue shooting for HDR composition.

ステップS105における判定の結果、HDR合成でない場合には、次に、深度合成か否かを判定する(S121)。ステップS9のカメラ設定において、撮影モードとして深度合成モードが設定されたか否かを判定する。深度合成モードは、前述したように、異なるフォーカス位置で順次撮影することによって取得した複数の画像データを用いて、単写とは異なる被写界深度の画像を生成するモードである。   If the result of determination in step S105 is not HDR combining, it is next determined whether or not it is depth combining (S121). In the camera setting in step S9, it is determined whether or not the depth synthesis mode is set as the shooting mode. As described above, the depth synthesis mode is a mode for generating an image with a depth of field different from that of single shooting by using a plurality of image data acquired by sequentially capturing images at different focus positions.

ステップS121における判定の結果、深度合成の場合には、フォーカス移動を行う(S123)。ここでは、交換式レンズ200内のマイクロコンピュータ207に対して、撮影レンズ201を所定フォーカス位置に順次移動させるように指示する。所定位置としては、例えば、至近側から無限遠まで1/8ステップずつ変更させた位置でもよい。   If the result of determination in step S121 is depth synthesis, focus movement is performed (S123). Here, the microcomputer 207 in the interchangeable lens 200 is instructed to sequentially move the photographing lens 201 to a predetermined focus position. The predetermined position may be, for example, a position changed by 1/8 step from the closest side to infinity.

フォーカス移動を行うと、次に、適正露出撮影を行う(S125)。ここでは、露光量を、ステップS35で決定した適正露光条件に従って、合成用画像の撮影を行う。適正露出撮影を行うと、次に、ステップS115と同様に、RAW圧縮取り込みを行う(S127)。ここでは、読み出された画像データを、RAWデータ圧縮部108によってデータ圧縮し、この圧縮したRAW画像データを合成用画像RAWデータとしてSDRAM127に一時記憶する。   Once the focus is moved, proper exposure shooting is performed (S125). Here, a composite image is taken according to the appropriate exposure condition determined in step S35. Once proper exposure photography has been performed, RAW compression capture is then performed (S127), as in step S115. Here, the read image data is compressed by the RAW data compression unit 108, and the compressed RAW image data is temporarily stored in the SDRAM 127 as the composition image RAW data.

RAW圧縮取り込みを行うと、次に、合成用画像の撮影枚数が所定枚数か否かを判定する(S129)。ここでは、深度合成を行うために設定されている枚数、例えば、フォーカス位置のステップ数を1/8に設定した場合には、合成用画像の撮影枚数が所定枚数=8枚に達したか否かを判定する。この判定の結果、所定枚数に達していない場合には、ステップS123に戻り、深度合成のための撮影を続行する。   Once RAW compression and capture have been performed, it is next determined whether or not the number of composite images to be captured is a predetermined number (S129). Here, when the number of images set for performing the depth composition, for example, when the number of steps at the focus position is set to 1/8, whether or not the number of images to be combined has reached the predetermined number = 8 is determined. Determine whether. If the result of this determination is that the predetermined number has not been reached, the process returns to step S123 to continue shooting for depth synthesis.

ステップS121における判定の結果、深度合成でない場合には、次に、超解像合成か否かを判定する(S131)。ステップS9のカメラ設定において、撮影モードとして超解像合成モードが設定されたか否かを判定する。超解像合成モードは、前述したように、複数の画像データを用いて、単写よりも解像感のある画像を生成するモードである。具体的には、センサ手振れ補正の場合にはセンサ(撮像素子103)を、またレンズ手振れ補正の場合には補正用レンズを、例えば、センサの1画素分ずらしながら、順次複数の撮影を行う。複数の画像データを取得すると、これらの画像データを用いて、単写とは異なる解像度の高い画像を生成するモードである。   If the result of determination in step S121 is not depth combining, it is next determined whether or not super-resolution combining (S131). In the camera setting in step S9, it is determined whether or not the super-resolution composition mode is set as the photographing mode. As described above, the super-resolution synthesis mode is a mode in which a plurality of image data is used to generate an image having a sense of resolution rather than a single shot. Specifically, in the case of sensor camera shake correction, a plurality of images are sequentially taken while shifting the sensor (image sensor 103), and in the case of lens camera shake correction, the correction lens is shifted by, for example, one pixel of the sensor. In this mode, when a plurality of image data is acquired, an image having a high resolution different from that of single shooting is generated using these image data.

ステップS131における判定の結果、超解像合成の場合には、光軸微移動を行う(S133)。ここでは、センサ手振れの場合には、撮像素子103を、例えば、1画素分移動させるように、センサの位置を光軸と直交する面内で微移動させる。   If the result of determination in step S131 is super-resolution synthesis, optical axis fine movement is performed (S133). Here, in the case of sensor camera shake, the position of the sensor is slightly moved in a plane orthogonal to the optical axis so that the image sensor 103 is moved, for example, by one pixel.

光軸微移動を行うと、ステップS125と同様に、適正露出撮影を行う(S135)。ここでは、露光量を、ステップS35で決定した適正露光条件に従って、合成用画像の撮影を行う。適正露出撮影を行うと、次に、ステップS115と同様に、RAW圧縮取り込みを行う(S137)。ここでは、読み出された画像データを、RAWデータ圧縮部108によってデータ圧縮し、この圧縮したRAW画像データを合成用画像RAWデータとしてSDRAM127に一時記憶する。   When the optical axis is finely moved, appropriate exposure shooting is performed as in step S125 (S135). Here, a composite image is taken according to the appropriate exposure condition determined in step S35. Once proper exposure photography has been carried out, RAW compression and capture are carried out in the same manner as in step S115 (S137). Here, the read image data is compressed by the RAW data compression unit 108, and the compressed RAW image data is temporarily stored in the SDRAM 127 as the composition image RAW data.

RAW圧縮取り込みを行うと、次に、合成用画像の撮影枚数が所定枚数か否かを判定する(S139)。ここでは、超解像合成を行うために設定されている所定枚数、例えば、最初に撮影した位置から、左へ1画素、下へ1画素、左下へ各1画素、ずらした3枚に達したか否かを判定する。この判定の結果、合成用画像の撮影枚数が所定枚数に達していない場合には、ステップS133に戻り、超解像合成のための撮影を続行する。   Once RAW compression capture has been performed, it is next determined whether or not the number of composite images to be captured is a predetermined number (S139). Here, a predetermined number of images set for super-resolution composition, for example, 3 pixels shifted from the first shooting position, 1 pixel left, 1 pixel down, 1 pixel down, left It is determined whether or not. If the result of this determination is that the number of images for compositing has not reached the predetermined number, processing returns to step S133 and photographing for super-resolution composition is continued.

ステップS117、S129、S139における判定の結果、所定枚数に達すると、次に、ステップS151以下において画像合成を行う。まず、ステップS105と同様に、HDR合成か否かを判定する(S151)。この判定の結果、HDR合成であった場合には、次に、RAW取得と伸張を行う(S153)。基準画像のRAWデータと合成用画像のRAWデータをSDRAM127から取得する。この場合、基準画像のRAWデータは非圧縮であるが、合成用画像のRAWデータは圧縮されているので、合成用画像のRAWデータについては、RAWデータ伸張部109aにおいて伸張処理を行う。   If the result of determination in steps S117, S129, and S139 is that the predetermined number is reached, then image synthesis is performed in step S151 and subsequent steps. First, as in step S105, it is determined whether or not HDR synthesis is performed (S151). If the result of this determination is HDR synthesis, then RAW acquisition and decompression are performed (S153). The RAW data of the reference image and the RAW data of the composition image are acquired from the SDRAM 127. In this case, the RAW data of the reference image is uncompressed, but the RAW data of the composition image is compressed. Therefore, the RAW data decompression unit 109a performs decompression processing on the RAW data of the composition image.

RAW取得と伸張を行うと、次に、位置合わせを行う(S155)。ここでは、ステップS153において取得した基準画像のRAWデータと合成用画像のRAWデータの画像の部分部分で位置合わせを行う。   Once RAW acquisition and decompression have been performed, alignment is performed (S155). Here, alignment is performed on the image RAW data of the reference image acquired in step S153 and the image RAW data of the compositing image.

位置合わせを行うと、次に、HDR合成を行う(S157)。ここでは、基準画像のRAWデータに対して、異なる露光量で順次撮影された合成用のRAWデータを順次読出し、この読み出された合成用RAWデータを用いて、単写よりも広いダイナミックレンジの画像を生成する。   Once alignment has been performed, HDR synthesis is then performed (S157). Here, the RAW data for combination sequentially captured with different exposure amounts is sequentially read out from the RAW data of the reference image, and the read out RAW data for combination has a wider dynamic range than that of the single shot. Generate an image.

HDR合成を行うと、次に、ステップS117と同様に、合成した合成用画像が所定枚数に達したか否かを判定する(S159)。ここでは、HDR合成用に撮影された枚数について、HDR合成を行ったか否かを判定する。この判定の結果、所定枚数に達していなかった場合には、ステップS153に戻り、HDR合成を続行する。   Once the HDR composition has been carried out, it is next determined whether or not the number of combined images for composition has reached a predetermined number, similar to step S117 (S159). Here, it is determined whether or not HDR composition has been performed for the number of images taken for HDR composition. If it is determined that the predetermined number has not been reached, the process returns to step S153 to continue the HDR synthesis.

ステップS151における判定の結果、HDR合成でなかった場合には、次に、ステップS121と同様に、深度合成か否かを判定する(S161)。この判定の結果、深度合成の場合には、ステップS153と同様にRAW取得と伸張を行う(S163)。続いて、ステップS155と同様に、位置合わせを行う(S165)。   If the result of determination in step S151 is not HDR combining, it is next determined whether or not it is depth combining as in step S121 (S161). As a result of this determination, in the case of depth synthesis, RAW acquisition and decompression are performed as in step S153 (S163). Subsequently, alignment is performed as in step S155 (S165).

位置合わせを行うと、次に、深度合成を行う(S167)。ここでは、基準画像のRAWデータに対して、異なるフォーカス位置で順次撮影された合成用のRAWデータを順次読出し、この読み出された合成用RAWデータを用いて、単写とは異なる被写界深度の画像を生成する。   Once alignment has been performed, next, depth synthesis is performed (S167). Here, with respect to the RAW data of the reference image, the composition RAW data sequentially photographed at different focus positions is sequentially read out, and the read out RAW data for composition is used to change the object field different from the single-shot. Generate depth images.

深度合成を行うと、次に、ステップS129と同様に、合成した合成用画像が所定枚数に達したか否かを判定する(S169)。ここでは、深度合成用に撮影された枚数について、深度合成を行ったか否かを判定する。この判定の結果、所定枚数に達していなかった場合には、ステップS163に戻り、深度合成を続行する。   Once the depth synthesis has been performed, it is then determined whether or not the number of synthesized images for synthesis has reached a predetermined number, similar to step S129 (S169). Here, it is determined whether or not depth composition has been performed for the number of images photographed for depth composition. If it is determined that the predetermined number has not been reached, the process returns to step S163 to continue the depth synthesis.

ステップS161における判定の結果、深度合成でなかった場合には、次に、ステップS131と同様に、超解像合成か否かを判定する(S171)。この判定の結果、超解像合成の場合には、ステップS153と同様にRAW取得と伸張を行う(S173)。続いて、ステップS155と同様に、位置合わせを行う(S175)。   If the result of determination in step S161 is not depth synthesis, it is next determined whether or not super-resolution synthesis is performed, as in step S131 (S171). As a result of this determination, in the case of super-resolution synthesis, RAW acquisition and expansion are performed in the same manner as in step S153 (S173). Subsequently, alignment is performed as in step S155 (S175).

位置合わせを行うと、次に、超解像合成を行う(S177)。ここでは、基準画像のRAWデータに対して、異なる光軸位置で順次撮影された合成用のRAWデータを順次読出し、この読み出された合成用RAWデータを用いて、単写とは異なる解像感の画像を生成する。   Once alignment has been performed, super-resolution synthesis is then performed (S177). Here, with respect to the RAW data of the reference image, the RAW data for synthesis sequentially photographed at different optical axis positions is sequentially read out, and the resolution different from that of single shooting is used by using the readout RAW data for synthesis. Generate a feeling image.

超解像合成を行うと、次に、ステップS139と同様に、合成した合成用画像が所定枚数に達したか否かを判定する(S179)。ここでは、超解像合成用に撮影された枚数について、超解像合成を行ったか否かを判定する。この判定の結果、所定枚数に達していなかった場合には、ステップS173に戻り、超解像合成を続行する。   Once super-resolution composition has been carried out, it is next determined whether or not the number of synthesized images for synthesis has reached a predetermined number, as in step S139 (S179). Here, it is determined whether super-resolution composition has been performed for the number of images taken for super-resolution composition. As a result of this determination, if the predetermined number has not been reached, the process returns to step S173 and the super-resolution composition is continued.

ステップS159、S169、S179における判定の結果、所定枚数であれば、次に、基本画像処理を行う(S181)。ここでは、ステップS157、S167、S177において合成されたRAWデータに対して、基本画像処理部109bが基本画像処理、すなわちWB補正、カラーマトリックス演算、ガンマ変換、エッジ強調、ノイズリダクション等の画像を行う。基本画像処理を行うと、撮影・画像処理のフローを終了し、元のフローに戻る。   If the result of determination in steps S159, S169, and S179 is a predetermined number, then basic image processing is performed (S181). Here, the basic image processing unit 109b performs basic image processing, that is, images such as WB correction, color matrix calculation, gamma conversion, edge enhancement, noise reduction, and the like on the RAW data synthesized in steps S157, S167, and S177. . When the basic image processing is performed, the shooting / image processing flow ends, and the flow returns to the original flow.

このように、本実施形態における撮影・画像処理のフローにおいては、最初に適正露出で基準画像を撮影し、基準画像のRAWデータを非圧縮で取り込み(S103)、その後、設定された撮影モード(合成モード)に沿った撮影を行うと(S111、S113、S123、S125、S133、S135)、取得したRAWデータを圧縮して取り込んでいる(S115、S127、S135)。このように、画像合成用の画像データは、圧縮して一時記憶しているので、一時記憶用のメモリの容量が小さくても、画像合成用に多数の画像を取得することができ、合成画像の画質を向上させることができる。   As described above, in the shooting / image processing flow in the present embodiment, the reference image is first shot with appropriate exposure, the raw data of the reference image is taken in uncompressed (S103), and then the set shooting mode ( When shooting is performed according to the synthesis mode (S111, S113, S123, S125, S133, S135), the acquired RAW data is compressed and captured (S115, S127, S135). In this way, the image data for image composition is compressed and temporarily stored, so that even if the capacity of the memory for temporary storage is small, a large number of images can be obtained for image composition. Image quality can be improved.

次に、図6を用いて、RAWデータ圧縮部108における圧縮特性について説明する。図6(a)は、撮影モードとして、HDR合成モードが設定された場合の圧縮特性を示し、ステップS115(図4)におけるRAW圧縮の際に使用される圧縮特性である。図6(a)と図6(b)では、横軸が入力輝度を、縦軸が出力を示す。ここで示した圧縮特性で圧縮したデータを、入力輝度よりも少ないビット数でサンプリングすることにより、画質低下を最小限にしながらRAWデータを圧縮できる。   Next, compression characteristics in the RAW data compression unit 108 will be described with reference to FIG. FIG. 6A shows compression characteristics when the HDR synthesis mode is set as the photographing mode, and is compression characteristics used in RAW compression in step S115 (FIG. 4). In FIG. 6A and FIG. 6B, the horizontal axis represents input luminance, and the vertical axis represents output. By sampling the data compressed with the compression characteristics shown here with a smaller number of bits than the input luminance, it is possible to compress the RAW data while minimizing image quality degradation.

図6(a)に示す例では、HDR合成を行うために、適正露光で撮影した基準画像の他に、適正露光よりも+1段オーバー露光での画像と、−1段アンダー露光での画像を取得する。すなわち、HDR合成では、オーバー撮影(+1段撮影)した画像は暗部階調があるため暗部を、アンダー撮影(−1段撮影)した画像は明部階調があるため明部を主として合成に使用する。   In the example shown in FIG. 6A, in order to perform the HDR composition, in addition to the reference image taken with the proper exposure, the image with the +1 stage overexposure and the image with the -1 stage underexposure from the proper exposure are displayed. get. That is, in HDR composition, an image that has been over-photographed (+1 level shooting) has a dark portion gradation, and therefore a dark portion is used. To do.

RAWデータ圧縮部108は、+1段オーバー露光で取得したRAWデータに対しては、被写体の暗い部分について再現しやすくするために、圧縮特性ラインLC(+1)に沿ったRAW圧縮を行う。すなわち、オーバー撮影した場合には、暗部の階調を保持し明部の階調を圧縮する。一方、−1段アンダー露光で取得したRAWデータに対しては、被写体の明るい部分について再現しやすくために、圧縮特性ラインLC(−1)に沿ったRAW圧縮を行う。すなわち、アンダー撮影した場合には、明部の階調をできるだけ保持し、暗部の階調を圧縮する。   The RAW data compression unit 108 performs RAW compression along the compression characteristic line LC (+1) for the RAW data acquired by +1 step overexposure so that the dark portion of the subject can be easily reproduced. That is, when over-shooting is performed, the gradation of the dark part is maintained and the gradation of the bright part is compressed. On the other hand, RAW compression along the compression characteristic line LC (-1) is performed on the RAW data acquired by -1 stage underexposure so that the bright portion of the subject can be easily reproduced. That is, when under-shooting is performed, the gradation of the bright part is kept as much as possible, and the gradation of the dark part is compressed.

なお、図6(a)に示す図では、圧縮特性ラインLC(+1)、LC(−1)を折れ線としているが、なめらかなカーブを描くような特性としてもよい。折れ線状の特性ラインの場合には、ハードウエアの規模を小さくすることができる。特に傾きが2のべき乗(2のk乗:kは整数)の折れ線状の特性にすると、乗算することなくビットシフトを用いて入力値と出力値の相互の変換演算が可能になる。   In the drawing shown in FIG. 6A, the compression characteristic lines LC (+1) and LC (−1) are broken lines, but the characteristic may be a smooth curve. In the case of a polygonal characteristic line, the scale of hardware can be reduced. In particular, when the slope is a power of 2 (2k power: k is an integer), the conversion between the input value and the output value can be performed using bit shift without multiplication.

図6(b)は、撮影モードとして、深度合成または超解像合成が設定された場合の圧縮特性ラインLCの一例を示し、ステップS127、S137(図4)におけるRAW圧縮の際の圧縮特性である。図中、横軸が入力輝度、縦軸が出力である。   FIG. 6B shows an example of the compression characteristic line LC when depth synthesis or super-resolution synthesis is set as the imaging mode, and shows the compression characteristics at the time of RAW compression in steps S127 and S137 (FIG. 4). is there. In the figure, the horizontal axis represents input luminance and the vertical axis represents output.

深度合成では、コントラストの高い部分を基準画像に合成する。また超解像合成では、単写での画素の間に、位置をずらして撮影した画像の画素に基づくデータを補間挿入する。よって、輝度に応じて合成部分を変えるわけではない。そこで、RAWデータを用いて合成した後に画像処理で用いるガンマ特性に類する特性でデータを圧縮する。これにより、合成後に画像処理したときに、トーンジャンプなどの画質劣化を最小限に抑えることができる。なお、図6(b)では、圧縮特性ラインLCは、なめらかなカーブを描いているが、図6(a)に示すような折れ線形状としてもよい。   In the depth synthesis, a high contrast portion is synthesized with a reference image. In super-resolution synthesis, data based on pixels of an image captured by shifting the position is interpolated between pixels in a single shot. Therefore, the composite portion is not changed according to the luminance. Therefore, after combining using RAW data, the data is compressed with characteristics similar to the gamma characteristics used in image processing. As a result, image quality degradation such as tone jump can be minimized when image processing is performed after synthesis. In FIG. 6B, the compression characteristic line LC draws a smooth curve, but it may have a polygonal line shape as shown in FIG.

次に、図7を用いて、RAWデータ伸張部109aおける伸張特性について説明する。図7(a)は、撮影モードとして、HDR合成モードが設定された場合の伸張特性を示し、ステップS153(図5)におけるRAW伸張の際に使用される伸張特性である。図7(a)では、横軸が入力輝度を、縦軸が出力を示す。   Next, the expansion characteristics in the RAW data expansion unit 109a will be described with reference to FIG. FIG. 7A shows the expansion characteristics when the HDR synthesis mode is set as the photographing mode, and is the expansion characteristics used in the RAW expansion in step S153 (FIG. 5). In FIG. 7A, the horizontal axis represents input luminance, and the vertical axis represents output.

RAW伸張する場合には、圧縮時の圧縮特性ライン(図中に細線で記載)LC(+1)、LC(−1)に対して、逆特性の伸張特性ラインLE(+1)、LE(−1)で変換することにより、元のRAWデータと同様のデータに戻る。すなわち、オーバー撮影した場合には圧縮特性ラインLC(+1)によって被写体の暗い部分の変化率を大きくし明るい部分の変化率を小さくしていたが、伸張する場合には伸張特性ラインLE(+1)で示すように、被写体の暗い部分の変化率を小さくし明るい部分の変化率を大きくすることにより、被写体の暗い部分について単写の場合よりも階調を再現することができる。アンダー撮影した場合には、オーバー撮影した場合と逆の傾向の圧縮特性ラインLC(−1)と伸張特性ラインLE(−1)を組み合わせることにより、被写体の明るい部分について単写の場合よりも階調を再現することができる。なお、特性ラインLは、非圧縮の場合の伸張特性を示す。   In the case of RAW expansion, the compression characteristic lines at the time of compression (shown by thin lines in the figure) LC (+1), LC (-1) are opposite to the expansion characteristic lines LE (+1), LE (-1 ) To return to the same data as the original RAW data. That is, in the case of over shooting, the change rate of the dark part of the subject is increased and the change rate of the bright part is reduced by the compression characteristic line LC (+1). As can be seen from the above, by decreasing the change rate of the dark part of the subject and increasing the change rate of the bright part, it is possible to reproduce the gradation of the dark part of the subject as compared with the case of single shooting. When under shooting is performed, the compression characteristic line LC (-1) and the expansion characteristic line LE (-1) tend to be opposite to those when over shooting is performed. Tones can be reproduced. The characteristic line L indicates the expansion characteristic in the case of non-compression.

図7(b)は、撮影モードとして、深度合成・超解像合成モードが設定された場合の伸張特性を示し、ステップS167、S177(図5)におけるRAW伸張の際に使用される伸張特性である。図7(b)でも、横軸が入力輝度を、縦軸が出力を示す。この場合も、RAW伸張する場合には、圧縮時の圧縮特性ライン(図中に細線で記載)LCに対して、逆特性の伸張特性ラインLEで変換することにより、元のRAWデータと同様のデータに戻る。   FIG. 7B shows the expansion characteristics when the depth synthesis / super-resolution synthesis mode is set as the imaging mode. The expansion characteristics used in the RAW expansion in steps S167 and S177 (FIG. 5). is there. Also in FIG. 7B, the horizontal axis represents input luminance, and the vertical axis represents output. Also in this case, in the case of RAW expansion, the compression characteristic line (denoted by a thin line in the figure) LC at the time of compression is converted with the reverse characteristic expansion characteristic line LE, so that it is the same as the original RAW data. Return to data.

このように、本発明の第1実施形態においては、基準画像データは非圧縮で一時記憶するが(図4のS103)、合成用画像データは図6に示すような圧縮特性でRAW圧縮し一時記憶している(図4のS115、S127、S137)。そして、画像合成する際には、RAW圧縮した画像データは、図7に示すような伸張特性でRAW伸張し、基準画像データと伸張された合成用画像データを用いて、HDR合成等、各種の画像合成が行われる。このため、多数の合成用画像データを記憶することが可能となり、合成画像の画質を向上させることができる。   Thus, in the first embodiment of the present invention, the reference image data is temporarily stored without being compressed (S103 in FIG. 4), but the composition image data is temporarily RAW-compressed with the compression characteristics as shown in FIG. (S115, S127, S137 in FIG. 4). At the time of image composition, the RAW compressed image data is RAW decompressed with the decompression characteristics as shown in FIG. 7, and various kinds of data such as HDR composition are used by using the reference image data and the decompressed image data for composition. Image composition is performed. For this reason, it becomes possible to store a large number of image data for synthesis, and the quality of the synthesized image can be improved.

次に、本発明の第2実施形態について、図8ないし図10を用いて説明する。第1実施形態においては、合成用画像の画像データについて、RAW圧縮してから一時記憶し、この圧縮した画像データをRAW伸張してから画像合成を行っていた。これに対して、本実施形態においては、合成用画像の画像データについてはダウンサンプル処理をしてから一時記憶し、このダウンサンプルした画像データをアップサンプルしてから画像合成を行うようにしている。   Next, a second embodiment of the present invention will be described with reference to FIGS. In the first embodiment, image data of a composition image is temporarily stored after being RAW compressed, and image compression is performed after the compressed image data is RAW expanded. On the other hand, in the present embodiment, the image data of the image for synthesis is temporarily stored after down-sampling processing, and image synthesis is performed after the down-sampled image data is up-sampled. .

本実施形態の構成は、第1実施形態に係る図1のブロック図と比較し、第1実施形態におけるRAWデータ圧縮部108とRAWデータ伸張部109aの代わりに、ダウンサンプル処理部109dとアップサンプル処理部109aを配置し、また基本画像処理部109b等の接続関係を変更した点が相違し、他は同一である。そこで、この相違点を中心に図8を用いて本実施形態の構成について説明する。   Compared with the block diagram of FIG. 1 according to the first embodiment, the configuration of the present embodiment replaces the RAW data compression unit 108 and the RAW data decompression unit 109a in the first embodiment with a downsample processing unit 109d and an upsample. The difference is that the processing unit 109a is arranged and the connection relationship of the basic image processing unit 109b and the like is changed, and the others are the same. Therefore, the configuration of the present embodiment will be described with reference to FIG.

図8において、A/D変換部107の出力は、バス110と基本画像処理部109bに出力される。画像処理部109内の基本画像処理部109bは、第1実施形態の場合と同様、RAWデータに対して、オプティカルブラック(OB)減算処理、ホワイトバランス(WB)補正、ベイヤデータの場合に行う同時化処理、色再現処理、ガンマ補正処理、カラーマトリックス演算、ノイズリダクション(NR)処理、エッジ強調処理等を行う。基本画像処理部109bによって画像処理された画像データは、バス110とダウンサンプル処理部109dに出力される。   In FIG. 8, the output of the A / D conversion unit 107 is output to the bus 110 and the basic image processing unit 109b. Similar to the first embodiment, the basic image processing unit 109b in the image processing unit 109 performs synchronization for RAW data in the case of optical black (OB) subtraction processing, white balance (WB) correction, and Bayer data. Processing, color reproduction processing, gamma correction processing, color matrix calculation, noise reduction (NR) processing, edge enhancement processing, and the like are performed. The image data processed by the basic image processing unit 109b is output to the bus 110 and the downsample processing unit 109d.

画像処理部109内のダウンサンプル処理部109dは、基本画像処理部109bによる基本画像処理後に、画像データをダウンサンプルして色差成分のデータ量を減らす処理を行う。例えば、水平2画素単位で1組の色差成分CbCrだけ残すYC422データや、水平垂直2画素(2×2の領域)で1組のCbCrだけを残すYC420データにダウンサンプルする。ダウンサンプル処理部109によって処理された画像データは、バス110に出力される。なお、ダウンサンプルにおいて、どのように一組のCbCrを生成するかは、JEIDA規格のデジタルスチルカメラ用画像ファイルフォーマット規格(Exif)Version2.1(JEIDA−49−1998)などで規定されている方法を使用すればよい。   The down-sample processing unit 109d in the image processing unit 109 performs processing to down-sample image data and reduce the data amount of the color difference component after the basic image processing by the basic image processing unit 109b. For example, YC422 data that leaves only one set of color difference components CbCr in units of two horizontal pixels or YC420 data that leaves only one set of CbCr in two horizontal and vertical pixels (2 × 2 region). The image data processed by the downsample processing unit 109 is output to the bus 110. It should be noted that how to generate a set of CbCr in downsampling is a method defined in the JEIDA standard digital file camera format (Exif) Version 2.1 (JEIDA-49-1998) and the like. Can be used.

ダウンサンプル処理部109dは、画像データのデータ量を削減し、基準画像データよりデータ量の少ない合成用画像データを生成する画像データ量削減部として機能する。この画像データ量削減部は、色差信号の数(データ量)、輝度信号の数(データ量)よりも少なくなるように削減している。これにより、色の解像度は低下するが、人間の知覚特製は輝度の変化よりも色の変化を知覚しにくいため、画質の劣化を抑えながらデータ量を削減できる。   The down-sample processing unit 109d functions as an image data amount reduction unit that reduces the data amount of image data and generates image data for synthesis that has a smaller data amount than the reference image data. This image data amount reducing unit reduces the number of color difference signals (data amount) and the number of luminance signals (data amount) to be smaller. As a result, although the color resolution is lowered, the human perception special product is less likely to perceive the color change than the luminance change, so that the data amount can be reduced while suppressing the deterioration of the image quality.

基本画像処理部109bは、基準画像および合成用画像の両画像データを処理するが、基準画像の画像データは、基本画像処理部109bによって処理された後に、バス110を介してSDRAM127に一時記憶される。一方、合成用画像の画像データは、ダウンサンプル処理部109dによって処理された後に、バス110を介してSDRAM127に一時記憶される。したがって、基準画像の画像データはダウンサンプルされることなく、各画素YCbCrの情報を持つデータ(例えば、YC444データ)がSDRAM127に一時記憶されるのに対して、合成用画像の画像データはダウンサンプルされ、データ量を小さくした上で、SDRAM127に一時記憶される。   The basic image processing unit 109b processes both image data of the reference image and the composition image. The image data of the reference image is temporarily stored in the SDRAM 127 via the bus 110 after being processed by the basic image processing unit 109b. The On the other hand, the image data of the composition image is temporarily stored in the SDRAM 127 via the bus 110 after being processed by the down-sample processing unit 109d. Therefore, the image data of the reference image is not downsampled, and data (for example, YC444 data) having information on each pixel YCbCr is temporarily stored in the SDRAM 127, whereas the image data of the composition image is downsampled. Then, the data amount is reduced and temporarily stored in the SDRAM 127.

画像処理部109内のアップサンプル処理部109eは、画像合成部109cによる画像合成前に、画像データをアップサンプルする。すなわち、画像データの内の色差成分CbCrが輝度データ(Y)に対して少ない場合(上述のYC422、YS420データのような場合)、色差成分CbCrをアップサンプルして、各画素YCbCrのデータがあるように変換する。アップサンプルの方法は、単純に色差成分CbCrをコピーしてもよく、またYC420やYC422形式のデータにおいて近傍のCbCrを使用して線形補間で求めるようしてもよい。なお、基準画像(YC444形式)の画像データは、既に各画素のCbCrを有するため、アップサンプル処理の必要はない。   An upsample processing unit 109e in the image processing unit 109 upsamples image data before the image composition by the image composition unit 109c. That is, when the color difference component CbCr in the image data is smaller than the luminance data (Y) (like the above-described YC422 and YS420 data), the color difference component CbCr is up-sampled and there is data for each pixel YCbCr. Convert as follows. In the up-sampling method, the color difference component CbCr may be simply copied, or it may be obtained by linear interpolation using neighboring CbCr in YC420 or YC422 format data. Note that the image data of the reference image (YC 444 format) already has CbCr for each pixel, so there is no need for upsampling processing.

次に、図9および図10に示すフローチャートを用いて、本実施形態の動作について説明する。本実施形態におけるメイン動作は、図2および図3に示したフローチャートと同様であるので、詳しい説明は省略する。本実施形態は、第1実施形態に係る図4および図5に示したフローチャートを図9および図10に示すフローチャートに置き換えればよく、さらに、これらのフローチャートにおいて、図4のステップS115、S127、S137を図9のS115A、S127A、S137Aに置き換え、図5のステップS153、S163、S173を図10のS153A、S163A、S173Aに置き換える点でのみ相違する。そこで、第1実施形態に係る図5および図6と同一の処理を行うステップには同一のステップ番号を付し詳しい説明を省略し、相違点を中心に説明する。   Next, the operation of the present embodiment will be described using the flowcharts shown in FIGS. The main operation in the present embodiment is the same as the flowcharts shown in FIGS. 2 and 3, and detailed description thereof is omitted. In the present embodiment, the flowcharts shown in FIGS. 4 and 5 according to the first embodiment may be replaced with the flowcharts shown in FIGS. 9 and 10, and in these flowcharts, steps S115, S127, and S137 in FIG. 9 is replaced with S115A, S127A, and S137A in FIG. 9, and steps S153, S163, and S173 in FIG. 5 are replaced with S153A, S163A, and S173A in FIG. Therefore, steps that perform the same processing as in FIG. 5 and FIG. 6 according to the first embodiment will be given the same step numbers and will not be described in detail, and differences will be mainly described.

図9に示す撮影のフローに入ると、適正露出で撮影を行う(S101)。このステップでは、レリーズ釦の1stレリーズで決めた露出条件および合焦位置(図3のS35)で露光を行う。続いて、基本画像処理を行う(S103)。このステップでは、ステップS101における露光で取得した画像データに対して、基本画像処理部109bが基本画像処理を行い、画像データをダウンサンプルせずにSDRAM127に一時記憶させる。   When the shooting flow shown in FIG. 9 is entered, shooting is performed with appropriate exposure (S101). In this step, exposure is performed with the exposure condition and the in-focus position determined in the first release of the release button (S35 in FIG. 3). Subsequently, basic image processing is performed (S103). In this step, the basic image processing unit 109b performs basic image processing on the image data acquired by the exposure in step S101, and temporarily stores the image data in the SDRAM 127 without down-sampling.

基本画像処理を行うと、次に、HDR合成が設定されている場合には、第1実施形態と同様に、露光量を変更しながら撮影を行う(S105Yes、S111、S113)。撮影を行うと、基本画像処理とダウンサンプルを行う(S115A)。ここでは、取得した画像データに対して、基本画像処理部109bが基本画像処理を行い、この画像データをダウンサンプル処理部109dがダウンサンプル処理を行い、ダウンサンプルした画像データをSDRAM127に一時記憶させる。ダウンサンプルを行うと所定枚数に達したか否かを判定し(S117)。達していない場合には、ステップS111に戻る。   Once the basic image processing is performed, next, when HDR composition is set, as in the first embodiment, shooting is performed while changing the exposure amount (S105 Yes, S111, S113). When shooting is performed, basic image processing and downsampling are performed (S115A). Here, the basic image processing unit 109b performs basic image processing on the acquired image data, the down-sampling processing unit 109d performs down-sampling processing on the image data, and the down-sampled image data is temporarily stored in the SDRAM 127. . When downsampling is performed, it is determined whether or not a predetermined number has been reached (S117). If not, the process returns to step S111.

また、深度合成が設定されている場合には、第1実施形態と同様に、フォーカス移動を行いながら撮影を行う(S121Yes、S123、S125)。撮影を行うと、基本画像処理とダウンサンプルを行う(S127A)。ここでは、ステップS115Aと同様に、取得した画像データに対して、基本画像処理部109bが基本画像処理を行い、この画像データをダウンサンプル処理部109dがダウンサンプル処理を行い、ダウンサンプルした画像データをSDRAM127に一時記憶させる。ダウンサンプルを行うと所定枚数に達したか否かを判定し(S129)。達していない場合には、ステップS123に戻る。   If depth composition is set, as in the first embodiment, shooting is performed while moving the focus (S121 Yes, S123, S125). When shooting is performed, basic image processing and downsampling are performed (S127A). Here, as in step S115A, the basic image processing unit 109b performs basic image processing on the acquired image data, and the down-sampling processing unit 109d performs down-sampling processing on the image data. Is temporarily stored in the SDRAM 127. When downsampling is performed, it is determined whether or not a predetermined number has been reached (S129). If not, the process returns to step S123.

また、超解像合成が設定されている場合には、第1実施形態と同様に、光軸を微移動させながら撮影を行う(S131Yes、S133、S135)。撮影を行うと、基本画像処理とダウンサンプルを行う(S137A)。ここでは、ステップS115Aと同様に、取得した画像データに対して、基本画像処理部109bが基本画像処理を行い、この画像データをダウンサンプル処理部109dがダウンサンプル処理を行い、ダウンサンプルした画像データをSDRAM127に一時記憶させる。ダウンサンプルを行うと所定枚数に達したか否かを判定し(S139)。達していない場合には、ステップS133に戻る。   If super-resolution composition is set, as in the first embodiment, shooting is performed while slightly moving the optical axis (S131 Yes, S133, S135). When shooting is performed, basic image processing and downsampling are performed (S137A). Here, as in step S115A, the basic image processing unit 109b performs basic image processing on the acquired image data, and the down-sampling processing unit 109d performs down-sampling processing on the image data. Is temporarily stored in the SDRAM 127. When downsampling is performed, it is determined whether or not a predetermined number has been reached (S139). If not, the process returns to step S133.

ステップS117、S129、S139における判定の結果、所定枚数に達すると、次に、ステップS151以下において画像合成を行う。まず、撮影モードとしてHDR合成が設定されている場合には(S151Yes)、まずアップサンプルを行う(S153A)。ここでは、SDRAM127に一時記憶されている基準画像と合成用画像の画像データを読み出し、合成用画像の画像データに対しアップサンプルを行う。合成用画像の画像データは、前述したようにダウンサンプルしてデータ量を減らしたYCデータ記憶していることから、このステップでアップサンプル処理部109eがアップサンプル処理を行う。   If the result of determination in steps S117, S129, and S139 is that the predetermined number is reached, then image synthesis is performed in step S151 and subsequent steps. First, when HDR synthesis is set as the photographing mode (S151 Yes), up-sampling is first performed (S153A). Here, the reference image temporarily stored in the SDRAM 127 and the image data of the composition image are read, and up-sampling is performed on the image data of the composition image. Since the image data of the composition image is stored as YC data in which the data amount is reduced by down-sampling as described above, the up-sampling processing unit 109e performs up-sampling processing at this step.

アップサンプル処理を行うと、位置合わせを行い(S155)、HDR合成を行い(S157)、所定枚数に達したか否かを判定し(S159)、達していない場合には、ステップS153Aに戻る。   When the up-sampling process is performed, alignment is performed (S155), HDR synthesis is performed (S157), it is determined whether the predetermined number has been reached (S159), and if not, the process returns to step S153A.

また、撮影モードとし深度合成が設定されている場合には(S161Yes)、まずステップS153Aと同様に、アップサンプルを行う(S163A)。ここでは、SDRAM127に一時記憶されている基準画像と合成用画像の画像データを読み出し、合成用画像の画像データに対してアップサンプル処理部109eがアップサンプルを行う。アップサンプル処理を行うと、位置合わせを行い(S165)、深度合成を行い(S167)、所定枚数に達したか否かを判定し(S169)、達していない場合には、ステップS163Aに戻る。   Further, when the depth synthesis is set as the photographing mode (S161 Yes), up-sampling is first performed as in step S153A (S163A). Here, the reference image temporarily stored in the SDRAM 127 and the image data of the composition image are read, and the upsample processing unit 109e performs upsampling on the image data of the composition image. When the up-sampling process is performed, alignment is performed (S165), depth composition is performed (S167), it is determined whether the predetermined number has been reached (S169), and if not, the process returns to step S163A.

また、撮影モードとし超解像合成が設定されている場合には(S171Yes)、まずステップS153Aと同様に、アップサンプルを行う(S173A)。ここでは、SDRAM127に一時記憶されている基準画像と合成用画像の画像データを読み出し、合成用画像の画像データに対してアップサンプル処理部109eがアップサンプルを行う。アップサンプル処理を行うと、位置合わせを行い(S175)、超解像合成を行い(S177)、所定枚数に達したか否かを判定し(S179)、達していない場合には、ステップS173Aに戻る。   If super-resolution composition is set as the photographing mode (S171 Yes), up-sampling is first performed as in step S153A (S173A). Here, the reference image temporarily stored in the SDRAM 127 and the image data of the composition image are read, and the upsample processing unit 109e performs upsampling on the image data of the composition image. When the up-sampling process is performed, alignment is performed (S175), super-resolution synthesis is performed (S177), it is determined whether the predetermined number has been reached (S179), and if not, step S173A is performed. Return.

このように、本発明の第2実施形態においては、基準画像データはダウンサンプル行うことなく一時記憶するが(図9のS103)、基本画像処理を行った合成用画像データはダウンサンプルを行ってから一時記憶している(図9のS115A、S127A、S137A)。そして、画像合成する際には、ダウンサンプルした画像データは、アップサンプルしてから、HDR合成等、各種の画像合成が行われる。このため、多数の合成用画像データを記憶することが可能となり、合成画像の画質を向上させることができる。   As described above, in the second embodiment of the present invention, the reference image data is temporarily stored without being downsampled (S103 in FIG. 9), but the image data for synthesis that has undergone the basic image processing is downsampled. (S115A, S127A, S137A in FIG. 9). When image synthesis is performed, the downsampled image data is upsampled and then subjected to various types of image synthesis such as HDR synthesis. For this reason, it becomes possible to store a large number of image data for synthesis, and the quality of the synthesized image can be improved.

なお、本実施形態においては、基準画像の画像データはダウンサンプルを行っていないが、合成用画像の画像データよりは、データ量の削減が大きくないようなダウンサンプルを行うようにしても勿論かまわない。また、ダウンサンプルの例として、輝度信号Yと色差信号CbCrを用いたが、他の輝度成分と色成分に分けて表記する色空間(例えば、YPbPr、L*a*b*、HSV等の色空間)を用い、輝度成分を表す信号よりも色差成分を表す信号を減らすようなダウンサンプルしてもよい。   In this embodiment, the image data of the reference image is not downsampled. However, it is of course possible to perform downsampling so that the data amount is not reduced more than the image data of the image for synthesis. Absent. In addition, as an example of downsampling, the luminance signal Y and the color difference signal CbCr are used. Space) and down-sampling may be performed so that a signal representing a color difference component is reduced from a signal representing a luminance component.

次に、本発明の第3実施形態について、図11ないし図13を用いて説明する。第1実施形態においては、合成用画像の画像データについて、RAW圧縮してから一時記憶し、この圧縮した画像データをRAW伸張してから画像合成を行い、また第2実施形態においては、ダウンサンプル処理して一時記憶し、このダウンサンプルした画像データをアップサンプルしてから画像合成していた。これに対して、本実施形態においては、合成用画像の画像データについてはJPEG等の画像圧縮をしてから一時記憶し、この画像圧縮した画像データを画像伸張してから画像合成を行うようにしている。   Next, a third embodiment of the present invention will be described with reference to FIGS. In the first embodiment, the image data of the compositing image is temporarily stored after RAW compression, and the compressed image data is subjected to RAW decompression and then image synthesis is performed. In the second embodiment, downsampling is performed. The image data is processed and temporarily stored, and the downsampled image data is upsampled and then the image is synthesized. On the other hand, in this embodiment, the image data of the image for synthesis is temporarily stored after image compression such as JPEG, and the image compression is performed after image compression of the image compressed image. ing.

本実施形態の構成は、第1実施形態に係る図1のブロック図と比較し、第1実施形態におけるRAWデータ圧縮部108とRAWデータ伸張部109aの代わりに、画像圧縮部109fと画像伸張部109eを配置し、また基本画像処理部109b等の接続関係を変更し、画像圧縮部115および画像伸張部117が重複することから省略した点が相違し、他は同一である。そこで、この相違点を中心に図11を用いて本実施形態の構成について説明する。   Compared with the block diagram of FIG. 1 according to the first embodiment, the configuration of the present embodiment is an image compression unit 109f and an image expansion unit instead of the RAW data compression unit 108 and the RAW data expansion unit 109a in the first embodiment. 109e is arranged, the connection relationship of the basic image processing unit 109b and the like is changed, and the image compression unit 115 and the image expansion unit 117 are overlapped, so that they are omitted, and the others are the same. Therefore, the configuration of the present embodiment will be described with reference to FIG.

図8において、A/D変換部107の出力は、バス110と基本画像処理部109bに出力される。画像処理部109内の基本画像処理部109bは、第1実施形態の場合と同様、RAWデータに対して、オプティカルブラック(OB)減算処理、ホワイトバランス(WB)補正、ベイヤデータの場合に行う同時化処理、色再現処理、ガンマ補正処理、カラーマトリックス演算、ノイズリダクション(NR)処理、エッジ強調処理等を行う。基本画像処理部109bによって画像処理された画像データは、バス110と画像圧縮部109fに出力される。   In FIG. 8, the output of the A / D conversion unit 107 is output to the bus 110 and the basic image processing unit 109b. Similar to the first embodiment, the basic image processing unit 109b in the image processing unit 109 performs synchronization for RAW data in the case of optical black (OB) subtraction processing, white balance (WB) correction, and Bayer data. Processing, color reproduction processing, gamma correction processing, color matrix calculation, noise reduction (NR) processing, edge enhancement processing, and the like are performed. The image data processed by the basic image processing unit 109b is output to the bus 110 and the image compression unit 109f.

画像処理部109内の画像圧縮部109fは、第1実施形態における画像圧縮部115と同様に、画像データを、静止画の場合にはJPEG圧縮方式等、また動画の場合にはMPEG等の各種圧縮方式に従って圧縮する。画像圧縮部109fは、画像データのデータ量を削減し、基準画像データよりデータ量の少ない合成用画像データを生成する画像データ量削減部として機能する。また、この画像データ量削減部は、画像データを符号化して圧縮する圧縮部を含んでいる。この圧縮部はJPEG等の非可逆圧縮を行う。   Similar to the image compression unit 115 in the first embodiment, the image compression unit 109f in the image processing unit 109 converts the image data into various types such as a JPEG compression method for a still image and MPEG for a moving image. Compress according to the compression method. The image compression unit 109f functions as an image data amount reduction unit that reduces the data amount of image data and generates image data for synthesis that has a smaller data amount than the reference image data. The image data amount reduction unit includes a compression unit that encodes and compresses image data. This compression unit performs lossy compression such as JPEG.

基本画像処理部109bは、基準画像および合成用画像の両画像データを処理するが、基準画像の画像データは、基本画像処理部109bによって処理された後に、バス110を介してSDRAM127に一時記憶される。一方、合成用画像の画像データは、画像圧縮部109fによって画像圧縮処理された後に、バス110を介してSDRAM127に一時記憶される。したがって、基準画像の画像データは画像圧縮されることなく、SDRAM127に一時記憶されるのに対して、合成用画像の画像データは画像圧縮され、データ量を小さくした上で、SDRAM127に一時記憶される。   The basic image processing unit 109b processes both image data of the reference image and the composition image. The image data of the reference image is temporarily stored in the SDRAM 127 via the bus 110 after being processed by the basic image processing unit 109b. The On the other hand, the image data of the composition image is temporarily stored in the SDRAM 127 via the bus 110 after being subjected to image compression processing by the image compression unit 109f. Therefore, the image data of the reference image is temporarily stored in the SDRAM 127 without image compression, whereas the image data of the image for synthesis is image-compressed and temporarily stored in the SDRAM 127 after reducing the data amount. The

画像処理部109内の画像伸張部109gは、第1実施形態と同様に、JPEG画像データやMPEG画像データ等の圧縮画像データの伸張を行う。なお、基準画像(の画像データは、非圧縮データであることから、画像伸張処理の必要はない。   The image decompression unit 109g in the image processing unit 109 decompresses compressed image data such as JPEG image data and MPEG image data, as in the first embodiment. Since the image data of the reference image is uncompressed data, there is no need for image expansion processing.

次に、図12および図13に示すフローチャートを用いて、本実施形態の動作について説明する。本実施形態におけるメイン動作は、図2および図3に示したフローチャートと同様であるので、詳しい説明は省略する。また、本実施形態は、第1実施形態に係る図4および図5に示したフローチャートを図12および図13に示すフローチャートに置き換えればよく、さらに、これらのフローチャートにおいて、図4のステップS103、S115、S127、S137を図12のS103B、S115B、S127B、S137Bに置き換え、図5のステップS153、S163、S173を図13のS153B、S163B、S173Bに置き換える点でのみ相違する。そこで、第1実施形態に係る図5および図6と同一の処理を行うステップには同一のステップ番号を付し詳しい説明を省略し、相違点を中心に説明する。   Next, the operation of this embodiment will be described using the flowcharts shown in FIGS. The main operation in the present embodiment is the same as the flowcharts shown in FIGS. 2 and 3, and detailed description thereof is omitted. Further, in the present embodiment, the flowcharts shown in FIGS. 4 and 5 according to the first embodiment may be replaced with the flowcharts shown in FIGS. 12 and 13, and in these flowcharts, steps S103 and S115 in FIG. , S127, and S137 are replaced with S103B, S115B, S127B, and S137B in FIG. 12, and steps S153, S163, and S173 in FIG. 5 are replaced with S153B, S163B, and S173B in FIG. Therefore, steps that perform the same processing as in FIG. 5 and FIG. 6 according to the first embodiment will be given the same step numbers and will not be described in detail, and differences will be mainly described.

図12に示す撮影のフローに入ると、適正露出で撮影を行う(S101)。このステップでは、レリーズ釦の1stレリーズで決めた露出条件および合焦位置(図3のS35)で露光を行う。続いて、基本画像処理と低圧縮を行う(S103B)。このステップでは、ステップS101における露光で取得した画像データに対して、基本画像処理部109bが基本画像処理を行い、また画像圧縮部109fによって低圧縮したのちにSDRAM127に一時記憶させる。ここでは、撮像素子103と低圧縮で画像データを圧縮する画像圧縮部109fが画像データから基準画像を生成する基準画像生成部として機能する。   When the shooting flow shown in FIG. 12 is entered, shooting is performed with appropriate exposure (S101). In this step, exposure is performed with the exposure condition and the in-focus position determined in the first release of the release button (S35 in FIG. 3). Subsequently, basic image processing and low compression are performed (S103B). In this step, the basic image processing unit 109b performs basic image processing on the image data acquired by the exposure in step S101, and after the image compression unit 109f performs low compression, the image data is temporarily stored in the SDRAM 127. Here, the image sensor 103 and the image compression unit 109f that compresses image data with low compression function as a reference image generation unit that generates a reference image from the image data.

基本画像処理と低圧縮を行うと、次に、HDR合成が設定されている場合には、第1実施形態と同様に、露光量を変更しながら撮影を行う(S105Yes、S111、S113)。撮影を行うと、基本画像処理と高圧縮を行う(S115B)。ここでは、取得した画像データに対して、基本画像処理部109bが基本画像処理を行い、この画像データを画像圧縮部109fが高圧縮で画像圧縮を行い、高圧縮した画像データをSDRAM127に一時記憶させる。高圧縮を行うと所定枚数に達したか否かを判定し(S117)。達していない場合には、ステップS111に戻る。   When basic image processing and low compression are performed, next, when HDR composition is set, shooting is performed while changing the exposure amount as in the first embodiment (S105 Yes, S111, S113). When shooting is performed, basic image processing and high compression are performed (S115B). Here, the basic image processing unit 109b performs basic image processing on the acquired image data, the image compression unit 109f performs high-compression image compression on the image data, and the high-compressed image data is temporarily stored in the SDRAM 127. Let It is determined whether or not the predetermined number has been reached when performing high compression (S117). If not, the process returns to step S111.

また、深度合成が設定されている場合には、第1実施形態と同様に、フォーカス移動を行いながら撮影を行う(S121Yes、S123、S125)。撮影を行うと、基本画像処理と高圧縮を行う(S127B)。ここでは、ステップS115Bと同様に、取得した画像データに対して、基本画像処理部109bが基本画像処理を行い、この画像データを画像圧縮部109fが高圧縮で画像圧縮処理を行い、画像圧縮した画像データをSDRAM127に一時記憶させる。高圧縮を行うと所定枚数に達したか否かを判定し(S129)。達していない場合には、ステップS123に戻る。   If depth composition is set, as in the first embodiment, shooting is performed while moving the focus (S121 Yes, S123, S125). When shooting is performed, basic image processing and high compression are performed (S127B). Here, as in step S115B, the basic image processing unit 109b performs basic image processing on the acquired image data, and the image compression unit 109f performs high-compression image compression processing and image compression on the acquired image data. Image data is temporarily stored in the SDRAM 127. It is determined whether or not the predetermined number has been reached when performing high compression (S129). If not, the process returns to step S123.

また、超解像合成が設定されている場合には、第1実施形態と同様に、光軸を微移動させながら撮影を行う(S131Yes、S133、S135)。撮影を行うと、基本画像処理と高圧縮を行う(S137B)。ここでは、ステップS115Bと同様に、取得した画像データに対して、基本画像処理部109bが基本画像処理を行い、この画像データを画像圧縮部109fが高圧縮で画像圧縮処理を行い、画像圧縮した画像データをSDRAM127に一時記憶させる。高圧縮を行うと所定枚数に達したか否かを判定し(S139)。達していない場合には、ステップS133に戻る。   If super-resolution composition is set, as in the first embodiment, shooting is performed while slightly moving the optical axis (S131 Yes, S133, S135). When shooting is performed, basic image processing and high compression are performed (S137B). Here, as in step S115B, the basic image processing unit 109b performs basic image processing on the acquired image data, and the image compression unit 109f performs high-compression image compression processing and image compression on the acquired image data. Image data is temporarily stored in the SDRAM 127. It is determined whether or not the predetermined number has been reached when performing high compression (S139). If not, the process returns to step S133.

ステップS117、S129、S139における判定の結果、所定枚数に達すると、次に、ステップS151以下において画像合成を行う。まず、撮影モードとしてHDR合成が設定されている場合には(S151Yes)、まず、画像伸張を行う(S153B)。ここでは、SDRAM127に一時記憶されている基準画像と合成用画像の画像データを読み出し、合成用画像の画像データに対し高伸張率で画像伸張を行い、基準画像の画像データに対し低伸張率で画像伸張を行う。合成用画像の画像データは、前述したように高画像圧縮によりデータ量を減らしてデータ記憶していることから、このステップでは高伸張率で画像伸張部109gが画像伸張処理を行う。また基準画像の画像データは低画像圧縮で圧縮されていることから、このステップでは低伸張率で画像伸張を行う。   If the result of determination in steps S117, S129, and S139 is that the predetermined number is reached, then image synthesis is performed in step S151 and subsequent steps. First, when HDR composition is set as a shooting mode (S151 Yes), first, image expansion is performed (S153B). Here, the image data of the reference image and the composition image temporarily stored in the SDRAM 127 is read, the image data of the composition image is decompressed at a high expansion ratio, and the image data of the reference image is decompressed at a low expansion ratio. Perform image decompression. Since the image data of the image for synthesis is stored by reducing the data amount by high image compression as described above, the image expansion unit 109g performs image expansion processing at a high expansion rate in this step. Since the image data of the reference image is compressed by low image compression, image expansion is performed at a low expansion rate in this step.

画像伸張を行うと、位置合わせを行い(S155)、HDR合成を行い(S157)、所定枚数に達したか否かを判定し(S159)、達していない場合には、ステップS153Bに戻る。   When image expansion is performed, alignment is performed (S155), HDR composition is performed (S157), it is determined whether or not the predetermined number has been reached (S159), and if not, the process returns to step S153B.

また、撮影モードとし深度合成が設定されている場合には(S161Yes)、まずステップS153Bと同様に、画像伸張を行う(S163B)。ここでは、SDRAM127に一時記憶されている基準画像と合成用画像の画像データを読み出し、低伸張率または高伸張率で画像伸張部109gが画像伸張を行う。画像伸張を行うと、位置合わせを行い(S165)、深度合成を行い(S167)、所定枚数に達したか否かを判定し(S169)、達していない場合には、ステップS163Bに戻る。   If depth synthesis is set as the photographing mode (S161 Yes), first, image expansion is performed as in step S153B (S163B). Here, the image data of the reference image and the composition image temporarily stored in the SDRAM 127 is read, and the image expansion unit 109g performs image expansion at a low expansion rate or a high expansion rate. When the image is expanded, alignment is performed (S165), depth composition is performed (S167), and it is determined whether or not the predetermined number has been reached (S169). If not, the process returns to step S163B.

また、撮影モードとし超解像合成が設定されている場合には(S171Yes)、まずステップS153Bと同様に、画像伸張を行う(S173B)。ここでは、SDRAM127に一時記憶されている基準画像と合成用画像の画像データを読み出し、低伸張率または高伸張率で画像伸張部109gが画像伸張を行う。画像伸張を行うと、位置合わせを行い(S175)、超解像合成を行い(S177)、所定枚数に達したか否かを判定し(S179)、達していない場合には、ステップS173Bに戻る。   When super-resolution composition is set as the photographing mode (S171 Yes), first, image decompression is performed as in step S153B (S173B). Here, the image data of the reference image and the composition image temporarily stored in the SDRAM 127 is read, and the image expansion unit 109g performs image expansion at a low expansion rate or a high expansion rate. When the image is expanded, alignment is performed (S175), super-resolution composition is performed (S177), and it is determined whether or not the predetermined number has been reached (S179). If not, the process returns to step S173B. .

このように、本発明の第3実施形態においては、基準画像データは低圧縮率で画像圧縮を行い一時記憶するが(図12のS103B)、基本画像処理を行った合成用画像データは高圧縮率で画像圧縮を行ってから一時記憶している(図13のS115B、S127B、S137B)。そして、画像合成する際には、画像圧縮した画像データは、画像伸張してから、HDR合成等、各種の画像合成が行われる。このため、多数の合成用画像データを記憶することが可能となり、合成画像の画質を向上させることができる。   As described above, in the third embodiment of the present invention, the reference image data is subjected to image compression at a low compression rate and temporarily stored (S103B in FIG. 12), but the composition image data subjected to basic image processing is highly compressed. The image is compressed at a rate and temporarily stored (S115B, S127B, S137B in FIG. 13). When the images are combined, the compressed image data is subjected to various types of image combining such as HDR combining after image expansion. For this reason, it becomes possible to store a large number of image data for synthesis, and the quality of the synthesized image can be improved.

なお、本実施形態においては、基準画像データを低圧縮率で画像圧縮していたが、画像圧縮を行わないままで、SDRAM127に一時記憶するようにしても構わない。この場合には、画像伸張の必要がない。   In the present embodiment, the reference image data is image-compressed at a low compression rate, but may be temporarily stored in the SDRAM 127 without performing image compression. In this case, there is no need for image expansion.

以上説明したように、本発明の各実施形態においては、被写体を撮像して基準画像の画像データを生成し(例えば、図4のS101、S103)、被写体を撮像して合成用画像の画像データを生成し(例えば、図4のS113、S125、S135)合成用画像の画像データを基準画像の画像データよりデータ量の少なくなるようにデータ量を削減し(例えば、図4のS115、S127、S137、図6)、基準画像の画像データと合成用画像の画像データを用いて、画像データの合成を行い、合成画像データを生成している(例えば、図5のS157、S167、S177)。このように、複数の画像を合成する際に、基準となる画像データよりも、合成する画像データのサイズを小さくしてメモリ(例えば、図1のSDRAM127)に一時記憶する。この結果、限られた容量のメモリ内において多くの撮影画像を記憶でき、同じ容量のメモリで比較すると、より高品位の合成画像を実現できる。   As described above, in each embodiment of the present invention, the subject is imaged to generate the image data of the reference image (for example, S101 and S103 in FIG. 4), and the subject is imaged to generate the image data of the composition image. (For example, S113, S125, and S135 in FIG. 4), the data amount of the image for synthesis is reduced so that the data amount is smaller than the image data of the reference image (for example, S115, S127, and FIG. 4). S137, FIG. 6), image data is synthesized by using the image data of the reference image and the image data of the synthesis image to generate synthesized image data (for example, S157, S167, S177 in FIG. 5). As described above, when a plurality of images are combined, the size of the image data to be combined is made smaller than the reference image data and temporarily stored in a memory (for example, SDRAM 127 in FIG. 1). As a result, a large number of captured images can be stored in a memory having a limited capacity, and a higher-quality composite image can be realized when compared with a memory having the same capacity.

なお、本発明の各実施形態においては、RAW圧縮データ等の画像データはSDRAM127に一時記憶したが、記憶媒体137やフラッシュメモリ123に一時記憶するようにしてもよい。RAWデータで合成処理が終わってから、基本画像処理を行う実施形態と、逆に基本画像処理後に合成処理を行う実施形態があるが、RAWデータで合成処理を行うか、基本画像処理後の画像データで合成処理を行うかは適宜選択してもよい。   In each embodiment of the present invention, image data such as RAW compressed data is temporarily stored in the SDRAM 127, but may be temporarily stored in the storage medium 137 or the flash memory 123. There is an embodiment in which basic image processing is performed after composition processing is completed with RAW data, and conversely, there is an embodiment in which composition processing is performed after basic image processing. You may select suitably whether it performs a synthetic | combination process by data.

また、本発明の第1および第2実施形態においては、基準画像の画像データは、データ量の削減を行っていなかったが、合成用画像のデータ量よりは低削減率(非可逆な削減方法の場合であれば合成用画像よりも高画質の状態)であれば、基準画像の画像データのデータ量を削減してもよい。   In the first and second embodiments of the present invention, the image data of the reference image is not reduced in data amount, but the reduction rate (irreversible reduction method) is lower than the data amount of the image for synthesis. In this case, the data amount of the image data of the reference image may be reduced if the image quality is higher than that of the composition image.

また、本発明の各実施形態においては、撮影のための機器として、デジタルカメラを用いて説明したが、カメラとしては、デジタル一眼レフカメラでもコンパクトデジタルカメラでもよく、ビデオカメラ、ムービーカメラのような動画用のカメラでもよく、さらに、携帯電話、スマートフォン、携帯情報端末(PDA:Personal Digital Assist)、パーソナルコンピュータ(PC)、タブレット型コンピュータ、ゲーム機器等に内蔵されるカメラでも構わない。いずれにしても、複数の画像データを合成する撮影のための機器であれば、本発明を適用することができる。また、撮影機器で撮影した複数の画像データを合成する画像合成装置であれば、本発明を適用することができる。   In each embodiment of the present invention, a digital camera has been described as an apparatus for photographing. However, the camera may be a digital single lens reflex camera or a compact digital camera, such as a video camera or a movie camera. It may be a camera for moving images, and may be a camera incorporated in a mobile phone, a smartphone, a personal digital assistant (PDA), a personal computer (PC), a tablet computer, a game machine, or the like. In any case, the present invention can be applied to any device for photographing that combines a plurality of image data. Further, the present invention can be applied to any image synthesizing apparatus that synthesizes a plurality of image data photographed by a photographing device.

また、本明細書において説明した技術のうち、主にフローチャートで説明した制御に関しては、プログラムで設定可能であることが多く、記録媒体や記録部に収められる場合もある。この記録媒体、記録部への記録の仕方は、製品出荷時に記録してもよく、配布された記録媒体を利用してもよく、インターネットを介してダウンロードしたものでもよい。   Of the techniques described in this specification, the control mainly described in the flowchart is often settable by a program and may be stored in a recording medium or a recording unit. The recording method for the recording medium and the recording unit may be recorded at the time of product shipment, may be a distributed recording medium, or may be downloaded via the Internet.

また、特許請求の範囲、明細書、および図面中の動作フローに関して、便宜上「まず」、「次に」等の順番を表現する言葉を用いて説明したとしても、特に説明していない箇所では、この順で実施することが必須であることを意味するものではない。   In addition, regarding the operation flow in the claims, the specification, and the drawings, even if it is described using words expressing the order such as “first”, “next”, etc. It does not mean that it is essential to implement in this order.

本発明は、上記実施形態にそのまま限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組み合わせにより、種々の発明を形成できる。例えば、実施形態に示される全構成要素の幾つかの構成要素を削除してもよい。さらに、異なる実施形態にわたる構成要素を適宜組み合わせてもよい。   The present invention is not limited to the above-described embodiments as they are, and can be embodied by modifying the constituent elements without departing from the scope of the invention in the implementation stage. In addition, various inventions can be formed by appropriately combining a plurality of components disclosed in the embodiment. For example, you may delete some components of all the components shown by embodiment. Furthermore, constituent elements over different embodiments may be appropriately combined.

100・・・カメラ本体、101・・・メカシャッタ、103・・・撮像素子、105・・・アナログ処理部、107・・・A/D変換部、108・・・RAWデータ圧縮部、109・・・画像処理部、109a・・・RAWデータ伸張部、109b・・・基本画像処理部、109c・・・画像合成部、109d・・・ダウンサンプル処理部、109e・・・アップサンプル処理部、109g・・・画像伸張部、110・・・バス、111・・・AE処理部、113・・・AF処理部、115・・・画像圧縮部、117・・・画像伸張部、121・・・マイクロコンピュータ、123・・・操作部、125・・・フラッシュメモリ、127・・・SDRAM、129・・・メモリI/F、131・・・記録媒体、133・・・表示ドライバ135・・・表示パネル、199・・・I/F、200・・・交換式レンズ、201・・・撮影レンズ、203・・・絞り、205・・・ドライバ、207・・・マイクロコンピュータ、209・・・フラッシュメモリ DESCRIPTION OF SYMBOLS 100 ... Camera body, 101 ... Mechanical shutter, 103 ... Imaging element, 105 ... Analog processing part, 107 ... A / D conversion part, 108 ... Raw data compression part, 109 ... Image processing unit 109a RAW data decompression unit 109b Basic image processing unit 109c Image synthesis unit 109d Down-sample processing unit 109e Up-sample processing unit 109g ... Image decompression unit, 110 ... Bus, 111 ... AE processing unit, 113 ... AF processing unit, 115 ... Image compression unit, 117 ... Image decompression unit, 121 ... Micro Computer, 123, operation unit, 125, flash memory, 127, SDRAM, 129, memory I / F, 131, recording medium, 133, display driver 1 DESCRIPTION OF SYMBOLS 5 ... Display panel, 199 ... I / F, 200 ... Interchangeable lens, 201 ... Shooting lens, 203 ... Aperture, 205 ... Driver, 207 ... Microcomputer, 209 ... Flash memory

Claims (11)

被写体を撮像素子で撮像して画像データを出力する撮像部と、
上記被写体を、上記撮像部の撮像素子に合焦させるように合焦位置を調節する合焦部と、
上記画像データから基準画像データを生成する基準画像生成部と、
上記画像データのデータ量を削減し、上記基準画像データよりデータ量の少ない合成用画像データを生成する画像データ量削減部と、
上記基準画像データと上記合成用画像データを用いて画像データの合成を行い、合成画像データを生成する画像合成部と、
を有し、
上記画像データ量削減部は、上記画像データのガンマ成分を抽出し、ガンマ成分に応じた圧縮特性に基づきデータ量を削減し、
上記合焦部により、複数の異なる合焦位置のそれぞれの合焦位置において、上記撮像部により出力される複数の画像データを取得し、上記画像データ量削減部により、上記複数の画像データのそれぞれのデータ量を削減し、上記画像合成部により合成画像データを生成することを特徴とする撮像装置。
An imaging unit for imaging a subject with an imaging device and outputting image data;
A focusing unit that adjusts a focusing position so that the subject is focused on the image sensor of the imaging unit;
A reference image generation unit that generates reference image data from the image data;
An image data amount reduction unit that reduces the data amount of the image data and generates image data for synthesis that has a smaller data amount than the reference image data;
An image composition unit that synthesizes image data using the reference image data and the image data for composition, and generates composite image data;
I have a,
The image data amount reduction unit extracts a gamma component of the image data, reduces the data amount based on compression characteristics according to the gamma component,
The focusing unit acquires a plurality of image data output by the imaging unit at each of a plurality of different focusing positions, and the image data amount reduction unit acquires each of the plurality of image data. An image pickup apparatus that reduces the amount of data and generates composite image data by the image composition unit .
上記画像データ量削減部は、上記画像データのビット精度を低下させることを特徴とする請求項1に記載の撮像装置。   The image pickup apparatus according to claim 1, wherein the image data amount reduction unit reduces the bit accuracy of the image data. 上記画像データ削減部は、テーブルまたは折れ線による階調変換部を含み、上記画像データに対して階調変換することを特徴とする請求項1に記載の撮像装置。 The imaging apparatus according to claim 1, wherein the image data amount reduction unit includes a gradation conversion unit using a table or a broken line, and performs gradation conversion on the image data. 上記画像データ削減部は、上記画像データを符号化して圧縮する圧縮部を含むことを特徴とする請求項1に記載の撮像装置。 The imaging apparatus according to claim 1, wherein the image data amount reduction unit includes a compression unit that encodes and compresses the image data. 上記圧縮部は非可逆圧縮を行うことを特徴とする請求項4に記載の撮像装置。   The imaging apparatus according to claim 4, wherein the compression unit performs lossy compression. 上記画像データ削減部は、色差信号のデータ量を削減することを特徴とする請求項1に記載の撮像装置。 The imaging apparatus according to claim 1, wherein the image data amount reduction unit reduces a data amount of the color difference signal. 上記基準画像データは、上記画像合成部において合成を行う複数の画像データの内、最初に撮像された画像データ、またはピントの合っている画像データであることを特徴とする請求項1に記載の撮像装置。   2. The reference image data according to claim 1, wherein the reference image data is image data first captured or image data in focus among a plurality of image data to be combined in the image combining unit. Imaging device. 上記合成画像データを記録する画像記録部を有し、
上記画像データ量削減部によってデータ量が削減された合成用画像データを用いて、上記合成画像データを生成した場合には、上記合成画像データに削減情報を添付の上、上記画像記録部に記録することを特徴とする請求項1に記載の撮像装置。
An image recording unit for recording the composite image data;
Using the synthetic image data in which the data amount is reduced by the image data quantity reduction unit, when generating the composite image data, on the accompanying reduction information to the composite image data, the image Zoki recording unit The image pickup apparatus according to claim 1, wherein the image pickup apparatus is recorded on the image pickup apparatus.
上記画像データ量削減部は、非可逆な方式によりデータ量を削減することを特徴とする請求項1に記載の撮像装置。   The imaging apparatus according to claim 1, wherein the image data amount reduction unit reduces the data amount by an irreversible method. 被写体を撮像素子で撮像して基準画像の画像データを生成し、
上記被写体を、上記撮像素子に合焦させるように合焦位置を調節し、
被写体を撮像して合成用画像の画像データを生成し、
上記合成用画像の画像データを上記基準画像の画像データよりデータ量の少なくなるようにデータ量を削減し、
上記基準画像の画像データと上記合成用画像の画像データを用いて、画像データの合成を行い、合成画像データを生成し、
さらに、上記画像データのガンマ成分を抽出し、ガンマ成分に応じた圧縮特性に基づきデータ量を削減し、
複数の異なる合焦位置のそれぞれの合焦位置において、上記撮像素子により出力される複数の画像データを取得し、上記複数の画像データのそれぞれのデータ量を削減し、合成画像データを生成する、
ことを特徴とする撮像方法。
Image a subject with an image sensor to generate image data of a reference image,
The subject, and adjust the focus position to focus on SL IMAGING element,
Capture the subject and generate image data for the composition image,
Reduce the amount of data so that the image data of the image for synthesis is less than the amount of data of the image of the reference image,
Using the image data of the reference image and the image data of the image for synthesis, the image data is synthesized to generate synthesized image data,
Furthermore, the gamma component of the image data is extracted, and the data amount is reduced based on the compression characteristics corresponding to the gamma component.
Obtaining a plurality of image data output by the imaging element at each of a plurality of different in-focus positions, reducing a data amount of each of the plurality of image data, and generating composite image data;
An imaging method characterized by the above.
被写体を撮像素子で撮像して基準画像の画像データを生成し、
被写体を撮像して合成用画像の画像データを生成し、
上記被写体を、上記撮像素子に合焦させるように合焦位置を調節し、
上記合成用画像の画像データを上記基準画像の画像データよりデータ量の少なくなるようにデータ量を削減し、
上記基準画像の画像データと上記合成用画像の画像データを用いて、画像データの合成を行い、合成画像データを生成し、
さらに、上記画像データのガンマ成分を抽出し、ガンマ成分に応じた圧縮特性に基づきデータ量を削減し、
複数の異なる合焦位置のそれぞれの合焦位置において、上記撮像素子により出力される複数の画像データを取得し、上記複数の画像データのそれぞれのデータ量を削減し、合成画像データを生成する、
ことをコンピュータに実行させることを特徴とするプログラム。
Image a subject with an image sensor to generate image data of a reference image,
Capture the subject and generate image data for the composition image,
The subject, and adjust the focus position to focus on SL IMAGING element,
Reduce the amount of data so that the image data of the image for synthesis is less than the amount of data of the image of the reference image,
Using the image data of the reference image and the image data of the image for synthesis, the image data is synthesized to generate synthesized image data,
Furthermore, the gamma component of the image data is extracted, and the data amount is reduced based on the compression characteristics corresponding to the gamma component.
Obtaining a plurality of image data output by the imaging element at each of a plurality of different in-focus positions, reducing a data amount of each of the plurality of image data, and generating composite image data;
A program characterized by causing a computer to execute the above.
JP2014038264A 2014-02-28 2014-02-28 Imaging apparatus, imaging method, and program Active JP6242244B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014038264A JP6242244B2 (en) 2014-02-28 2014-02-28 Imaging apparatus, imaging method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014038264A JP6242244B2 (en) 2014-02-28 2014-02-28 Imaging apparatus, imaging method, and program

Publications (2)

Publication Number Publication Date
JP2015162851A JP2015162851A (en) 2015-09-07
JP6242244B2 true JP6242244B2 (en) 2017-12-06

Family

ID=54185658

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014038264A Active JP6242244B2 (en) 2014-02-28 2014-02-28 Imaging apparatus, imaging method, and program

Country Status (1)

Country Link
JP (1) JP6242244B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6871795B2 (en) * 2017-04-18 2021-05-12 キヤノン株式会社 Imaging device, its control method, program and recording medium
JP6909669B2 (en) * 2017-08-03 2021-07-28 オリンパス株式会社 Image processing device and image processing method
JP7031410B2 (en) * 2018-03-22 2022-03-08 株式会社リコー Image processing device, image processing method, image processing program, shooting device, shooting method and shooting program

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000224470A (en) * 1999-02-02 2000-08-11 Minolta Co Ltd Camera system
JP2002305684A (en) * 2001-01-31 2002-10-18 Olympus Optical Co Ltd Imaging system and program
JP2008113070A (en) * 2006-10-27 2008-05-15 Sony Corp Imaging device and imaging method
JP6074926B2 (en) * 2012-07-05 2017-02-08 カシオ計算機株式会社 Image processing apparatus, image processing method, and program

Also Published As

Publication number Publication date
JP2015162851A (en) 2015-09-07

Similar Documents

Publication Publication Date Title
JP6325885B2 (en) Imaging apparatus, imaging method, and program
JP6346793B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND PROGRAM
JP4567593B2 (en) Imaging apparatus and imaging method
US10122947B2 (en) Image pickup apparatus and image processing method
US8872936B2 (en) Image processing device, white balance correction method, and imaging device
WO2015045144A1 (en) Electronic device, method for controlling electronic device, and control program
JP6325841B2 (en) Imaging apparatus, imaging method, and program
WO2016072103A1 (en) Imaging device, imaging method and processing program
US8786728B2 (en) Image processing apparatus, image processing method, and storage medium storing image processing program
JP4407454B2 (en) Digital camera and image processing method
JP4606486B2 (en) Image processing apparatus and photographing apparatus
JP2008053931A (en) Imaging apparatus
WO2016117137A1 (en) Image-capturing device, image-capturing method, and image display device
JP6242244B2 (en) Imaging apparatus, imaging method, and program
US10097751B2 (en) Imaging apparatus and image compositing method
US8363128B2 (en) Image processing apparatus and image processing method
US9282257B2 (en) Image apparatus and imaging method
JP2015231192A (en) Imaging device and exposure control method of imaging device
JP6280780B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND PROGRAM
JP5530304B2 (en) Imaging apparatus and captured image display method
JP5673137B2 (en) Imaging apparatus and imaging method
JP2010283504A (en) Imaging device, imaging method, and imaging program
JP5191941B2 (en) Imaging apparatus, image processing apparatus, image processing method, and image processing program
JP5094686B2 (en) Image processing apparatus, image processing method, and image processing program
JP2010098428A (en) Imaging apparatus, imaging method, and imaging program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20161014

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170608

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170612

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170804

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170816

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170919

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20171107

R151 Written notification of patent or utility model registration

Ref document number: 6242244

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250